31 template<
class BaseThermo>
39 scalarField& TuCells = this->Tu_.primitiveFieldRef();
40 scalarField& CpCells = this->Cp_.primitiveFieldRef();
41 scalarField& CvCells = this->Cv_.primitiveFieldRef();
42 scalarField& psiCells = this->psi_.primitiveFieldRef();
43 scalarField& muCells = this->mu_.primitiveFieldRef();
44 scalarField& kappaCells = this->kappa_.primitiveFieldRef();
46 auto Yslicer = this->Yslicer();
50 auto composition = this->cellComposition(Yslicer, celli);
52 const typename BaseThermo::mixtureType::thermoMixtureType&
53 thermoMixture = this->thermoMixture(composition);
55 const typename BaseThermo::mixtureType::transportMixtureType&
57 this->transportMixture(composition, thermoMixture);
59 TCells[celli] = thermoMixture.The
66 CpCells[celli] = thermoMixture.Cp(pCells[celli], TCells[celli]);
67 CvCells[celli] = thermoMixture.Cv(pCells[celli], TCells[celli]);
68 psiCells[celli] = thermoMixture.psi(pCells[celli], TCells[celli]);
70 muCells[celli] = transportMixture.mu(pCells[celli], TCells[celli]);
72 transportMixture.kappa(pCells[celli], TCells[celli]);
74 TuCells[celli] = this->reactants(composition).The
82 volScalarField::Boundary& pBf = this->p_.boundaryFieldRef();
83 volScalarField::Boundary& TBf = this->T_.boundaryFieldRef();
84 volScalarField::Boundary& TuBf = this->Tu_.boundaryFieldRef();
85 volScalarField::Boundary& CpBf = this->Cp_.boundaryFieldRef();
86 volScalarField::Boundary& CvBf = this->Cv_.boundaryFieldRef();
87 volScalarField::Boundary& psiBf = this->psi_.boundaryFieldRef();
88 volScalarField::Boundary& heBf = this->
he().boundaryFieldRef();
89 volScalarField::Boundary& heuBf = this->heu().boundaryFieldRef();
90 volScalarField::Boundary& muBf = this->mu_.boundaryFieldRef();
91 volScalarField::Boundary& kappaBf = this->kappa_.boundaryFieldRef();
106 if (TPf.fixesValue())
111 this->patchFaceComposition(Yslicer,
patchi, facei);
113 const typename BaseThermo::mixtureType::thermoMixtureType&
114 thermoMixture = this->thermoMixture(composition);
116 const typename BaseThermo::mixtureType::transportMixtureType&
118 this->transportMixture(composition, thermoMixture);
120 hePf[facei] = thermoMixture.he(pPf[facei], TPf[facei]);
122 CpPf[facei] = thermoMixture.Cp(pPf[facei], TPf[facei]);
123 CvPf[facei] = thermoMixture.Cv(pPf[facei], TPf[facei]);
124 psiPf[facei] = thermoMixture.psi(pPf[facei], TPf[facei]);
125 muPf[facei] = transportMixture.mu(pPf[facei], TPf[facei]);
126 kappaPf[facei] = transportMixture.kappa(pPf[facei], TPf[facei]);
134 this->patchFaceComposition(Yslicer,
patchi, facei);
136 const typename BaseThermo::mixtureType::thermoMixtureType&
137 thermoMixture = this->thermoMixture(composition);
139 const typename BaseThermo::mixtureType::transportMixtureType&
141 this->transportMixture(composition, thermoMixture);
144 thermoMixture.The(hePf[facei], pPf[facei], TPf[facei]);
146 CpPf[facei] = thermoMixture.Cp(pPf[facei], TPf[facei]);
147 CvPf[facei] = thermoMixture.Cv(pPf[facei], TPf[facei]);
148 psiPf[facei] = thermoMixture.psi(pPf[facei], TPf[facei]);
149 muPf[facei] = transportMixture.mu(pPf[facei], TPf[facei]);
150 kappaPf[facei] = transportMixture.kappa(pPf[facei], TPf[facei]);
153 this->reactants(composition)
154 .The(heuPf[facei], pPf[facei], TuPf[facei]);
163 template<
class BaseThermo>
167 const word& phaseName
170 BaseThermo(
mesh, phaseName),
187 BaseThermo::mixtureType::thermoType::heName() +
'u',
193 this->volScalarFieldProperty
195 BaseThermo::mixtureType::thermoType::heName() +
'u',
197 &BaseThermo::mixtureType::reactants,
198 &BaseThermo::mixtureType::thermoMixtureType::
he,
202 this->heuBoundaryTypes()
205 this->heuBoundaryCorrection(this->heu_);
209 this->psi_.oldTime();
215 template<
class BaseThermo>
222 template<
class BaseThermo>
225 if (BaseThermo::debug)
231 this->psi_.oldTime();
235 if (BaseThermo::debug)
242 template<
class BaseThermo>
256 auto Yslicer = this->Yslicer();
262 fresCells[celli] = BaseThermo::mixtureType::fres
264 this->cellComposition(Yslicer, celli)
276 fresPf[facei] = BaseThermo::mixtureType::fres
278 this->patchFaceComposition(Yslicer,
patchi, facei)
287 template<
class BaseThermo>
290 BaseThermo::mixtureType::reset(this->
Y());
294 template<
class BaseThermo>
302 return this->cellSetProperty
304 &BaseThermo::mixtureType::reactants,
313 template<
class BaseThermo>
321 return this->patchFieldProperty
323 &BaseThermo::mixtureType::reactants,
326 this->p_.boundaryField()[
patchi],
332 template<
class BaseThermo>
336 return this->volScalarFieldProperty
340 &BaseThermo::mixtureType::products,
341 &BaseThermo::mixtureType::thermoMixtureType::The,
349 template<
class BaseThermo>
354 this->volScalarFieldProperty
358 &BaseThermo::mixtureType::reactants,
359 &BaseThermo::mixtureType::thermoMixtureType::hf
361 - this->volScalarFieldProperty
365 &BaseThermo::mixtureType::products,
366 &BaseThermo::mixtureType::thermoMixtureType::hf
371 template<
class BaseThermo>
375 return this->volScalarFieldProperty
378 this->psi_.dimensions(),
379 &BaseThermo::mixtureType::reactants,
387 template<
class BaseThermo>
393 return this->volScalarFieldProperty
396 this->psi_.dimensions(),
397 &BaseThermo::mixtureType::products,
405 template<
class BaseThermo>
409 return this->volScalarFieldProperty
413 &BaseThermo::mixtureType::reactants,
421 template<
class BaseThermo>
427 return this->volScalarFieldProperty
431 &BaseThermo::mixtureType::products,
#define forAll(list, i)
Loop across all elements in list.
Generic GeometricBoundaryField class.
Generic GeometricField class.
static tmp< GeometricField< Type, GeoMesh, PrimitiveField > > New(const word &name, const Internal &, const PtrList< Patch > &, const HashPtrTable< Source > &=HashPtrTable< Source >())
Return a temporary field constructed from name,.
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 > 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.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
A class for managing temporary objects.
T & ref() const
Return non-const reference or generate a fatal error.
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 dimDynamicViscosity
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 dimEnergy
Ostream & endl(Ostream &os)
Add newline and flush stream.
const dimensionSet dimless
const dimensionSet dimTemperature
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
const dimensionSet dimMass
fvPatchField< scalar > fvPatchScalarField
PtrList< volScalarField > & Y