mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of /home/noisy3/OpenFOAM/OpenFOAM-dev
This commit is contained in:
@ -0,0 +1,3 @@
|
||||
rhoReactingFoam.C
|
||||
|
||||
EXE = $(FOAM_APPBIN)/rhoReactingFoam
|
||||
19
applications/solvers/combustion/rhoReactingFoam/Make/options
Normal file
19
applications/solvers/combustion/rhoReactingFoam/Make/options
Normal file
@ -0,0 +1,19 @@
|
||||
EXE_INC = \
|
||||
-I../XiFoam \
|
||||
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
|
||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
|
||||
-I$(LIB_SRC)/ODE/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lcompressibleRASModels \
|
||||
-lcompressibleLESModels \
|
||||
-lreactionThermophysicalModels \
|
||||
-lspecie \
|
||||
-lbasicThermophysicalModels \
|
||||
-lchemistryModel \
|
||||
-lODE \
|
||||
-lfiniteVolume
|
||||
43
applications/solvers/combustion/rhoReactingFoam/YEqn.H
Normal file
43
applications/solvers/combustion/rhoReactingFoam/YEqn.H
Normal file
@ -0,0 +1,43 @@
|
||||
tmp<fv::convectionScheme<scalar> > mvConvection
|
||||
(
|
||||
fv::convectionScheme<scalar>::New
|
||||
(
|
||||
mesh,
|
||||
fields,
|
||||
phi,
|
||||
mesh.divScheme("div(phi,Yi_h)")
|
||||
)
|
||||
);
|
||||
|
||||
{
|
||||
label inertIndex = -1;
|
||||
volScalarField Yt = 0.0*Y[0];
|
||||
|
||||
for (label i=0; i<Y.size(); i++)
|
||||
{
|
||||
if (Y[i].name() != inertSpecie)
|
||||
{
|
||||
volScalarField& Yi = Y[i];
|
||||
|
||||
solve
|
||||
(
|
||||
fvm::ddt(rho, Yi)
|
||||
+ mvConvection->fvmDiv(phi, Yi)
|
||||
- fvm::laplacian(turbulence->muEff(), Yi)
|
||||
==
|
||||
kappa*chemistry.RR(i),
|
||||
mesh.solver("Yi")
|
||||
);
|
||||
|
||||
Yi.max(0.0);
|
||||
Yt += Yi;
|
||||
}
|
||||
else
|
||||
{
|
||||
inertIndex = i;
|
||||
}
|
||||
}
|
||||
|
||||
Y[inertIndex] = scalar(1) - Yt;
|
||||
Y[inertIndex].max(0.0);
|
||||
}
|
||||
24
applications/solvers/combustion/rhoReactingFoam/chemistry.H
Normal file
24
applications/solvers/combustion/rhoReactingFoam/chemistry.H
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
Info << "Solving chemistry" << endl;
|
||||
|
||||
chemistry.solve
|
||||
(
|
||||
runTime.value() - runTime.deltaT().value(),
|
||||
runTime.deltaT().value()
|
||||
);
|
||||
|
||||
// turbulent time scale
|
||||
if (turbulentReaction)
|
||||
{
|
||||
volScalarField tk =
|
||||
Cmix*sqrt(turbulence->muEff()/rho/turbulence->epsilon());
|
||||
volScalarField tc = chemistry.tc();
|
||||
|
||||
// Chalmers PaSR model
|
||||
kappa = (runTime.deltaT() + tc)/(runTime.deltaT() + tc + tk);
|
||||
}
|
||||
else
|
||||
{
|
||||
kappa = 1.0;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,85 @@
|
||||
Info<< nl << "Reading thermophysicalProperties" << endl;
|
||||
autoPtr<rhoChemistryModel> pChemistry
|
||||
(
|
||||
rhoChemistryModel::New(mesh)
|
||||
);
|
||||
rhoChemistryModel& chemistry = pChemistry();
|
||||
|
||||
hReactionThermo& thermo = chemistry.thermo();
|
||||
|
||||
basicMultiComponentMixture& composition = thermo.composition();
|
||||
PtrList<volScalarField>& Y = composition.Y();
|
||||
|
||||
word inertSpecie(thermo.lookup("inertSpecie"));
|
||||
|
||||
volScalarField rho
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"rho",
|
||||
runTime.timeName(),
|
||||
mesh
|
||||
),
|
||||
thermo.rho()
|
||||
);
|
||||
|
||||
Info<< "Reading field U\n" << endl;
|
||||
volVectorField U
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"U",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
|
||||
volScalarField& p = thermo.p();
|
||||
const volScalarField& psi = thermo.psi();
|
||||
volScalarField& h = thermo.h();
|
||||
|
||||
|
||||
#include "compressibleCreatePhi.H"
|
||||
|
||||
volScalarField kappa
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"kappa",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("zero", dimless, 0.0)
|
||||
);
|
||||
|
||||
Info << "Creating turbulence model.\n" << nl;
|
||||
autoPtr<compressible::turbulenceModel> turbulence
|
||||
(
|
||||
compressible::turbulenceModel::New
|
||||
(
|
||||
rho,
|
||||
U,
|
||||
phi,
|
||||
thermo
|
||||
)
|
||||
);
|
||||
|
||||
Info<< "Creating field DpDt\n" << endl;
|
||||
volScalarField DpDt =
|
||||
fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
|
||||
|
||||
multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
|
||||
|
||||
forAll (Y, i)
|
||||
{
|
||||
fields.add(Y[i]);
|
||||
}
|
||||
fields.add(h);
|
||||
|
||||
93
applications/solvers/combustion/rhoReactingFoam/pEqn.H
Normal file
93
applications/solvers/combustion/rhoReactingFoam/pEqn.H
Normal file
@ -0,0 +1,93 @@
|
||||
{
|
||||
rho = thermo.rho();
|
||||
|
||||
// Thermodynamic density needs to be updated by psi*d(p) after the
|
||||
// pressure solution - done in 2 parts. Part 1:
|
||||
thermo.rho() -= psi*p;
|
||||
|
||||
volScalarField rUA = 1.0/UEqn.A();
|
||||
U = rUA*UEqn.H();
|
||||
|
||||
if (transonic)
|
||||
{
|
||||
surfaceScalarField phiv =
|
||||
(fvc::interpolate(U) & mesh.Sf())
|
||||
+ fvc::ddtPhiCorr(rUA, rho, U, phi);
|
||||
|
||||
phi = fvc::interpolate(rho)*phiv;
|
||||
|
||||
surfaceScalarField phid
|
||||
(
|
||||
"phid",
|
||||
fvc::interpolate(thermo.psi())*phiv
|
||||
);
|
||||
|
||||
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
||||
{
|
||||
fvScalarMatrix pEqn
|
||||
(
|
||||
fvc::ddt(rho) + fvc::div(phi)
|
||||
+ correction(fvm::ddt(psi, p) + fvm::div(phid, p))
|
||||
- fvm::laplacian(rho*rUA, p)
|
||||
);
|
||||
|
||||
if (ocorr == nOuterCorr && corr == nCorr && nonOrth == nNonOrthCorr)
|
||||
{
|
||||
pEqn.solve(mesh.solver(p.name() + "Final"));
|
||||
}
|
||||
else
|
||||
{
|
||||
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
|
||||
(
|
||||
fvc::ddt(rho) + psi*correction(fvm::ddt(p))
|
||||
+ fvc::div(phi)
|
||||
- fvm::laplacian(rho*rUA, p)
|
||||
);
|
||||
|
||||
if (ocorr == nOuterCorr && corr == nCorr && nonOrth == nNonOrthCorr)
|
||||
{
|
||||
pEqn.solve(mesh.solver(p.name() + "Final"));
|
||||
}
|
||||
else
|
||||
{
|
||||
pEqn.solve();
|
||||
}
|
||||
|
||||
if (nonOrth == nNonOrthCorr)
|
||||
{
|
||||
phi += pEqn.flux();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Second part of thermodynamic density update
|
||||
thermo.rho() += psi*p;
|
||||
|
||||
#include "rhoEqn.H"
|
||||
#include "compressibleContinuityErrs.H"
|
||||
|
||||
U -= rUA*fvc::grad(p);
|
||||
U.correctBoundaryConditions();
|
||||
|
||||
DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
|
||||
}
|
||||
@ -0,0 +1,23 @@
|
||||
Info<< "Reading chemistry properties\n" << endl;
|
||||
|
||||
IOdictionary chemistryProperties
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"chemistryProperties",
|
||||
runTime.constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
)
|
||||
);
|
||||
|
||||
Switch turbulentReaction(chemistryProperties.lookup("turbulentReaction"));
|
||||
|
||||
dimensionedScalar Cmix("Cmix", dimless, 1.0);
|
||||
|
||||
if (turbulentReaction)
|
||||
{
|
||||
chemistryProperties.lookup("Cmix") >> Cmix;
|
||||
}
|
||||
@ -0,0 +1,102 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2009-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
|
||||
|
||||
Application
|
||||
rhoReactingFoam
|
||||
|
||||
Description
|
||||
Chemical reaction code using density based thermodynamics package.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
#include "hReactionThermo.H"
|
||||
#include "turbulenceModel.H"
|
||||
#include "rhoChemistryModel.H"
|
||||
#include "chemistrySolver.H"
|
||||
#include "multivariateScheme.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
#include "setRootCase.H"
|
||||
#include "createTime.H"
|
||||
#include "createMesh.H"
|
||||
#include "readChemistryProperties.H"
|
||||
#include "readEnvironmentalProperties.H"
|
||||
#include "createFields.H"
|
||||
#include "initContinuityErrs.H"
|
||||
#include "readTimeControls.H"
|
||||
#include "compressibleCourantNo.H"
|
||||
#include "setInitialDeltaT.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Info << "\nStarting time loop\n" << endl;
|
||||
|
||||
while (runTime.run())
|
||||
{
|
||||
#include "readTimeControls.H"
|
||||
#include "readPISOControls.H"
|
||||
#include "compressibleCourantNo.H"
|
||||
#include "setDeltaT.H"
|
||||
|
||||
runTime++;
|
||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
#include "chemistry.H"
|
||||
#include "rhoEqn.H"
|
||||
#include "UEqn.H"
|
||||
|
||||
for (label ocorr=1; ocorr <= nOuterCorr; ocorr++)
|
||||
{
|
||||
#include "YEqn.H"
|
||||
#include "hEqn.H"
|
||||
|
||||
// --- PISO loop
|
||||
for (int corr=1; corr<=nCorr; corr++)
|
||||
{
|
||||
#include "pEqn.H"
|
||||
}
|
||||
}
|
||||
|
||||
turbulence->correct();
|
||||
|
||||
rho = thermo.rho();
|
||||
|
||||
runTime.write();
|
||||
|
||||
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
||||
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
||||
<< nl << endl;
|
||||
}
|
||||
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -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