mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Thermodynamics: Updated combustion solvers to use EEqn and support h/e or ha/ea
This commit is contained in:
17
applications/solvers/combustion/PDRFoam/EaEqn.H
Normal file
17
applications/solvers/combustion/PDRFoam/EaEqn.H
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
volScalarField& hea = thermo.he();
|
||||||
|
|
||||||
|
solve
|
||||||
|
(
|
||||||
|
betav*fvm::ddt(rho, hea) + mvConvection->fvmDiv(phi, hea)
|
||||||
|
+ betav*fvc::ddt(rho, K) + fvc::div(phi, K)
|
||||||
|
+ (
|
||||||
|
hea.name() == "ea"
|
||||||
|
? fvc::div(phi, volScalarField("Ep", p/rho))
|
||||||
|
: -betav*dpdt
|
||||||
|
)
|
||||||
|
- fvm::laplacian(Db, hea)
|
||||||
|
);
|
||||||
|
|
||||||
|
thermo.correct();
|
||||||
|
}
|
||||||
22
applications/solvers/combustion/PDRFoam/EauEqn.H
Normal file
22
applications/solvers/combustion/PDRFoam/EauEqn.H
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
if (ign.ignited())
|
||||||
|
{
|
||||||
|
volScalarField& heau = thermo.heu();
|
||||||
|
|
||||||
|
solve
|
||||||
|
(
|
||||||
|
betav*fvm::ddt(rho, heau) + mvConvection->fvmDiv(phi, heau)
|
||||||
|
+ (betav*fvc::ddt(rho, K) + fvc::div(phi, K))*rho/thermo.rhou()
|
||||||
|
+ (
|
||||||
|
heau.name() == "eau"
|
||||||
|
? fvc::div(phi, volScalarField("Ep", p/rho))*rho/thermo.rhou()
|
||||||
|
: -betav*dpdt*rho/thermo.rhou()
|
||||||
|
)
|
||||||
|
- fvm::laplacian(Db, heau)
|
||||||
|
|
||||||
|
// These terms cannot be used in partially-premixed combustion due to
|
||||||
|
// the resultant inconsistency between ft and heau transport.
|
||||||
|
// A possible solution would be to solve for ftu as well as ft.
|
||||||
|
//- fvm::div(muEff*fvc::grad(b)/(b + 0.001), heau)
|
||||||
|
//+ fvm::Sp(fvc::div(muEff*fvc::grad(b)/(b + 0.001)), heau)
|
||||||
|
);
|
||||||
|
}
|
||||||
@ -123,12 +123,12 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
#include "bEqn.H"
|
#include "bEqn.H"
|
||||||
#include "ftEqn.H"
|
#include "ftEqn.H"
|
||||||
#include "hauEqn.H"
|
#include "EauEqn.H"
|
||||||
#include "haEqn.H"
|
#include "EaEqn.H"
|
||||||
|
|
||||||
if (!ign.ignited())
|
if (!ign.ignited())
|
||||||
{
|
{
|
||||||
hau == ha;
|
thermo.heu() == thermo.he();
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "pEqn.H"
|
#include "pEqn.H"
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
psiuReactionThermo::New(mesh)
|
psiuReactionThermo::New(mesh)
|
||||||
);
|
);
|
||||||
psiuReactionThermo& thermo = pThermo();
|
psiuReactionThermo& thermo = pThermo();
|
||||||
thermo.validate(args.executable(), "ha");
|
thermo.validate(args.executable(), "ha", "ea");
|
||||||
|
|
||||||
basicMultiComponentMixture& composition = thermo.composition();
|
basicMultiComponentMixture& composition = thermo.composition();
|
||||||
|
|
||||||
@ -24,14 +24,10 @@
|
|||||||
|
|
||||||
volScalarField& p = thermo.p();
|
volScalarField& p = thermo.p();
|
||||||
const volScalarField& psi = thermo.psi();
|
const volScalarField& psi = thermo.psi();
|
||||||
volScalarField& ha = thermo.he();
|
|
||||||
volScalarField& hau = thermo.heu();
|
|
||||||
|
|
||||||
volScalarField& b = composition.Y("b");
|
volScalarField& b = composition.Y("b");
|
||||||
Info<< "min(b) = " << min(b).value() << endl;
|
Info<< "min(b) = " << min(b).value() << endl;
|
||||||
|
|
||||||
//const volScalarField& T = thermo->T();
|
|
||||||
|
|
||||||
Info<< "\nReading field U\n" << endl;
|
Info<< "\nReading field U\n" << endl;
|
||||||
volVectorField U
|
volVectorField U
|
||||||
(
|
(
|
||||||
@ -198,6 +194,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
fields.add(b);
|
fields.add(b);
|
||||||
fields.add(ha);
|
fields.add(thermo.he());
|
||||||
fields.add(hau);
|
fields.add(thermo.heu());
|
||||||
flameWrinkling->addXi(fields);
|
flameWrinkling->addXi(fields);
|
||||||
|
|||||||
@ -1,13 +0,0 @@
|
|||||||
{
|
|
||||||
solve
|
|
||||||
(
|
|
||||||
betav*fvm::ddt(rho, ha)
|
|
||||||
+ mvConvection->fvmDiv(phi, ha)
|
|
||||||
- fvm::laplacian(Db, ha)
|
|
||||||
==
|
|
||||||
betav*dpdt
|
|
||||||
- betav*(fvc::ddt(rho, K) + fvc::div(phi, K))
|
|
||||||
);
|
|
||||||
|
|
||||||
thermo.correct();
|
|
||||||
}
|
|
||||||
@ -1,18 +0,0 @@
|
|||||||
if (ign.ignited())
|
|
||||||
{
|
|
||||||
solve
|
|
||||||
(
|
|
||||||
betav*fvm::ddt(rho, hau)
|
|
||||||
+ mvConvection->fvmDiv(phi, hau)
|
|
||||||
- fvm::laplacian(Db, hau)
|
|
||||||
|
|
||||||
// These terms cannot be used in partially-premixed combustion due to
|
|
||||||
// the resultant inconsistency between ft and hau transport.
|
|
||||||
// A possible solution would be to solve for ftu as well as ft.
|
|
||||||
//- fvm::div(muEff*fvc::grad(b)/(b + 0.001), hau)
|
|
||||||
//+ fvm::Sp(fvc::div(muEff*fvc::grad(b)/(b + 0.001)), hau)
|
|
||||||
|
|
||||||
==
|
|
||||||
betav*(dpdt - (fvc::ddt(rho, K) + fvc::div(phi, K)))*rho/thermo.rhou()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
20
applications/solvers/combustion/XiFoam/EaEqn.H
Normal file
20
applications/solvers/combustion/XiFoam/EaEqn.H
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
volScalarField& hea = thermo.he();
|
||||||
|
|
||||||
|
fvScalarMatrix EaEqn
|
||||||
|
(
|
||||||
|
fvm::ddt(rho, hea) + mvConvection->fvmDiv(phi, hea)
|
||||||
|
+ fvc::ddt(rho, K) + fvc::div(phi, K)
|
||||||
|
+ (
|
||||||
|
hea.name() == "ea"
|
||||||
|
? fvc::div(phi, volScalarField("Ep", p/rho))
|
||||||
|
: -dpdt
|
||||||
|
)
|
||||||
|
- fvm::laplacian(turbulence->alphaEff(), hea)
|
||||||
|
);
|
||||||
|
|
||||||
|
EaEqn.relax();
|
||||||
|
EaEqn.solve();
|
||||||
|
|
||||||
|
thermo.correct();
|
||||||
|
}
|
||||||
22
applications/solvers/combustion/XiFoam/EauEqn.H
Normal file
22
applications/solvers/combustion/XiFoam/EauEqn.H
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
if (ign.ignited())
|
||||||
|
{
|
||||||
|
volScalarField& heau = thermo.heu();
|
||||||
|
|
||||||
|
solve
|
||||||
|
(
|
||||||
|
fvm::ddt(rho, heau) + mvConvection->fvmDiv(phi, heau)
|
||||||
|
+ (fvc::ddt(rho, K) + fvc::div(phi, K))*rho/thermo.rhou()
|
||||||
|
+ (
|
||||||
|
heau.name() == "eau"
|
||||||
|
? fvc::div(phi, volScalarField("Ep", p/rho))*rho/thermo.rhou()
|
||||||
|
: -dpdt*rho/thermo.rhou()
|
||||||
|
)
|
||||||
|
- fvm::laplacian(turbulence->alphaEff(), heau)
|
||||||
|
|
||||||
|
// These terms cannot be used in partially-premixed combustion due to
|
||||||
|
// the resultant inconsistency between ft and heau transport.
|
||||||
|
// A possible solution would be to solve for ftu as well as ft.
|
||||||
|
//- fvm::div(muEff*fvc::grad(b)/(b + 0.001), heau)
|
||||||
|
//+ fvm::Sp(fvc::div(muEff*fvc::grad(b)/(b + 0.001)), heau)
|
||||||
|
);
|
||||||
|
}
|
||||||
@ -97,12 +97,12 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
#include "ftEqn.H"
|
#include "ftEqn.H"
|
||||||
#include "bEqn.H"
|
#include "bEqn.H"
|
||||||
#include "hauEqn.H"
|
#include "EauEqn.H"
|
||||||
#include "haEqn.H"
|
#include "EaEqn.H"
|
||||||
|
|
||||||
if (!ign.ignited())
|
if (!ign.ignited())
|
||||||
{
|
{
|
||||||
hau == ha;
|
thermo.heu() == thermo.he();
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- Pressure corrector loop
|
// --- Pressure corrector loop
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
psiuReactionThermo::New(mesh)
|
psiuReactionThermo::New(mesh)
|
||||||
);
|
);
|
||||||
psiuReactionThermo& thermo = pThermo();
|
psiuReactionThermo& thermo = pThermo();
|
||||||
thermo.validate(args.executable(), "ha");
|
thermo.validate(args.executable(), "ha", "ea");
|
||||||
|
|
||||||
basicMultiComponentMixture& composition = thermo.composition();
|
basicMultiComponentMixture& composition = thermo.composition();
|
||||||
|
|
||||||
@ -24,14 +24,10 @@
|
|||||||
|
|
||||||
volScalarField& p = thermo.p();
|
volScalarField& p = thermo.p();
|
||||||
const volScalarField& psi = thermo.psi();
|
const volScalarField& psi = thermo.psi();
|
||||||
volScalarField& ha = thermo.he();
|
|
||||||
volScalarField& hau = thermo.heu();
|
|
||||||
|
|
||||||
volScalarField& b = composition.Y("b");
|
volScalarField& b = composition.Y("b");
|
||||||
Info<< "min(b) = " << min(b).value() << endl;
|
Info<< "min(b) = " << min(b).value() << endl;
|
||||||
|
|
||||||
const volScalarField& T = thermo.T();
|
|
||||||
|
|
||||||
|
|
||||||
Info<< "\nReading field U\n" << endl;
|
Info<< "\nReading field U\n" << endl;
|
||||||
volVectorField U
|
volVectorField U
|
||||||
@ -140,5 +136,5 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
fields.add(b);
|
fields.add(b);
|
||||||
fields.add(ha);
|
fields.add(thermo.he());
|
||||||
fields.add(hau);
|
fields.add(thermo.heu());
|
||||||
|
|||||||
@ -1,16 +0,0 @@
|
|||||||
{
|
|
||||||
fvScalarMatrix haEqn
|
|
||||||
(
|
|
||||||
fvm::ddt(rho, ha)
|
|
||||||
+ mvConvection->fvmDiv(phi, ha)
|
|
||||||
- fvm::laplacian(turbulence->alphaEff(), ha)
|
|
||||||
==
|
|
||||||
dpdt
|
|
||||||
- (fvc::ddt(rho, K) + fvc::div(phi, K))
|
|
||||||
);
|
|
||||||
|
|
||||||
haEqn.relax();
|
|
||||||
haEqn.solve();
|
|
||||||
|
|
||||||
thermo.correct();
|
|
||||||
}
|
|
||||||
@ -1,18 +0,0 @@
|
|||||||
if (ign.ignited())
|
|
||||||
{
|
|
||||||
solve
|
|
||||||
(
|
|
||||||
fvm::ddt(rho, hau)
|
|
||||||
+ mvConvection->fvmDiv(phi, hau)
|
|
||||||
- fvm::laplacian(turbulence->alphaEff(), hau)
|
|
||||||
|
|
||||||
// These terms cannot be used in partially-premixed combustion due to
|
|
||||||
// the resultant inconsistency between ft and hau transport.
|
|
||||||
// A possible solution would be to solve for ftu as well as ft.
|
|
||||||
//- fvm::div(muEff*fvc::grad(b)/(b + 0.001), hau)
|
|
||||||
//+ fvm::Sp(fvc::div(muEff*fvc::grad(b)/(b + 0.001)), hau)
|
|
||||||
|
|
||||||
==
|
|
||||||
(dpdt - (fvc::ddt(rho, K) + fvc::div(phi, K)))*rho/thermo.rhou()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@ -103,12 +103,12 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
#include "ftEqn.H"
|
#include "ftEqn.H"
|
||||||
#include "bEqn.H"
|
#include "bEqn.H"
|
||||||
#include "hauEqn.H"
|
#include "EauEqn.H"
|
||||||
#include "haEqn.H"
|
#include "EaEqn.H"
|
||||||
|
|
||||||
if (!ign.ignited())
|
if (!ign.ignited())
|
||||||
{
|
{
|
||||||
hau == ha;
|
thermo.heu() == thermo.he();
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- Pressure corrector loop
|
// --- Pressure corrector loop
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
Info<< "Mean pressure:" << p.weightedAverage(mesh.V()).value() << endl;
|
Info<< "Mean pressure:" << p.weightedAverage(mesh.V()).value() << endl;
|
||||||
Info<< "Mean temperature:" << T.weightedAverage(mesh.V()).value() << endl;
|
Info<< "Mean temperature:" << thermo.T().weightedAverage(mesh.V()).value()
|
||||||
|
<< endl;
|
||||||
Info<< "Mean u':"
|
Info<< "Mean u':"
|
||||||
<< (sqrt((2.0/3.0)*turbulence->k()))().weightedAverage(mesh.V()).value()
|
<< (sqrt((2.0/3.0)*turbulence->k()))().weightedAverage(mesh.V()).value()
|
||||||
<< endl;
|
<< endl;
|
||||||
@ -7,7 +8,7 @@ Info<< "Mean u':"
|
|||||||
logSummaryFile
|
logSummaryFile
|
||||||
<< runTime.theta() << tab
|
<< runTime.theta() << tab
|
||||||
<< p.weightedAverage(mesh.V()).value() << tab
|
<< p.weightedAverage(mesh.V()).value() << tab
|
||||||
<< T.weightedAverage(mesh.V()).value() << tab
|
<< thermo.T().weightedAverage(mesh.V()).value() << tab
|
||||||
<< (sqrt((2.0/3.0)*turbulence->k()))().weightedAverage(mesh.V()).value()
|
<< (sqrt((2.0/3.0)*turbulence->k()))().weightedAverage(mesh.V()).value()
|
||||||
<< tab
|
<< tab
|
||||||
<< 1 - b.weightedAverage(mesh.V()).value()
|
<< 1 - b.weightedAverage(mesh.V()).value()
|
||||||
|
|||||||
@ -47,22 +47,27 @@ tmp<fv::convectionScheme<scalar> > mvConvection
|
|||||||
Y[inertIndex] = scalar(1) - Yt;
|
Y[inertIndex] = scalar(1) - Yt;
|
||||||
Y[inertIndex].max(0.0);
|
Y[inertIndex].max(0.0);
|
||||||
|
|
||||||
fvScalarMatrix hsEqn
|
volScalarField& he = thermo.he();
|
||||||
|
|
||||||
|
fvScalarMatrix EEqn
|
||||||
(
|
(
|
||||||
fvm::ddt(rho, hs)
|
fvm::ddt(rho, he) + mvConvection->fvmDiv(phi, he)
|
||||||
+ mvConvection->fvmDiv(phi, hs)
|
+ fvc::ddt(rho, K) + fvc::div(phi, K)
|
||||||
- fvm::laplacian(turbulence->alphaEff(), hs)
|
+ (
|
||||||
|
he.name() == "e"
|
||||||
|
? fvc::div(phi, volScalarField("Ep", p/rho))
|
||||||
|
: -dpdt
|
||||||
|
)
|
||||||
|
- fvm::laplacian(turbulence->alphaEff(), he)
|
||||||
==
|
==
|
||||||
dpdt
|
combustion->Sh()
|
||||||
- (fvc::ddt(rho, K) + fvc::div(phi, K))
|
|
||||||
+ combustion->Sh()
|
|
||||||
+ radiation->Sh(thermo)
|
+ radiation->Sh(thermo)
|
||||||
+ parcels.Sh(hs)
|
+ parcels.Sh(he)
|
||||||
+ surfaceFilm.Sh()
|
+ surfaceFilm.Sh()
|
||||||
);
|
);
|
||||||
|
|
||||||
hsEqn.relax();
|
EEqn.relax();
|
||||||
hsEqn.solve();
|
EEqn.solve();
|
||||||
|
|
||||||
thermo.correct();
|
thermo.correct();
|
||||||
|
|
||||||
@ -11,6 +11,7 @@
|
|||||||
Info<< "Reading thermophysical properties\n" << endl;
|
Info<< "Reading thermophysical properties\n" << endl;
|
||||||
|
|
||||||
psiReactionThermo& thermo = combustion->thermo();
|
psiReactionThermo& thermo = combustion->thermo();
|
||||||
|
thermo.validate(args.executable(), "h", "e");
|
||||||
|
|
||||||
SLGThermo slgThermo(mesh, thermo);
|
SLGThermo slgThermo(mesh, thermo);
|
||||||
|
|
||||||
@ -34,7 +35,6 @@
|
|||||||
);
|
);
|
||||||
|
|
||||||
volScalarField& p = thermo.p();
|
volScalarField& p = thermo.p();
|
||||||
volScalarField& hs = thermo.he();
|
|
||||||
const volScalarField& T = thermo.T();
|
const volScalarField& T = thermo.T();
|
||||||
const volScalarField& psi = thermo.psi();
|
const volScalarField& psi = thermo.psi();
|
||||||
|
|
||||||
@ -128,7 +128,7 @@
|
|||||||
{
|
{
|
||||||
fields.add(Y[i]);
|
fields.add(Y[i]);
|
||||||
}
|
}
|
||||||
fields.add(hs);
|
fields.add(thermo.he());
|
||||||
|
|
||||||
IOdictionary additionalControlsDict
|
IOdictionary additionalControlsDict
|
||||||
(
|
(
|
||||||
|
|||||||
@ -94,7 +94,7 @@ int main(int argc, char *argv[])
|
|||||||
while (pimple.loop())
|
while (pimple.loop())
|
||||||
{
|
{
|
||||||
#include "UEqn.H"
|
#include "UEqn.H"
|
||||||
#include "YhsEqn.H"
|
#include "YEEqn.H"
|
||||||
|
|
||||||
// --- Pressure corrector loop
|
// --- Pressure corrector loop
|
||||||
while (pimple.correct())
|
while (pimple.correct())
|
||||||
|
|||||||
@ -6,6 +6,7 @@ cd ${0%/*} || exit 1 # run from this directory
|
|||||||
cleanCase
|
cleanCase
|
||||||
|
|
||||||
rm -rf VTK
|
rm -rf VTK
|
||||||
|
rm -rf 0
|
||||||
rm -rf constant/polyMesh/sets constant/polyMesh/faces
|
rm -rf constant/polyMesh/sets constant/polyMesh/faces
|
||||||
rm -rf constant/polyMesh/faces
|
rm -rf constant/polyMesh/faces
|
||||||
rm -rf constant/polyMesh/points
|
rm -rf constant/polyMesh/points
|
||||||
|
|||||||
@ -5,11 +5,13 @@ cd ${0%/*} || exit 1 # run from this directory
|
|||||||
# Source tutorial run functions
|
# Source tutorial run functions
|
||||||
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||||
|
|
||||||
|
rm -rf 0
|
||||||
|
cp -r 0.org 0
|
||||||
runApplication blockMesh
|
runApplication blockMesh
|
||||||
runApplication changeDictionary
|
runApplication changeDictionary
|
||||||
runApplication topoSet
|
runApplication topoSet
|
||||||
|
|
||||||
runApplication PDRMesh
|
runApplication PDRMesh -overwrite
|
||||||
|
|
||||||
# Run
|
# Run
|
||||||
runApplication `getApplication`
|
runApplication `getApplication`
|
||||||
|
|||||||
@ -44,6 +44,7 @@ FoamFile
|
|||||||
baffleCyclic_half0
|
baffleCyclic_half0
|
||||||
{
|
{
|
||||||
type cyclic;
|
type cyclic;
|
||||||
|
inGroups 1(cyclic);
|
||||||
nFaces 0;
|
nFaces 0;
|
||||||
startFace 24810;
|
startFace 24810;
|
||||||
matchTolerance 0.0001;
|
matchTolerance 0.0001;
|
||||||
@ -52,6 +53,7 @@ FoamFile
|
|||||||
baffleCyclic_half1
|
baffleCyclic_half1
|
||||||
{
|
{
|
||||||
type cyclic;
|
type cyclic;
|
||||||
|
inGroups 1(cyclic);
|
||||||
nFaces 0;
|
nFaces 0;
|
||||||
startFace 24810;
|
startFace 24810;
|
||||||
matchTolerance 0.0001;
|
matchTolerance 0.0001;
|
||||||
|
|||||||
@ -38,6 +38,7 @@ FoamFile
|
|||||||
frontAndBack
|
frontAndBack
|
||||||
{
|
{
|
||||||
type empty;
|
type empty;
|
||||||
|
inGroups 1(empty);
|
||||||
nFaces 45000;
|
nFaces 45000;
|
||||||
startFace 45284;
|
startFace 45284;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user