mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
porousExplicitSourceReactingParcelFoam: Add total energy source term to enthalpy equation
Pressure time derivative term is run-time switchable
This commit is contained in:
@ -10,6 +10,8 @@
|
|||||||
+ sources(rho, U)
|
+ sources(rho, U)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
UEqn.relax();
|
||||||
|
|
||||||
sources.constrain(UEqn);
|
sources.constrain(UEqn);
|
||||||
|
|
||||||
pZones.addResistance(UEqn);
|
pZones.addResistance(UEqn);
|
||||||
@ -17,5 +19,6 @@
|
|||||||
if (pimple.momentumPredictor())
|
if (pimple.momentumPredictor())
|
||||||
{
|
{
|
||||||
solve(UEqn == -fvc::grad(p));
|
solve(UEqn == -fvc::grad(p));
|
||||||
|
K = 0.5*magSqr(U);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -35,6 +35,8 @@ if (solveSpecies)
|
|||||||
+ sources(rho, Yi)
|
+ sources(rho, Yi)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
YiEqn.relax();
|
||||||
|
|
||||||
sources.constrain(YiEqn);
|
sources.constrain(YiEqn);
|
||||||
|
|
||||||
YiEqn.solve(mesh.solver("Yi"));
|
YiEqn.solve(mesh.solver("Yi"));
|
||||||
|
|||||||
@ -98,3 +98,9 @@
|
|||||||
mesh,
|
mesh,
|
||||||
dimensionedScalar("dQ", dimEnergy/dimTime, 0.0)
|
dimensionedScalar("dQ", dimEnergy/dimTime, 0.0)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Info<< "Creating field dpdt\n" << endl;
|
||||||
|
volScalarField dpdt("dpdt", fvc::ddt(p));
|
||||||
|
|
||||||
|
Info<< "Creating field kinetic energy K\n" << endl;
|
||||||
|
volScalarField K("K", 0.5*magSqr(U));
|
||||||
|
|||||||
@ -1,33 +1,3 @@
|
|||||||
{
|
|
||||||
tmp<volScalarField> pWork
|
|
||||||
(
|
|
||||||
new volScalarField
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"pWork",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
),
|
|
||||||
mesh,
|
|
||||||
dimensionedScalar("zero", dimensionSet(1, -1, -3, 0, 0), 0.0)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
if (pressureWork)
|
|
||||||
{
|
|
||||||
surfaceScalarField phiU("phiU", phi/fvc::interpolate(rho));
|
|
||||||
|
|
||||||
pWork() += fvc::div(phiU*fvc::interpolate(p)) - p*fvc::div(phiU);
|
|
||||||
|
|
||||||
if (pressureWorkTimeDerivative)
|
|
||||||
{
|
|
||||||
pWork() += fvc::ddt(p);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
{
|
||||||
fvScalarMatrix hsEqn
|
fvScalarMatrix hsEqn
|
||||||
(
|
(
|
||||||
@ -35,13 +5,20 @@
|
|||||||
+ mvConvection->fvmDiv(phi, hs)
|
+ mvConvection->fvmDiv(phi, hs)
|
||||||
- fvm::laplacian(turbulence->alphaEff(), hs)
|
- fvm::laplacian(turbulence->alphaEff(), hs)
|
||||||
==
|
==
|
||||||
pWork()
|
- (fvc::ddt(rho, K) + fvc::div(phi, K))
|
||||||
+ parcels.Sh(hs)
|
+ parcels.Sh(hs)
|
||||||
+ radiation->Shs(thermo)
|
+ radiation->Shs(thermo)
|
||||||
+ combustion->Sh()
|
+ combustion->Sh()
|
||||||
+ sources(rho, hs)
|
+ sources(rho, hs)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (pressureWorkTimeDerivative)
|
||||||
|
{
|
||||||
|
hsEqn -= dpdt;
|
||||||
|
}
|
||||||
|
|
||||||
|
hsEqn.relax();
|
||||||
|
|
||||||
sources.constrain(hsEqn);
|
sources.constrain(hsEqn);
|
||||||
|
|
||||||
hsEqn.solve();
|
hsEqn.solve();
|
||||||
@ -53,4 +30,3 @@
|
|||||||
Info<< "T gas min/max = " << min(T).value() << ", "
|
Info<< "T gas min/max = " << min(T).value() << ", "
|
||||||
<< max(T).value() << endl;
|
<< max(T).value() << endl;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@ -59,4 +59,7 @@
|
|||||||
|
|
||||||
U -= rAU*fvc::grad(p);
|
U -= rAU*fvc::grad(p);
|
||||||
U.correctBoundaryConditions();
|
U.correctBoundaryConditions();
|
||||||
|
K = 0.5*magSqr(U);
|
||||||
|
|
||||||
|
dpdt = fvc::ddt(p);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,9 +1,8 @@
|
|||||||
dictionary additional = mesh.solutionDict().subDict("additional");
|
dictionary additional = mesh.solutionDict().subDict("additional");
|
||||||
|
|
||||||
// pressure work term for enthalpy equation
|
// pressure work term for enthalpy equation
|
||||||
bool pressureWork = additional.lookupOrDefault("pressureWork", true);
|
|
||||||
bool pressureWorkTimeDerivative =
|
bool pressureWorkTimeDerivative =
|
||||||
additional.lookupOrDefault("pressureWorkTimeDerivative", true);
|
additional.lookupOrDefault("pressureWorkTimeDerivative", false);
|
||||||
|
|
||||||
// flag to activate solve transport for each specie (Y vector)
|
// flag to activate solve transport for each specie (Y vector)
|
||||||
bool solveSpecies = additional.lookupOrDefault("solveSpecies", true);
|
bool solveSpecies = additional.lookupOrDefault("solveSpecies", true);
|
||||||
|
|||||||
@ -645,20 +645,18 @@ backwardDdtScheme<Type>::fvcDdtPhiCorr
|
|||||||
phiAbs.oldTime()/fvc::interpolate(rho.oldTime())
|
phiAbs.oldTime()/fvc::interpolate(rho.oldTime())
|
||||||
)
|
)
|
||||||
*(
|
*(
|
||||||
fvc::interpolate(rA*rho.oldTime())
|
fvc::interpolate(rA)
|
||||||
*(
|
*(
|
||||||
coefft0*phiAbs.oldTime()
|
coefft0*phiAbs.oldTime()
|
||||||
/fvc::interpolate(rho.oldTime())
|
|
||||||
- coefft00*phiAbs.oldTime().oldTime()
|
- coefft00*phiAbs.oldTime().oldTime()
|
||||||
/fvc::interpolate(rho.oldTime().oldTime())
|
|
||||||
)
|
)
|
||||||
- (
|
- (
|
||||||
fvc::interpolate
|
fvc::interpolate
|
||||||
(
|
(
|
||||||
rA*rho.oldTime()*
|
rA*
|
||||||
(
|
(
|
||||||
coefft0*U.oldTime()
|
coefft0*rho.oldTime()*U.oldTime()
|
||||||
- coefft00*U.oldTime().oldTime()
|
- coefft00*rho.oldTime().oldTime()*U.oldTime().oldTime()
|
||||||
)
|
)
|
||||||
) & mesh().Sf()
|
) & mesh().Sf()
|
||||||
)
|
)
|
||||||
|
|||||||
@ -21,40 +21,40 @@ FoamFile
|
|||||||
{
|
{
|
||||||
type wall;
|
type wall;
|
||||||
nFaces 172;
|
nFaces 172;
|
||||||
startFace 3334;
|
startFace 3294;
|
||||||
}
|
}
|
||||||
inlet
|
inlet
|
||||||
{
|
{
|
||||||
type patch;
|
type patch;
|
||||||
nFaces 20;
|
nFaces 20;
|
||||||
startFace 3506;
|
startFace 3466;
|
||||||
}
|
}
|
||||||
outlet
|
outlet
|
||||||
{
|
{
|
||||||
type patch;
|
type patch;
|
||||||
nFaces 20;
|
nFaces 20;
|
||||||
startFace 3526;
|
startFace 3486;
|
||||||
}
|
}
|
||||||
cycLeft_half0
|
cycLeft_half0
|
||||||
{
|
{
|
||||||
type cyclic;
|
type cyclic;
|
||||||
nFaces 0;
|
nFaces 20;
|
||||||
startFace 3546;
|
startFace 3506;
|
||||||
matchTolerance 0.0001;
|
matchTolerance 0.0001;
|
||||||
neighbourPatch cycLeft_half1;
|
neighbourPatch cycLeft_half1;
|
||||||
}
|
}
|
||||||
cycLeft_half1
|
cycLeft_half1
|
||||||
{
|
{
|
||||||
type cyclic;
|
type cyclic;
|
||||||
nFaces 0;
|
nFaces 20;
|
||||||
startFace 3546;
|
startFace 3526;
|
||||||
matchTolerance 0.0001;
|
matchTolerance 0.0001;
|
||||||
neighbourPatch cycLeft_half0;
|
neighbourPatch cycLeft_half0;
|
||||||
}
|
}
|
||||||
cycRight_half0
|
cycRight_half0
|
||||||
{
|
{
|
||||||
type cyclic;
|
type cyclic;
|
||||||
nFaces 0;
|
nFaces 20;
|
||||||
startFace 3546;
|
startFace 3546;
|
||||||
matchTolerance 0.0001;
|
matchTolerance 0.0001;
|
||||||
neighbourPatch cycRight_half1;
|
neighbourPatch cycRight_half1;
|
||||||
@ -62,8 +62,8 @@ FoamFile
|
|||||||
cycRight_half1
|
cycRight_half1
|
||||||
{
|
{
|
||||||
type cyclic;
|
type cyclic;
|
||||||
nFaces 0;
|
nFaces 20;
|
||||||
startFace 3546;
|
startFace 3566;
|
||||||
matchTolerance 0.0001;
|
matchTolerance 0.0001;
|
||||||
neighbourPatch cycRight_half0;
|
neighbourPatch cycRight_half0;
|
||||||
}
|
}
|
||||||
@ -71,7 +71,7 @@ FoamFile
|
|||||||
{
|
{
|
||||||
type empty;
|
type empty;
|
||||||
nFaces 3440;
|
nFaces 3440;
|
||||||
startFace 3546;
|
startFace 3586;
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@ -85,8 +85,7 @@ PIMPLE
|
|||||||
|
|
||||||
additional
|
additional
|
||||||
{
|
{
|
||||||
pressureWork true;
|
pressureWorkTimeDerivative false;
|
||||||
pressureWorkTimeDerivative true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
relaxationFactors
|
relaxationFactors
|
||||||
|
|||||||
@ -31,7 +31,7 @@ divSchemes
|
|||||||
default none;
|
default none;
|
||||||
div(phi,U) Gauss upwind;
|
div(phi,U) Gauss upwind;
|
||||||
div(phid,p) Gauss upwind;
|
div(phid,p) Gauss upwind;
|
||||||
div(phi,K) Gauss linear;
|
div(phi,K) Gauss upwind;
|
||||||
div(phi,hs) Gauss upwind;
|
div(phi,hs) Gauss upwind;
|
||||||
div(phi,k) Gauss upwind;
|
div(phi,k) Gauss upwind;
|
||||||
div(phi,epsilon) Gauss upwind;
|
div(phi,epsilon) Gauss upwind;
|
||||||
|
|||||||
@ -83,19 +83,18 @@ PIMPLE
|
|||||||
|
|
||||||
additional
|
additional
|
||||||
{
|
{
|
||||||
pressureWork true;
|
pressureWorkTimeDerivative false;
|
||||||
pressureWorkTimeDerivative true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
relaxationFactors
|
relaxationFactors
|
||||||
{
|
{
|
||||||
fields
|
fields
|
||||||
{
|
{
|
||||||
".*Final" 1;
|
".*" 1;
|
||||||
}
|
}
|
||||||
equations
|
equations
|
||||||
{
|
{
|
||||||
".*Final" 1;
|
".*" 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -33,7 +33,7 @@ divSchemes
|
|||||||
default none;
|
default none;
|
||||||
div(phi,U) Gauss upwind;
|
div(phi,U) Gauss upwind;
|
||||||
div(phid,p) Gauss upwind;
|
div(phid,p) Gauss upwind;
|
||||||
div(phi,K) Gauss linear;
|
div(phi,K) Gauss upwind;
|
||||||
div(phi,hs) Gauss upwind;
|
div(phi,hs) Gauss upwind;
|
||||||
div(phi,k) Gauss upwind;
|
div(phi,k) Gauss upwind;
|
||||||
div(phi,epsilon) Gauss upwind;
|
div(phi,epsilon) Gauss upwind;
|
||||||
|
|||||||
@ -89,7 +89,6 @@ potentialFlow
|
|||||||
|
|
||||||
additional
|
additional
|
||||||
{
|
{
|
||||||
pressureWork false;
|
|
||||||
pressureWorkTimeDerivative false;
|
pressureWorkTimeDerivative false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -97,11 +96,11 @@ relaxationFactors
|
|||||||
{
|
{
|
||||||
fields
|
fields
|
||||||
{
|
{
|
||||||
".*Final" 1;
|
".*" 1;
|
||||||
}
|
}
|
||||||
equations
|
equations
|
||||||
{
|
{
|
||||||
".*Final" 1;
|
".*" 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user