67ab0b5abd
- in FOAM library updated containers backported PackedBoolList, hashedWordList, nullObject, wordRe, backported functions to backported int32 support backported tableReaders backported Function1, TimeFunction1 backported dynamicCode (for codedBCs, ...) -- needs to be mapped out advanced error macros (FatalIOErrorInFunction, ...) -- needs to be mapped out backported IOobject::MUST_READ_IF_MODIFIED and added IOobject::READ_IF_PRESENT_IF_MODIFIED (only in FO) - in postProcessing backported IO FOs (partialWrite, removeRegisteredObject, writeDictionary, writeRegisteredObject) backported field FOs (fieldCoordinateSystemTransform, fieldValues, nearWallFields, processorField, readFields, regionSizeDistribution, streamLine, wallBoundedStreamLine) backported fvTools FOs (calcFvcDiv, calcFvcGrad, calcMag) backported jobControl FOs (abortCalculation) backported utilities FOs (ourantNo, Lambda2, Peclet, Q, codedFunctionObject, pressureTools, residuals, scalarTransport, setTimeStep, timeActivatedFileUpdate, turbulenceFields, vorticity, wallShearStress)
132 lines
2.4 KiB
C++
132 lines
2.4 KiB
C++
Info<< "Reading thermophysical properties\n" << endl;
|
|
|
|
autoPtr<hsCombustionThermo> pThermo
|
|
(
|
|
hsCombustionThermo::New(mesh)
|
|
);
|
|
|
|
hsCombustionThermo& thermo = pThermo();
|
|
|
|
basicMultiComponentMixture& composition = thermo.composition();
|
|
|
|
volScalarField rho
|
|
(
|
|
IOobject
|
|
(
|
|
"rho",
|
|
runTime.timeName(),
|
|
mesh,
|
|
IOobject::NO_READ,
|
|
IOobject::AUTO_WRITE
|
|
),
|
|
thermo.rho()
|
|
);
|
|
|
|
dimensionedScalar stoicRatio
|
|
(
|
|
thermo.lookup("stoichiometricAirFuelMassRatio")
|
|
);
|
|
|
|
volScalarField& p = thermo.p();
|
|
volScalarField& hs = thermo.hs();
|
|
|
|
const volScalarField& psi = thermo.psi();
|
|
|
|
volScalarField& ft = composition.Y("ft");
|
|
volScalarField& fu = composition.Y("fu");
|
|
|
|
Info<< "Reading field U\n" << endl;
|
|
|
|
volVectorField U
|
|
(
|
|
IOobject
|
|
(
|
|
"U",
|
|
runTime.timeName(),
|
|
mesh,
|
|
IOobject::MUST_READ,
|
|
IOobject::AUTO_WRITE
|
|
),
|
|
mesh
|
|
);
|
|
|
|
#include "compressibleCreatePhi.H"
|
|
|
|
Info<< "Creating turbulence model\n" << endl;
|
|
autoPtr<compressible::turbulenceModel> turbulence
|
|
(
|
|
compressible::turbulenceModel::New(rho, U, phi, thermo)
|
|
);
|
|
|
|
IOdictionary combustionProperties
|
|
(
|
|
IOobject
|
|
(
|
|
"combustionProperties",
|
|
runTime.constant(),
|
|
mesh,
|
|
IOobject::MUST_READ_IF_MODIFIED,
|
|
IOobject::NO_WRITE
|
|
)
|
|
);
|
|
|
|
Info<< "Creating combustion model\n" << endl;
|
|
autoPtr<combustionModel> combustion
|
|
(
|
|
combustionModel::combustionModel::New
|
|
(
|
|
combustionProperties,
|
|
thermo,
|
|
turbulence(),
|
|
phi,
|
|
rho
|
|
)
|
|
);
|
|
|
|
volScalarField dQ
|
|
(
|
|
IOobject
|
|
(
|
|
"dQ",
|
|
runTime.timeName(),
|
|
mesh,
|
|
IOobject::NO_READ,
|
|
IOobject::AUTO_WRITE
|
|
),
|
|
mesh,
|
|
dimensionedScalar("dQ", dimMass/pow3(dimTime)/dimLength, 0.0)
|
|
);
|
|
|
|
|
|
Info<< "Creating field DpDt\n" << endl;
|
|
volScalarField DpDt =
|
|
fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
|
|
|
|
|
|
Info<< "Calculating field g.h\n" << endl;
|
|
volScalarField gh("gh", g & mesh.C());
|
|
|
|
surfaceScalarField ghf("gh", g & mesh.Cf());
|
|
|
|
p += rho*gh;
|
|
|
|
thermo.correct();
|
|
|
|
dimensionedScalar initialMass = fvc::domainIntegrate(rho);
|
|
|
|
|
|
multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
|
|
|
|
if (composition.contains("ft"))
|
|
{
|
|
fields.add(composition.Y("ft"));
|
|
}
|
|
|
|
if (composition.contains("fu"))
|
|
{
|
|
fields.add(composition.Y("fu"));
|
|
}
|
|
|
|
fields.add(hs);
|
|
|
|
mesh.schemesDict().setFluxRequired(p.name());
|