Commit b61537bd authored by Mark Olesen's avatar Mark Olesen
Browse files

Merge commit 'OpenCFD/master' into olesenm

parents 024e5737 ce9a3064
......@@ -6,7 +6,7 @@ autoPtr<psiChemistryModel> pChemistry
);
psiChemistryModel& chemistry = pChemistry();
hCombustionThermo& thermo = chemistry.thermo();
hsCombustionThermo& thermo = chemistry.thermo();
basicMultiComponentMixture& composition = thermo.composition();
PtrList<volScalarField>& Y = composition.Y();
......@@ -50,7 +50,7 @@ volVectorField U
volScalarField& p = thermo.p();
const volScalarField& psi = thermo.psi();
const volScalarField& T = thermo.T();
volScalarField& h = thermo.h();
volScalarField& hs = thermo.hs();
#include "compressibleCreatePhi.H"
......@@ -92,4 +92,18 @@ forAll(Y, i)
{
fields.add(Y[i]);
}
fields.add(h);
fields.add(hs);
DimensionedField<scalar, volMesh> chemistrySh
(
IOobject
(
"chemistry::Sh",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimensionedScalar("chemistrySh", dimEnergy/dimTime/dimVolume, 0.0)
);
......@@ -23,7 +23,7 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Application
dieselFoam
dieselEngineFoam
Description
Solver for diesel engine spray and combustion.
......@@ -103,13 +103,15 @@ int main(int argc, char *argv[])
kappa = (runTime.deltaT() + tc)/(runTime.deltaT() + tc + tk);
}
chemistrySh = kappa*chemistry.Sh()();
#include "rhoEqn.H"
#include "UEqn.H"
for (label ocorr=1; ocorr <= nOuterCorr; ocorr++)
{
#include "YEqn.H"
#include "hEqn.H"
#include "hsEqn.H"
// --- PISO loop
for (int corr=1; corr<=nCorr; corr++)
......
{
solve
(
fvm::ddt(rho, h)
+ mvConvection->fvmDiv(phi, h)
- fvm::laplacian(turbulence->alphaEff(), h)
==
DpDt
+ dieselSpray.heatTransferSource()
);
thermo.correct();
}
{
solve
(
fvm::ddt(rho, hs)
+ mvConvection->fvmDiv(phi, hs)
- fvm::laplacian(turbulence->alphaEff(), hs)
==
DpDt
+ dieselSpray.heatTransferSource()().dimensionedInternalField()
+ chemistrySh
);
thermo.correct();
}
......@@ -100,7 +100,7 @@ int main(int argc, char *argv[])
for (label ocorr=1; ocorr <= nOuterCorr; ocorr++)
{
#include "YEqn.H"
#include "hEqn.H"
#include "hsEqn.H"
// --- PISO loop
for (int corr=1; corr<=nCorr; corr++)
......
......@@ -3,7 +3,6 @@ cd ${0%/*} || exit 1 # run from this directory
set -x
wclean libso combustionModels
wclean all sensibleEnthalpyCombustionThermophysicalModels
wclean
# ----------------------------------------------------------------- end-of-file
......@@ -2,7 +2,6 @@
cd ${0%/*} || exit 1 # run from this directory
set -x
sensibleEnthalpyCombustionThermophysicalModels/Allwmake
wmake libso combustionModels
wmake
......
EXE_INC = \
-I./combustionModels/lnInclude \
-I./sensibleEnthalpyCombustionThermophysicalModels/basic/lnInclude \
-I./sensibleEnthalpyCombustionThermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
......@@ -11,8 +9,6 @@ EXE_INC = \
EXE_LIBS = \
-lbasicSensibleEnthalpyThermophysicalModels \
-lreactionSensibleEnthalpyThermophysicalModels \
-lcombustionModels \
-lspecie \
-lreactionThermophysicalModels \
......
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
set -x
wmake libso basic
wmake libso reactionThermo
# ----------------------------------------------------------------- end-of-file
psiThermo/basicSensiblePsiThermo/basicSensiblePsiThermo.C
psiThermo/basicSensiblePsiThermo/newBasicSensiblePsiThermo.C
LIB = $(FOAM_LIBBIN)/libbasicSensibleEnthalpyThermophysicalModels
EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude
LIB_LIBS = \
-lfiniteVolume
combustionThermo/hsCombustionThermo/hsCombustionThermo.C
combustionThermo/hsCombustionThermo/newhsCombustionThermo.C
combustionThermo/hsCombustionThermo/hsCombustionThermos.C
LIB = $(FOAM_LIBBIN)/libreactionSensibleEnthalpyThermophysicalModels
EXE_INC = \
-I../basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude
LIB_LIBS = \
-lfiniteVolume
EXE_INC = \
-I../XiFoam \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
......
fvVectorMatrix UEqn
(
fvm::ddt(rho, U)
+ fvm::div(phi, U)
+ turbulence->divDevRhoReff(U)
==
rho*g
);
UEqn.relax();
if (momentumPredictor)
{
solve(UEqn == -fvc::grad(p));
}
......@@ -21,4 +21,6 @@
{
kappa = 1.0;
}
chemistrySh = kappa*chemistry.Sh()();
}
......@@ -5,7 +5,7 @@ autoPtr<psiChemistryModel> pChemistry
);
psiChemistryModel& chemistry = pChemistry();
hCombustionThermo& thermo = chemistry.thermo();
hsCombustionThermo& thermo = chemistry.thermo();
basicMultiComponentMixture& composition = thermo.composition();
PtrList<volScalarField>& Y = composition.Y();
......@@ -40,8 +40,8 @@ volVectorField U
volScalarField& p = thermo.p();
const volScalarField& psi = thermo.psi();
volScalarField& h = thermo.h();
volScalarField& hs = thermo.hs();
const volScalarField& T = thermo.T();
#include "compressibleCreatePhi.H"
......@@ -81,5 +81,18 @@ forAll(Y, i)
{
fields.add(Y[i]);
}
fields.add(h);
fields.add(hs);
DimensionedField<scalar, volMesh> chemistrySh
(
IOobject
(
"chemistry::Sh",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimensionedScalar("chemistrySh", dimEnergy/dimTime/dimVolume, 0.0)
);
{
fvScalarMatrix hsEqn
(
fvm::ddt(rho, hs)
+ mvConvection->fvmDiv(phi, hs)
- fvm::laplacian(turbulence->alphaEff(), hs)
// - fvm::laplacian(turbulence->muEff(), hs) // unit lewis no.
==
DpDt
+ chemistrySh
);
hsEqn.relax();
hsEqn.solve();
thermo.correct();
Info<< "T gas min/max = " << min(T).value() << ", "
<< max(T).value() << endl;
}
rho = thermo.rho();
volScalarField rUA = 1.0/UEqn.A();
U = rUA*UEqn.H();
if (transonic)
{
surfaceScalarField phid
(
"phid",
fvc::interpolate(psi)
*(
(fvc::interpolate(U) & mesh.Sf())
+ fvc::ddtPhiCorr(rUA, rho, U, phi)
)
);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
fvScalarMatrix pEqn
(
fvm::ddt(psi, p)
+ fvm::div(phid, p)
- fvm::laplacian(rho*rUA, p)
);
pEqn.solve();
if (nonOrth == nNonOrthCorr)
{
phi == pEqn.flux();
}
}
}
else
{
phi =
fvc::interpolate(rho)
*(
(fvc::interpolate(U) & mesh.Sf())
+ fvc::ddtPhiCorr(rUA, rho, U, phi)
);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
fvScalarMatrix pEqn
(
fvm::ddt(psi, p)
+ fvc::div(phi)
- fvm::laplacian(rho*rUA, p)
);
pEqn.solve();
if (nonOrth == nNonOrthCorr)
{
phi += pEqn.flux();
}
}
}
#include "rhoEqn.H"
#include "compressibleContinuityErrs.H"
U -= rUA*fvc::grad(p);
U.correctBoundaryConditions();
DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
......@@ -73,9 +73,7 @@ int main(int argc, char *argv[])
{
#include "UEqn.H"
#include "YEqn.H"
#define Db turbulence->alphaEff()
#include "hEqn.H"
#include "hsEqn.H"
// --- PISO loop
for (int corr=1; corr<=nCorr; corr++)
......
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