Go to the documentation of this file.
32 template<
class ChemistryModel>
40 coeffsDict_(this->subDict(
"EulerImplicitCoeffs")),
41 cTauChem_(
readScalar(coeffsDict_.lookup(
"cTauChem"))),
42 eqRateLimiter_(coeffsDict_.lookup(
"equilibriumRateLimiter")),
49 template<
class ChemistryModel>
56 template<
class ChemistryModel>
71 this->reactions_[index];
76 scalar sl =
R.lhs()[
s].stoichCoeff;
77 RR[si][rRef] -= sl*pr*corr;
78 RR[si][lRef] += sl*pf*corr;
84 scalar sr =
R.rhs()[
s].stoichCoeff;
85 RR[si][lRef] -= sr*pf*corr;
86 RR[si][rRef] += sr*pr*corr;
91 template<
class ChemistryModel>
106 c[i] =
max(0.0,
c[i]);
110 scalar cTot =
sum(
c);
111 typename ChemistryModel::thermoType
mixture
113 (
c[0]/cTot)*this->specieThermo_[0]
117 mixture += (
c[i]/cTot)*this->specieThermo_[i];
121 scalar deltaTEst =
min(deltaT, subDeltaT);
123 forAll(this->reactions(), i)
125 scalar pf, cf, pr, cr;
128 scalar omegai = this->omegaI(i,
c,
T,
p, pf, cf, lRef, pr, cr, rRef);
135 corr = 1.0/(1.0 + pr*deltaTEst);
139 corr = 1.0/(1.0 + pf*deltaTEst);
143 updateRRInReactionI(i, pr, pf, corr, lRef, rRef,
p,
T,
RR);
159 tMin =
min(tMin, -(
c[i] + SMALL)/d);
164 scalar cm =
max(cTot -
c[i], 1.0
e-5);
165 tMin =
min(tMin, cm/d);
169 subDeltaT = cTauChem_*tMin;
170 deltaT =
min(deltaT, subDeltaT);
175 RR[i][i] += 1.0/deltaT;
176 RR.source()[i] =
c[i]/deltaT;
185 c[i] =
max(0.0,
c[i]);
190 mixture = (
c[0]/cTot)*this->specieThermo_[0];
193 mixture += (
c[i]/cTot)*this->specieThermo_[i];
const scalar RR
Universal gas constant (default in [J/(kmol K)])
A simple square matrix solver with scalar coefficients.
A class for handling words, derived from string.
#define forAll(list, i)
Loop across all elements in list.
An abstract base class for solving chemistry.
Info<< "Reading field p_rgh\n"<< endl;volScalarField p_rgh(IOobject("p_rgh", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);Info<< "Reading field U\n"<< endl;volVectorField U(IOobject("U", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);Info<< "Creating phaseChangeTwoPhaseMixture\n"<< endl;autoPtr< phaseChangeTwoPhaseMixture > mixture
virtual void solve(scalarField &c, scalar &T, scalar &p, scalar &deltaT, scalar &subDeltaT) const
Update the concentrations and return the chemical time.
#define R(A, B, C, D, E, F, K, M)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Pre-declare SubField and related Field type.
EulerImplicit(const fvMesh &mesh, const word &phaseName)
Construct from mesh and phase name.
Macros for easy insertion into run-time selection tables.
Mesh data needed to do the Finite Volume discretisation.
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
virtual ~EulerImplicit()
Destructor.
const dimensionedScalar e
Elementary charge.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
const dimensionedScalar c
Speed of light in a vacuum.
Simple extension of ReactionThermo to handle reaction kinetics in addition to the equilibrium thermod...
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
void updateRRInReactionI(const label index, const scalar pr, const scalar pf, const scalar corr, const label lRef, const label rRef, const scalar p, const scalar T, simpleMatrix< scalar > &RR) const