Skip to content
Merged

FGM #187

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 30 additions & 13 deletions applications/solvers/dfLowMachFoam/createFields.H
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ volScalarField rho
thermo.rho()
);


Info<< "Reading field U\n" << endl;
volVectorField U
(
Expand Down Expand Up @@ -54,12 +55,34 @@ autoPtr<compressible::turbulenceModel> turbulence
)
);

Info<< "Creating field dpdt\n" << endl;
volScalarField dpdt
(
IOobject
(
"dpdt",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimensionedScalar("dpdt",p.dimensions()/dimTime, 0)
);


Info<< "Creating reaction model\n" << endl;
autoPtr<CombustionModel<basicThermo>> combustion
(
CombustionModel<basicThermo>::New(thermo, turbulence())
);
Info<< "end Creating reaction model\n" << endl;


//const word combModelName(combustion->type());
const word combModelName(mesh.objectRegistry::lookupObject<IOdictionary>("combustionProperties").lookup("combustionModel"));
Info << "Combustion Model Name is confirmed as "<< combModelName << endl;

dfChemistryModel<basicThermo>* chemistry = combustion->chemistry();
PtrList<volScalarField>& Y = chemistry->Y();
const word inertSpecie(chemistry->lookup("inertSpecie"));
Expand All @@ -69,28 +92,22 @@ const label inertIndex(chemistry->species()[inertSpecie]);
chemistry->correctThermo();
Info<< "At initial time, min/max(T) = " << min(T).value() << ", " << max(T).value() << endl;

Info<< "Creating field dpdt\n" << endl;
volScalarField dpdt
(
IOobject
(
"dpdt",
runTime.timeName(),
mesh
),
mesh,
dimensionedScalar(p.dimensions()/dimTime, 0)
);
//for dpdt

Info<< "Creating field kinetic energy K\n" << endl;
volScalarField K("K", 0.5*magSqr(U));

multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;

if(combModelName!="flareFGM")
{
forAll(Y, i)
{
fields.add(Y[i]);
}
fields.add(thermo.he());
}


const scalar Sct = chemistry->lookupOrDefault("Sct", 1.);
volScalarField diffAlphaD
Expand Down Expand Up @@ -152,4 +169,4 @@ const Switch splitting = CanteraTorchProperties.lookupOrDefault("splittingStrate
#ifdef USE_LIBTORCH
const Switch log_ = CanteraTorchProperties.subDict("TorchSettings").lookupOrDefault("log", false);
const Switch torch_ = CanteraTorchProperties.subDict("TorchSettings").lookupOrDefault("torch", false);
#endif
#endif
27 changes: 18 additions & 9 deletions applications/solvers/dfLowMachFoam/dfLowMachFoam.C
Original file line number Diff line number Diff line change
Expand Up @@ -148,17 +148,24 @@ int main(int argc, char *argv[])
end = std::clock();
time_monitor_flow += double(end - start) / double(CLOCKS_PER_SEC);

#include "YEqn.H"
if(combModelName!="ESF" && combModelName!="flareFGM" )
{
#include "YEqn.H"

start = std::clock();
#include "EEqn.H"
end = std::clock();
time_monitor_E += double(end - start) / double(CLOCKS_PER_SEC);
start = std::clock();
#include "EEqn.H"
end = std::clock();
time_monitor_E += double(end - start) / double(CLOCKS_PER_SEC);

start = std::clock();
chemistry->correctThermo();
end = std::clock();
time_monitor_corrThermo += double(end - start) / double(CLOCKS_PER_SEC);
start = std::clock();
chemistry->correctThermo();
end = std::clock();
time_monitor_corrThermo += double(end - start) / double(CLOCKS_PER_SEC);
}
else
{
combustion->correct();
}

Info<< "min/max(T) = " << min(T).value() << ", " << max(T).value() << endl;

Expand Down Expand Up @@ -189,6 +196,8 @@ int main(int argc, char *argv[])

runTime.write();

Info << "output time index " << runTime.timeIndex() << endl;

Info<< "========Time Spent in diffenet parts========"<< endl;
Info<< "Chemical sources = " << time_monitor_chem << " s" << endl;
Info<< "Species Equations = " << time_monitor_Y << " s" << endl;
Expand Down
Loading