updates to ../../applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam

This commit is contained in:
andy
2009-07-06 17:07:31 +01:00
parent 516c20c8e7
commit 3deed0eb44
8 changed files with 109 additions and 190 deletions

View File

@ -9,35 +9,10 @@
+ parcels.SU() + parcels.SU()
); );
UEqn.relax();
tmp<volScalarField> trAU;
tmp<volTensorField> trTU;
if (pressureImplicitPorosity)
{
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();
}
else
{
pZones.addResistance(UEqn); pZones.addResistance(UEqn);
trAU = 1.0/UEqn.A(); if (momentumPredictor)
trAU().rename("rAU"); {
solve(UEqn == -fvc::grad(p));
solve
(
UEqn == -fvc::grad(p)
);
} }

View File

@ -43,5 +43,4 @@ 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);
} }

View File

@ -73,13 +73,7 @@
) )
); );
Info<< "Creating field DpDt\n" << endl; Info<< "Creating multi-variate interpolation scheme\n" << endl;
volScalarField DpDt
(
"DpDt",
fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p)
);
multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields; multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
forAll (Y, i) forAll (Y, i)

View File

@ -1,21 +1,3 @@
Info<< "Creating porous zones" << nl << endl; Info<< "Creating porous zones" << nl << endl;
porousZones pZones(mesh); 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;
}
}

View File

@ -1,20 +1,51 @@
{ {
fvScalarMatrix hEqn 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 (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));
}
{
solve
( (
fvm::ddt(rho, h) fvm::ddt(rho, h)
+ mvConvection->fvmDiv(phi, h) + mvConvection->fvmDiv(phi, h)
- fvm::laplacian(turbulence->alphaEff(), h) - fvm::laplacian(turbulence->alphaEff(), h)
== ==
DpDt pWork()
+ parcels.Sh() + parcels.Sh()
+ radiation->Sh(thermo) + radiation->Sh(thermo)
); );
hEqn.relax();
hEqn.solve();
thermo.correct(); thermo.correct();
radiation->correct(); radiation->correct();
Info<< "T gas min/max = " << min(T).value() << ", "
<< max(T).value() << endl;
}
} }

View File

@ -5,65 +5,13 @@
// pressure solution - done in 2 parts. Part 1: // pressure solution - done in 2 parts. Part 1:
thermo.rho() -= psi*p; thermo.rho() -= psi*p;
if (pressureImplicitPorosity) volScalarField rAU = 1.0/UEqn.A();
{ U = rAU*UEqn.H();
U = trTU()&UEqn.H();
}
else
{
U = trAU()*UEqn.H();
}
if (transonic) if (pZones.size() > 0)
{ {
surfaceScalarField phiv = fvc::interpolate(U) & mesh.Sf(); // ddtPhiCorr not well defined for cases with porosity
phi = fvc::interpolate(rho)*(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();
}
}
} }
else else
{ {
@ -71,38 +19,23 @@
fvc::interpolate(rho) fvc::interpolate(rho)
*( *(
(fvc::interpolate(U) & mesh.Sf()) (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++)
{ {
tmp<fvScalarMatrix> lapTerm;
if (pressureImplicitPorosity)
{
lapTerm = fvm::laplacian(rho*trTU(), p);
}
else
{
lapTerm = fvm::laplacian(rho*trAU(), p);
}
fvScalarMatrix pEqn fvScalarMatrix pEqn
( (
fvc::ddt(rho) + psi*correction(fvm::ddt(p)) fvc::ddt(rho) + psi*correction(fvm::ddt(p))
+ fvc::div(phi) + fvc::div(phi)
- lapTerm() - fvm::laplacian(rho*rAU, p)
== ==
parcels.Srho() parcels.Srho()
+ pointMassSources.Su() + pointMassSources.Su()
); );
if if (corr == nCorr-1 && nonOrth == nNonOrthCorr)
(
oCorr == nOuterCorr-1
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
{ {
pEqn.solve(mesh.solver("pFinal")); pEqn.solve(mesh.solver("pFinal"));
} }
@ -116,7 +49,6 @@
phi += pEqn.flux(); phi += pEqn.flux();
} }
} }
}
// Second part of thermodynamic density update // Second part of thermodynamic density update
thermo.rho() += psi*p; thermo.rho() += psi*p;
@ -124,15 +56,6 @@
#include "rhoEqn.H" #include "rhoEqn.H"
#include "compressibleContinuityErrs.H" #include "compressibleContinuityErrs.H"
if (pressureImplicitPorosity) U -= rAU*fvc::grad(p);
{
U -= trTU()&fvc::grad(p);
}
else
{
U -= trAU()*fvc::grad(p);
}
U.correctBoundaryConditions(); U.correctBoundaryConditions();
DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
} }

View File

@ -23,15 +23,16 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Application Application
trackedReactingParcelFoam porousExplicitSourceReactingParcelFoam
Description Description
- reacting parcel cloud tracking - reacting parcel cloud
- porous media - porous media
- point mass sources - point mass sources
- polynomial based, incompressible thermodynamics (f(T)) - 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 "readTimeControls.H"
#include "readPISOControls.H" #include "readPISOControls.H"
#include "readAdditionalSolutionControls.H"
#include "compressibleCourantNo.H" #include "compressibleCourantNo.H"
#include "setDeltaT.H" #include "setDeltaT.H"
@ -88,22 +90,15 @@ int main(int argc, char *argv[])
#include "chemistry.H" #include "chemistry.H"
#include "rhoEqn.H" #include "rhoEqn.H"
#include "UEqn.H" #include "UEqn.H"
// --- PIMPLE loop
for (int oCorr=1; oCorr<=nOuterCorr; oCorr++)
{
#include "YEqn.H" #include "YEqn.H"
#include "hEqn.H" #include "hEqn.H"
// --- PISO loop // --- PISO loop
for (int corr=1; corr<=nCorr; corr++) for (int corr=0; corr<nCorr; corr++)
{ {
#include "pEqn.H" #include "pEqn.H"
} }
Info<< "T gas min/max = " << min(T).value() << ", "
<< max(T).value() << endl;
}
turbulence->correct(); turbulence->correct();

View File

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