ENH: Updated enthalpy equations for solvers with chemistry using updated

sensible enthalpy thermo packages

- Enthalpy source term now retrieved from the chemistry model (scaled by
  kappa for the PaSR model)
This commit is contained in:
andy 2010-02-12 17:05:15 +00:00
parent b635f73f51
commit 40f141e2c9
33 changed files with 376 additions and 110 deletions

View File

@ -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)
);

View File

@ -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++)

View File

@ -1,13 +0,0 @@
{
solve
(
fvm::ddt(rho, h)
+ mvConvection->fvmDiv(phi, h)
- fvm::laplacian(turbulence->alphaEff(), h)
==
DpDt
+ dieselSpray.heatTransferSource()
);
thermo.correct();
}

View File

@ -0,0 +1,14 @@
{
solve
(
fvm::ddt(rho, hs)
+ mvConvection->fvmDiv(phi, hs)
- fvm::laplacian(turbulence->alphaEff(), hs)
==
DpDt
+ dieselSpray.heatTransferSource()().dimensionedInternalField()
+ chemistrySh
);
thermo.correct();
}

View File

@ -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++)

View File

@ -1,5 +1,4 @@
EXE_INC = \
-I../XiFoam \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \

View File

@ -0,0 +1,15 @@
fvVectorMatrix UEqn
(
fvm::ddt(rho, U)
+ fvm::div(phi, U)
+ turbulence->divDevRhoReff(U)
==
rho*g
);
UEqn.relax();
if (momentumPredictor)
{
solve(UEqn == -fvc::grad(p));
}

View File

@ -21,4 +21,6 @@
{
kappa = 1.0;
}
chemistrySh = kappa*chemistry.Sh()();
}

View File

@ -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)
);

View File

@ -0,0 +1,20 @@
{
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;
}

View File

@ -0,0 +1,72 @@
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)
// ==
// RRTot
);
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)
// ==
// RRTot
);
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);

View File

@ -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++)

View File

@ -0,0 +1,42 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Global
rhoEqn
Description
Solve the continuity for density.
\*---------------------------------------------------------------------------*/
{
solve
(
fvm::ddt(rho) + fvc::div(phi)
// ==
// RRTot
);
}
// ************************************************************************* //

View File

@ -1,5 +1,4 @@
EXE_INC = \
-I../XiFoam \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \

View File

@ -0,0 +1,15 @@
fvVectorMatrix UEqn
(
fvm::ddt(rho, U)
+ fvm::div(phi, U)
+ turbulence->divDevRhoReff(U)
==
rho*g
);
UEqn.relax();
if (momentumPredictor)
{
solve(UEqn == -fvc::grad(p));
}

View File

@ -21,4 +21,6 @@
{
kappa = 1.0;
}
chemistrySh = kappa*chemistry.Sh()();
}

View File

@ -5,7 +5,7 @@ autoPtr<rhoChemistryModel> pChemistry
);
rhoChemistryModel& chemistry = pChemistry();
hReactionThermo& thermo = chemistry.thermo();
hsReactionThermo& thermo = chemistry.thermo();
basicMultiComponentMixture& composition = thermo.composition();
PtrList<volScalarField>& Y = composition.Y();
@ -40,7 +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 +82,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)
);

View File

@ -0,0 +1,19 @@
{
fvScalarMatrix hsEqn
(
fvm::ddt(rho, hs)
+ mvConvection->fvmDiv(phi, hs)
- fvm::laplacian(turbulence->alphaEff(), hs)
==
DpDt
+ chemistrySh
);
hsEqn.relax();
hsEqn.solve();
thermo.correct();
Info<< "T gas min/max = " << min(T).value() << ", "
<< max(T).value() << endl;
}

View File

@ -74,7 +74,7 @@ int main(int argc, char *argv[])
{
#include "UEqn.H"
#include "YEqn.H"
#include "hEqn.H"
#include "hsEqn.H"
// --- PISO loop
for (int corr=1; corr<=nCorr; corr++)

View File

@ -22,4 +22,6 @@
{
kappa = 1.0;
}
chemistrySh = kappa*chemistry.Sh()();
}

View File

@ -84,16 +84,8 @@ int main(int argc, char *argv[])
coalParcels.evolve();
coalParcels.info();
Info<< endl;
limestoneParcels.evolve();
limestoneParcels.info();
Info<< endl;
#include "chemistry.H"
#include "rhoEqn.H"
@ -102,16 +94,13 @@ int main(int argc, char *argv[])
{
#include "UEqn.H"
#include "YEqn.H"
#include "hEqn.H"
#include "hsEqn.H"
// --- PISO loop
for (int corr=1; corr<=nCorr; corr++)
{
#include "pEqn.H"
}
Info<< "T gas min/max = " << min(T).value() << ", "
<< max(T).value() << endl;
}
turbulence->correct();

View File

@ -6,7 +6,7 @@
);
psiChemistryModel& chemistry = pChemistry();
hCombustionThermo& thermo = chemistry.thermo();
hsCombustionThermo& thermo = chemistry.thermo();
basicMultiComponentMixture& composition = thermo.composition();
PtrList<volScalarField>& Y = composition.Y();
@ -22,7 +22,7 @@
}
volScalarField& p = thermo.p();
volScalarField& h = thermo.h();
volScalarField& hs = thermo.hs();
const volScalarField& T = thermo.T();
const volScalarField& psi = thermo.psi();
@ -32,7 +32,7 @@
{
fields.add(Y[i]);
}
fields.add(h);
fields.add(hs);
volScalarField rho
(
@ -133,5 +133,19 @@
"energy",
mesh,
dimEnergy/dimTime/dimVolume,
"h"
"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)
);

View File

@ -1,22 +0,0 @@
{
fvScalarMatrix hEqn
(
fvm::ddt(rho, h)
+ mvConvection->fvmDiv(phi, h)
- fvm::laplacian(turbulence->alphaEff(), h)
==
DpDt
+ coalParcels.Sh()
+ limestoneParcels.Sh()
+ enthalpySource.Su()
+ radiation->Sh(thermo)
);
hEqn.relax();
hEqn.solve();
thermo.correct();
radiation->correct();
}

View File

@ -0,0 +1,26 @@
{
fvScalarMatrix hsEqn
(
fvm::ddt(rho, hs)
+ mvConvection->fvmDiv(phi, hs)
- fvm::laplacian(turbulence->alphaEff(), hs)
==
DpDt
+ coalParcels.Sh()
+ limestoneParcels.Sh()
+ enthalpySource.Su()
+ radiation->Shs(thermo)
+ chemistrySh
);
hsEqn.relax();
hsEqn.solve();
thermo.correct();
radiation->correct();
Info<< "T gas min/max = " << min(T).value() << ", "
<< max(T).value() << endl;
}

View File

@ -22,4 +22,6 @@
{
kappa = 1.0;
}
chemistrySh = kappa*chemistry.Sh()();
}

View File

@ -6,7 +6,7 @@
);
rhoChemistryModel& chemistry = pChemistry();
hReactionThermo& thermo = chemistry.thermo();
hsReactionThermo& thermo = chemistry.thermo();
basicMultiComponentMixture& composition = thermo.composition();
PtrList<volScalarField>& Y = composition.Y();
@ -22,7 +22,7 @@
}
volScalarField& p = thermo.p();
volScalarField& h = thermo.h();
volScalarField& hs = thermo.hs();
const volScalarField& T = thermo.T();
const volScalarField& psi = thermo.psi();
@ -88,4 +88,18 @@
{
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)
);

View File

@ -32,14 +32,15 @@
{
solve
(
fvm::ddt(rho, h)
+ mvConvection->fvmDiv(phi, h)
- fvm::laplacian(turbulence->alphaEff(), h)
fvm::ddt(rho, hs)
+ mvConvection->fvmDiv(phi, hs)
- fvm::laplacian(turbulence->alphaEff(), hs)
==
pWork()
+ parcels.Sh()
+ radiation->Sh(thermo)
+ radiation->Shs(thermo)
+ energySource.Su()
+ chemistrySh
);
thermo.correct();

View File

@ -33,7 +33,7 @@ Description
The solver includes:
- reacting multiphase parcel cloud
- porous media
- point mass sources
- mass, momentum and energy sources
- polynomial based, incompressible thermodynamics (f(T))
Note: ddtPhiCorr not used here when porous zones are active
@ -89,13 +89,11 @@ int main(int argc, char *argv[])
parcels.evolve();
parcels.info();
#include "chemistry.H"
#include "rhoEqn.H"
#include "UEqn.H"
#include "YEqn.H"
#include "hEqn.H"
#include "hsEqn.H"
// --- PISO loop
for (int corr=0; corr<nCorr; corr++)

View File

@ -22,4 +22,6 @@
{
kappa = 1.0;
}
chemistrySh = kappa*chemistry.Sh()();
}

View File

@ -6,7 +6,7 @@
);
psiChemistryModel& chemistry = pChemistry();
hCombustionThermo& thermo = chemistry.thermo();
hsCombustionThermo& thermo = chemistry.thermo();
basicMultiComponentMixture& composition = thermo.composition();
PtrList<volScalarField>& Y = composition.Y();
@ -22,7 +22,7 @@
}
volScalarField& p = thermo.p();
volScalarField& h = thermo.h();
volScalarField& hs = thermo.hs();
const volScalarField& T = thermo.T();
const volScalarField& psi = thermo.psi();
@ -94,4 +94,18 @@
{
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("chemistry::Sh", dimEnergy/dimTime/dimVolume, 0.0)
);

View File

@ -1,20 +0,0 @@
{
fvScalarMatrix hEqn
(
fvm::ddt(rho, h)
+ mvConvection->fvmDiv(phi, h)
- fvm::laplacian(turbulence->alphaEff(), h)
==
DpDt
+ parcels.Sh()
+ radiation->Sh(thermo)
);
hEqn.relax();
hEqn.solve();
thermo.correct();
radiation->correct();
}

View File

@ -0,0 +1,24 @@
{
fvScalarMatrix hEqn
(
fvm::ddt(rho, hs)
+ mvConvection->fvmDiv(phi, hs)
- fvm::laplacian(turbulence->alphaEff(), hs)
==
DpDt
+ parcels.Sh()
+ radiation->Shs(thermo)
+ chemistrySh
);
hEqn.relax();
hEqn.solve();
thermo.correct();
radiation->correct();
Info<< "T gas min/max = " << min(T).value() << ", "
<< max(T).value() << endl;
}

View File

@ -74,8 +74,6 @@ int main(int argc, char *argv[])
parcels.evolve();
parcels.info();
#include "chemistry.H"
#include "rhoEqn.H"
@ -88,12 +86,9 @@ int main(int argc, char *argv[])
// --- PISO loop
for (int corr=1; corr<=nCorr; corr++)
{
#include "hEqn.H"
#include "hsEqn.H"
#include "pEqn.H"
}
Info<< "T gas min/max = " << min(T).value() << ", "
<< max(T).value() << endl;
}
turbulence->correct();