Commit 6a9dfcdc authored by Andrew Heather's avatar Andrew Heather
Browse files

merge of thermo branch into master

parents 687ac7e9 9ec6e0ad
......@@ -8,7 +8,7 @@ EXE_INC = \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/combustion/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/turbulenceModels \
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/laminarFlameSpeed/lnInclude \
......@@ -23,7 +23,7 @@ EXE_LIBS = \
-lmeshTools \
-lcompressibleRASModels \
-lbasicThermophysicalModels \
-lcombustionThermophysicalModels \
-lreactionThermophysicalModels \
-lspecie \
-llaminarFlameSpeedModels \
-lfiniteVolume \
......
......@@ -36,7 +36,7 @@ Description
to be appropriate by comparison with the results from the
spectral model.
Strain effects are encorporated directly into the Xi equation
Strain effects are incorporated directly into the Xi equation
but not in the algebraic approximation. Further work need to be
done on this issue, particularly regarding the enhanced removal rate
caused by flame compression. Analysis using results of the spectral
......@@ -70,53 +70,53 @@ Description
int main(int argc, char *argv[])
{
# include "setRootCase.H"
#include "setRootCase.H"
# include "createTime.H"
# include "createMesh.H"
# include "readCombustionProperties.H"
# include "readEnvironmentalProperties.H"
# include "createFields.H"
# include "readPISOControls.H"
# include "initContinuityErrs.H"
# include "readTimeControls.H"
# include "CourantNo.H"
# include "setInitialDeltaT.H"
#include "createTime.H"
#include "createMesh.H"
#include "readCombustionProperties.H"
#include "readEnvironmentalProperties.H"
#include "createFields.H"
#include "readPISOControls.H"
#include "initContinuityErrs.H"
#include "readTimeControls.H"
#include "CourantNo.H"
#include "setInitialDeltaT.H"
scalar StCoNum = 0.0;
scalar StCoNum = 0.0;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
while (runTime.run())
{
# include "readTimeControls.H"
# include "readPISOControls.H"
# include "CourantNo.H"
# include "setDeltaT.H"
#include "readTimeControls.H"
#include "readPISOControls.H"
#include "CourantNo.H"
#include "setDeltaT.H"
runTime++;
Info<< "\n\nTime = " << runTime.timeName() << endl;
# include "rhoEqn.H"
# include "UEqn.H"
#include "rhoEqn.H"
#include "UEqn.H"
// --- PISO loop
for (int corr=1; corr<=nCorr; corr++)
{
# include "bEqn.H"
# include "ftEqn.H"
# include "huEqn.H"
# include "hEqn.H"
#include "bEqn.H"
#include "ftEqn.H"
#include "huEqn.H"
#include "hEqn.H"
if (!ign.ignited())
{
hu == h;
}
# include "pEqn.H"
#include "pEqn.H"
}
turbulence->correct();
......
......@@ -31,23 +31,25 @@ Description
\*---------------------------------------------------------------------------*/
{
scalar meanStCoNum = 0.0;
scalar meanStCoNum = 0.0;
if (mesh.nInternalFaces())
{
surfaceScalarField SfUfbyDelta =
mesh.surfaceInterpolation::deltaCoeffs()
*mag(phiSt/fvc::interpolate(rho));
if (mesh.nInternalFaces())
{
surfaceScalarField SfUfbyDelta =
mesh.surfaceInterpolation::deltaCoeffs()
*mag(phiSt/fvc::interpolate(rho));
StCoNum = max(SfUfbyDelta/mesh.magSf())
.value()*runTime.deltaT().value();
StCoNum =
max(SfUfbyDelta/mesh.magSf()).value()
*runTime.deltaT().value();
meanStCoNum = (sum(SfUfbyDelta)/sum(mesh.magSf()))
.value()*runTime.deltaT().value();
}
meanStCoNum =
(sum(SfUfbyDelta)/sum(mesh.magSf())).value()
*runTime.deltaT().value();
}
Info<< "St courant Number mean: " << meanStCoNum
<< " max: " << StCoNum << endl;
Info<< "St courant Number mean: " << meanStCoNum
<< " max: " << StCoNum << endl;
}
// ************************************************************************* //
tmp<fv::convectionScheme<scalar> > mvConvection
(
fv::convectionScheme<scalar>::New
(
(
mesh,
fields,
phi,
......@@ -25,7 +25,7 @@ if (ign.ignited())
// Unburnt gas density
// ~~~~~~~~~~~~~~~~~~~
volScalarField rhou = thermo->rhou();
volScalarField rhou = thermo.rhou();
// Calculate flame normal etc.
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
......
Info<< "Reading thermophysical properties\n" << endl;
autoPtr<hhuCombustionThermo> thermo
autoPtr<hhuCombustionThermo> pThermo
(
hhuCombustionThermo::New(mesh)
);
combustionMixture& composition = thermo->composition();
hhuCombustionThermo& thermo = pThermo();
basicMultiComponentMixture& composition = thermo.composition();
volScalarField rho
(
......@@ -16,13 +17,13 @@
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
thermo->rho()
thermo.rho()
);
volScalarField& p = thermo->p();
const volScalarField& psi = thermo->psi();
volScalarField& h = thermo->h();
volScalarField& hu = thermo->hu();
volScalarField& p = thermo.p();
const volScalarField& psi = thermo.psi();
volScalarField& h = thermo.h();
volScalarField& hu = thermo.hu();
volScalarField& b = composition.Y("b");
Info<< "min(b) = " << min(b).value() << endl;
......@@ -54,7 +55,7 @@
rho,
U,
phi,
thermo()
thermo
)
);
......
......@@ -8,5 +8,5 @@
betav*DpDt
);
thermo->correct();
thermo.correct();
}
......@@ -13,6 +13,6 @@ if (ign.ignited())
//+ fvm::Sp(fvc::div(muEff*fvc::grad(b)/(b + 0.001)), hu)
==
betav*DpDt*rho/thermo->rhou()
betav*DpDt*rho/thermo.rhou()
);
}
......@@ -196,8 +196,7 @@ public:
// Destructor
~SCOPE();
~SCOPE();
// Member functions
......
rho = thermo->rho();
rho = thermo.rho();
volScalarField rUA = 1.0/UEqn.A();
U = invA & UEqn.H();
......@@ -8,7 +8,7 @@ if (transonic)
surfaceScalarField phid
(
"phid",
fvc::interpolate(thermo->psi())
fvc::interpolate(psi)
*(
(fvc::interpolate(U) & mesh.Sf())
+ fvc::ddtPhiCorr(rUA, rho, U, phi)
......@@ -34,7 +34,7 @@ if (transonic)
}
else
{
phi =
phi =
fvc::interpolate(rho)*
(
(fvc::interpolate(U) & mesh.Sf())
......
......@@ -2,7 +2,7 @@ EXE_INC = \
-I$(LIB_SRC)/engine/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/combustion/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
-I$(LIB_SRC)/thermophysicalModels/laminarFlameSpeed/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
......@@ -13,7 +13,7 @@ EXE_LIBS = \
-lcompressibleRASModels \
-lcompressibleLESModels \
-lbasicThermophysicalModels \
-lcombustionThermophysicalModels \
-lreactionThermophysicalModels \
-lspecie \
-llaminarFlameSpeedModels \
-lfiniteVolume \
......
......@@ -109,7 +109,7 @@ int main(int argc, char *argv[])
turbulence->correct();
rho = thermo->rho();
rho = thermo.rho();
runTime.write();
......
......@@ -6,7 +6,7 @@ if (ign.ignited())
// Unburnt gas density
// ~~~~~~~~~~~~~~~~~~~
volScalarField rhou = thermo->rhou();
volScalarField rhou = thermo.rhou();
// Calculate flame normal etc.
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
......@@ -76,7 +76,7 @@ if (ign.ignited())
volScalarField epsilon = pow(uPrimeCoef, 3)*turbulence->epsilon();
volScalarField tauEta = sqrt(thermo->muu()/(rhou*epsilon));
volScalarField tauEta = sqrt(thermo.muu()/(rhou*epsilon));
volScalarField Reta = up/
(
......@@ -180,7 +180,7 @@ if (ign.ignited())
// with a linear correction function to give a plausible profile for Xi
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
volScalarField XiEqStar =
volScalarField XiEqStar =
scalar(1.001) + XiCoef*sqrt(up/(Su + SuMin))*Reta;
volScalarField XiEq =
......
Info<< "Reading thermophysical properties\n" << endl;
autoPtr<hhuCombustionThermo> thermo
autoPtr<hhuCombustionThermo> pThermo
(
hhuCombustionThermo::New(mesh)
);
combustionMixture& composition = thermo->composition();
hhuCombustionThermo& thermo = pThermo();
basicMultiComponentMixture& composition = thermo.composition();
volScalarField rho
(
......@@ -16,18 +17,18 @@
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
thermo->rho()
thermo.rho()
);
volScalarField& p = thermo->p();
const volScalarField& psi = thermo->psi();
volScalarField& h = thermo->h();
volScalarField& hu = thermo->hu();
volScalarField& p = thermo.p();
const volScalarField& psi = thermo.psi();
volScalarField& h = thermo.h();
volScalarField& hu = thermo.hu();
volScalarField& b = composition.Y("b");
Info<< "min(b) = " << min(b).value() << endl;
const volScalarField& T = thermo->T();
const volScalarField& T = thermo.T();
Info<< "\nReading field U\n" << endl;
......@@ -55,7 +56,7 @@
rho,
U,
phi,
thermo()
thermo
)
);
......
......@@ -8,5 +8,5 @@
DpDt
);
thermo->correct();
thermo.correct();
}
......@@ -13,6 +13,6 @@ if (ign.ignited())
//+ fvm::Sp(fvc::div(muEff*fvc::grad(b)/(b + 0.001)), hu)
==
DpDt*rho/thermo->rhou()
DpDt*rho/thermo.rhou()
);
}
rho = thermo->rho();
rho = thermo.rho();
volScalarField rUA = 1.0/UEqn.A();
U = rUA*UEqn.H();
......@@ -8,7 +8,7 @@ if (transonic)
surfaceScalarField phid
(
"phid",
fvc::interpolate(thermo->psi())
fvc::interpolate(psi)
*(
(fvc::interpolate(U) & mesh.Sf())
+ fvc::ddtPhiCorr(rUA, rho, U, phi)
......@@ -34,9 +34,9 @@ if (transonic)
}
else
{
phi =
fvc::interpolate(rho)*
(
phi =
fvc::interpolate(rho)
*(
(fvc::interpolate(U) & mesh.Sf())
+ fvc::ddtPhiCorr(rUA, rho, U, phi)
);
......
{
tmp<volScalarField> tdQ
(
new volScalarField
(
IOobject
(
"dQ",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar
(
"zero",
dimensionSet(1, -3, -1, 0, 0, 0, 0),
0.0
)
)
);
scalarField& dQ = tdQ();
scalarField cp(dQ.size(), 0.0);
forAll(Y, i)
{
volScalarField RRi = chemistry.RR(i);
forAll(h, celli)
{
scalar Ti = T[celli];
cp[celli] += Y[i][celli]*chemistry.specieThermo()[i].Cp(Ti);
scalar hi = chemistry.specieThermo()[i].h(Ti);
scalar RR = RRi[celli];
dQ[celli] -= hi*RR;
}
}
forAll(dQ, celli)
{
dQ[celli] /= cp[celli];
}
tdQ().write();
}
......@@ -4,7 +4,7 @@ EXE_INC = \
-I$(LIB_SRC)/engine/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/combustion/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
-I$(LIB_SRC)/finiteVolume/lnInclude
......
......@@ -33,7 +33,7 @@ Description
#include "fvCFD.H"
#include "engineTime.H"
#include "engineMesh.H"
#include "basicThermo.H"
#include "basicPsiThermo.H"
#include "turbulenceModel.H"
#include "OFstream.H"
......@@ -41,27 +41,27 @@ Description
int main(int argc, char *argv[])
{
# include "setRootCase.H"
#include "setRootCase.H"
# include "createEngineTime.H"
# include "createEngineMesh.H"
# include "createFields.H"
# include "initContinuityErrs.H"
# include "readEngineTimeControls.H"
# include "compressibleCourantNo.H"
# include "setInitialDeltaT.H"
# include "startSummary.H"
#include "createEngineTime.H"
#include "createEngineMesh.H"
#include "createFields.H"
#include "initContinuityErrs.H"
#include "readEngineTimeControls.H"
#include "compressibleCourantNo.H"
#include "setInitialDeltaT.H"
#include "startSummary.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
while (runTime.run())
{
# include "readPISOControls.H"
# include "readEngineTimeControls.H"
# include "compressibleCourantNo.H"
# include "setDeltaT.H"
#include "readPISOControls.H"
#include "readEngineTimeControls.H"
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
runTime++;
......@@ -70,22 +70,22 @@ int main(int argc, char *argv[])
mesh.move();
# include "rhoEqn.H"
#include "rhoEqn.H"
# include "UEqn.H"
#include "UEqn.H"
// --- PISO loop
for (int corr=1; corr<=nCorr; corr++)
{
# include "hEqn.H"
# include "pEqn.H"
#include "hEqn.H"
#include "pEqn.H"
}
turbulence->correct();
runTime.write();
# include "logSummary.H"
#include "logSummary.H"
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
......
Info<< "Reading thermophysical properties\n" << endl;
autoPtr<basicThermo> thermo
autoPtr<basicPsiThermo> pThermo
(
basicThermo::New(mesh)
basicPsiThermo::New(mesh)
);
basicPsiThermo& thermo = pThermo();
volScalarField rho
(
......@@ -15,13 +16,13 @@
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
thermo->rho()
thermo.rho()
);
volScalarField& p = thermo->p();
const volScalarField& psi = thermo->psi();
volScalarField& h = thermo->h();
const volScalarField& T = thermo->T();
volScalarField& p = thermo.p();
const volScalarField& psi = thermo.psi();
volScalarField& h = thermo.h();
const volScalarField& T = thermo.T();
Info<< "\nReading field U\n" << endl;
......@@ -38,7 +39,7 @@
mesh
);
# include "compressibleCreatePhi.H"
#include "compressibleCreatePhi.H"
Info<< "Creating turbulence model\n" << endl;
......@@ -49,7 +50,7 @@
rho,
U,
phi,
thermo()
thermo
)
);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment