mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
updates to ../../applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam
This commit is contained in:
@ -9,35 +9,10 @@
|
||||
+ parcels.SU()
|
||||
);
|
||||
|
||||
UEqn.relax();
|
||||
pZones.addResistance(UEqn);
|
||||
|
||||
tmp<volScalarField> trAU;
|
||||
tmp<volTensorField> trTU;
|
||||
|
||||
if (pressureImplicitPorosity)
|
||||
if (momentumPredictor)
|
||||
{
|
||||
tmp<volTensorField> tTU = tensor(I)*UEqn.A();
|
||||
pZones.addResistance(UEqn, tTU());
|
||||
trTU = inv(tTU());
|
||||
trTU().rename("rAU");
|
||||
|
||||
volVectorField gradp = fvc::grad(p);
|
||||
|
||||
for (int UCorr=0; UCorr<nUCorr; UCorr++)
|
||||
{
|
||||
U = trTU() & (UEqn.H() - gradp);
|
||||
}
|
||||
U.correctBoundaryConditions();
|
||||
solve(UEqn == -fvc::grad(p));
|
||||
}
|
||||
else
|
||||
{
|
||||
pZones.addResistance(UEqn);
|
||||
|
||||
trAU = 1.0/UEqn.A();
|
||||
trAU().rename("rAU");
|
||||
|
||||
solve
|
||||
(
|
||||
UEqn == -fvc::grad(p)
|
||||
);
|
||||
}
|
||||
|
||||
@ -43,5 +43,4 @@ tmp<fv::convectionScheme<scalar> > mvConvection
|
||||
|
||||
Y[inertIndex] = scalar(1) - Yt;
|
||||
Y[inertIndex].max(0.0);
|
||||
|
||||
}
|
||||
|
||||
@ -73,13 +73,7 @@
|
||||
)
|
||||
);
|
||||
|
||||
Info<< "Creating field DpDt\n" << endl;
|
||||
volScalarField DpDt
|
||||
(
|
||||
"DpDt",
|
||||
fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p)
|
||||
);
|
||||
|
||||
Info<< "Creating multi-variate interpolation scheme\n" << endl;
|
||||
multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
|
||||
|
||||
forAll (Y, i)
|
||||
|
||||
@ -1,21 +1,3 @@
|
||||
Info<< "Creating porous zones" << nl << endl;
|
||||
|
||||
porousZones pZones(mesh);
|
||||
Switch pressureImplicitPorosity(false);
|
||||
|
||||
label nUCorr = 0;
|
||||
if (pZones.size())
|
||||
{
|
||||
// nUCorrectors for pressureImplicitPorosity
|
||||
if (mesh.solutionDict().subDict("PISO").found("nUCorrectors"))
|
||||
{
|
||||
mesh.solutionDict().subDict("PISO").lookup("nUCorrectors")
|
||||
>> nUCorr;
|
||||
}
|
||||
|
||||
if (nUCorr > 0)
|
||||
{
|
||||
pressureImplicitPorosity = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,20 +1,51 @@
|
||||
{
|
||||
fvScalarMatrix hEqn
|
||||
tmp<volScalarField> pWork
|
||||
(
|
||||
fvm::ddt(rho, h)
|
||||
+ mvConvection->fvmDiv(phi, h)
|
||||
- fvm::laplacian(turbulence->alphaEff(), h)
|
||||
==
|
||||
DpDt
|
||||
+ parcels.Sh()
|
||||
+ radiation->Sh(thermo)
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"pWork",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("zero", dimensionSet(1, -1, -3, 0, 0), 0.0)
|
||||
)
|
||||
);
|
||||
|
||||
hEqn.relax();
|
||||
if (dpdt)
|
||||
{
|
||||
pWork() += fvc::ddt(p);
|
||||
}
|
||||
if (eWork)
|
||||
{
|
||||
pWork() = -p*fvc::div(phi/fvc::interpolate(rho));
|
||||
}
|
||||
if (hWork)
|
||||
{
|
||||
pWork() += fvc::div(phi/fvc::interpolate(rho)*fvc::interpolate(p));
|
||||
}
|
||||
|
||||
hEqn.solve();
|
||||
{
|
||||
solve
|
||||
(
|
||||
fvm::ddt(rho, h)
|
||||
+ mvConvection->fvmDiv(phi, h)
|
||||
- fvm::laplacian(turbulence->alphaEff(), h)
|
||||
==
|
||||
pWork()
|
||||
+ parcels.Sh()
|
||||
+ radiation->Sh(thermo)
|
||||
);
|
||||
|
||||
thermo.correct();
|
||||
thermo.correct();
|
||||
|
||||
radiation->correct();
|
||||
radiation->correct();
|
||||
|
||||
Info<< "T gas min/max = " << min(T).value() << ", "
|
||||
<< max(T).value() << endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,65 +5,13 @@
|
||||
// pressure solution - done in 2 parts. Part 1:
|
||||
thermo.rho() -= psi*p;
|
||||
|
||||
if (pressureImplicitPorosity)
|
||||
volScalarField rAU = 1.0/UEqn.A();
|
||||
U = rAU*UEqn.H();
|
||||
|
||||
if (pZones.size() > 0)
|
||||
{
|
||||
U = trTU()&UEqn.H();
|
||||
}
|
||||
else
|
||||
{
|
||||
U = trAU()*UEqn.H();
|
||||
}
|
||||
|
||||
if (transonic)
|
||||
{
|
||||
surfaceScalarField phiv = fvc::interpolate(U) & mesh.Sf();
|
||||
|
||||
phi = fvc::interpolate(rho)*phiv;
|
||||
|
||||
surfaceScalarField phid("phid", fvc::interpolate(psi)*phiv);
|
||||
|
||||
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
||||
{
|
||||
tmp<fvScalarMatrix> lapTerm;
|
||||
|
||||
if (pressureImplicitPorosity)
|
||||
{
|
||||
lapTerm = fvm::laplacian(rho*trTU(), p);
|
||||
}
|
||||
else
|
||||
{
|
||||
lapTerm = fvm::laplacian(rho*trAU(), p);
|
||||
}
|
||||
|
||||
fvScalarMatrix pEqn
|
||||
(
|
||||
fvc::ddt(rho) + fvc::div(phi)
|
||||
+ correction(psi*fvm::ddt(p) + fvm::div(phid, p))
|
||||
- lapTerm()
|
||||
==
|
||||
parcels.Srho()
|
||||
+ pointMassSources.Su()
|
||||
);
|
||||
|
||||
if
|
||||
(
|
||||
oCorr == nOuterCorr-1
|
||||
&& corr == nCorr-1
|
||||
&& nonOrth == nNonOrthCorr
|
||||
)
|
||||
{
|
||||
pEqn.solve(mesh.solver("pFinal"));
|
||||
}
|
||||
else
|
||||
{
|
||||
pEqn.solve();
|
||||
}
|
||||
|
||||
if (nonOrth == nNonOrthCorr)
|
||||
{
|
||||
phi == pEqn.flux();
|
||||
}
|
||||
}
|
||||
// ddtPhiCorr not well defined for cases with porosity
|
||||
phi = fvc::interpolate(rho)*(fvc::interpolate(U) & mesh.Sf());
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -71,50 +19,34 @@
|
||||
fvc::interpolate(rho)
|
||||
*(
|
||||
(fvc::interpolate(U) & mesh.Sf())
|
||||
// + fvc::ddtPhiCorr(trAU(), rho, U, phi)
|
||||
+ fvc::ddtPhiCorr(rAU, rho, U, phi)
|
||||
);
|
||||
}
|
||||
|
||||
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
||||
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
||||
{
|
||||
fvScalarMatrix pEqn
|
||||
(
|
||||
fvc::ddt(rho) + psi*correction(fvm::ddt(p))
|
||||
+ fvc::div(phi)
|
||||
- fvm::laplacian(rho*rAU, p)
|
||||
==
|
||||
parcels.Srho()
|
||||
+ pointMassSources.Su()
|
||||
);
|
||||
|
||||
if (corr == nCorr-1 && nonOrth == nNonOrthCorr)
|
||||
{
|
||||
tmp<fvScalarMatrix> lapTerm;
|
||||
pEqn.solve(mesh.solver("pFinal"));
|
||||
}
|
||||
else
|
||||
{
|
||||
pEqn.solve();
|
||||
}
|
||||
|
||||
if (pressureImplicitPorosity)
|
||||
{
|
||||
lapTerm = fvm::laplacian(rho*trTU(), p);
|
||||
}
|
||||
else
|
||||
{
|
||||
lapTerm = fvm::laplacian(rho*trAU(), p);
|
||||
}
|
||||
|
||||
fvScalarMatrix pEqn
|
||||
(
|
||||
fvc::ddt(rho) + psi*correction(fvm::ddt(p))
|
||||
+ fvc::div(phi)
|
||||
- lapTerm()
|
||||
==
|
||||
parcels.Srho()
|
||||
+ pointMassSources.Su()
|
||||
);
|
||||
|
||||
if
|
||||
(
|
||||
oCorr == nOuterCorr-1
|
||||
&& corr == nCorr-1
|
||||
&& nonOrth == nNonOrthCorr
|
||||
)
|
||||
{
|
||||
pEqn.solve(mesh.solver("pFinal"));
|
||||
}
|
||||
else
|
||||
{
|
||||
pEqn.solve();
|
||||
}
|
||||
|
||||
if (nonOrth == nNonOrthCorr)
|
||||
{
|
||||
phi += pEqn.flux();
|
||||
}
|
||||
if (nonOrth == nNonOrthCorr)
|
||||
{
|
||||
phi += pEqn.flux();
|
||||
}
|
||||
}
|
||||
|
||||
@ -124,15 +56,6 @@
|
||||
#include "rhoEqn.H"
|
||||
#include "compressibleContinuityErrs.H"
|
||||
|
||||
if (pressureImplicitPorosity)
|
||||
{
|
||||
U -= trTU()&fvc::grad(p);
|
||||
}
|
||||
else
|
||||
{
|
||||
U -= trAU()*fvc::grad(p);
|
||||
}
|
||||
U -= rAU*fvc::grad(p);
|
||||
U.correctBoundaryConditions();
|
||||
|
||||
DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
|
||||
}
|
||||
|
||||
@ -23,15 +23,16 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Application
|
||||
trackedReactingParcelFoam
|
||||
porousExplicitSourceReactingParcelFoam
|
||||
|
||||
Description
|
||||
- reacting parcel cloud tracking
|
||||
- reacting parcel cloud
|
||||
- porous media
|
||||
- point mass sources
|
||||
- polynomial based, incompressible thermodynamics (f(T))
|
||||
|
||||
Note: ddtPhiCorr not used here - not well defined for porous calcs
|
||||
Note: ddtPhiCorr not used here when porous zones are active
|
||||
- not well defined for porous calcs
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -74,6 +75,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
#include "readTimeControls.H"
|
||||
#include "readPISOControls.H"
|
||||
#include "readAdditionalSolutionControls.H"
|
||||
#include "compressibleCourantNo.H"
|
||||
#include "setDeltaT.H"
|
||||
|
||||
@ -88,23 +90,16 @@ int main(int argc, char *argv[])
|
||||
#include "chemistry.H"
|
||||
#include "rhoEqn.H"
|
||||
#include "UEqn.H"
|
||||
#include "YEqn.H"
|
||||
#include "hEqn.H"
|
||||
|
||||
// --- PIMPLE loop
|
||||
for (int oCorr=1; oCorr<=nOuterCorr; oCorr++)
|
||||
// --- PISO loop
|
||||
for (int corr=0; corr<nCorr; corr++)
|
||||
{
|
||||
#include "YEqn.H"
|
||||
#include "hEqn.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;
|
||||
#include "pEqn.H"
|
||||
}
|
||||
|
||||
|
||||
turbulence->correct();
|
||||
|
||||
rho = thermo.rho();
|
||||
|
||||
@ -0,0 +1,20 @@
|
||||
dictionary additional = mesh.solutionDict().subDict("additional");
|
||||
|
||||
bool dpdt = true;
|
||||
if (additional.found("dpdt"))
|
||||
{
|
||||
additional.lookup("dpdt") >> dpdt;
|
||||
}
|
||||
|
||||
bool eWork = true;
|
||||
if (additional.found("eWork"))
|
||||
{
|
||||
additional.lookup("eWork") >> eWork;
|
||||
}
|
||||
|
||||
bool hWork = true;
|
||||
if (additional.found("hWork"))
|
||||
{
|
||||
additional.lookup("hWork") >> hWork;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user