32 template<
class BaseThermo>
40 scalarField& TuCells = this->Tu_.primitiveFieldRef();
41 scalarField& CpCells = this->Cp_.primitiveFieldRef();
42 scalarField& CvCells = this->Cv_.primitiveFieldRef();
43 scalarField& psiCells = this->psi_.primitiveFieldRef();
44 scalarField& muCells = this->mu_.primitiveFieldRef();
45 scalarField& kappaCells = this->kappa_.primitiveFieldRef();
47 auto Yslicer = this->Yslicer();
51 auto composition = this->cellComposition(Yslicer, celli);
53 const typename BaseThermo::mixtureType::thermoMixtureType&
54 thermoMixture = this->thermoMixture(composition);
56 const typename BaseThermo::mixtureType::transportMixtureType&
58 this->transportMixture(composition, thermoMixture);
60 TCells[celli] = thermoMixture.The
67 CpCells[celli] = thermoMixture.Cp(pCells[celli], TCells[celli]);
68 CvCells[celli] = thermoMixture.Cv(pCells[celli], TCells[celli]);
69 psiCells[celli] = thermoMixture.psi(pCells[celli], TCells[celli]);
71 muCells[celli] = transportMixture.mu(pCells[celli], TCells[celli]);
73 transportMixture.kappa(pCells[celli], TCells[celli]);
75 TuCells[celli] = this->reactants(composition).The
83 volScalarField::Boundary& pBf = this->p_.boundaryFieldRef();
84 volScalarField::Boundary& TBf = this->T_.boundaryFieldRef();
85 volScalarField::Boundary& TuBf = this->Tu_.boundaryFieldRef();
86 volScalarField::Boundary& CpBf = this->Cp_.boundaryFieldRef();
87 volScalarField::Boundary& CvBf = this->Cv_.boundaryFieldRef();
88 volScalarField::Boundary& psiBf = this->psi_.boundaryFieldRef();
89 volScalarField::Boundary& heBf = this->he().boundaryFieldRef();
90 volScalarField::Boundary& heuBf = this->heu().boundaryFieldRef();
91 volScalarField::Boundary& muBf = this->mu_.boundaryFieldRef();
92 volScalarField::Boundary& kappaBf = this->kappa_.boundaryFieldRef();
107 if (TPf.fixesValue())
112 this->patchFaceComposition(Yslicer,
patchi, facei);
114 const typename BaseThermo::mixtureType::thermoMixtureType&
115 thermoMixture = this->thermoMixture(composition);
117 const typename BaseThermo::mixtureType::transportMixtureType&
119 this->transportMixture(composition, thermoMixture);
121 hePf[facei] = thermoMixture.he(pPf[facei], TPf[facei]);
123 CpPf[facei] = thermoMixture.Cp(pPf[facei], TPf[facei]);
124 CvPf[facei] = thermoMixture.Cv(pPf[facei], TPf[facei]);
125 psiPf[facei] = thermoMixture.psi(pPf[facei], TPf[facei]);
126 muPf[facei] = transportMixture.mu(pPf[facei], TPf[facei]);
127 kappaPf[facei] = transportMixture.kappa(pPf[facei], TPf[facei]);
135 this->patchFaceComposition(Yslicer,
patchi, facei);
137 const typename BaseThermo::mixtureType::thermoMixtureType&
138 thermoMixture = this->thermoMixture(composition);
140 const typename BaseThermo::mixtureType::transportMixtureType&
142 this->transportMixture(composition, thermoMixture);
145 thermoMixture.The(hePf[facei], pPf[facei], TPf[facei]);
147 CpPf[facei] = thermoMixture.Cp(pPf[facei], TPf[facei]);
148 CvPf[facei] = thermoMixture.Cv(pPf[facei], TPf[facei]);
149 psiPf[facei] = thermoMixture.psi(pPf[facei], TPf[facei]);
150 muPf[facei] = transportMixture.mu(pPf[facei], TPf[facei]);
151 kappaPf[facei] = transportMixture.kappa(pPf[facei], TPf[facei]);
154 this->reactants(composition)
155 .The(heuPf[facei], pPf[facei], TuPf[facei]);
164 template<
class BaseThermo>
168 const word& phaseName
171 BaseThermo(
mesh, phaseName),
188 BaseThermo::mixtureType::thermoType::heName() +
'u',
194 this->volScalarFieldProperty
196 BaseThermo::mixtureType::thermoType::heName() +
'u',
198 &BaseThermo::mixtureType::reactants,
199 &BaseThermo::mixtureType::thermoMixtureType::he,
203 this->heuBoundaryTypes()
206 this->heuBoundaryCorrection(this->heu_);
210 this->psi_.oldTime();
216 template<
class BaseThermo>
223 template<
class BaseThermo>
226 if (BaseThermo::debug)
232 this->psi_.oldTime();
236 if (BaseThermo::debug)
243 template<
class BaseThermo>
247 scalar (BaseThermo::mixtureType::*mixtureMethod)
249 const scalarFieldListSlice&
250 )
const = &BaseThermo::mixtureType::fres;
252 return this->volScalarFieldMixtureProperty
261 template<
class BaseThermo>
265 return this->volScalarFieldMixtureProperty
269 &BaseThermo::mixtureType::Phi
274 template<
class BaseThermo>
277 BaseThermo::mixtureType::reset(this->
Y());
281 template<
class BaseThermo>
289 return this->cellSetProperty
291 &BaseThermo::mixtureType::reactants,
292 &BaseThermo::mixtureType::thermoMixtureType::he,
300 template<
class BaseThermo>
308 return this->patchFieldProperty
310 &BaseThermo::mixtureType::reactants,
311 &BaseThermo::mixtureType::thermoMixtureType::he,
313 this->p_.boundaryField()[
patchi],
319 template<
class BaseThermo>
323 return this->volScalarFieldProperty
327 &BaseThermo::mixtureType::products,
328 &BaseThermo::mixtureType::thermoMixtureType::The,
336 template<
class BaseThermo>
341 this->volScalarFieldProperty
345 &BaseThermo::mixtureType::reactants,
346 &BaseThermo::mixtureType::thermoMixtureType::hf
348 - this->volScalarFieldProperty
352 &BaseThermo::mixtureType::products,
353 &BaseThermo::mixtureType::thermoMixtureType::hf
358 template<
class BaseThermo>
362 return this->volScalarFieldProperty
365 this->psi_.dimensions(),
366 &BaseThermo::mixtureType::reactants,
374 template<
class BaseThermo>
380 return this->volScalarFieldProperty
383 this->psi_.dimensions(),
384 &BaseThermo::mixtureType::products,
392 template<
class BaseThermo>
396 return this->volScalarFieldProperty
400 &BaseThermo::mixtureType::reactants,
408 template<
class BaseThermo>
414 return this->volScalarFieldProperty
418 &BaseThermo::mixtureType::products,
#define forAll(list, i)
Loop across all elements in list.
Generic GeometricField class.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Thermo implementation based on compressibility with additional unburnt thermodynamic state.
virtual tmp< volScalarField > mub() const
Dynamic viscosity of burnt gas [kg/m/s].
PsiuMulticomponentThermo(const fvMesh &, const word &phaseName)
Construct from mesh and phase name.
virtual void correct()
Update properties.
virtual tmp< volScalarField > muu() const
Dynamic viscosity of unburnt gas [kg/m/s].
virtual tmp< volScalarField > Phi() const
Return the fuel-oxidant equivalence ratio.
virtual tmp< volScalarField > hr() const
Standard enthalpy of reaction [J/kg].
virtual const volScalarField & heu() const
Unburnt gas enthalpy [J/kg].
virtual tmp< volScalarField > Tb() const
Burnt gas temperature [K].
virtual tmp< volScalarField > psib() const
Burnt gas compressibility [s^2/m^2].
virtual tmp< volScalarField > psiu() const
Unburnt gas compressibility [s^2/m^2].
virtual void reset()
Reset the mixture to an unburnt state and update EGR.
virtual ~PsiuMulticomponentThermo()
Destructor.
virtual tmp< volScalarField > fres() const
Return the residual fraction of fuel in the burnt mixture.
Mesh data needed to do the Finite Volume discretisation.
A class for managing temporary objects.
A class for handling words, derived from string.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
volScalarField scalarField(fieldObject, mesh)
const volScalarField & psi
#define InfoInFunction
Report an information message using Foam::Info.
const dimensionedScalar mu
Atomic mass unit.
label calculate(const fvMesh &mesh, const labelHashSet &patchIDs, const scalar minFaceFraction, GeometricField< scalar, GeoMesh > &distance)
Calculate distance data from patches.
const dimensionSet & dimless
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const dimensionSet & dimDynamicViscosity
const dimensionSet & dimMass
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
const dimensionSet & dimEnergy
const dimensionSet & dimTemperature
fvPatchField< scalar > fvPatchScalarField
PtrList< volScalarField > & Y