thermodynamics: Added pressure as an addition argument to all primitive thermodynamic functions

Added additional layer of templating to reactingMixture to support specie functions in a generic manner.
This commit is contained in:
Henry
2012-06-05 19:51:57 +01:00
parent 0cdb34dbdf
commit 2d2787bd8c
69 changed files with 1154 additions and 1555 deletions

View File

@ -87,7 +87,7 @@
forAll(Y, i)
{
Y[i] = Y0[i];
hs0 += Y0[i]*specieData[i].Hs(T0);
hs0 += Y0[i]*specieData[i].Hs(p[i], T0);
}
hs = dimensionedScalar("h", dimEnergy/dimMass, hs0);

View File

@ -211,7 +211,7 @@ int main(int argc, char *argv[])
co = co2*
min
(
CO2BreakUp.Kn(equilibriumFlameTemperature, P, N)
CO2BreakUp.Kn(P, equilibriumFlameTemperature, N)
/::sqrt(max(ores, 0.001)),
1.0
);
@ -219,7 +219,7 @@ int main(int argc, char *argv[])
h2 = h2o*
min
(
H2OBreakUp.Kn(equilibriumFlameTemperature, P, N)
H2OBreakUp.Kn(P, equilibriumFlameTemperature, N)
/::sqrt(max(ores, 0.001)),
1.0
);

View File

@ -424,7 +424,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc
{
scalar dm = np0*dMassGas[i];
label gid = composition.localToGlobalCarrierId(GAS, i);
scalar hs = composition.carrier().Hs(gid, T0);
scalar hs = composition.carrier().Hs(gid, pc, T0);
td.cloud().rhoTrans(gid)[cellI] += dm;
td.cloud().UTrans()[cellI] += dm*U0;
td.cloud().hsTrans()[cellI] += dm*hs;
@ -433,7 +433,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc
{
scalar dm = np0*dMassLiquid[i];
label gid = composition.localToGlobalCarrierId(LIQ, i);
scalar hs = composition.carrier().Hs(gid, T0);
scalar hs = composition.carrier().Hs(gid, pc, T0);
td.cloud().rhoTrans(gid)[cellI] += dm;
td.cloud().UTrans()[cellI] += dm*U0;
td.cloud().hsTrans()[cellI] += dm*hs;
@ -444,7 +444,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc
{
scalar dm = np0*dMassSolid[i];
label gid = composition.localToGlobalCarrierId(SLD, i);
scalar hs = composition.carrier().Hs(gid, T0);
scalar hs = composition.carrier().Hs(gid, pc, T0);
td.cloud().rhoTrans(gid)[cellI] += dm;
td.cloud().UTrans()[cellI] += dm*U0;
td.cloud().hsTrans()[cellI] += dm*hs;
@ -453,7 +453,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc
forAll(dMassSRCarrier, i)
{
scalar dm = np0*dMassSRCarrier[i];
scalar hs = composition.carrier().Hs(i, T0);
scalar hs = composition.carrier().Hs(i, pc, T0);
td.cloud().rhoTrans(i)[cellI] += dm;
td.cloud().UTrans()[cellI] += dm*U0;
td.cloud().hsTrans()[cellI] += dm*hs;
@ -541,7 +541,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calcDevolatilisation
forAll(dMassDV, i)
{
const label id = composition.localToGlobalCarrierId(GAS, i);
const scalar Cp = composition.carrier().Cp(id, Ts);
const scalar Cp = composition.carrier().Cp(id, this->pc_, Ts);
const scalar W = composition.carrier().W(id);
const scalar Ni = dMassDV[i]/(this->areaS(d)*dt*W);

View File

@ -104,7 +104,12 @@ void Foam::ReactingParcel<ParcelType>::cellValueSourceCorrection
forAll(td.cloud().rhoTrans(), i)
{
scalar Y = td.cloud().rhoTrans(i)[cellI]/addedMass;
CpEff += Y*td.cloud().composition().carrier().Cp(i, this->Tc_);
CpEff += Y*td.cloud().composition().carrier().Cp
(
i,
this->pc_,
this->Tc_
);
}
const scalar Cpc = td.CpInterp().psi()[cellI];
@ -206,9 +211,9 @@ void Foam::ReactingParcel<ParcelType>::correctSurfaceValues
const scalar cbrtW = cbrt(W);
rhos += Xs[i]*W;
mus += Ys[i]*sqrtW*thermo.carrier().mu(i, T);
kappas += Ys[i]*cbrtW*thermo.carrier().kappa(i, T);
Cps += Xs[i]*thermo.carrier().Cp(i, T);
mus += Ys[i]*sqrtW*thermo.carrier().mu(i, pc_, T);
kappas += Ys[i]*cbrtW*thermo.carrier().kappa(i, pc_, T);
Cps += Xs[i]*thermo.carrier().Cp(i, pc_, T);
sumYiSqrtW += Ys[i]*sqrtW;
sumYiCbrtW += Ys[i]*cbrtW;
@ -378,7 +383,7 @@ void Foam::ReactingParcel<ParcelType>::calc
{
scalar dmi = dm*Y_[i];
label gid = composition.localToGlobalCarrierId(0, i);
scalar hs = composition.carrier().Hs(gid, T0);
scalar hs = composition.carrier().Hs(gid, pc_, T0);
td.cloud().rhoTrans(gid)[cellI] += dmi;
td.cloud().hsTrans()[cellI] += dmi*hs;
@ -439,7 +444,7 @@ void Foam::ReactingParcel<ParcelType>::calc
{
scalar dm = np0*dMass[i];
label gid = composition.localToGlobalCarrierId(0, i);
scalar hs = composition.carrier().Hs(gid, T0);
scalar hs = composition.carrier().Hs(gid, pc_, T0);
td.cloud().rhoTrans(gid)[cellI] += dm;
td.cloud().UTrans()[cellI] += dm*U0;
@ -543,7 +548,7 @@ void Foam::ReactingParcel<ParcelType>::calcPhaseChange
const label idc = composition.localToGlobalCarrierId(idPhase, i);
const label idl = composition.globalIds(idPhase)[i];
const scalar Cp = composition.carrier().Cp(idc, Ts);
const scalar Cp = composition.carrier().Cp(idc, pc_, Ts);
const scalar W = composition.carrier().W(idc);
const scalar Ni = dMassPC[i]/(this->areaS(d)*dt*W);

View File

@ -396,7 +396,7 @@ Foam::scalar Foam::CompositionModel<CloudType>::H
forAll(Y, i)
{
label gid = props.globalIds()[i];
HMixture += Y[i]*thermo_.carrier().Hs(gid, T);
HMixture += Y[i]*thermo_.carrier().Hs(gid, p, T);
}
break;
}
@ -460,7 +460,7 @@ Foam::scalar Foam::CompositionModel<CloudType>::Hs
forAll(Y, i)
{
label gid = props.globalIds()[i];
HsMixture += Y[i]*thermo_.carrier().Hs(gid, T);
HsMixture += Y[i]*thermo_.carrier().Hs(gid, p, T);
}
break;
}
@ -584,7 +584,7 @@ Foam::scalar Foam::CompositionModel<CloudType>::Cp
forAll(Y, i)
{
label gid = props.globalIds()[i];
CpMixture += Y[i]*thermo_.carrier().Cp(gid, T);
CpMixture += Y[i]*thermo_.carrier().Cp(gid, p, T);
}
break;
}

View File

@ -216,7 +216,7 @@ Foam::scalar Foam::LiquidEvaporation<CloudType>::dh
}
case (parent::etEnthalpyDifference):
{
scalar hc = this->owner().composition().carrier().Hs(idc, T);
scalar hc = this->owner().composition().carrier().Hs(idc, p, T);
scalar hp = liquids_.properties()[idl].h(p, T);
dh = hc - hp;

View File

@ -171,10 +171,10 @@ void Foam::LiquidEvaporationBoil<CloudType>::calculate
forAll(this->owner().thermo().carrier().Y(), i)
{
scalar Yc = this->owner().thermo().carrier().Y()[i][cellI];
Hc += Yc*this->owner().thermo().carrier().Hs(i, Tc);
Hsc += Yc*this->owner().thermo().carrier().Hs(i, Ts);
Cpc += Yc*this->owner().thermo().carrier().Cp(i, Ts);
kappac += Yc*this->owner().thermo().carrier().kappa(i, Ts);
Hc += Yc*this->owner().thermo().carrier().Hs(i, pc, Tc);
Hsc += Yc*this->owner().thermo().carrier().Hs(i, ps, Ts);
Cpc += Yc*this->owner().thermo().carrier().Cp(i, ps, Ts);
kappac += Yc*this->owner().thermo().carrier().kappa(i, ps, Ts);
}
// calculate mass transfer of each specie in liquid
@ -315,7 +315,7 @@ Foam::scalar Foam::LiquidEvaporationBoil<CloudType>::dh
}
case (parent::etEnthalpyDifference):
{
scalar hc = this->owner().composition().carrier().Hs(idc, TDash);
scalar hc = this->owner().composition().carrier().Hs(idc, p, TDash);
scalar hp = liquids_.properties()[idl].h(p, TDash);
dh = hc - hp;

View File

@ -146,7 +146,8 @@ void reactingOneDim::updatePhiGas()
forAll(gasTable, gasI)
{
tmp<volScalarField> tHsiGas = solidChemistry_->gasHs(T_, gasI);
tmp<volScalarField> tHsiGas =
solidChemistry_->gasHs(p, T_, gasI);
tmp<volScalarField> tRRiGas = solidChemistry_->RRg(gasI);
const volScalarField& HsiGas = tHsiGas();

View File

@ -153,6 +153,7 @@ public:
//- Enthalpy/Internal energy for cell-set [J/kg]
virtual tmp<scalarField> he
(
const scalarField& p,
const scalarField& T,
const labelList& cells
) const = 0;
@ -160,6 +161,7 @@ public:
//- Enthalpy/Internal energy for patch [J/kg]
virtual tmp<scalarField> he
(
const scalarField& p,
const scalarField& T,
const label patchi
) const = 0;
@ -171,6 +173,7 @@ public:
virtual tmp<scalarField> THE
(
const scalarField& h,
const scalarField& p,
const scalarField& T0, // starting temperature
const labelList& cells
) const = 0;
@ -179,6 +182,7 @@ public:
virtual tmp<scalarField> THE
(
const scalarField& h,
const scalarField& p,
const scalarField& T0, // starting temperature
const label patchi
) const = 0;
@ -195,6 +199,7 @@ public:
//- Heat capacity at constant pressure for patch [J/kg/K]
virtual tmp<scalarField> Cp
(
const scalarField& p,
const scalarField& T,
const label patchi
) const = 0;
@ -205,6 +210,7 @@ public:
//- Heat capacity at constant volume for patch [J/kg/K]
virtual tmp<scalarField> Cv
(
const scalarField& p,
const scalarField& T,
const label patchi
) const = 0;
@ -215,6 +221,7 @@ public:
//- gamma = Cp/Cv for patch []
virtual tmp<scalarField> gamma
(
const scalarField& p,
const scalarField& T,
const label patchi
) const = 0;
@ -225,6 +232,7 @@ public:
//- Heat capacity at constant pressure/volume for patch [J/kg/K]
virtual tmp<scalarField> Cpv
(
const scalarField& p,
const scalarField& T,
const label patchi
) const = 0;
@ -235,6 +243,7 @@ public:
//- Heat capacity ratio for patch []
virtual tmp<scalarField> CpByCpv
(
const scalarField& p,
const scalarField& T,
const label patchi
) const = 0;

View File

@ -110,6 +110,7 @@ void Foam::energyJumpFvPatchScalarField::updateCoeffs()
label patchID = patch().index();
const scalarField& pp = thermo.p().boundaryField()[patchID];
const temperatureJumpFvPatchScalarField& TbPatch =
refCast<const temperatureJumpFvPatchScalarField>
(
@ -124,7 +125,7 @@ void Foam::energyJumpFvPatchScalarField::updateCoeffs()
const labelUList& faceCells = this->patch().faceCells();
jump_ = thermo.he(jumpTb, faceCells);
jump_ = thermo.he(pp, jumpTb, faceCells);
}
fixedJumpFvPatchField<scalar>::updateCoeffs();

View File

@ -104,10 +104,11 @@ void Foam::fixedEnergyFvPatchScalarField::updateCoeffs()
const label patchi = patch().index();
const scalarField& pw = thermo.p().boundaryField()[patchi];
fvPatchScalarField& Tw =
const_cast<fvPatchScalarField&>(thermo.T().boundaryField()[patchi]);
Tw.evaluate();
operator==(thermo.he(Tw, patchi));
operator==(thermo.he(pw, Tw, patchi));
fixedValueFvPatchScalarField::updateCoeffs();
}

View File

@ -104,16 +104,17 @@ void Foam::gradientEnergyFvPatchScalarField::updateCoeffs()
const label patchi = patch().index();
const scalarField& pw = thermo.p().boundaryField()[patchi];
fvPatchScalarField& Tw =
const_cast<fvPatchScalarField&>(thermo.T().boundaryField()[patchi]);
Tw.evaluate();
gradient() = thermo.Cpv(Tw, patchi)*Tw.snGrad()
gradient() = thermo.Cpv(pw, Tw, patchi)*Tw.snGrad()
+ patch().deltaCoeffs()*
(
thermo.he(Tw, patchi)
- thermo.he(Tw, patch().faceCells())
thermo.he(pw, Tw, patchi)
- thermo.he(pw, Tw, patch().faceCells())
);
fixedGradientFvPatchScalarField::updateCoeffs();

View File

@ -109,6 +109,7 @@ void Foam::mixedEnergyFvPatchScalarField::updateCoeffs()
const label patchi = patch().index();
const scalarField& pw = thermo.p().boundaryField()[patchi];
mixedFvPatchScalarField& Tw = refCast<mixedFvPatchScalarField>
(
const_cast<fvPatchScalarField&>(thermo.T().boundaryField()[patchi])
@ -117,13 +118,13 @@ void Foam::mixedEnergyFvPatchScalarField::updateCoeffs()
Tw.evaluate();
valueFraction() = Tw.valueFraction();
refValue() = thermo.he(Tw.refValue(), patchi);
refValue() = thermo.he(pw, Tw.refValue(), patchi);
refGrad() =
thermo.Cpv(Tw, patchi)*Tw.refGrad()
thermo.Cpv(pw, Tw, patchi)*Tw.refGrad()
+ patch().deltaCoeffs()*
(
thermo.he(Tw, patchi)
- thermo.he(Tw, patch().faceCells())
thermo.he(pw, Tw, patchi)
- thermo.he(pw, Tw, patch().faceCells())
);
mixedFvPatchScalarField::updateCoeffs();

View File

@ -156,8 +156,9 @@ void Foam::wallHeatTransferFvPatchScalarField::updateCoeffs()
const label patchi = patch().index();
const scalarField& pw = thermo.p().boundaryField()[patchi];
const scalarField& Tw = thermo.T().boundaryField()[patchi];
const scalarField Cpw(thermo.Cp(Tw, patchi));
const scalarField Cpw(thermo.Cp(pw, Tw, patchi));
valueFraction() =
1.0/

View File

@ -49,17 +49,23 @@ Foam::heThermo<BasicThermo, MixtureType>::heThermo(const fvMesh& mesh)
)
{
scalarField& heCells = he_.internalField();
const scalarField& pCells = this->p_.internalField();
const scalarField& TCells = this->T_.internalField();
forAll(heCells, celli)
{
heCells[celli] = this->cellMixture(celli).HE(TCells[celli]);
heCells[celli] =
this->cellMixture(celli).HE(pCells[celli], TCells[celli]);
}
forAll(he_.boundaryField(), patchi)
{
he_.boundaryField()[patchi] ==
he(this->T_.boundaryField()[patchi], patchi);
he_.boundaryField()[patchi] == he
(
this->p_.boundaryField()[patchi],
this->T_.boundaryField()[patchi],
patchi
);
}
this->heBoundaryCorrection(he_);
@ -78,6 +84,7 @@ Foam::heThermo<BasicThermo, MixtureType>::~heThermo()
template<class BasicThermo, class MixtureType>
Foam::tmp<Foam::scalarField> Foam::heThermo<BasicThermo, MixtureType>::he
(
const scalarField& p,
const scalarField& T,
const labelList& cells
) const
@ -87,7 +94,7 @@ Foam::tmp<Foam::scalarField> Foam::heThermo<BasicThermo, MixtureType>::he
forAll(T, celli)
{
he[celli] = this->cellMixture(cells[celli]).HE(T[celli]);
he[celli] = this->cellMixture(cells[celli]).HE(p[celli], T[celli]);
}
return the;
@ -97,6 +104,7 @@ Foam::tmp<Foam::scalarField> Foam::heThermo<BasicThermo, MixtureType>::he
template<class BasicThermo, class MixtureType>
Foam::tmp<Foam::scalarField> Foam::heThermo<BasicThermo, MixtureType>::he
(
const scalarField& p,
const scalarField& T,
const label patchi
) const
@ -106,7 +114,8 @@ Foam::tmp<Foam::scalarField> Foam::heThermo<BasicThermo, MixtureType>::he
forAll(T, facei)
{
he[facei] = this->patchFaceMixture(patchi, facei).HE(T[facei]);
he[facei] =
this->patchFaceMixture(patchi, facei).HE(p[facei], T[facei]);
}
return the;
@ -161,6 +170,7 @@ Foam::heThermo<BasicThermo, MixtureType>::hc() const
template<class BasicThermo, class MixtureType>
Foam::tmp<Foam::scalarField> Foam::heThermo<BasicThermo, MixtureType>::Cp
(
const scalarField& p,
const scalarField& T,
const label patchi
) const
@ -170,7 +180,8 @@ Foam::tmp<Foam::scalarField> Foam::heThermo<BasicThermo, MixtureType>::Cp
forAll(T, facei)
{
cp[facei] = this->patchFaceMixture(patchi, facei).Cp(T[facei]);
cp[facei] =
this->patchFaceMixture(patchi, facei).Cp(p[facei], T[facei]);
}
return tCp;
@ -204,17 +215,20 @@ Foam::heThermo<BasicThermo, MixtureType>::Cp() const
forAll(this->T_, celli)
{
cp[celli] = this->cellMixture(celli).Cp(this->T_[celli]);
cp[celli] =
this->cellMixture(celli).Cp(this->p_[celli], this->T_[celli]);
}
forAll(this->T_.boundaryField(), patchi)
{
const fvPatchScalarField& pp = this->p_.boundaryField()[patchi];
const fvPatchScalarField& pT = this->T_.boundaryField()[patchi];
fvPatchScalarField& pCp = cp.boundaryField()[patchi];
forAll(pT, facei)
{
pCp[facei] = this->patchFaceMixture(patchi, facei).Cp(pT[facei]);
pCp[facei] =
this->patchFaceMixture(patchi, facei).Cp(pp[facei], pT[facei]);
}
}
@ -226,6 +240,7 @@ template<class BasicThermo, class MixtureType>
Foam::tmp<Foam::scalarField>
Foam::heThermo<BasicThermo, MixtureType>::Cv
(
const scalarField& p,
const scalarField& T,
const label patchi
) const
@ -235,7 +250,8 @@ Foam::heThermo<BasicThermo, MixtureType>::Cv
forAll(T, facei)
{
cv[facei] = this->patchFaceMixture(patchi, facei).Cv(T[facei]);
cv[facei] =
this->patchFaceMixture(patchi, facei).Cv(p[facei], T[facei]);
}
return tCv;
@ -269,13 +285,18 @@ Foam::heThermo<BasicThermo, MixtureType>::Cv() const
forAll(this->T_, celli)
{
cv[celli] = this->cellMixture(celli).Cv(this->T_[celli]);
cv[celli] =
this->cellMixture(celli).Cv(this->p_[celli], this->T_[celli]);
}
forAll(this->T_.boundaryField(), patchi)
{
cv.boundaryField()[patchi] =
Cv(this->T_.boundaryField()[patchi], patchi);
cv.boundaryField()[patchi] = Cv
(
this->p_.boundaryField()[patchi],
this->T_.boundaryField()[patchi],
patchi
);
}
return tCv;
@ -285,6 +306,7 @@ Foam::heThermo<BasicThermo, MixtureType>::Cv() const
template<class BasicThermo, class MixtureType>
Foam::tmp<Foam::scalarField> Foam::heThermo<BasicThermo, MixtureType>::gamma
(
const scalarField& p,
const scalarField& T,
const label patchi
) const
@ -294,7 +316,8 @@ Foam::tmp<Foam::scalarField> Foam::heThermo<BasicThermo, MixtureType>::gamma
forAll(T, facei)
{
cpv[facei] = this->patchFaceMixture(patchi, facei).gamma(T[facei]);
cpv[facei] =
this->patchFaceMixture(patchi, facei).gamma(p[facei], T[facei]);
}
return tgamma;
@ -328,18 +351,23 @@ Foam::heThermo<BasicThermo, MixtureType>::gamma() const
forAll(this->T_, celli)
{
cpv[celli] = this->cellMixture(celli).gamma(this->T_[celli]);
cpv[celli] =
this->cellMixture(celli).gamma(this->p_[celli], this->T_[celli]);
}
forAll(this->T_.boundaryField(), patchi)
{
const fvPatchScalarField& pp = this->p_.boundaryField()[patchi];
const fvPatchScalarField& pT = this->T_.boundaryField()[patchi];
fvPatchScalarField& pgamma = cpv.boundaryField()[patchi];
forAll(pT, facei)
{
pgamma[facei] =
this->patchFaceMixture(patchi, facei).gamma(pT[facei]);
pgamma[facei] = this->patchFaceMixture(patchi, facei).gamma
(
pp[facei],
pT[facei]
);
}
}
@ -350,6 +378,7 @@ Foam::heThermo<BasicThermo, MixtureType>::gamma() const
template<class BasicThermo, class MixtureType>
Foam::tmp<Foam::scalarField> Foam::heThermo<BasicThermo, MixtureType>::Cpv
(
const scalarField& p,
const scalarField& T,
const label patchi
) const
@ -359,7 +388,8 @@ Foam::tmp<Foam::scalarField> Foam::heThermo<BasicThermo, MixtureType>::Cpv
forAll(T, facei)
{
cpv[facei] = this->patchFaceMixture(patchi, facei).Cpv(T[facei]);
cpv[facei] =
this->patchFaceMixture(patchi, facei).Cpv(p[facei], T[facei]);
}
return tCpv;
@ -393,17 +423,20 @@ Foam::heThermo<BasicThermo, MixtureType>::Cpv() const
forAll(this->T_, celli)
{
cpv[celli] = this->cellMixture(celli).Cpv(this->T_[celli]);
cpv[celli] =
this->cellMixture(celli).Cpv(this->p_[celli], this->T_[celli]);
}
forAll(this->T_.boundaryField(), patchi)
{
const fvPatchScalarField& pp = this->p_.boundaryField()[patchi];
const fvPatchScalarField& pT = this->T_.boundaryField()[patchi];
fvPatchScalarField& pCpv = cpv.boundaryField()[patchi];
forAll(pT, facei)
{
pCpv[facei] = this->patchFaceMixture(patchi, facei).Cpv(pT[facei]);
pCpv[facei] =
this->patchFaceMixture(patchi, facei).Cpv(pp[facei], pT[facei]);
}
}
@ -414,6 +447,7 @@ Foam::heThermo<BasicThermo, MixtureType>::Cpv() const
template<class BasicThermo, class MixtureType>
Foam::tmp<Foam::scalarField> Foam::heThermo<BasicThermo, MixtureType>::CpByCpv
(
const scalarField& p,
const scalarField& T,
const label patchi
) const
@ -424,7 +458,7 @@ Foam::tmp<Foam::scalarField> Foam::heThermo<BasicThermo, MixtureType>::CpByCpv
forAll(T, facei)
{
cpByCpv[facei] =
this->patchFaceMixture(patchi, facei).cpBycpv(T[facei]);
this->patchFaceMixture(patchi, facei).cpBycpv(p[facei], T[facei]);
}
return tCpByCpv;
@ -458,18 +492,26 @@ Foam::heThermo<BasicThermo, MixtureType>::CpByCpv() const
forAll(this->T_, celli)
{
cpByCpv[celli] = this->cellMixture(celli).cpBycpv(this->T_[celli]);
cpByCpv[celli] = this->cellMixture(celli).cpBycpv
(
this->p_[celli],
this->T_[celli]
);
}
forAll(this->T_.boundaryField(), patchi)
{
const fvPatchScalarField& pp = this->p_.boundaryField()[patchi];
const fvPatchScalarField& pT = this->T_.boundaryField()[patchi];
fvPatchScalarField& pCpByCpv = cpByCpv.boundaryField()[patchi];
forAll(pT, facei)
{
pCpByCpv[facei] =
this->patchFaceMixture(patchi, facei).cpBycpv(pT[facei]);
pCpByCpv[facei] = this->patchFaceMixture(patchi, facei).cpBycpv
(
pp[facei],
pT[facei]
);
}
}
@ -481,6 +523,7 @@ template<class BasicThermo, class MixtureType>
Foam::tmp<Foam::scalarField> Foam::heThermo<BasicThermo, MixtureType>::THE
(
const scalarField& h,
const scalarField& p,
const scalarField& T0,
const labelList& cells
) const
@ -490,7 +533,8 @@ Foam::tmp<Foam::scalarField> Foam::heThermo<BasicThermo, MixtureType>::THE
forAll(h, celli)
{
T[celli] = this->cellMixture(cells[celli]).THE(h[celli], T0[celli]);
T[celli] =
this->cellMixture(cells[celli]).THE(h[celli], p[celli], T0[celli]);
}
return tT;
@ -501,6 +545,7 @@ template<class BasicThermo, class MixtureType>
Foam::tmp<Foam::scalarField> Foam::heThermo<BasicThermo, MixtureType>::THE
(
const scalarField& h,
const scalarField& p,
const scalarField& T0,
const label patchi
) const
@ -514,7 +559,7 @@ Foam::tmp<Foam::scalarField> Foam::heThermo<BasicThermo, MixtureType>::THE
(
patchi,
facei
).THE(h[facei], T0[facei]);
).THE(h[facei], p[facei], T0[facei]);
}
return tT;
@ -538,8 +583,12 @@ Foam::tmp<Foam::scalarField> Foam::heThermo<BasicThermo, MixtureType>::kappa
) const
{
return
Cp(this->T_.boundaryField()[patchi], patchi)
*this->alpha_.boundaryField()[patchi];
Cp
(
this->p_.boundaryField()[patchi],
this->T_.boundaryField()[patchi],
patchi
)*this->alpha_.boundaryField()[patchi];
}
@ -565,8 +614,12 @@ Foam::heThermo<BasicThermo, MixtureType>::kappaEff
) const
{
return
Cp(this->T_.boundaryField()[patchi], patchi)
*alphaEff(alphat, patchi);
Cp
(
this->p_.boundaryField()[patchi],
this->T_.boundaryField()[patchi],
patchi
)*alphaEff(alphat, patchi);
}
@ -592,7 +645,12 @@ Foam::heThermo<BasicThermo, MixtureType>::alphaEff
) const
{
return
this->CpByCpv(this->T_.boundaryField()[patchi], patchi)
this->CpByCpv
(
this->p_.boundaryField()[patchi],
this->T_.boundaryField()[patchi],
patchi
)
*(
this->alpha_.boundaryField()[patchi]
+ alphat

View File

@ -118,6 +118,7 @@ public:
//- Enthalpy/Internal energy for cell-set [J/kg]
virtual tmp<scalarField> he
(
const scalarField& p,
const scalarField& T,
const labelList& cells
) const;
@ -125,6 +126,7 @@ public:
//- Enthalpy/Internal energy for patch [J/kg]
virtual tmp<scalarField> he
(
const scalarField& p,
const scalarField& T,
const label patchi
) const;
@ -136,6 +138,7 @@ public:
virtual tmp<scalarField> THE
(
const scalarField& he,
const scalarField& p,
const scalarField& T0, // starting temperature
const labelList& cells
) const;
@ -144,6 +147,7 @@ public:
virtual tmp<scalarField> THE
(
const scalarField& he,
const scalarField& p,
const scalarField& T0, // starting temperature
const label patchi
) const;
@ -151,6 +155,7 @@ public:
//- Heat capacity at constant pressure for patch [J/kg/K]
virtual tmp<scalarField> Cp
(
const scalarField& p,
const scalarField& T,
const label patchi
) const;
@ -161,6 +166,7 @@ public:
//- Heat capacity at constant volume for patch [J/kg/K]
virtual tmp<scalarField> Cv
(
const scalarField& p,
const scalarField& T,
const label patchi
) const;
@ -174,6 +180,7 @@ public:
//- gamma = Cp/Cv for patch []
virtual tmp<scalarField> gamma
(
const scalarField& p,
const scalarField& T,
const label patchi
) const;
@ -181,6 +188,7 @@ public:
//- Heat capacity at constant pressure/volume for patch [J/kg/K]
virtual tmp<scalarField> Cpv
(
const scalarField& p,
const scalarField& T,
const label patchi
) const;
@ -194,6 +202,7 @@ public:
//- Heat capacity ratio for patch []
virtual tmp<scalarField> CpByCpv
(
const scalarField& p,
const scalarField& T,
const label patchi
) const;

View File

@ -43,11 +43,17 @@ void Foam::hePsiThermo<MixtureType>::calculate()
const typename MixtureType::thermoType& mixture_ =
this->cellMixture(celli);
TCells[celli] = mixture_.THE(hCells[celli], TCells[celli]);
TCells[celli] = mixture_.THE
(
hCells[celli],
pCells[celli],
TCells[celli]
);
psiCells[celli] = mixture_.psi(pCells[celli], TCells[celli]);
muCells[celli] = mixture_.mu(TCells[celli]);
alphaCells[celli] = mixture_.alphah(TCells[celli]);
muCells[celli] = mixture_.mu(pCells[celli], TCells[celli]);
alphaCells[celli] = mixture_.alphah(pCells[celli], TCells[celli]);
}
forAll(this->T_.boundaryField(), patchi)
@ -68,11 +74,11 @@ void Foam::hePsiThermo<MixtureType>::calculate()
const typename MixtureType::thermoType& mixture_ =
this->patchFaceMixture(patchi, facei);
ph[facei] = mixture_.HE(pT[facei]);
ph[facei] = mixture_.HE(pp[facei], pT[facei]);
ppsi[facei] = mixture_.psi(pp[facei], pT[facei]);
pmu[facei] = mixture_.mu(pT[facei]);
palpha[facei] = mixture_.alphah(pT[facei]);
pmu[facei] = mixture_.mu(pp[facei], pT[facei]);
palpha[facei] = mixture_.alphah(pp[facei], pT[facei]);
}
}
else
@ -82,11 +88,11 @@ void Foam::hePsiThermo<MixtureType>::calculate()
const typename MixtureType::thermoType& mixture_ =
this->patchFaceMixture(patchi, facei);
pT[facei] = mixture_.THE(ph[facei], pT[facei]);
pT[facei] = mixture_.THE(ph[facei], pp[facei], pT[facei]);
ppsi[facei] = mixture_.psi(pp[facei], pT[facei]);
pmu[facei] = mixture_.mu(pT[facei]);
palpha[facei] = mixture_.alphah(pT[facei]);
pmu[facei] = mixture_.mu(pp[facei], pT[facei]);
palpha[facei] = mixture_.alphah(pp[facei], pT[facei]);
}
}
}

View File

@ -44,12 +44,18 @@ void Foam::heRhoThermo<MixtureType>::calculate()
const typename MixtureType::thermoType& mixture_ =
this->cellMixture(celli);
TCells[celli] = mixture_.THE(hCells[celli], TCells[celli]);
TCells[celli] = mixture_.THE
(
hCells[celli],
pCells[celli],
TCells[celli]
);
psiCells[celli] = mixture_.psi(pCells[celli], TCells[celli]);
rhoCells[celli] = mixture_.rho(pCells[celli], TCells[celli]);
muCells[celli] = mixture_.mu(TCells[celli]);
alphaCells[celli] = mixture_.alphah(TCells[celli]);
muCells[celli] = mixture_.mu(pCells[celli], TCells[celli]);
alphaCells[celli] = mixture_.alphah(pCells[celli], TCells[celli]);
}
forAll(this->T_.boundaryField(), patchi)
@ -71,12 +77,12 @@ void Foam::heRhoThermo<MixtureType>::calculate()
const typename MixtureType::thermoType& mixture_ =
this->patchFaceMixture(patchi, facei);
ph[facei] = mixture_.HE(pT[facei]);
ph[facei] = mixture_.HE(pp[facei], pT[facei]);
ppsi[facei] = mixture_.psi(pp[facei], pT[facei]);
prho[facei] = mixture_.rho(pp[facei], pT[facei]);
pmu[facei] = mixture_.mu(pT[facei]);
palpha[facei] = mixture_.alphah(pT[facei]);
pmu[facei] = mixture_.mu(pp[facei], pT[facei]);
palpha[facei] = mixture_.alphah(pp[facei], pT[facei]);
}
}
else
@ -86,12 +92,12 @@ void Foam::heRhoThermo<MixtureType>::calculate()
const typename MixtureType::thermoType& mixture_ =
this->patchFaceMixture(patchi, facei);
pT[facei] = mixture_.THE(ph[facei], pT[facei]);
pT[facei] = mixture_.THE(ph[facei], pp[facei], pT[facei]);
ppsi[facei] = mixture_.psi(pp[facei], pT[facei]);
prho[facei] = mixture_.rho(pp[facei], pT[facei]);
pmu[facei] = mixture_.mu(pT[facei]);
palpha[facei] = mixture_.alphah(pT[facei]);
pmu[facei] = mixture_.mu(pp[facei], pT[facei]);
palpha[facei] = mixture_.alphah(pp[facei], pT[facei]);
}
}
}

View File

@ -352,7 +352,7 @@ void Foam::ODEChemistryModel<CompType, ThermoType>::derivatives
scalar cp = 0.0;
for (label i=0; i<nSpecie_; i++)
{
const scalar cpi = specieThermo_[i].cp(T);
const scalar cpi = specieThermo_[i].cp(p, T);
const scalar Xi = c[i]/rho;
cp += Xi*cpi;
}
@ -361,7 +361,7 @@ void Foam::ODEChemistryModel<CompType, ThermoType>::derivatives
scalar dT = 0.0;
for (label i = 0; i < nSpecie_; i++)
{
const scalar hi = specieThermo_[i].ha(T);
const scalar hi = specieThermo_[i].ha(p, T);
dT += hi*dcdt[i];
}
dT /= rho*cp;
@ -815,7 +815,7 @@ Foam::scalar Foam::ODEChemistryModel<CompType, ThermoType>::solve
{
mixture += (c[i]/cTot)*specieThermo_[i];
}
Ti = mixture.THa(hi, Ti);
Ti = mixture.THa(hi, pi, Ti);
timeLeft -= dt;
this->deltaTChem_[celli] = tauC;

View File

@ -105,10 +105,11 @@ void Foam::fixedUnburntEnthalpyFvPatchScalarField::updateCoeffs()
const label patchi = patch().index();
const scalarField& pw = thermo.p().boundaryField()[patchi];
fvPatchScalarField& Tw =
const_cast<fvPatchScalarField&>(thermo.Tu().boundaryField()[patchi]);
Tw.evaluate();
operator==(thermo.heu(Tw, patchi));
operator==(thermo.heu(pw, Tw, patchi));
fixedValueFvPatchScalarField::updateCoeffs();
}

View File

@ -104,16 +104,17 @@ void Foam::gradientUnburntEnthalpyFvPatchScalarField::updateCoeffs()
const label patchi = patch().index();
const scalarField& pw = thermo.p().boundaryField()[patchi];
fvPatchScalarField& Tw =
const_cast<fvPatchScalarField&>(thermo.Tu().boundaryField()[patchi]);
Tw.evaluate();
gradient() = thermo.Cp(Tw, patchi)*Tw.snGrad()
gradient() = thermo.Cp(pw, Tw, patchi)*Tw.snGrad()
+ patch().deltaCoeffs()*
(
thermo.heu(Tw, patchi)
- thermo.heu(Tw, patch().faceCells())
thermo.heu(pw, Tw, patchi)
- thermo.heu(pw, Tw, patch().faceCells())
);
fixedGradientFvPatchScalarField::updateCoeffs();

View File

@ -108,6 +108,7 @@ void Foam::mixedUnburntEnthalpyFvPatchScalarField::updateCoeffs()
const label patchi = patch().index();
const scalarField& pw = thermo.p().boundaryField()[patchi];
mixedFvPatchScalarField& Tw = refCast<mixedFvPatchScalarField>
(
const_cast<fvPatchScalarField&>(thermo.Tu().boundaryField()[patchi])
@ -116,12 +117,12 @@ void Foam::mixedUnburntEnthalpyFvPatchScalarField::updateCoeffs()
Tw.evaluate();
valueFraction() = Tw.valueFraction();
refValue() = thermo.heu(Tw.refValue(), patchi);
refGrad() = thermo.Cp(Tw, patchi)*Tw.refGrad()
refValue() = thermo.heu(pw, Tw.refValue(), patchi);
refGrad() = thermo.Cp(pw, Tw, patchi)*Tw.refGrad()
+ patch().deltaCoeffs()*
(
thermo.heu(Tw, patchi)
- thermo.heu(Tw, patch().faceCells())
thermo.heu(pw, Tw, patchi)
- thermo.heu(pw, Tw, patch().faceCells())
);
mixedFvPatchScalarField::updateCoeffs();

View File

@ -27,14 +27,32 @@ License
#define makeReactionThermo_H
#include "addToRunTimeSelectionTable.H"
#include "SpecieMixture.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define makeReactionThermo(BaseThermo,CThermo,MixtureThermo,Mixture,Transport,Type,Thermo,EqnOfState) \
\
typedef MixtureThermo \
<Mixture<Transport<specieThermo<Thermo<EqnOfState>,Type> > > > \
MixtureThermo##Mixture##Transport##Type##Thermo##EqnOfState; \
< \
SpecieMixture \
< \
Mixture \
< \
Transport \
< \
specieThermo \
< \
Thermo \
< \
EqnOfState \
>, \
Type \
> \
> \
> \
> \
> MixtureThermo##Mixture##Transport##Type##Thermo##EqnOfState; \
\
defineTemplateTypeNameAndDebugWithName \
( \
@ -71,8 +89,16 @@ addToRunTimeSelectionTable \
#define makeReactionMixtureThermo(BaseThermo,CThermo,MixtureThermo,Mixture,ThermoPhys) \
\
typedef MixtureThermo<Mixture<ThermoPhys> > \
MixtureThermo##Mixture##ThermoPhys; \
typedef MixtureThermo \
< \
SpecieMixture \
< \
Mixture \
< \
ThermoPhys \
> \
> \
> MixtureThermo##Mixture##ThermoPhys; \
\
defineTemplateTypeNameAndDebugWithName \
( \

View File

@ -0,0 +1,210 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ 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 3 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, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "SpecieMixture.H"
#include "fvMesh.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class MixtureType>
Foam::SpecieMixture<MixtureType>::SpecieMixture
(
const dictionary& thermoDict,
const fvMesh& mesh
)
:
MixtureType
(
thermoDict,
mesh
)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class MixtureType>
Foam::scalar Foam::SpecieMixture<MixtureType>::nMoles
(
const label speciei
) const
{
return this->getLocalThermo(speciei).nMoles();
}
template<class MixtureType>
Foam::scalar Foam::SpecieMixture<MixtureType>::W
(
const label speciei
) const
{
return this->getLocalThermo(speciei).W();
}
template<class MixtureType>
Foam::scalar Foam::SpecieMixture<MixtureType>::Cp
(
const label speciei,
const scalar p,
const scalar T
) const
{
return this->getLocalThermo(speciei).Cp(p, T);
}
template<class MixtureType>
Foam::scalar Foam::SpecieMixture<MixtureType>::Cv
(
const label speciei,
const scalar p,
const scalar T
) const
{
return this->getLocalThermo(speciei).Cv(p, T);
}
template<class MixtureType>
Foam::scalar Foam::SpecieMixture<MixtureType>::Ha
(
const label speciei,
const scalar p,
const scalar T
) const
{
return this->getLocalThermo(speciei).Ha(p, T);
}
template<class MixtureType>
Foam::scalar Foam::SpecieMixture<MixtureType>::Hs
(
const label speciei,
const scalar p,
const scalar T
) const
{
return this->getLocalThermo(speciei).Hs(p, T);
}
template<class MixtureType>
Foam::scalar Foam::SpecieMixture<MixtureType>::Hc
(
const label speciei
) const
{
return this->getLocalThermo(speciei).Hc();
}
template<class MixtureType>
Foam::scalar Foam::SpecieMixture<MixtureType>::S
(
const label speciei,
const scalar p,
const scalar T
) const
{
return this->getLocalThermo(speciei).S(p, T);
}
template<class MixtureType>
Foam::scalar Foam::SpecieMixture<MixtureType>::Es
(
const label speciei,
const scalar p,
const scalar T
) const
{
return this->getLocalThermo(speciei).Es(p, T);
}
template<class MixtureType>
Foam::scalar Foam::SpecieMixture<MixtureType>::G
(
const label speciei,
const scalar p,
const scalar T
) const
{
return this->getLocalThermo(speciei).G(p, T);
}
template<class MixtureType>
Foam::scalar Foam::SpecieMixture<MixtureType>::A
(
const label speciei,
const scalar p,
const scalar T
) const
{
return this->getLocalThermo(speciei).A(p, T);
}
template<class MixtureType>
Foam::scalar Foam::SpecieMixture<MixtureType>::mu
(
const label speciei,
const scalar p,
const scalar T
) const
{
return this->getLocalThermo(speciei).mu(p, T);
}
template<class MixtureType>
Foam::scalar Foam::SpecieMixture<MixtureType>::kappa
(
const label speciei,
const scalar p,
const scalar T
) const
{
return this->getLocalThermo(speciei).kappa(p, T);
}
template<class MixtureType>
Foam::scalar Foam::SpecieMixture<MixtureType>::alphah
(
const label speciei,
const scalar p,
const scalar T
) const
{
return this->getLocalThermo(speciei).alphah(p, T);
}
// ************************************************************************* //

View File

@ -0,0 +1,196 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ 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 3 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, see <http://www.gnu.org/licenses/>.
Class
Foam::SpecieMixture
Description
Foam::SpecieMixture
SourceFiles
SpecieMixture.C
\*---------------------------------------------------------------------------*/
#ifndef SpecieMixture_H
#define SpecieMixture_H
#include "scalar.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Forward declaration of classes
class dictionary;
class fvMesh;
/*---------------------------------------------------------------------------*\
Class SpecieMixture Declaration
\*---------------------------------------------------------------------------*/
template<class MixtureType>
class SpecieMixture
:
public MixtureType
{
public:
// Constructors
//- Construct from dictionary and mesh
SpecieMixture(const dictionary&, const fvMesh&);
//- Destructor
virtual ~SpecieMixture()
{}
// Member functions
// Per specie properties
//- Number of moles []
virtual scalar nMoles(const label speciei) const;
//- Molecular weight [kg/kmol]
virtual scalar W(const label speciei) const;
// Per specie thermo properties
//- Heat capacity at constant pressure [J/(kg K)]
virtual scalar Cp
(
const label speciei,
const scalar p,
const scalar T
) const;
//- Heat capacity at constant volume [J/(kg K)]
virtual scalar Cv
(
const label speciei,
const scalar p,
const scalar T
) const;
//- Absolute enthalpy [J/kg]
virtual scalar Ha
(
const label speciei,
const scalar p,
const scalar T
) const;
//- Sensible enthalpy [J/kg]
virtual scalar Hs
(
const label speciei,
const scalar p,
const scalar T
) const;
//- Chemical enthalpy [J/kg]
virtual scalar Hc(const label speciei) const;
//- Entropy [J/(kg K)]
virtual scalar S
(
const label speciei,
const scalar p,
const scalar T
) const;
//- Sensible internal energy [J/kg]
virtual scalar Es
(
const label speciei,
const scalar p,
const scalar T
) const;
//- Gibbs free energy [J/kg]
virtual scalar G
(
const label speciei,
const scalar p,
const scalar T
) const;
//- Helmholtz free energy [J/kg]
virtual scalar A
(
const label speciei,
const scalar p,
const scalar T
) const;
// Per specie transport properties
//- Dynamic viscosity [kg/m/s]
virtual scalar mu
(
const label speciei,
const scalar p,
const scalar T
) const;
//- Thermal conductivity [W/m/K]
virtual scalar kappa
(
const label speciei,
const scalar p,
const scalar T
) const;
//- Thermal diffusivity of enthalpy [kg/m/s]
virtual scalar alphah
(
const label speciei,
const scalar p,
const scalar T
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
#ifdef NoRepository
# include "SpecieMixture.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -135,44 +135,98 @@ public:
// Per specie thermo properties
//- Heat capacity at constant pressure [J/(kg K)]
virtual scalar Cp(const label specieI, const scalar T) const = 0;
virtual scalar Cp
(
const label specieI,
const scalar p,
const scalar T
) const = 0;
//- Heat capacity at constant volume [J/(kg K)]
virtual scalar Cv(const label specieI, const scalar T) const = 0;
virtual scalar Cv
(
const label specieI,
const scalar p,
const scalar T
) const = 0;
//- Absolute enthalpy [J/kg]
virtual scalar Ha(const label specieI, const scalar T) const = 0;
virtual scalar Ha
(
const label specieI,
const scalar p,
const scalar T
) const = 0;
//- Sensible enthalpy [J/kg]
virtual scalar Hs(const label specieI, const scalar T) const = 0;
virtual scalar Hs
(
const label specieI,
const scalar p,
const scalar T
) const = 0;
//- Chemical enthalpy [J/kg]
virtual scalar Hc(const label specieI) const = 0;
//- Entropy [J/(kg K)]
virtual scalar S(const label specieI, const scalar T) const = 0;
virtual scalar S
(
const label specieI,
const scalar p,
const scalar T
) const = 0;
//- Sensible internal energy [J/kg]
virtual scalar Es(const label specieI, const scalar T) const = 0;
virtual scalar Es
(
const label specieI,
const scalar p,
const scalar T
) const = 0;
//- Gibbs free energy [J/kg]
virtual scalar G(const label specieI, const scalar T) const = 0;
virtual scalar G
(
const label specieI,
const scalar p,
const scalar T
) const = 0;
//- Helmholtz free energy [J/kg]
virtual scalar A(const label specieI, const scalar T) const = 0;
virtual scalar A
(
const label specieI,
const scalar p,
const scalar T
) const = 0;
// Per specie transport properties
//- Dynamic viscosity [kg/m/s]
virtual scalar mu(const label specieI, const scalar T) const = 0;
virtual scalar mu
(
const label specieI,
const scalar p,
const scalar T
) const = 0;
//- Thermal conductivity [W/m/K]
virtual scalar kappa(const label specieI, const scalar T) const = 0;
virtual scalar kappa
(
const label specieI,
const scalar p,
const scalar T
) const = 0;
//- Thermal diffusivity of enthalpy [kg/m/s]
virtual scalar alphah(const label specieI, const scalar T) const
= 0;
virtual scalar alphah
(
const label specieI,
const scalar p,
const scalar T
) const = 0;
};

View File

@ -131,155 +131,4 @@ const ThermoType& Foam::dieselMixture<ThermoType>::getLocalThermo
}
template<class ThermoType>
Foam::scalar Foam::dieselMixture<ThermoType>::nMoles
(
const label specieI
) const
{
return getLocalThermo(specieI).nMoles();
}
template<class ThermoType>
Foam::scalar Foam::dieselMixture<ThermoType>::W
(
const label specieI
) const
{
return getLocalThermo(specieI).W();
}
template<class ThermoType>
Foam::scalar Foam::dieselMixture<ThermoType>::Cp
(
const label specieI,
const scalar T
) const
{
return getLocalThermo(specieI).Cp(T);
}
template<class ThermoType>
Foam::scalar Foam::dieselMixture<ThermoType>::Cv
(
const label specieI,
const scalar T
) const
{
return getLocalThermo(specieI).Cv(T);
}
template<class ThermoType>
Foam::scalar Foam::dieselMixture<ThermoType>::Ha
(
const label specieI,
const scalar T
) const
{
return getLocalThermo(specieI).Ha(T);
}
template<class ThermoType>
Foam::scalar Foam::dieselMixture<ThermoType>::Hs
(
const label specieI,
const scalar T
) const
{
return getLocalThermo(specieI).Hs(T);
}
template<class ThermoType>
Foam::scalar Foam::dieselMixture<ThermoType>::Hc
(
const label specieI
) const
{
return getLocalThermo(specieI).Hc();
}
template<class ThermoType>
Foam::scalar Foam::dieselMixture<ThermoType>::S
(
const label specieI,
const scalar T
) const
{
return getLocalThermo(specieI).S(T);
}
template<class ThermoType>
Foam::scalar Foam::dieselMixture<ThermoType>::Es
(
const label specieI,
const scalar T
) const
{
return getLocalThermo(specieI).Es(T);
}
template<class ThermoType>
Foam::scalar Foam::dieselMixture<ThermoType>::G
(
const label specieI,
const scalar T
) const
{
return getLocalThermo(specieI).G(T);
}
template<class ThermoType>
Foam::scalar Foam::dieselMixture<ThermoType>::A
(
const label specieI,
const scalar T
) const
{
return getLocalThermo(specieI).A(T);
}
template<class ThermoType>
Foam::scalar Foam::dieselMixture<ThermoType>::mu
(
const label specieI,
const scalar T
) const
{
return getLocalThermo(specieI).mu(T);
}
template<class ThermoType>
Foam::scalar Foam::dieselMixture<ThermoType>::kappa
(
const label specieI,
const scalar T
) const
{
return getLocalThermo(specieI).kappa(T);
}
template<class ThermoType>
Foam::scalar Foam::dieselMixture<ThermoType>::alphah
(
const label specieI,
const scalar T
) const
{
return getLocalThermo(specieI).alphah(T);
}
// ************************************************************************* //

View File

@ -154,57 +154,6 @@ public:
//- Return thermo based on index
const ThermoType& getLocalThermo(const label specieI) const;
// Per specie properties
//- Number of moles []
virtual scalar nMoles(const label specieI) const;
//- Molecular weight [kg/kmol]
virtual scalar W(const label specieI) const;
// Per specie thermo properties
//- Heat capacity at constant pressure [J/(kg K)]
virtual scalar Cp(const label specieI, const scalar T) const;
//- Heat capacity at constant volume [J/(kg K)]
virtual scalar Cv(const label specieI, const scalar T) const;
//- Absolute enthalpy [J/kg]
virtual scalar Ha(const label specieI, const scalar T) const;
//- Sensible enthalpy [J/kg]
virtual scalar Hs(const label specieI, const scalar T) const;
//- Chemical enthalpy [J/kg]
virtual scalar Hc(const label specieI) const;
//- Entropy [J/(kg K)]
virtual scalar S(const label specieI, const scalar T) const;
//- Sensible internal energy [J/kg]
virtual scalar Es(const label specieI, const scalar T) const;
//- Gibbs free energy [J/kg]
virtual scalar G(const label specieI, const scalar T) const;
//- Helmholtz free energy [J/kg]
virtual scalar A(const label specieI, const scalar T) const;
// Per specie transport properties
//- Dynamic viscosity [kg/m/s]
virtual scalar mu(const label specieI, const scalar T) const;
//- Thermal conductivity [W/m/K]
virtual scalar kappa(const label specieI, const scalar T) const;
//- Thermal diffusivity of enthalpy [kg/m/s]
virtual scalar alphah(const label specieI, const scalar T) const;
};

View File

@ -141,155 +141,4 @@ const ThermoType& Foam::egrMixture<ThermoType>::getLocalThermo
}
template<class ThermoType>
Foam::scalar Foam::egrMixture<ThermoType>::nMoles
(
const label specieI
) const
{
return getLocalThermo(specieI).nMoles();
}
template<class ThermoType>
Foam::scalar Foam::egrMixture<ThermoType>::W
(
const label specieI
) const
{
return getLocalThermo(specieI).W();
}
template<class ThermoType>
Foam::scalar Foam::egrMixture<ThermoType>::Cp
(
const label specieI,
const scalar T
) const
{
return getLocalThermo(specieI).Cp(T);
}
template<class ThermoType>
Foam::scalar Foam::egrMixture<ThermoType>::Cv
(
const label specieI,
const scalar T
) const
{
return getLocalThermo(specieI).Cv(T);
}
template<class ThermoType>
Foam::scalar Foam::egrMixture<ThermoType>::Ha
(
const label specieI,
const scalar T
) const
{
return getLocalThermo(specieI).Ha(T);
}
template<class ThermoType>
Foam::scalar Foam::egrMixture<ThermoType>::Hs
(
const label specieI,
const scalar T
) const
{
return getLocalThermo(specieI).Hs(T);
}
template<class ThermoType>
Foam::scalar Foam::egrMixture<ThermoType>::Hc
(
const label specieI
) const
{
return getLocalThermo(specieI).Hc();
}
template<class ThermoType>
Foam::scalar Foam::egrMixture<ThermoType>::S
(
const label specieI,
const scalar T
) const
{
return getLocalThermo(specieI).S(T);
}
template<class ThermoType>
Foam::scalar Foam::egrMixture<ThermoType>::Es
(
const label specieI,
const scalar T
) const
{
return getLocalThermo(specieI).Es(T);
}
template<class ThermoType>
Foam::scalar Foam::egrMixture<ThermoType>::G
(
const label specieI,
const scalar T
) const
{
return getLocalThermo(specieI).G(T);
}
template<class ThermoType>
Foam::scalar Foam::egrMixture<ThermoType>::A
(
const label specieI,
const scalar T
) const
{
return getLocalThermo(specieI).A(T);
}
template<class ThermoType>
Foam::scalar Foam::egrMixture<ThermoType>::mu
(
const label specieI,
const scalar T
) const
{
return getLocalThermo(specieI).mu(T);
}
template<class ThermoType>
Foam::scalar Foam::egrMixture<ThermoType>::kappa
(
const label specieI,
const scalar T
) const
{
return getLocalThermo(specieI).kappa(T);
}
template<class ThermoType>
Foam::scalar Foam::egrMixture<ThermoType>::alphah
(
const label specieI,
const scalar T
) const
{
return getLocalThermo(specieI).alphah(T);
}
// ************************************************************************* //

View File

@ -170,57 +170,6 @@ public:
//- Return thermo based on index
const ThermoType& getLocalThermo(const label specieI) const;
// Per specie properties
//- Number of moles []
virtual scalar nMoles(const label specieI) const;
//- Molecular weight [kg/kmol]
virtual scalar W(const label specieI) const;
// Per specie thermo properties
//- Heat capacity at constant pressure [J/(kg K)]
virtual scalar Cp(const label specieI, const scalar T) const;
//- Heat capacity at constant volume [J/(kg K)]
virtual scalar Cv(const label specieI, const scalar T) const;
//- Absolute enthalpy [J/kg]
virtual scalar Ha(const label specieI, const scalar T) const;
//- Sensible enthalpy [J/kg]
virtual scalar Hs(const label specieI, const scalar T) const;
//- Chemical enthalpy [J/kg]
virtual scalar Hc(const label specieI) const;
//- Entropy [J/(kg K)]
virtual scalar S(const label specieI, const scalar T) const;
//- Sensible internal energy [J/kg]
virtual scalar Es(const label specieI, const scalar T) const;
//- Gibbs free energy [J/kg]
virtual scalar G(const label specieI, const scalar T) const;
//- Helmholtz free energy [J/kg]
virtual scalar A(const label specieI, const scalar T) const;
// Per specie transport properties
//- Dynamic viscosity [kg/m/s]
virtual scalar mu(const label specieI, const scalar T) const;
//- Thermal conductivity [W/m/K]
virtual scalar kappa(const label specieI, const scalar T) const;
//- Thermal diffusivity of enthalpy [kg/m/s]
virtual scalar alphah(const label specieI, const scalar T) const;
};

View File

@ -120,155 +120,4 @@ const ThermoType& Foam::homogeneousMixture<ThermoType>::getLocalThermo
}
template<class ThermoType>
Foam::scalar Foam::homogeneousMixture<ThermoType>::nMoles
(
const label specieI
) const
{
return getLocalThermo(specieI).nMoles();
}
template<class ThermoType>
Foam::scalar Foam::homogeneousMixture<ThermoType>::W
(
const label specieI
) const
{
return getLocalThermo(specieI).W();
}
template<class ThermoType>
Foam::scalar Foam::homogeneousMixture<ThermoType>::Cp
(
const label specieI,
const scalar T
) const
{
return getLocalThermo(specieI).Cp(T);
}
template<class ThermoType>
Foam::scalar Foam::homogeneousMixture<ThermoType>::Cv
(
const label specieI,
const scalar T
) const
{
return getLocalThermo(specieI).Cv(T);
}
template<class ThermoType>
Foam::scalar Foam::homogeneousMixture<ThermoType>::Ha
(
const label specieI,
const scalar T
) const
{
return getLocalThermo(specieI).Ha(T);
}
template<class ThermoType>
Foam::scalar Foam::homogeneousMixture<ThermoType>::Hs
(
const label specieI,
const scalar T
) const
{
return getLocalThermo(specieI).Hs(T);
}
template<class ThermoType>
Foam::scalar Foam::homogeneousMixture<ThermoType>::Hc
(
const label specieI
) const
{
return getLocalThermo(specieI).Hc();
}
template<class ThermoType>
Foam::scalar Foam::homogeneousMixture<ThermoType>::S
(
const label specieI,
const scalar T
) const
{
return getLocalThermo(specieI).S(T);
}
template<class ThermoType>
Foam::scalar Foam::homogeneousMixture<ThermoType>::Es
(
const label specieI,
const scalar T
) const
{
return getLocalThermo(specieI).Es(T);
}
template<class ThermoType>
Foam::scalar Foam::homogeneousMixture<ThermoType>::G
(
const label specieI,
const scalar T
) const
{
return getLocalThermo(specieI).G(T);
}
template<class ThermoType>
Foam::scalar Foam::homogeneousMixture<ThermoType>::A
(
const label specieI,
const scalar T
) const
{
return getLocalThermo(specieI).A(T);
}
template<class ThermoType>
Foam::scalar Foam::homogeneousMixture<ThermoType>::mu
(
const label specieI,
const scalar T
) const
{
return getLocalThermo(specieI).mu(T);
}
template<class ThermoType>
Foam::scalar Foam::homogeneousMixture<ThermoType>::kappa
(
const label specieI,
const scalar T
) const
{
return getLocalThermo(specieI).kappa(T);
}
template<class ThermoType>
Foam::scalar Foam::homogeneousMixture<ThermoType>::alphah
(
const label specieI,
const scalar T
) const
{
return getLocalThermo(specieI).alphah(T);
}
// ************************************************************************* //

View File

@ -128,57 +128,6 @@ public:
//- Return thermo based on index
const ThermoType& getLocalThermo(const label specieI) const;
// Per specie properties
//- Number of moles []
virtual scalar nMoles(const label specieI) const;
//- Molecular weight [kg/kmol]
virtual scalar W(const label specieI) const;
// Per specie thermo properties
//- Heat capacity at constant pressure [J/(kg K)]
virtual scalar Cp(const label specieI, const scalar T) const;
//- Heat capacity at constant volume [J/(kg K)]
virtual scalar Cv(const label specieI, const scalar T) const;
//- Absolute enthalpy [J/kg]
virtual scalar Ha(const label specieI, const scalar T) const;
//- Sensible enthalpy [J/kg]
virtual scalar Hs(const label specieI, const scalar T) const;
//- Chemical enthalpy [J/kg]
virtual scalar Hc(const label specieI) const;
//- Entropy [J/(kg K)]
virtual scalar S(const label specieI, const scalar T) const;
//- Sensible internal energy [J/kg]
virtual scalar Es(const label specieI, const scalar T) const;
//- Gibbs free energy [J/kg]
virtual scalar G(const label specieI, const scalar T) const;
//- Helmholtz free energy [J/kg]
virtual scalar A(const label specieI, const scalar T) const;
// Per specie transport properties
//- Dynamic viscosity [kg/m/s]
virtual scalar mu(const label specieI, const scalar T) const;
//- Thermal conductivity [W/m/K]
virtual scalar kappa(const label specieI, const scalar T) const;
//- Thermal diffusivity of enthalpy [kg/m/s]
virtual scalar alphah(const label specieI, const scalar T) const;
};

View File

@ -136,155 +136,4 @@ const ThermoType& Foam::inhomogeneousMixture<ThermoType>::getLocalThermo
}
template<class ThermoType>
Foam::scalar Foam::inhomogeneousMixture<ThermoType>::nMoles
(
const label specieI
) const
{
return getLocalThermo(specieI).nMoles();
}
template<class ThermoType>
Foam::scalar Foam::inhomogeneousMixture<ThermoType>::W
(
const label specieI
) const
{
return getLocalThermo(specieI).W();
}
template<class ThermoType>
Foam::scalar Foam::inhomogeneousMixture<ThermoType>::Cp
(
const label specieI,
const scalar T
) const
{
return getLocalThermo(specieI).Cp(T);
}
template<class ThermoType>
Foam::scalar Foam::inhomogeneousMixture<ThermoType>::Cv
(
const label specieI,
const scalar T
) const
{
return getLocalThermo(specieI).Cv(T);
}
template<class ThermoType>
Foam::scalar Foam::inhomogeneousMixture<ThermoType>::Ha
(
const label specieI,
const scalar T
) const
{
return getLocalThermo(specieI).Ha(T);
}
template<class ThermoType>
Foam::scalar Foam::inhomogeneousMixture<ThermoType>::Hs
(
const label specieI,
const scalar T
) const
{
return getLocalThermo(specieI).Hs(T);
}
template<class ThermoType>
Foam::scalar Foam::inhomogeneousMixture<ThermoType>::Hc
(
const label specieI
) const
{
return getLocalThermo(specieI).Hc();
}
template<class ThermoType>
Foam::scalar Foam::inhomogeneousMixture<ThermoType>::S
(
const label specieI,
const scalar T
) const
{
return getLocalThermo(specieI).S(T);
}
template<class ThermoType>
Foam::scalar Foam::inhomogeneousMixture<ThermoType>::Es
(
const label specieI,
const scalar T
) const
{
return getLocalThermo(specieI).Es(T);
}
template<class ThermoType>
Foam::scalar Foam::inhomogeneousMixture<ThermoType>::G
(
const label specieI,
const scalar T
) const
{
return getLocalThermo(specieI).G(T);
}
template<class ThermoType>
Foam::scalar Foam::inhomogeneousMixture<ThermoType>::A
(
const label specieI,
const scalar T
) const
{
return getLocalThermo(specieI).A(T);
}
template<class ThermoType>
Foam::scalar Foam::inhomogeneousMixture<ThermoType>::mu
(
const label specieI,
const scalar T
) const
{
return getLocalThermo(specieI).mu(T);
}
template<class ThermoType>
Foam::scalar Foam::inhomogeneousMixture<ThermoType>::kappa
(
const label specieI,
const scalar T
) const
{
return getLocalThermo(specieI).kappa(T);
}
template<class ThermoType>
Foam::scalar Foam::inhomogeneousMixture<ThermoType>::alphah
(
const label specieI,
const scalar T
) const
{
return getLocalThermo(specieI).alphah(T);
}
// ************************************************************************* //

View File

@ -159,57 +159,6 @@ public:
//- Return thermo based on index
const ThermoType& getLocalThermo(const label specieI) const;
// Per specie properties
//- Number of moles []
virtual scalar nMoles(const label specieI) const;
//- Molecular weight [kg/kmol]
virtual scalar W(const label specieI) const;
// Per specie thermo properties
//- Heat capacity at constant pressure [J/(kg K)]
virtual scalar Cp(const label specieI, const scalar T) const;
//- Heat capacity at constant volume [J/(kg K)]
virtual scalar Cv(const label specieI, const scalar T) const;
//- Absolute enthalpy [J/kg]
virtual scalar Ha(const label specieI, const scalar T) const;
//- Sensible enthalpy [J/kg]
virtual scalar Hs(const label specieI, const scalar T) const;
//- Chemical enthalpy [J/kg]
virtual scalar Hc(const label specieI) const;
//- Entropy [J/(kg K)]
virtual scalar S(const label specieI, const scalar T) const;
//- Sensible internal energy [J/kg]
virtual scalar Es(const label specieI, const scalar T) const;
//- Gibbs free energy [J/kg]
virtual scalar G(const label specieI, const scalar T) const;
//- Helmholtz free energy [J/kg]
virtual scalar A(const label specieI, const scalar T) const;
// Per specie transport properties
//- Dynamic viscosity [kg/m/s]
virtual scalar mu(const label specieI, const scalar T) const;
//- Thermal conductivity [W/m/K]
virtual scalar kappa(const label specieI, const scalar T) const;
//- Thermal diffusivity ofu enthalpy [kg/m/s]
virtual scalar alphah(const label specieI, const scalar T) const;
};

View File

@ -161,155 +161,4 @@ void Foam::multiComponentMixture<ThermoType>::read
}
template<class ThermoType>
Foam::scalar Foam::multiComponentMixture<ThermoType>::nMoles
(
const label specieI
) const
{
return speciesData_[specieI].nMoles();
}
template<class ThermoType>
Foam::scalar Foam::multiComponentMixture<ThermoType>::W
(
const label specieI
) const
{
return speciesData_[specieI].W();
}
template<class ThermoType>
Foam::scalar Foam::multiComponentMixture<ThermoType>::Cp
(
const label specieI,
const scalar T
) const
{
return speciesData_[specieI].Cp(T);
}
template<class ThermoType>
Foam::scalar Foam::multiComponentMixture<ThermoType>::Cv
(
const label specieI,
const scalar T
) const
{
return speciesData_[specieI].Cv(T);
}
template<class ThermoType>
Foam::scalar Foam::multiComponentMixture<ThermoType>::Ha
(
const label specieI,
const scalar T
) const
{
return speciesData_[specieI].Ha(T);
}
template<class ThermoType>
Foam::scalar Foam::multiComponentMixture<ThermoType>::Hs
(
const label specieI,
const scalar T
) const
{
return speciesData_[specieI].Hs(T);
}
template<class ThermoType>
Foam::scalar Foam::multiComponentMixture<ThermoType>::Hc
(
const label specieI
) const
{
return speciesData_[specieI].Hc();
}
template<class ThermoType>
Foam::scalar Foam::multiComponentMixture<ThermoType>::S
(
const label specieI,
const scalar T
) const
{
return speciesData_[specieI].S(T);
}
template<class ThermoType>
Foam::scalar Foam::multiComponentMixture<ThermoType>::Es
(
const label specieI,
const scalar T
) const
{
return speciesData_[specieI].Es(T);
}
template<class ThermoType>
Foam::scalar Foam::multiComponentMixture<ThermoType>::G
(
const label specieI,
const scalar T
) const
{
return speciesData_[specieI].G(T);
}
template<class ThermoType>
Foam::scalar Foam::multiComponentMixture<ThermoType>::A
(
const label specieI,
const scalar T
) const
{
return speciesData_[specieI].A(T);
}
template<class ThermoType>
Foam::scalar Foam::multiComponentMixture<ThermoType>::mu
(
const label specieI,
const scalar T
) const
{
return speciesData_[specieI].mu(T);
}
template<class ThermoType>
Foam::scalar Foam::multiComponentMixture<ThermoType>::kappa
(
const label specieI,
const scalar T
) const
{
return speciesData_[specieI].kappa(T);
}
template<class ThermoType>
Foam::scalar Foam::multiComponentMixture<ThermoType>::alphah
(
const label specieI,
const scalar T
) const
{
return speciesData_[specieI].alphah(T);
}
// ************************************************************************* //

View File

@ -119,56 +119,11 @@ public:
//- Read dictionary
void read(const dictionary&);
// Per specie properties
//- Number of moles []
virtual scalar nMoles(const label specieI) const;
//- Molecular weight [kg/kmol]
virtual scalar W(const label specieI) const;
// Per specie thermo properties
//- Heat capacity at constant pressure [J/(kg K)]
virtual scalar Cp(const label specieI, const scalar T) const;
//- Heat capacity at constant volume [J/(kg K)]
virtual scalar Cv(const label specieI, const scalar T) const;
//- Absolute enthalpy [J/kg]
virtual scalar Ha(const label specieI, const scalar T) const;
//- Sensible enthalpy [J/kg]
virtual scalar Hs(const label specieI, const scalar T) const;
//- Chemical enthalpy [J/kg]
virtual scalar Hc(const label specieI) const;
//- Entropy [J/(kg K)]
virtual scalar S(const label specieI, const scalar T) const;
//- Sensible internal energy [J/kg]
virtual scalar Es(const label specieI, const scalar T) const;
//- Gibbs free energy [J/kg]
virtual scalar G(const label specieI, const scalar T) const;
//- Helmholtz free energy [J/kg]
virtual scalar A(const label specieI, const scalar T) const;
// Per specie transport properties
//- Dynamic viscosity [kg/m/s]
virtual scalar mu(const label specieI, const scalar T) const;
//- Thermal conductivity [W/m/K]
virtual scalar kappa(const label specieI, const scalar T) const;
//- Thermal diffusivity of enthalpy [kg/m/s]
virtual scalar alphah(const label specieI, const scalar T) const;
//- Return thermo based on index
inline const ThermoType& getLocalThermo(const label speciei) const
{
return speciesData_[speciei];
}
};

View File

@ -137,155 +137,4 @@ const ThermoType& Foam::veryInhomogeneousMixture<ThermoType>::getLocalThermo
}
template<class ThermoType>
Foam::scalar Foam::veryInhomogeneousMixture<ThermoType>::nMoles
(
const label specieI
) const
{
return getLocalThermo(specieI).nMoles();
}
template<class ThermoType>
Foam::scalar Foam::veryInhomogeneousMixture<ThermoType>::W
(
const label specieI
) const
{
return getLocalThermo(specieI).W();
}
template<class ThermoType>
Foam::scalar Foam::veryInhomogeneousMixture<ThermoType>::Cp
(
const label specieI,
const scalar T
) const
{
return getLocalThermo(specieI).Cp(T);
}
template<class ThermoType>
Foam::scalar Foam::veryInhomogeneousMixture<ThermoType>::Cv
(
const label specieI,
const scalar T
) const
{
return getLocalThermo(specieI).Cv(T);
}
template<class ThermoType>
Foam::scalar Foam::veryInhomogeneousMixture<ThermoType>::Ha
(
const label specieI,
const scalar T
) const
{
return getLocalThermo(specieI).Ha(T);
}
template<class ThermoType>
Foam::scalar Foam::veryInhomogeneousMixture<ThermoType>::Hs
(
const label specieI,
const scalar T
) const
{
return getLocalThermo(specieI).Hs(T);
}
template<class ThermoType>
Foam::scalar Foam::veryInhomogeneousMixture<ThermoType>::Hc
(
const label specieI
) const
{
return getLocalThermo(specieI).Hc();
}
template<class ThermoType>
Foam::scalar Foam::veryInhomogeneousMixture<ThermoType>::S
(
const label specieI,
const scalar T
) const
{
return getLocalThermo(specieI).S(T);
}
template<class ThermoType>
Foam::scalar Foam::veryInhomogeneousMixture<ThermoType>::Es
(
const label specieI,
const scalar T
) const
{
return getLocalThermo(specieI).Es(T);
}
template<class ThermoType>
Foam::scalar Foam::veryInhomogeneousMixture<ThermoType>::G
(
const label specieI,
const scalar T
) const
{
return getLocalThermo(specieI).G(T);
}
template<class ThermoType>
Foam::scalar Foam::veryInhomogeneousMixture<ThermoType>::A
(
const label specieI,
const scalar T
) const
{
return getLocalThermo(specieI).A(T);
}
template<class ThermoType>
Foam::scalar Foam::veryInhomogeneousMixture<ThermoType>::mu
(
const label specieI,
const scalar T
) const
{
return getLocalThermo(specieI).mu(T);
}
template<class ThermoType>
Foam::scalar Foam::veryInhomogeneousMixture<ThermoType>::kappa
(
const label specieI,
const scalar T
) const
{
return getLocalThermo(specieI).kappa(T);
}
template<class ThermoType>
Foam::scalar Foam::veryInhomogeneousMixture<ThermoType>::alphah
(
const label specieI,
const scalar T
) const
{
return getLocalThermo(specieI).alphah(T);
}
// ************************************************************************* //

View File

@ -160,57 +160,6 @@ public:
//- Return thermo based on index
const ThermoType& getLocalThermo(const label specieI) const;
// Per specie properties
//- Number of moles []
virtual scalar nMoles(const label specieI) const;
//- Molecular weight [kg/kmol]
virtual scalar W(const label specieI) const;
// Per specie thermo properties
//- Heat capacity at constant pressure [J/(kg K)]
virtual scalar Cp(const label specieI, const scalar T) const;
//- Heat capacity at constant volume [J/(kg K)]
virtual scalar Cv(const label specieI, const scalar T) const;
//- Absolute enthalpy [J/kg]
virtual scalar Ha(const label specieI, const scalar T) const;
//- Sensible enthalpy [J/kg]
virtual scalar Hs(const label specieI, const scalar T) const;
//- Chemical enthalpy [J/kg]
virtual scalar Hc(const label specieI) const;
//- Entropy [J/(kg K)]
virtual scalar S(const label specieI, const scalar T) const;
//- Sensible internal energy [J/kg]
virtual scalar Es(const label specieI, const scalar T) const;
//- Gibbs free energy [J/kg]
virtual scalar G(const label specieI, const scalar T) const;
//- Helmholtz free energy [J/kg]
virtual scalar A(const label specieI, const scalar T) const;
// Per specie transport properties
//- Dynamic viscosity [kg/m/s]
virtual scalar mu(const label specieI, const scalar T) const;
//- Thermal conductivity [W/m/K]
virtual scalar kappa(const label specieI, const scalar T) const;
//- Thermal diffusivity of enthalpy [kg/m/s]
virtual scalar alphah(const label specieI, const scalar T) const;
};

View File

@ -45,11 +45,17 @@ void Foam::hePsiReactionThermo<MixtureType>::calculate()
const typename MixtureType::thermoType& mixture =
this->cellMixture(celli);
TCells[celli] = mixture.THE(hCells[celli], TCells[celli]);
TCells[celli] = mixture.THE
(
hCells[celli],
pCells[celli],
TCells[celli]
);
psiCells[celli] = mixture.psi(pCells[celli], TCells[celli]);
muCells[celli] = mixture.mu(TCells[celli]);
alphaCells[celli] = mixture.alphah(TCells[celli]);
muCells[celli] = mixture.mu(pCells[celli], TCells[celli]);
alphaCells[celli] = mixture.alphah(pCells[celli], TCells[celli]);
}
forAll(this->T_.boundaryField(), patchi)
@ -70,11 +76,11 @@ void Foam::hePsiReactionThermo<MixtureType>::calculate()
const typename MixtureType::thermoType& mixture =
this->patchFaceMixture(patchi, facei);
ph[facei] = mixture.HE(pT[facei]);
ph[facei] = mixture.HE(pp[facei], pT[facei]);
ppsi[facei] = mixture.psi(pp[facei], pT[facei]);
pmu_[facei] = mixture.mu(pT[facei]);
palpha_[facei] = mixture.alphah(pT[facei]);
pmu_[facei] = mixture.mu(pp[facei], pT[facei]);
palpha_[facei] = mixture.alphah(pp[facei], pT[facei]);
}
}
else
@ -84,11 +90,11 @@ void Foam::hePsiReactionThermo<MixtureType>::calculate()
const typename MixtureType::thermoType& mixture =
this->patchFaceMixture(patchi, facei);
pT[facei] = mixture.THE(ph[facei], pT[facei]);
pT[facei] = mixture.THE(ph[facei], pp[facei], pT[facei]);
ppsi[facei] = mixture.psi(pp[facei], pT[facei]);
pmu_[facei] = mixture.mu(pT[facei]);
palpha_[facei] = mixture.alphah(pT[facei]);
pmu_[facei] = mixture.mu(pp[facei], pT[facei]);
palpha_[facei] = mixture.alphah(pp[facei], pT[facei]);
}
}
}

View File

@ -47,14 +47,24 @@ void Foam::heheuReactionThermo<MixtureType>::calculate()
const typename MixtureType::thermoType& mixture_ =
this->cellMixture(celli);
TCells[celli] = mixture_.THE(hCells[celli], TCells[celli]);
TCells[celli] = mixture_.THE
(
hCells[celli],
pCells[celli],
TCells[celli]
);
psiCells[celli] = mixture_.psi(pCells[celli], TCells[celli]);
muCells[celli] = mixture_.mu(TCells[celli]);
alphaCells[celli] = mixture_.alphah(TCells[celli]);
muCells[celli] = mixture_.mu(pCells[celli], TCells[celli]);
alphaCells[celli] = mixture_.alphah(pCells[celli], TCells[celli]);
TuCells[celli] =
this->cellReactants(celli).THE(heuCells[celli], TuCells[celli]);
TuCells[celli] = this->cellReactants(celli).THE
(
heuCells[celli],
pCells[celli],
TuCells[celli]
);
}
forAll(this->T_.boundaryField(), patchi)
@ -77,11 +87,11 @@ void Foam::heheuReactionThermo<MixtureType>::calculate()
const typename MixtureType::thermoType& mixture_ =
this->patchFaceMixture(patchi, facei);
ph[facei] = mixture_.HE(pT[facei]);
ph[facei] = mixture_.HE(pp[facei], pT[facei]);
ppsi[facei] = mixture_.psi(pp[facei], pT[facei]);
pmu_[facei] = mixture_.mu(pT[facei]);
palpha_[facei] = mixture_.alphah(pT[facei]);
pmu_[facei] = mixture_.mu(pp[facei], pT[facei]);
palpha_[facei] = mixture_.alphah(pp[facei], pT[facei]);
}
}
else
@ -91,15 +101,15 @@ void Foam::heheuReactionThermo<MixtureType>::calculate()
const typename MixtureType::thermoType& mixture_ =
this->patchFaceMixture(patchi, facei);
pT[facei] = mixture_.THE(ph[facei], pT[facei]);
pT[facei] = mixture_.THE(ph[facei], pp[facei], pT[facei]);
ppsi[facei] = mixture_.psi(pp[facei], pT[facei]);
pmu_[facei] = mixture_.mu(pT[facei]);
palpha_[facei] = mixture_.alphah(pT[facei]);
pmu_[facei] = mixture_.mu(pp[facei], pT[facei]);
palpha_[facei] = mixture_.alphah(pp[facei], pT[facei]);
pTu[facei] =
this->patchFaceReactants(patchi, facei)
.THE(pheu[facei], pTu[facei]);
.THE(pheu[facei], pp[facei], pTu[facei]);
}
}
}
@ -141,22 +151,31 @@ Foam::heheuReactionThermo<MixtureType>::heheuReactionThermo(const fvMesh& mesh)
)
{
scalarField& heuCells = this->heu_.internalField();
const scalarField& pCells = this->p_.internalField();
const scalarField& TuCells = this->Tu_.internalField();
forAll(heuCells, celli)
{
heuCells[celli] = this->cellReactants(celli).HE(TuCells[celli]);
heuCells[celli] = this->cellReactants(celli).HE
(
pCells[celli],
TuCells[celli]
);
}
forAll(this->heu_.boundaryField(), patchi)
{
fvPatchScalarField& pheu = this->heu_.boundaryField()[patchi];
const fvPatchScalarField& pp = this->p_.boundaryField()[patchi];
const fvPatchScalarField& pTu = this->Tu_.boundaryField()[patchi];
forAll(pheu, facei)
{
pheu[facei] =
this->patchFaceReactants(patchi, facei).HE(pTu[facei]);
pheu[facei] = this->patchFaceReactants(patchi, facei).HE
(
pp[facei],
pTu[facei]
);
}
}
@ -200,6 +219,7 @@ template<class MixtureType>
Foam::tmp<Foam::scalarField>
Foam::heheuReactionThermo<MixtureType>::heu
(
const scalarField& p,
const scalarField& Tu,
const labelList& cells
) const
@ -209,7 +229,7 @@ Foam::heheuReactionThermo<MixtureType>::heu
forAll(Tu, celli)
{
heu[celli] = this->cellReactants(cells[celli]).HE(Tu[celli]);
heu[celli] = this->cellReactants(cells[celli]).HE(p[celli], Tu[celli]);
}
return theu;
@ -220,6 +240,7 @@ template<class MixtureType>
Foam::tmp<Foam::scalarField>
Foam::heheuReactionThermo<MixtureType>::heu
(
const scalarField& p,
const scalarField& Tu,
const label patchi
) const
@ -229,7 +250,8 @@ Foam::heheuReactionThermo<MixtureType>::heu
forAll(Tu, facei)
{
heu[facei] = this->patchFaceReactants(patchi, facei).HE(Tu[facei]);
heu[facei] =
this->patchFaceReactants(patchi, facei).HE(p[facei], Tu[facei]);
}
return theu;
@ -258,13 +280,18 @@ Foam::heheuReactionThermo<MixtureType>::Tb() const
volScalarField& Tb_ = tTb();
scalarField& TbCells = Tb_.internalField();
const scalarField& pCells = this->p_.internalField();
const scalarField& TCells = this->T_.internalField();
const scalarField& hCells = this->he_.internalField();
forAll(TbCells, celli)
{
TbCells[celli] =
this->cellProducts(celli).THE(hCells[celli], TCells[celli]);
TbCells[celli] = this->cellProducts(celli).THE
(
hCells[celli],
pCells[celli],
TCells[celli]
);
}
forAll(Tb_.boundaryField(), patchi)
@ -272,13 +299,14 @@ Foam::heheuReactionThermo<MixtureType>::Tb() const
fvPatchScalarField& pTb = Tb_.boundaryField()[patchi];
const fvPatchScalarField& ph = this->he_.boundaryField()[patchi];
const fvPatchScalarField& pp = this->p_.boundaryField()[patchi];
const fvPatchScalarField& pT = this->T_.boundaryField()[patchi];
forAll(pTb, facei)
{
pTb[facei] =
this->patchFaceProducts(patchi, facei)
.THE(ph[facei], pT[facei]);
.THE(ph[facei], pp[facei], pT[facei]);
}
}
@ -412,22 +440,31 @@ Foam::heheuReactionThermo<MixtureType>::muu() const
volScalarField& muu_ = tmuu();
scalarField& muuCells = muu_.internalField();
const scalarField& pCells = this->p_.internalField();
const scalarField& TuCells = this->Tu_.internalField();
forAll(muuCells, celli)
{
muuCells[celli] = this->cellReactants(celli).mu(TuCells[celli]);
muuCells[celli] = this->cellReactants(celli).mu
(
pCells[celli],
TuCells[celli]
);
}
forAll(muu_.boundaryField(), patchi)
{
fvPatchScalarField& pMuu = muu_.boundaryField()[patchi];
const fvPatchScalarField& pp = this->p_.boundaryField()[patchi];
const fvPatchScalarField& pTu = this->Tu_.boundaryField()[patchi];
forAll(pMuu, facei)
{
pMuu[facei] =
this->patchFaceReactants(patchi, facei).mu(pTu[facei]);
pMuu[facei] = this->patchFaceReactants(patchi, facei).mu
(
pp[facei],
pTu[facei]
);
}
}
@ -459,22 +496,31 @@ Foam::heheuReactionThermo<MixtureType>::mub() const
volScalarField& mub_ = tmub();
scalarField& mubCells = mub_.internalField();
const volScalarField Tb_(Tb());
const scalarField& pCells = this->p_.internalField();
const scalarField& TbCells = Tb_.internalField();
forAll(mubCells, celli)
{
mubCells[celli] = this->cellProducts(celli).mu(TbCells[celli]);
mubCells[celli] = this->cellProducts(celli).mu
(
pCells[celli],
TbCells[celli]
);
}
forAll(mub_.boundaryField(), patchi)
{
fvPatchScalarField& pMub = mub_.boundaryField()[patchi];
const fvPatchScalarField& pp = this->p_.boundaryField()[patchi];
const fvPatchScalarField& pTb = Tb_.boundaryField()[patchi];
forAll(pMub, facei)
{
pMub[facei] =
this->patchFaceProducts(patchi, facei).mu(pTb[facei]);
pMub[facei] = this->patchFaceProducts(patchi, facei).mu
(
pp[facei],
pTb[facei]
);
}
}

View File

@ -114,6 +114,7 @@ public:
//- Unburnt gas enthalpy for cell-set [J/kg]
virtual tmp<scalarField> heu
(
const scalarField& p,
const scalarField& T,
const labelList& cells
) const;
@ -121,6 +122,7 @@ public:
//- Unburnt gas enthalpy for patch [J/kg]
virtual tmp<scalarField> heu
(
const scalarField& p,
const scalarField& T,
const label patchi
) const;

View File

@ -114,6 +114,7 @@ public:
//- Unburnt gas enthalpy for cell-set [J/kg]
virtual tmp<scalarField> heu
(
const scalarField& p,
const scalarField& T,
const labelList& cells
) const = 0;
@ -121,6 +122,7 @@ public:
//- Unburnt gas enthalpy for patch [J/kg]
virtual tmp<scalarField> heu
(
const scalarField& p,
const scalarField& T,
const label patchi
) const = 0;

View File

@ -46,12 +46,17 @@ void Foam::heRhoReactionThermo<MixtureType>::calculate()
const typename MixtureType::thermoType& mixture =
this->cellMixture(celli);
TCells[celli] = mixture.THE(hCells[celli], TCells[celli]);
TCells[celli] = mixture.THE
(
hCells[celli],
pCells[celli],
TCells[celli]
);
psiCells[celli] = mixture.psi(pCells[celli], TCells[celli]);
rhoCells[celli] = mixture.rho(pCells[celli], TCells[celli]);
muCells[celli] = mixture.mu(TCells[celli]);
alphaCells[celli] = mixture.alphah(TCells[celli]);
muCells[celli] = mixture.mu(pCells[celli], TCells[celli]);
alphaCells[celli] = mixture.alphah(pCells[celli], TCells[celli]);
}
forAll(this->T_.boundaryField(), patchi)
@ -73,12 +78,12 @@ void Foam::heRhoReactionThermo<MixtureType>::calculate()
const typename MixtureType::thermoType& mixture =
this->patchFaceMixture(patchi, facei);
ph[facei] = mixture.HE(pT[facei]);
ph[facei] = mixture.HE(pp[facei], pT[facei]);
ppsi[facei] = mixture.psi(pp[facei], pT[facei]);
prho[facei] = mixture.rho(pp[facei], pT[facei]);
pmu_[facei] = mixture.mu(pT[facei]);
palpha_[facei] = mixture.alphah(pT[facei]);
pmu_[facei] = mixture.mu(pp[facei], pT[facei]);
palpha_[facei] = mixture.alphah(pp[facei], pT[facei]);
}
}
else
@ -88,12 +93,12 @@ void Foam::heRhoReactionThermo<MixtureType>::calculate()
const typename MixtureType::thermoType& mixture =
this->patchFaceMixture(patchi, facei);
pT[facei] = mixture.THE(ph[facei], pT[facei]);
pT[facei] = mixture.THE(ph[facei], pp[facei], pT[facei]);
ppsi[facei] = mixture.psi(pp[facei], pT[facei]);
prho[facei] = mixture.rho(pp[facei], pT[facei]);
pmu_[facei] = mixture.mu(pT[facei]);
palpha_[facei] = mixture.alphah(pT[facei]);
pmu_[facei] = mixture.mu(pp[facei], pT[facei]);
palpha_[facei] = mixture.alphah(pp[facei], pT[facei]);
}
}
}

View File

@ -737,6 +737,7 @@ template<class CompType, class SolidThermo,class GasThermo>
Foam::tmp<Foam::volScalarField>
Foam::ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::gasHs
(
const volScalarField& p,
const volScalarField& T,
const label index
) const
@ -766,7 +767,7 @@ Foam::ODESolidChemistryModel<CompType, SolidThermo, GasThermo>::gasHs
forAll(gasHs, cellI)
{
gasHs[cellI] = mixture.Hs(T[cellI]);
gasHs[cellI] = mixture.Hs(p[cellI], T[cellI]);
}
return tHs;

View File

@ -220,6 +220,7 @@ public:
//- Return sensible enthalpy for gas i [J/Kg]
virtual tmp<volScalarField> gasHs
(
const volScalarField& p,
const volScalarField& T,
const label i
) const;

View File

@ -138,6 +138,7 @@ public:
//- Return sensible enthalpy for gas i [J/Kg]
virtual tmp<volScalarField> gasHs
(
const volScalarField& p,
const volScalarField& T,
const label i
) const = 0;

View File

@ -100,7 +100,7 @@ Foam::scalar Foam::ReversibleReaction<ReactionThermo, ReactionRate>::kr
const scalarField& c
) const
{
return kfwd/this->Kc(T);
return kfwd/this->Kc(p, T);
}

View File

@ -65,35 +65,60 @@ public:
}
// Absolute enthalpy [J/kmol]
scalar he(const Thermo& thermo, const scalar T) const
scalar he
(
const Thermo& thermo,
const scalar p,
const scalar T
) const
{
return thermo.ha(T);
return thermo.ha(p, T);
}
// Heat capacity at constant pressure [J/(kmol K)]
scalar cpv(const Thermo& thermo, const scalar T) const
scalar cpv
(
const Thermo& thermo,
const scalar p,
const scalar T
) const
{
return thermo.cp(T);
return thermo.cp(p, T);
}
//- cp/cp []
scalar cpBycpv(const Thermo& thermo, const scalar T) const
scalar cpBycpv
(
const Thermo& thermo,
const scalar p,
const scalar T
) const
{
return 1;
}
// Absolute enthalpy [J/kg]
scalar HE(const Thermo& thermo, const scalar T) const
scalar HE
(
const Thermo& thermo,
const scalar p,
const scalar T
) const
{
return thermo.Ha(T);
return thermo.Ha(p, T);
}
//- Temperature from absolute enthalpy
// given an initial temperature T0
scalar THE(const Thermo& thermo, const scalar h, const scalar T0)
const
scalar THE
(
const Thermo& thermo,
const scalar h,
const scalar p,
const scalar T0
) const
{
return thermo.THa(h, T0);
return thermo.THa(h, p, T0);
}
};

View File

@ -141,19 +141,19 @@ public:
// Fundamental properties
//- Heat capacity at constant pressure [J/(kmol K)]
inline scalar cp(const scalar T) const;
inline scalar cp(const scalar p, const scalar T) const;
//- Absolute Enthalpy [J/kmol]
inline scalar ha(const scalar T) const;
inline scalar ha(const scalar p, const scalar T) const;
//- Sensible Enthalpy [J/kmol]
inline scalar hs(const scalar T) const;
inline scalar hs(const scalar p, const scalar T) const;
//- Chemical enthalpy [J/kmol]
inline scalar hc() const;
//- Entropy [J/(kmol K)]
inline scalar s(const scalar T) const;
inline scalar s(const scalar p, const scalar T) const;
// I-O

View File

@ -102,7 +102,8 @@ inline Foam::scalar Foam::eConstThermo<EquationOfState>::limit
template<class EquationOfState>
inline Foam::scalar Foam::eConstThermo<EquationOfState>::cp
(
const scalar
const scalar p,
const scalar T
) const
{
return Cv_*this->W() + specie::RR;
@ -112,20 +113,22 @@ inline Foam::scalar Foam::eConstThermo<EquationOfState>::cp
template<class EquationOfState>
inline Foam::scalar Foam::eConstThermo<EquationOfState>::ha
(
const scalar p,
const scalar T
) const
{
return cp(T)*T + Hf_*this->W();
return cp(p, T)*T + Hf_*this->W();
}
template<class EquationOfState>
inline Foam::scalar Foam::eConstThermo<EquationOfState>::hs
(
const scalar p,
const scalar T
) const
{
return cp(T)*T;
return cp(p, T)*T;
}
@ -139,12 +142,14 @@ inline Foam::scalar Foam::eConstThermo<EquationOfState>::hc() const
template<class EquationOfState>
inline Foam::scalar Foam::eConstThermo<EquationOfState>::s
(
const scalar p,
const scalar T
) const
{
notImplemented
(
"scalar eConstThermo<EquationOfState>::s(const scalar) const"
"scalar eConstThermo<EquationOfState>::"
"s(const scalar p, const scalar) const"
);
return T;
}

View File

@ -139,19 +139,19 @@ public:
// Fundamental properties
//- Heat capacity at constant pressure [J/(kmol K)]
inline scalar cp(const scalar T) const;
inline scalar cp(const scalar p, const scalar T) const;
//- Absolute Enthalpy [J/kmol]
inline scalar ha(const scalar T) const;
inline scalar ha(const scalar p, const scalar T) const;
//- Sensible enthalpy [J/kmol]
inline scalar hs(const scalar T) const;
inline scalar hs(const scalar p, const scalar T) const;
//- Chemical enthalpy [J/kmol]
inline scalar hc() const;
//- Entropy [J/(kmol K)]
inline scalar s(const scalar T) const;
inline scalar s(const scalar p, const scalar T) const;
// I-O

View File

@ -102,7 +102,8 @@ inline Foam::scalar Foam::hConstThermo<EquationOfState>::limit
template<class equationOfState>
inline Foam::scalar Foam::hConstThermo<equationOfState>::cp
(
const scalar
const scalar p,
const scalar T
) const
{
return Cp_*this->W();
@ -112,7 +113,7 @@ inline Foam::scalar Foam::hConstThermo<equationOfState>::cp
template<class equationOfState>
inline Foam::scalar Foam::hConstThermo<equationOfState>::ha
(
const scalar T
const scalar p, const scalar T
) const
{
return (Cp_*T + Hf_)*this->W();
@ -122,7 +123,7 @@ inline Foam::scalar Foam::hConstThermo<equationOfState>::ha
template<class equationOfState>
inline Foam::scalar Foam::hConstThermo<equationOfState>::hs
(
const scalar T
const scalar p, const scalar T
) const
{
return Cp_*T*this->W();
@ -139,12 +140,13 @@ inline Foam::scalar Foam::hConstThermo<equationOfState>::hc() const
template<class equationOfState>
inline Foam::scalar Foam::hConstThermo<equationOfState>::s
(
const scalar T
const scalar p, const scalar T
) const
{
notImplemented
(
"scalar hConstThermo<equationOfState>::s(const scalar T) const"
"scalar hConstThermo<equationOfState>::"
"s(const scalar p, const scalar T) const"
);
return T;
}

View File

@ -152,24 +152,24 @@ public:
// Member Functions
//- Limit the temperature to be in the range Tlow_ to Thigh_
inline scalar limit(const scalar T) const;
inline scalar limit(const scalar) const;
// Fundamental properties
//- Heat capacity at constant pressure [J/(kmol K)]
inline scalar cp(const scalar T) const;
inline scalar cp(const scalar p, const scalar T) const;
//- Absolute Enthalpy [J/kmol]
inline scalar ha(const scalar T) const;
inline scalar ha(const scalar p, const scalar T) const;
//- Sensible enthalpy [J/kmol]
inline scalar hs(const scalar T) const;
inline scalar hs(const scalar p, const scalar T) const;
//- Chemical enthalpy [J/kmol]
inline scalar hc() const;
//- Entropy [J/(kmol K)]
inline scalar s(const scalar T) const;
inline scalar s(const scalar p, const scalar T) const;
// I-O

View File

@ -95,7 +95,7 @@ inline Foam::scalar Foam::hPolynomialThermo<EquationOfState, PolySize>::limit
template<class EquationOfState, int PolySize>
inline Foam::scalar Foam::hPolynomialThermo<EquationOfState, PolySize>::cp
(
const scalar T
const scalar p, const scalar T
) const
{
return CpCoeffs_.value(T);
@ -105,7 +105,7 @@ inline Foam::scalar Foam::hPolynomialThermo<EquationOfState, PolySize>::cp
template<class EquationOfState, int PolySize>
inline Foam::scalar Foam::hPolynomialThermo<EquationOfState, PolySize>::ha
(
const scalar T
const scalar p, const scalar T
) const
{
return hCoeffs_.value(T);
@ -115,10 +115,10 @@ inline Foam::scalar Foam::hPolynomialThermo<EquationOfState, PolySize>::ha
template<class EquationOfState, int PolySize>
inline Foam::scalar Foam::hPolynomialThermo<EquationOfState, PolySize>::hs
(
const scalar T
const scalar p, const scalar T
) const
{
return ha(T) - hc();
return ha(p, T) - hc();
}
@ -133,6 +133,7 @@ const
template<class EquationOfState, int PolySize>
inline Foam::scalar Foam::hPolynomialThermo<EquationOfState, PolySize>::s
(
const scalar p,
const scalar T
) const
{

View File

@ -175,19 +175,19 @@ public:
// Fundamental properties
//- Heat capacity at constant pressure [J/(kmol K)]
inline scalar cp(const scalar T) const;
inline scalar cp(const scalar p, const scalar T) const;
//- Absolute Enthalpy [J/kmol]
inline scalar ha(const scalar T) const;
inline scalar ha(const scalar p, const scalar T) const;
//- Sensible enthalpy [J/kmol]
inline scalar hs(const scalar T) const;
inline scalar hs(const scalar p, const scalar T) const;
//- Chemical enthalpy [J/kmol]
inline scalar hc() const;
//- Entropy [J/(kmol K)]
inline scalar s(const scalar T) const;
inline scalar s(const scalar p, const scalar T) const;
// I-O

View File

@ -159,6 +159,7 @@ Foam::janafThermo<EquationOfState>::lowCpCoeffs() const
template<class EquationOfState>
inline Foam::scalar Foam::janafThermo<EquationOfState>::cp
(
const scalar p,
const scalar T
) const
{
@ -170,6 +171,7 @@ inline Foam::scalar Foam::janafThermo<EquationOfState>::cp
template<class EquationOfState>
inline Foam::scalar Foam::janafThermo<EquationOfState>::ha
(
const scalar p,
const scalar T
) const
{
@ -185,10 +187,11 @@ inline Foam::scalar Foam::janafThermo<EquationOfState>::ha
template<class EquationOfState>
inline Foam::scalar Foam::janafThermo<EquationOfState>::hs
(
const scalar p,
const scalar T
) const
{
return ha(T) - hc();
return ha(p, T) - hc();
}
@ -210,6 +213,7 @@ inline Foam::scalar Foam::janafThermo<EquationOfState>::hc() const
template<class EquationOfState>
inline Foam::scalar Foam::janafThermo<EquationOfState>::s
(
const scalar p,
const scalar T
) const
{

View File

@ -65,35 +65,60 @@ public:
}
// Sensible enthalpy [J/kmol]
scalar he(const Thermo& thermo, const scalar T) const
scalar he
(
const Thermo& thermo,
const scalar p,
const scalar T
) const
{
return thermo.hs(T);
return thermo.hs(p, T);
}
// Heat capacity at constant pressure [J/(kmol K)]
scalar cpv(const Thermo& thermo, const scalar T) const
scalar cpv
(
const Thermo& thermo,
const scalar p,
const scalar T
) const
{
return thermo.cp(T);
return thermo.cp(p, T);
}
//- cp/cp []
scalar cpBycpv(const Thermo& thermo, const scalar T) const
scalar cpBycpv
(
const Thermo& thermo,
const scalar p,
const scalar T
) const
{
return 1;
}
// Sensible enthalpy [J/kg]
scalar HE(const Thermo& thermo, const scalar T) const
scalar HE
(
const Thermo& thermo,
const scalar p,
const scalar T
) const
{
return thermo.Hs(T);
return thermo.Hs(p, T);
}
//- Temperature from sensible enthalpy
// given an initial temperature T0
scalar THE(const Thermo& thermo, const scalar h, const scalar T0)
const
scalar THE
(
const Thermo& thermo,
const scalar h,
const scalar p,
const scalar T0
) const
{
return thermo.THs(h, T0);
return thermo.THs(h, p, T0);
}
};

View File

@ -65,35 +65,59 @@ public:
}
//- Sensible Internal energy [J/kmol]
scalar he(const Thermo& thermo, const scalar T) const
scalar he
(
const Thermo& thermo,
const scalar p,
const scalar T) const
{
return thermo.es(T);
return thermo.es(p, T);
}
//- Heat capacity at constant volume [J/(kmol K)]
scalar cpv(const Thermo& thermo, const scalar T) const
scalar cpv
(
const Thermo& thermo,
const scalar p,
const scalar T
) const
{
return thermo.cv(T);
return thermo.cv(p, T);
}
//- cp/cv []
scalar cpBycpv(const Thermo& thermo, const scalar T) const
scalar cpBycpv
(
const Thermo& thermo,
const scalar p,
const scalar T
) const
{
return thermo.gamma(T);
return thermo.gamma(p, T);
}
//- Sensible enthalpy [J/kg]
scalar HE(const Thermo& thermo, const scalar T) const
scalar HE
(
const Thermo& thermo,
const scalar p,
const scalar T
) const
{
return thermo.Es(T);
return thermo.Es(p, T);
}
//- Temperature from sensible internal energy
// given an initial temperature T0
scalar THE(const Thermo& thermo, const scalar e, const scalar T0)
const
scalar THE
(
const Thermo& thermo,
const scalar e,
const scalar p,
const scalar T0
) const
{
return thermo.TEs(e, T0);
return thermo.TEs(e, p, T0);
}
};

View File

@ -105,13 +105,15 @@ class specieThermo
// Private Member Functions
//- Return the temperature corresponding to the value of the
// thermodynamic property f, given the function f = F(T) and dF(T)/dT
// thermodynamic property f, given the function f = F(p, T)
// and dF(p, T)/dT
inline scalar T
(
scalar f,
scalar p,
scalar T0,
scalar (specieThermo::*F)(const scalar) const,
scalar (specieThermo::*dFdT)(const scalar) const,
scalar (specieThermo::*F)(const scalar, const scalar) const,
scalar (specieThermo::*dFdT)(const scalar, const scalar) const,
scalar (specieThermo::*limit)(const scalar) const
) const;
@ -163,108 +165,112 @@ public:
static inline word heName();
//- Enthalpy/Internal energy [J/kmol]
inline scalar he(const scalar T) const;
inline scalar he(const scalar p, const scalar T) const;
//- Heat capacity at constant volume [J/(kmol K)]
inline scalar cv(const scalar T) const;
inline scalar cv(const scalar p, const scalar T) const;
//- Heat capacity at constant pressure/volume [J/(kmol K)]
inline scalar cpv(const scalar T) const;
inline scalar cpv(const scalar p, const scalar T) const;
//- gamma = cp/cv []
inline scalar gamma(const scalar T) const;
inline scalar gamma(const scalar p, const scalar T) const;
//- Ratio of heat capacity at constant pressure to that at
// constant pressure/volume []
inline scalar cpBycpv(const scalar T) const;
inline scalar cpBycpv(const scalar p, const scalar T) const;
//- Sensible internal energy [J/kmol]
inline scalar es(const scalar T) const;
inline scalar es(const scalar p, const scalar T) const;
//- Absolute internal energy [J/kmol]
inline scalar ea(const scalar T) const;
inline scalar ea(const scalar p, const scalar T) const;
//- Gibbs free energy [J/kmol]
inline scalar g(const scalar T) const;
inline scalar g(const scalar p, const scalar T) const;
//- Helmholtz free energy [J/kmol]
inline scalar a(const scalar T) const;
inline scalar a(const scalar p, const scalar T) const;
// Mass specific properties
//- Heat capacity at constant pressure [J/(kg K)]
inline scalar Cp(const scalar T) const;
inline scalar Cp(const scalar p, const scalar T) const;
//- Heat capacity at constant volume [J/(kg K)]
inline scalar Cv(const scalar T) const;
inline scalar Cv(const scalar p, const scalar T) const;
//- Heat capacity at constant pressure/volume [J/(kg K)]
inline scalar Cpv(const scalar T) const;
inline scalar Cpv(const scalar p, const scalar T) const;
//- Enthalpy/Internal energy [J/kg]
inline scalar HE(const scalar T) const;
inline scalar HE(const scalar p, const scalar T) const;
//- Enthalpy [J/kg]
inline scalar H(const scalar T) const;
inline scalar H(const scalar p, const scalar T) const;
//- Sensible enthalpy [J/kg]
inline scalar Hs(const scalar T) const;
inline scalar Hs(const scalar p, const scalar T) const;
//- Chemical enthalpy [J/kg]
inline scalar Hc() const;
//- Absolute Enthalpy [J/kg]
inline scalar Ha(const scalar T) const;
inline scalar Ha(const scalar p, const scalar T) const;
//- Entropy [J/(kg K)]
inline scalar S(const scalar T) const;
inline scalar S(const scalar p, const scalar T) const;
//- Internal energy [J/kg]
inline scalar E(const scalar T) const;
inline scalar E(const scalar p, const scalar T) const;
//- Sensible internal energy [J/kg]
inline scalar Es(const scalar T) const;
inline scalar Es(const scalar p, const scalar T) const;
//- Absolute internal energy [J/kg]
inline scalar Ea(const scalar T) const;
inline scalar Ea(const scalar p, const scalar T) const;
//- Gibbs free energy [J/kg]
inline scalar G(const scalar T) const;
inline scalar G(const scalar p, const scalar T) const;
//- Helmholtz free energy [J/kg]
inline scalar A(const scalar T) const;
inline scalar A(const scalar p, const scalar T) const;
// Equilibrium reaction thermodynamics
//- Equilibrium constant [] i.t.o fugacities
// = PIi(fi/Pstd)^nui
inline scalar K(const scalar T) const;
inline scalar K(const scalar p, const scalar T) const;
//- Equilibrium constant [] i.t.o. partial pressures
// = PIi(pi/Pstd)^nui
// For low pressures (where the gas mixture is near perfect) Kp = K
inline scalar Kp(const scalar T) const;
inline scalar Kp(const scalar p, const scalar T) const;
//- Equilibrium constant i.t.o. molar concentration
// = PIi(ci/cstd)^nui
// For low pressures (where the gas mixture is near perfect)
// Kc = Kp(pstd/(RR*T))^nu
inline scalar Kc(const scalar T) const;
inline scalar Kc(const scalar p, const scalar T) const;
//- Equilibrium constant [] i.t.o. mole-fractions
// For low pressures (where the gas mixture is near perfect)
// Kx = Kp(pstd/p)^nui
inline scalar Kx(const scalar T, const scalar p) const;
inline scalar Kx
(
const scalar p,
const scalar T
) const;
//- Equilibrium constant [] i.t.o. number of moles
// For low pressures (where the gas mixture is near perfect)
// Kn = Kp(n*pstd/p)^nui where n = number of moles in mixture
inline scalar Kn
(
const scalar T,
const scalar p,
const scalar T,
const scalar n
) const;
@ -273,22 +279,47 @@ public:
//- Temperature from enthalpy or internal energy
// given an initial temperature T0
inline scalar THE(const scalar H, const scalar T0) const;
inline scalar THE
(
const scalar H,
const scalar p,
const scalar T0
) const;
//- Temperature from sensible enthalpy given an initial T0
inline scalar THs(const scalar Hs, const scalar T0) const;
inline scalar THs
(
const scalar Hs,
const scalar p,
const scalar T0
) const;
//- Temperature from absolute enthalpy
// given an initial temperature T0
inline scalar THa(const scalar H, const scalar T0) const;
inline scalar THa
(
const scalar H,
const scalar p,
const scalar T0
) const;
//- Temperature from sensible internal energy
// given an initial temperature T0
inline scalar TEs(const scalar E, const scalar T0) const;
inline scalar TEs
(
const scalar E,
const scalar p,
const scalar T0
) const;
//- Temperature from absolute internal energy
// given an initial temperature T0
inline scalar TEa(const scalar E, const scalar T0) const;
inline scalar TEa
(
const scalar E,
const scalar p,
const scalar T0
) const;
// I-O

View File

@ -41,9 +41,11 @@ template<class Thermo, template<class> class Type>
inline Foam::scalar Foam::specieThermo<Thermo, Type>::T
(
scalar f,
scalar p,
scalar T0,
scalar (specieThermo<Thermo, Type>::*F)(const scalar) const,
scalar (specieThermo<Thermo, Type>::*dFdT)(const scalar) const,
scalar (specieThermo<Thermo, Type>::*F)(const scalar, const scalar) const,
scalar (specieThermo<Thermo, Type>::*dFdT)(const scalar, const scalar)
const,
scalar (specieThermo<Thermo, Type>::*limit)(const scalar) const
) const
{
@ -56,7 +58,8 @@ inline Foam::scalar Foam::specieThermo<Thermo, Type>::T
{
Test = Tnew;
Tnew =
(this->*limit)(Test - ((this->*F)(Test) - f)/(this->*dFdT)(Test));
(this->*limit)
(Test - ((this->*F)(p, Test) - f)/(this->*dFdT)(p, Test));
if (iter++ > maxIter_)
{
@ -103,122 +106,122 @@ Foam::specieThermo<Thermo, Type>::heName()
template<class Thermo, template<class> class Type>
inline Foam::scalar
Foam::specieThermo<Thermo, Type>::he(const scalar T) const
Foam::specieThermo<Thermo, Type>::he(const scalar p, const scalar T) const
{
return Type<specieThermo<Thermo, Type> >::he(*this, T);
return Type<specieThermo<Thermo, Type> >::he(*this, p, T);
}
template<class Thermo, template<class> class Type>
inline Foam::scalar
Foam::specieThermo<Thermo, Type>::cv(const scalar T) const
Foam::specieThermo<Thermo, Type>::cv(const scalar p, const scalar T) const
{
return this->cp(T) - this->RR;
return this->cp(p, T) - this->RR;
}
template<class Thermo, template<class> class Type>
inline Foam::scalar
Foam::specieThermo<Thermo, Type>::cpv(const scalar T) const
Foam::specieThermo<Thermo, Type>::cpv(const scalar p, const scalar T) const
{
return Type<specieThermo<Thermo, Type> >::cpv(*this, T);
return Type<specieThermo<Thermo, Type> >::cpv(*this, p, T);
}
template<class Thermo, template<class> class Type>
inline Foam::scalar
Foam::specieThermo<Thermo, Type>::gamma(const scalar T) const
Foam::specieThermo<Thermo, Type>::gamma(const scalar p, const scalar T) const
{
scalar CP = this->cp(T);
scalar CP = this->cp(p, T);
return CP/(CP - this->RR);
}
template<class Thermo, template<class> class Type>
inline Foam::scalar
Foam::specieThermo<Thermo, Type>::cpBycpv(const scalar T) const
Foam::specieThermo<Thermo, Type>::cpBycpv(const scalar p, const scalar T) const
{
return Type<specieThermo<Thermo, Type> >::cpBycpv(*this, T);
return Type<specieThermo<Thermo, Type> >::cpBycpv(*this, p, T);
}
template<class Thermo, template<class> class Type>
inline Foam::scalar
Foam::specieThermo<Thermo, Type>::es(const scalar T) const
Foam::specieThermo<Thermo, Type>::es(const scalar p, const scalar T) const
{
return this->hs(T) - this->RR*(T - this->Tstd);
return this->hs(p, T) - this->RR*(T - this->Tstd);
}
template<class Thermo, template<class> class Type>
inline Foam::scalar
Foam::specieThermo<Thermo, Type>::ea(const scalar T) const
Foam::specieThermo<Thermo, Type>::ea(const scalar p, const scalar T) const
{
return this->ha(T) - this->RR*(T - this->Tstd);
return this->ha(p, T) - this->RR*(T - this->Tstd);
}
template<class Thermo, template<class> class Type>
inline Foam::scalar
Foam::specieThermo<Thermo, Type>::g(const scalar T) const
Foam::specieThermo<Thermo, Type>::g(const scalar p, const scalar T) const
{
return this->ha(T) - T*this->s(T);
return this->ha(p, T) - T*this->s(p, T);
}
template<class Thermo, template<class> class Type>
inline Foam::scalar
Foam::specieThermo<Thermo, Type>::a(const scalar T) const
Foam::specieThermo<Thermo, Type>::a(const scalar p, const scalar T) const
{
return this->ea(T) - T*this->s(T);
return this->ea(p, T) - T*this->s(p, T);
}
template<class Thermo, template<class> class Type>
inline Foam::scalar
Foam::specieThermo<Thermo, Type>::Cpv(const scalar T) const
Foam::specieThermo<Thermo, Type>::Cpv(const scalar p, const scalar T) const
{
return this->cpv(T)/this->W();
return this->cpv(p, T)/this->W();
}
template<class Thermo, template<class> class Type>
inline Foam::scalar
Foam::specieThermo<Thermo, Type>::Cp(const scalar T) const
Foam::specieThermo<Thermo, Type>::Cp(const scalar p, const scalar T) const
{
return this->cp(T)/this->W();
return this->cp(p, T)/this->W();
}
template<class Thermo, template<class> class Type>
inline Foam::scalar
Foam::specieThermo<Thermo, Type>::Cv(const scalar T) const
Foam::specieThermo<Thermo, Type>::Cv(const scalar p, const scalar T) const
{
return this->cv(T)/this->W();
return this->cv(p, T)/this->W();
}
template<class Thermo, template<class> class Type>
inline Foam::scalar
Foam::specieThermo<Thermo, Type>::HE(const scalar T) const
Foam::specieThermo<Thermo, Type>::HE(const scalar p, const scalar T) const
{
return Type<specieThermo<Thermo, Type> >::HE(*this, T);
return Type<specieThermo<Thermo, Type> >::HE(*this, p, T);
}
template<class Thermo, template<class> class Type>
inline Foam::scalar
Foam::specieThermo<Thermo, Type>::H(const scalar T) const
Foam::specieThermo<Thermo, Type>::H(const scalar p, const scalar T) const
{
return this->h(T)/this->W();
return this->h(p, T)/this->W();
}
template<class Thermo, template<class> class Type>
inline Foam::scalar
Foam::specieThermo<Thermo, Type>::Hs(const scalar T) const
Foam::specieThermo<Thermo, Type>::Hs(const scalar p, const scalar T) const
{
return this->hs(T)/this->W();
return this->hs(p, T)/this->W();
}
@ -232,64 +235,64 @@ Foam::specieThermo<Thermo, Type>::Hc() const
template<class Thermo, template<class> class Type>
inline Foam::scalar
Foam::specieThermo<Thermo, Type>::Ha(const scalar T) const
Foam::specieThermo<Thermo, Type>::Ha(const scalar p, const scalar T) const
{
return this->ha(T)/this->W();
return this->ha(p, T)/this->W();
}
template<class Thermo, template<class> class Type>
inline Foam::scalar
Foam::specieThermo<Thermo, Type>::S(const scalar T) const
Foam::specieThermo<Thermo, Type>::S(const scalar p, const scalar T) const
{
return this->s(T)/this->W();
return this->s(p, T)/this->W();
}
template<class Thermo, template<class> class Type>
inline Foam::scalar
Foam::specieThermo<Thermo, Type>::E(const scalar T) const
Foam::specieThermo<Thermo, Type>::E(const scalar p, const scalar T) const
{
return this->e(T)/this->W();
return this->e(p, T)/this->W();
}
template<class Thermo, template<class> class Type>
inline Foam::scalar
Foam::specieThermo<Thermo, Type>::Es(const scalar T) const
Foam::specieThermo<Thermo, Type>::Es(const scalar p, const scalar T) const
{
return this->es(T)/this->W();
return this->es(p, T)/this->W();
}
template<class Thermo, template<class> class Type>
inline Foam::scalar
Foam::specieThermo<Thermo, Type>::Ea(const scalar T) const
Foam::specieThermo<Thermo, Type>::Ea(const scalar p, const scalar T) const
{
return this->ea(T)/this->W();
return this->ea(p, T)/this->W();
}
template<class Thermo, template<class> class Type>
inline Foam::scalar
Foam::specieThermo<Thermo, Type>::G(const scalar T) const
Foam::specieThermo<Thermo, Type>::G(const scalar p, const scalar T) const
{
return this->g(T)/this->W();
return this->g(p, T)/this->W();
}
template<class Thermo, template<class> class Type>
inline Foam::scalar
Foam::specieThermo<Thermo, Type>::A(const scalar T) const
Foam::specieThermo<Thermo, Type>::A(const scalar p, const scalar T) const
{
return this->a(T)/this->W();
return this->a(p, T)/this->W();
}
template<class Thermo, template<class> class Type>
inline Foam::scalar
Foam::specieThermo<Thermo, Type>::K(const scalar T) const
Foam::specieThermo<Thermo, Type>::K(const scalar p, const scalar T) const
{
scalar arg = -this->nMoles()*this->g(T)/(this->RR*T);
scalar arg = -this->nMoles()*this->g(p, T)/(this->RR*T);
if (arg < 600.0)
{
@ -304,23 +307,23 @@ Foam::specieThermo<Thermo, Type>::K(const scalar T) const
template<class Thermo, template<class> class Type>
inline Foam::scalar
Foam::specieThermo<Thermo, Type>::Kp(const scalar T) const
Foam::specieThermo<Thermo, Type>::Kp(const scalar p, const scalar T) const
{
return K(T);
return K(p, T);
}
template<class Thermo, template<class> class Type>
inline Foam::scalar
Foam::specieThermo<Thermo, Type>::Kc(const scalar T) const
Foam::specieThermo<Thermo, Type>::Kc(const scalar p, const scalar T) const
{
if (equal(this->nMoles(), SMALL))
{
return Kp(T);
return Kp(p, T);
}
else
{
return Kp(T)*pow(this->Pstd/(this->RR*T), this->nMoles());
return Kp(p, T)*pow(this->Pstd/(this->RR*T), this->nMoles());
}
}
@ -328,17 +331,17 @@ Foam::specieThermo<Thermo, Type>::Kc(const scalar T) const
template<class Thermo, template<class> class Type>
inline Foam::scalar Foam::specieThermo<Thermo, Type>::Kx
(
const scalar T,
const scalar p
const scalar p,
const scalar T
) const
{
if (equal(this->nMoles(), SMALL))
{
return Kp(T);
return Kp(p, T);
}
else
{
return Kp(T)*pow(this->Pstd/p, this->nMoles());
return Kp(p, T)*pow(this->Pstd/p, this->nMoles());
}
}
@ -346,18 +349,18 @@ inline Foam::scalar Foam::specieThermo<Thermo, Type>::Kx
template<class Thermo, template<class> class Type>
inline Foam::scalar Foam::specieThermo<Thermo, Type>::Kn
(
const scalar T,
const scalar p,
const scalar T,
const scalar n
) const
{
if (equal(this->nMoles(), SMALL))
{
return Kp(T);
return Kp(p, T);
}
else
{
return Kp(T)*pow(n*this->Pstd/p, this->nMoles());
return Kp(p, T)*pow(n*this->Pstd/p, this->nMoles());
}
}
@ -366,10 +369,11 @@ template<class Thermo, template<class> class Type>
inline Foam::scalar Foam::specieThermo<Thermo, Type>::THE
(
const scalar he,
const scalar p,
const scalar T0
) const
{
return Type<specieThermo<Thermo, Type> >::THE(*this, he, T0);
return Type<specieThermo<Thermo, Type> >::THE(*this, he, p, T0);
}
@ -377,12 +381,14 @@ template<class Thermo, template<class> class Type>
inline Foam::scalar Foam::specieThermo<Thermo, Type>::THs
(
const scalar hs,
const scalar p,
const scalar T0
) const
{
return T
(
hs,
p,
T0,
&specieThermo<Thermo, Type>::Hs,
&specieThermo<Thermo, Type>::Cp,
@ -395,12 +401,14 @@ template<class Thermo, template<class> class Type>
inline Foam::scalar Foam::specieThermo<Thermo, Type>::THa
(
const scalar ht,
const scalar p,
const scalar T0
) const
{
return T
(
ht,
p,
T0,
&specieThermo<Thermo, Type>::Ha,
&specieThermo<Thermo, Type>::Cp,
@ -413,12 +421,14 @@ template<class Thermo, template<class> class Type>
inline Foam::scalar Foam::specieThermo<Thermo, Type>::TEs
(
const scalar es,
const scalar p,
const scalar T0
) const
{
return T
(
es,
p,
T0,
&specieThermo<Thermo, Type>::Es,
&specieThermo<Thermo, Type>::Cv,
@ -431,12 +441,14 @@ template<class Thermo, template<class> class Type>
inline Foam::scalar Foam::specieThermo<Thermo, Type>::TEa
(
const scalar e,
const scalar p,
const scalar T0
) const
{
return T
(
ea,
p,
T0,
&specieThermo<Thermo, Type>::Ea,
&specieThermo<Thermo, Type>::Cv,

View File

@ -129,16 +129,16 @@ public:
// Member functions
//- Dynamic viscosity [kg/ms]
inline scalar mu(const scalar T) const;
inline scalar mu(const scalar p, const scalar T) const;
//- Thermal conductivity [W/mK]
inline scalar kappa(const scalar T) const;
inline scalar kappa(const scalar p, const scalar T) const;
//- Thermal diffusivity of enthalpy [kg/ms]
inline scalar alphah(const scalar T) const;
inline scalar alphah(const scalar p, const scalar T) const;
// Species diffusivity
//inline scalar D(const scalar T) const;
//inline scalar D(const scalar p, const scalar T) const;
//- Write to Ostream
void write(Ostream& os) const;

View File

@ -55,23 +55,35 @@ inline Foam::constTransport<Thermo>::constTransport
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Thermo>
inline Foam::scalar Foam::constTransport<Thermo>::mu(const scalar) const
inline Foam::scalar Foam::constTransport<Thermo>::mu
(
const scalar p,
const scalar T
) const
{
return mu_;
}
template<class Thermo>
inline Foam::scalar Foam::constTransport<Thermo>::kappa(const scalar T) const
inline Foam::scalar Foam::constTransport<Thermo>::kappa
(
const scalar p,
const scalar T
) const
{
return this->Cp(T)*mu(T)*rPr_;
return this->Cp(p, T)*mu(p, T)*rPr_;
}
template<class Thermo>
inline Foam::scalar Foam::constTransport<Thermo>::alphah(const scalar T) const
inline Foam::scalar Foam::constTransport<Thermo>::alphah
(
const scalar p,
const scalar T
) const
{
return mu(T)*rPr_;
return mu(p, T)*rPr_;
}

View File

@ -143,16 +143,16 @@ public:
// Member functions
//- Dynamic viscosity [kg/ms]
inline scalar mu(const scalar T) const;
inline scalar mu(const scalar p, const scalar T) const;
//- Thermal conductivity [W/mK]
inline scalar kappa(const scalar T) const;
inline scalar kappa(const scalar p, const scalar T) const;
//- Thermal diffusivity of enthalpy [kg/ms]
inline scalar alphah(const scalar T) const;
inline scalar alphah(const scalar p, const scalar T) const;
// Species diffusivity
//inline scalar D(const scalar T) const;
//inline scalar D(const scalar p, const scalar T) const;
//- Write to Ostream
void write(Ostream& os) const;

View File

@ -104,6 +104,7 @@ Foam::polynomialTransport<Thermo, PolySize>::New(const dictionary& dict)
template<class Thermo, int PolySize>
inline Foam::scalar Foam::polynomialTransport<Thermo, PolySize>::mu
(
const scalar p,
const scalar T
) const
{
@ -114,6 +115,7 @@ inline Foam::scalar Foam::polynomialTransport<Thermo, PolySize>::mu
template<class Thermo, int PolySize>
inline Foam::scalar Foam::polynomialTransport<Thermo, PolySize>::kappa
(
const scalar p,
const scalar T
) const
{
@ -124,10 +126,10 @@ inline Foam::scalar Foam::polynomialTransport<Thermo, PolySize>::kappa
template<class Thermo, int PolySize>
inline Foam::scalar Foam::polynomialTransport<Thermo, PolySize>::alphah
(
const scalar T
const scalar p, const scalar T
) const
{
return kappa(T)/this->Cp(T);
return kappa(p, T)/this->Cp(p, T);
}

View File

@ -157,16 +157,16 @@ public:
// Member functions
//- Dynamic viscosity [kg/ms]
inline scalar mu(const scalar T) const;
inline scalar mu(const scalar p, const scalar T) const;
//- Thermal conductivity [W/mK]
inline scalar kappa(const scalar T) const;
inline scalar kappa(const scalar p, const scalar T) const;
//- Thermal diffusivity of enthalpy [kg/ms]
inline scalar alphah(const scalar T) const;
inline scalar alphah(const scalar p, const scalar T) const;
// Species diffusivity
//inline scalar D(const scalar T) const;
//inline scalar D(const scalar p, const scalar T) const;
//- Write to Ostream
void write(Ostream& os) const;

View File

@ -129,7 +129,11 @@ Foam::sutherlandTransport<Thermo>::New
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Thermo>
inline Foam::scalar Foam::sutherlandTransport<Thermo>::mu(const scalar T) const
inline Foam::scalar Foam::sutherlandTransport<Thermo>::mu
(
const scalar p,
const scalar T
) const
{
return As_*::sqrt(T)/(1.0 + Ts_/T);
}
@ -138,22 +142,23 @@ inline Foam::scalar Foam::sutherlandTransport<Thermo>::mu(const scalar T) const
template<class Thermo>
inline Foam::scalar Foam::sutherlandTransport<Thermo>::kappa
(
const scalar T
const scalar p, const scalar T
) const
{
scalar Cv_ = this->Cv(T);
return mu(T)*Cv_*(1.32 + 1.77*this->R()/Cv_);
scalar Cv_ = this->Cv(p, T);
return mu(p, T)*Cv_*(1.32 + 1.77*this->R()/Cv_);
}
template<class Thermo>
inline Foam::scalar Foam::sutherlandTransport<Thermo>::alphah
(
const scalar p,
const scalar T
) const
{
return kappa(T)/this->Cp(T);
return kappa(p, T)/this->Cp(p, T);
}

View File

@ -83,7 +83,7 @@ void Foam::porousMedia::fixedTemperature::addEnthalpySource
forAll(zones, zoneI)
{
const labelList& cells = mesh.cellZones()[zones[zoneI]];
hEqn.setValues(cells, thermo.he(T, cells));
hEqn.setValues(cells, thermo.he(thermo.p(), T, cells));
}
}

View File

@ -114,7 +114,8 @@ void htcConvFvPatchScalarField::updateCoeffs()
const vectorField& Uc = rasModel.U();
const vectorField& Uw = rasModel.U().boundaryField()[patchI];
const scalarField& Tw = rasModel.thermo().T().boundaryField()[patchI];
const scalarField Cpw(rasModel.thermo().Cp(Tw, patchI));
const scalarField& pw = rasModel.thermo().p().boundaryField()[patchI];
const scalarField Cpw(rasModel.thermo().Cp(pw, Tw, patchI));
const scalarField kappaw(Cpw*alphaEffw);
const scalarField Pr(muw*Cpw/kappaw);

View File

@ -208,7 +208,6 @@ void temperatureThermoBaffle1DFvPatchScalarField<solidType>::updateCoeffs()
if (baffleActivated_)
{
const fvPatch& nbrPatch =
patch().boundaryMesh()[mpp.samplePolyPatch().index()];
@ -230,9 +229,11 @@ void temperatureThermoBaffle1DFvPatchScalarField<solidType>::updateCoeffs()
const scalarField& Tp =
patch().template lookupPatchField<volScalarField, scalar>(TName_);
const scalarField& pp = model.thermo().p().boundaryField()[patchI];
tmp<scalarField> Ti = patchInternalField();
const scalarField Cpw(model.thermo().Cp(Ti, patchI));
const scalarField Cpw(model.thermo().Cp(pp, Ti, patchI));
scalarField myh(patch().deltaCoeffs()*alphaw*Cpw);
@ -247,6 +248,9 @@ void temperatureThermoBaffle1DFvPatchScalarField<solidType>::updateCoeffs()
const fvPatchScalarField& nbrHw =
model.thermo().he().boundaryField()[nbrPatchI];
const scalarField& nbrHwPp =
model.thermo().p().boundaryField()[nbrPatchI];
scalarField nbrQDot
(
model.alphaEff()().boundaryField()[nbrPatchI]*nbrHw.snGrad()
@ -271,7 +275,7 @@ void temperatureThermoBaffle1DFvPatchScalarField<solidType>::updateCoeffs()
const scalarField nbrCpw
(
model.thermo().Cp(nbrField.patchInternalField(), nbrPatchI)
model.thermo().Cp(nbrHwPp, nbrField.patchInternalField(), nbrPatchI)
);
scalarField nbrh