From 2d2787bd8cc9393ed8c970672d9e6390bf7776c6 Mon Sep 17 00:00:00 2001 From: Henry Date: Tue, 5 Jun 2012 19:51:57 +0100 Subject: [PATCH] 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. --- .../chemFoam/readInitialConditions.H | 2 +- .../equilibriumFlameT/equilibriumFlameT.C | 4 +- .../ReactingMultiphaseParcel.C | 10 +- .../Templates/ReactingParcel/ReactingParcel.C | 19 +- .../CompositionModel/CompositionModel.C | 6 +- .../LiquidEvaporation/LiquidEvaporation.C | 2 +- .../LiquidEvaporationBoil.C | 10 +- .../reactingOneDim/reactingOneDim.C | 3 +- .../basic/basicThermo/basicThermo.H | 9 + .../energyJump/energyJumpFvPatchScalarField.C | 3 +- .../fixedEnergyFvPatchScalarField.C | 3 +- .../gradientEnergyFvPatchScalarField.C | 7 +- .../mixedEnergyFvPatchScalarField.C | 9 +- .../wallHeatTransferFvPatchScalarField.C | 3 +- .../basic/heThermo/heThermo.C | 118 +++++++--- .../basic/heThermo/heThermo.H | 9 + .../basic/psiThermo/hePsiThermo/hePsiThermo.C | 24 +- .../basic/rhoThermo/heRhoThermo/heRhoThermo.C | 24 +- .../ODEChemistryModel/ODEChemistryModel.C | 6 +- .../fixedUnburntEnthalpyFvPatchScalarField.C | 3 +- ...radientUnburntEnthalpyFvPatchScalarField.C | 7 +- .../mixedUnburntEnthalpyFvPatchScalarField.C | 9 +- .../reactionThermo/makeReactionThermo.H | 34 ++- .../mixtures/SpecieMixture/SpecieMixture.C | 210 ++++++++++++++++++ .../mixtures/SpecieMixture/SpecieMixture.H | 196 ++++++++++++++++ .../basicMultiComponentMixture.H | 78 ++++++- .../mixtures/dieselMixture/dieselMixture.C | 151 ------------- .../mixtures/dieselMixture/dieselMixture.H | 51 ----- .../mixtures/egrMixture/egrMixture.C | 151 ------------- .../mixtures/egrMixture/egrMixture.H | 51 ----- .../homogeneousMixture/homogeneousMixture.C | 151 ------------- .../homogeneousMixture/homogeneousMixture.H | 51 ----- .../inhomogeneousMixture.C | 151 ------------- .../inhomogeneousMixture.H | 51 ----- .../multiComponentMixture.C | 151 ------------- .../multiComponentMixture.H | 55 +---- .../veryInhomogeneousMixture.C | 151 ------------- .../veryInhomogeneousMixture.H | 51 ----- .../hePsiReactionThermo/hePsiReactionThermo.C | 24 +- .../heheuReactionThermo/heheuReactionThermo.C | 98 +++++--- .../heheuReactionThermo/heheuReactionThermo.H | 2 + .../psiuReactionThermo/psiuReactionThermo.H | 2 + .../heRhoReactionThermo/heRhoReactionThermo.C | 23 +- .../ODESolidChemistryModel.C | 3 +- .../ODESolidChemistryModel.H | 1 + .../solidChemistryModel/solidChemistryModel.H | 1 + .../ReversibleReaction/ReversibleReaction.C | 2 +- .../absoluteEnthalpy/absoluteEnthalpy.H | 45 +++- .../specie/thermo/eConst/eConstThermo.H | 8 +- .../specie/thermo/eConst/eConstThermoI.H | 13 +- .../specie/thermo/hConst/hConstThermo.H | 8 +- .../specie/thermo/hConst/hConstThermoI.H | 12 +- .../thermo/hPolynomial/hPolynomialThermo.H | 10 +- .../thermo/hPolynomial/hPolynomialThermoI.H | 9 +- .../specie/thermo/janaf/janafThermo.H | 8 +- .../specie/thermo/janaf/janafThermoI.H | 6 +- .../sensibleEnthalpy/sensibleEnthalpy.H | 45 +++- .../sensibleInternalEnergy.H | 46 +++- .../specie/thermo/specieThermo/specieThermo.H | 101 ++++++--- .../thermo/specieThermo/specieThermoI.H | 136 ++++++------ .../specie/transport/const/constTransport.H | 8 +- .../specie/transport/const/constTransportI.H | 22 +- .../polynomial/polynomialTransport.H | 8 +- .../polynomial/polynomialTransportI.H | 6 +- .../sutherland/sutherlandTransport.H | 8 +- .../sutherland/sutherlandTransportI.H | 15 +- .../fixedTemperature/fixedTemperature.C | 2 +- .../htcConv/htcConvFvPatchScalarField.C | 3 +- ...peratureThermoBaffle1DFvPatchScalarField.C | 10 +- 69 files changed, 1154 insertions(+), 1555 deletions(-) create mode 100644 src/thermophysicalModels/reactionThermo/mixtures/SpecieMixture/SpecieMixture.C create mode 100644 src/thermophysicalModels/reactionThermo/mixtures/SpecieMixture/SpecieMixture.H diff --git a/applications/solvers/combustion/chemFoam/readInitialConditions.H b/applications/solvers/combustion/chemFoam/readInitialConditions.H index 73e34e510e..9a03c53b1f 100644 --- a/applications/solvers/combustion/chemFoam/readInitialConditions.H +++ b/applications/solvers/combustion/chemFoam/readInitialConditions.H @@ -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); diff --git a/applications/utilities/thermophysical/equilibriumFlameT/equilibriumFlameT.C b/applications/utilities/thermophysical/equilibriumFlameT/equilibriumFlameT.C index 7f73ef38f6..cfb5d71d74 100644 --- a/applications/utilities/thermophysical/equilibriumFlameT/equilibriumFlameT.C +++ b/applications/utilities/thermophysical/equilibriumFlameT/equilibriumFlameT.C @@ -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 ); diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C index 14450d6c27..aea7cec9f9 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C @@ -424,7 +424,7 @@ void Foam::ReactingMultiphaseParcel::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::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::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::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::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); diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C index 538ef84c82..cfd21ceed0 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C @@ -104,7 +104,12 @@ void Foam::ReactingParcel::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::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::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::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::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); diff --git a/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.C b/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.C index 53496a3170..faafdd551d 100644 --- a/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.C +++ b/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.C @@ -396,7 +396,7 @@ Foam::scalar Foam::CompositionModel::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::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::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; } diff --git a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.C b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.C index dd2a1f78af..475430bd83 100644 --- a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.C +++ b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.C @@ -216,7 +216,7 @@ Foam::scalar Foam::LiquidEvaporation::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; diff --git a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporationBoil/LiquidEvaporationBoil.C b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporationBoil/LiquidEvaporationBoil.C index ff87a1b280..32821f8966 100644 --- a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporationBoil/LiquidEvaporationBoil.C +++ b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporationBoil/LiquidEvaporationBoil.C @@ -171,10 +171,10 @@ void Foam::LiquidEvaporationBoil::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::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; diff --git a/src/regionModels/pyrolysisModels/reactingOneDim/reactingOneDim.C b/src/regionModels/pyrolysisModels/reactingOneDim/reactingOneDim.C index eb99d40067..758b410e10 100644 --- a/src/regionModels/pyrolysisModels/reactingOneDim/reactingOneDim.C +++ b/src/regionModels/pyrolysisModels/reactingOneDim/reactingOneDim.C @@ -146,7 +146,8 @@ void reactingOneDim::updatePhiGas() forAll(gasTable, gasI) { - tmp tHsiGas = solidChemistry_->gasHs(T_, gasI); + tmp tHsiGas = + solidChemistry_->gasHs(p, T_, gasI); tmp tRRiGas = solidChemistry_->RRg(gasI); const volScalarField& HsiGas = tHsiGas(); diff --git a/src/thermophysicalModels/basic/basicThermo/basicThermo.H b/src/thermophysicalModels/basic/basicThermo/basicThermo.H index 59ac5f1195..9518c9d6cc 100644 --- a/src/thermophysicalModels/basic/basicThermo/basicThermo.H +++ b/src/thermophysicalModels/basic/basicThermo/basicThermo.H @@ -153,6 +153,7 @@ public: //- Enthalpy/Internal energy for cell-set [J/kg] virtual tmp 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 he ( + const scalarField& p, const scalarField& T, const label patchi ) const = 0; @@ -171,6 +173,7 @@ public: virtual tmp THE ( const scalarField& h, + const scalarField& p, const scalarField& T0, // starting temperature const labelList& cells ) const = 0; @@ -179,6 +182,7 @@ public: virtual tmp 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 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 Cv ( + const scalarField& p, const scalarField& T, const label patchi ) const = 0; @@ -215,6 +221,7 @@ public: //- gamma = Cp/Cv for patch [] virtual tmp 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 Cpv ( + const scalarField& p, const scalarField& T, const label patchi ) const = 0; @@ -235,6 +243,7 @@ public: //- Heat capacity ratio for patch [] virtual tmp CpByCpv ( + const scalarField& p, const scalarField& T, const label patchi ) const = 0; diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJumpFvPatchScalarField.C b/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJumpFvPatchScalarField.C index b86ac9ad03..d3ba1becdd 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJumpFvPatchScalarField.C +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJumpFvPatchScalarField.C @@ -110,6 +110,7 @@ void Foam::energyJumpFvPatchScalarField::updateCoeffs() label patchID = patch().index(); + const scalarField& pp = thermo.p().boundaryField()[patchID]; const temperatureJumpFvPatchScalarField& TbPatch = refCast ( @@ -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::updateCoeffs(); diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/fixedEnergy/fixedEnergyFvPatchScalarField.C b/src/thermophysicalModels/basic/derivedFvPatchFields/fixedEnergy/fixedEnergyFvPatchScalarField.C index 614ce00e93..177d21661c 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/fixedEnergy/fixedEnergyFvPatchScalarField.C +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/fixedEnergy/fixedEnergyFvPatchScalarField.C @@ -104,10 +104,11 @@ void Foam::fixedEnergyFvPatchScalarField::updateCoeffs() const label patchi = patch().index(); + const scalarField& pw = thermo.p().boundaryField()[patchi]; fvPatchScalarField& Tw = const_cast(thermo.T().boundaryField()[patchi]); Tw.evaluate(); - operator==(thermo.he(Tw, patchi)); + operator==(thermo.he(pw, Tw, patchi)); fixedValueFvPatchScalarField::updateCoeffs(); } diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/gradientEnergy/gradientEnergyFvPatchScalarField.C b/src/thermophysicalModels/basic/derivedFvPatchFields/gradientEnergy/gradientEnergyFvPatchScalarField.C index 49d8562c5e..42ed096ea6 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/gradientEnergy/gradientEnergyFvPatchScalarField.C +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/gradientEnergy/gradientEnergyFvPatchScalarField.C @@ -104,16 +104,17 @@ void Foam::gradientEnergyFvPatchScalarField::updateCoeffs() const label patchi = patch().index(); + const scalarField& pw = thermo.p().boundaryField()[patchi]; fvPatchScalarField& Tw = const_cast(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(); diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/mixedEnergy/mixedEnergyFvPatchScalarField.C b/src/thermophysicalModels/basic/derivedFvPatchFields/mixedEnergy/mixedEnergyFvPatchScalarField.C index 2c5626b081..af83cfd20e 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/mixedEnergy/mixedEnergyFvPatchScalarField.C +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/mixedEnergy/mixedEnergyFvPatchScalarField.C @@ -109,6 +109,7 @@ void Foam::mixedEnergyFvPatchScalarField::updateCoeffs() const label patchi = patch().index(); + const scalarField& pw = thermo.p().boundaryField()[patchi]; mixedFvPatchScalarField& Tw = refCast ( const_cast(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(); diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/wallHeatTransfer/wallHeatTransferFvPatchScalarField.C b/src/thermophysicalModels/basic/derivedFvPatchFields/wallHeatTransfer/wallHeatTransferFvPatchScalarField.C index c724f9d9a7..8a93ad36ad 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/wallHeatTransfer/wallHeatTransferFvPatchScalarField.C +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/wallHeatTransfer/wallHeatTransferFvPatchScalarField.C @@ -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/ diff --git a/src/thermophysicalModels/basic/heThermo/heThermo.C b/src/thermophysicalModels/basic/heThermo/heThermo.C index 774a73e7dd..ab0d33a888 100644 --- a/src/thermophysicalModels/basic/heThermo/heThermo.C +++ b/src/thermophysicalModels/basic/heThermo/heThermo.C @@ -49,17 +49,23 @@ Foam::heThermo::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::~heThermo() template Foam::tmp Foam::heThermo::he ( + const scalarField& p, const scalarField& T, const labelList& cells ) const @@ -87,7 +94,7 @@ Foam::tmp Foam::heThermo::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::heThermo::he template Foam::tmp Foam::heThermo::he ( + const scalarField& p, const scalarField& T, const label patchi ) const @@ -106,7 +114,8 @@ Foam::tmp Foam::heThermo::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::hc() const template Foam::tmp Foam::heThermo::Cp ( + const scalarField& p, const scalarField& T, const label patchi ) const @@ -170,7 +180,8 @@ Foam::tmp Foam::heThermo::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::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 Foam::tmp Foam::heThermo::Cv ( + const scalarField& p, const scalarField& T, const label patchi ) const @@ -235,7 +250,8 @@ Foam::heThermo::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::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::Cv() const template Foam::tmp Foam::heThermo::gamma ( + const scalarField& p, const scalarField& T, const label patchi ) const @@ -294,7 +316,8 @@ Foam::tmp Foam::heThermo::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::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::gamma() const template Foam::tmp Foam::heThermo::Cpv ( + const scalarField& p, const scalarField& T, const label patchi ) const @@ -359,7 +388,8 @@ Foam::tmp Foam::heThermo::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::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::Cpv() const template Foam::tmp Foam::heThermo::CpByCpv ( + const scalarField& p, const scalarField& T, const label patchi ) const @@ -424,7 +458,7 @@ Foam::tmp Foam::heThermo::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::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 Foam::tmp Foam::heThermo::THE ( const scalarField& h, + const scalarField& p, const scalarField& T0, const labelList& cells ) const @@ -490,7 +533,8 @@ Foam::tmp Foam::heThermo::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 Foam::tmp Foam::heThermo::THE ( const scalarField& h, + const scalarField& p, const scalarField& T0, const label patchi ) const @@ -514,7 +559,7 @@ Foam::tmp Foam::heThermo::THE ( patchi, facei - ).THE(h[facei], T0[facei]); + ).THE(h[facei], p[facei], T0[facei]); } return tT; @@ -538,8 +583,12 @@ Foam::tmp Foam::heThermo::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::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::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 diff --git a/src/thermophysicalModels/basic/heThermo/heThermo.H b/src/thermophysicalModels/basic/heThermo/heThermo.H index c11aa43249..d2db7d0286 100644 --- a/src/thermophysicalModels/basic/heThermo/heThermo.H +++ b/src/thermophysicalModels/basic/heThermo/heThermo.H @@ -118,6 +118,7 @@ public: //- Enthalpy/Internal energy for cell-set [J/kg] virtual tmp 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 he ( + const scalarField& p, const scalarField& T, const label patchi ) const; @@ -136,6 +138,7 @@ public: virtual tmp THE ( const scalarField& he, + const scalarField& p, const scalarField& T0, // starting temperature const labelList& cells ) const; @@ -144,6 +147,7 @@ public: virtual tmp 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 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 Cv ( + const scalarField& p, const scalarField& T, const label patchi ) const; @@ -174,6 +180,7 @@ public: //- gamma = Cp/Cv for patch [] virtual tmp 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 Cpv ( + const scalarField& p, const scalarField& T, const label patchi ) const; @@ -194,6 +202,7 @@ public: //- Heat capacity ratio for patch [] virtual tmp CpByCpv ( + const scalarField& p, const scalarField& T, const label patchi ) const; diff --git a/src/thermophysicalModels/basic/psiThermo/hePsiThermo/hePsiThermo.C b/src/thermophysicalModels/basic/psiThermo/hePsiThermo/hePsiThermo.C index 4d1ce938b0..47570b82a3 100644 --- a/src/thermophysicalModels/basic/psiThermo/hePsiThermo/hePsiThermo.C +++ b/src/thermophysicalModels/basic/psiThermo/hePsiThermo/hePsiThermo.C @@ -43,11 +43,17 @@ void Foam::hePsiThermo::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::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::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]); } } } diff --git a/src/thermophysicalModels/basic/rhoThermo/heRhoThermo/heRhoThermo.C b/src/thermophysicalModels/basic/rhoThermo/heRhoThermo/heRhoThermo.C index 044936ebae..d76ba12b1d 100644 --- a/src/thermophysicalModels/basic/rhoThermo/heRhoThermo/heRhoThermo.C +++ b/src/thermophysicalModels/basic/rhoThermo/heRhoThermo/heRhoThermo.C @@ -44,12 +44,18 @@ void Foam::heRhoThermo::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::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::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]); } } } diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/ODEChemistryModel/ODEChemistryModel.C b/src/thermophysicalModels/chemistryModel/chemistryModel/ODEChemistryModel/ODEChemistryModel.C index 89e658352b..5026b517da 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/ODEChemistryModel/ODEChemistryModel.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/ODEChemistryModel/ODEChemistryModel.C @@ -352,7 +352,7 @@ void Foam::ODEChemistryModel::derivatives scalar cp = 0.0; for (label i=0; i::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::solve { mixture += (c[i]/cTot)*specieThermo_[i]; } - Ti = mixture.THa(hi, Ti); + Ti = mixture.THa(hi, pi, Ti); timeLeft -= dt; this->deltaTChem_[celli] = tauC; diff --git a/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/fixedUnburntEnthalpy/fixedUnburntEnthalpyFvPatchScalarField.C b/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/fixedUnburntEnthalpy/fixedUnburntEnthalpyFvPatchScalarField.C index d7c1c27b40..4f0bc06f52 100644 --- a/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/fixedUnburntEnthalpy/fixedUnburntEnthalpyFvPatchScalarField.C +++ b/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/fixedUnburntEnthalpy/fixedUnburntEnthalpyFvPatchScalarField.C @@ -105,10 +105,11 @@ void Foam::fixedUnburntEnthalpyFvPatchScalarField::updateCoeffs() const label patchi = patch().index(); + const scalarField& pw = thermo.p().boundaryField()[patchi]; fvPatchScalarField& Tw = const_cast(thermo.Tu().boundaryField()[patchi]); Tw.evaluate(); - operator==(thermo.heu(Tw, patchi)); + operator==(thermo.heu(pw, Tw, patchi)); fixedValueFvPatchScalarField::updateCoeffs(); } diff --git a/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/gradientUnburntEnthalpy/gradientUnburntEnthalpyFvPatchScalarField.C b/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/gradientUnburntEnthalpy/gradientUnburntEnthalpyFvPatchScalarField.C index 9ff1a44d88..1c13f7a0dd 100644 --- a/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/gradientUnburntEnthalpy/gradientUnburntEnthalpyFvPatchScalarField.C +++ b/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/gradientUnburntEnthalpy/gradientUnburntEnthalpyFvPatchScalarField.C @@ -104,16 +104,17 @@ void Foam::gradientUnburntEnthalpyFvPatchScalarField::updateCoeffs() const label patchi = patch().index(); + const scalarField& pw = thermo.p().boundaryField()[patchi]; fvPatchScalarField& Tw = const_cast(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(); diff --git a/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/mixedUnburntEnthalpy/mixedUnburntEnthalpyFvPatchScalarField.C b/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/mixedUnburntEnthalpy/mixedUnburntEnthalpyFvPatchScalarField.C index 16ce7c47b1..3ab1424dc0 100644 --- a/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/mixedUnburntEnthalpy/mixedUnburntEnthalpyFvPatchScalarField.C +++ b/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/mixedUnburntEnthalpy/mixedUnburntEnthalpyFvPatchScalarField.C @@ -108,6 +108,7 @@ void Foam::mixedUnburntEnthalpyFvPatchScalarField::updateCoeffs() const label patchi = patch().index(); + const scalarField& pw = thermo.p().boundaryField()[patchi]; mixedFvPatchScalarField& Tw = refCast ( const_cast(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(); diff --git a/src/thermophysicalModels/reactionThermo/makeReactionThermo.H b/src/thermophysicalModels/reactionThermo/makeReactionThermo.H index 85ebdafd42..9f2de27639 100644 --- a/src/thermophysicalModels/reactionThermo/makeReactionThermo.H +++ b/src/thermophysicalModels/reactionThermo/makeReactionThermo.H @@ -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 \ - ,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 > \ - MixtureThermo##Mixture##ThermoPhys; \ +typedef MixtureThermo \ +< \ + SpecieMixture \ + < \ + Mixture \ + < \ + ThermoPhys \ + > \ + > \ +> MixtureThermo##Mixture##ThermoPhys; \ \ defineTemplateTypeNameAndDebugWithName \ ( \ diff --git a/src/thermophysicalModels/reactionThermo/mixtures/SpecieMixture/SpecieMixture.C b/src/thermophysicalModels/reactionThermo/mixtures/SpecieMixture/SpecieMixture.C new file mode 100644 index 0000000000..4cdec064bf --- /dev/null +++ b/src/thermophysicalModels/reactionThermo/mixtures/SpecieMixture/SpecieMixture.C @@ -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 . + +\*---------------------------------------------------------------------------*/ + +#include "SpecieMixture.H" +#include "fvMesh.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::SpecieMixture::SpecieMixture +( + const dictionary& thermoDict, + const fvMesh& mesh +) +: + MixtureType + ( + thermoDict, + mesh + ) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +Foam::scalar Foam::SpecieMixture::nMoles +( + const label speciei +) const +{ + return this->getLocalThermo(speciei).nMoles(); +} + + +template +Foam::scalar Foam::SpecieMixture::W +( + const label speciei +) const +{ + return this->getLocalThermo(speciei).W(); +} + + +template +Foam::scalar Foam::SpecieMixture::Cp +( + const label speciei, + const scalar p, + const scalar T +) const +{ + return this->getLocalThermo(speciei).Cp(p, T); +} + + +template +Foam::scalar Foam::SpecieMixture::Cv +( + const label speciei, + const scalar p, + const scalar T +) const +{ + return this->getLocalThermo(speciei).Cv(p, T); +} + + +template +Foam::scalar Foam::SpecieMixture::Ha +( + const label speciei, + const scalar p, + const scalar T +) const +{ + return this->getLocalThermo(speciei).Ha(p, T); +} + + +template +Foam::scalar Foam::SpecieMixture::Hs +( + const label speciei, + const scalar p, + const scalar T +) const +{ + return this->getLocalThermo(speciei).Hs(p, T); +} + + +template +Foam::scalar Foam::SpecieMixture::Hc +( + const label speciei +) const +{ + return this->getLocalThermo(speciei).Hc(); +} + + +template +Foam::scalar Foam::SpecieMixture::S +( + const label speciei, + const scalar p, + const scalar T +) const +{ + return this->getLocalThermo(speciei).S(p, T); +} + + +template +Foam::scalar Foam::SpecieMixture::Es +( + const label speciei, + const scalar p, + const scalar T +) const +{ + return this->getLocalThermo(speciei).Es(p, T); +} + + +template +Foam::scalar Foam::SpecieMixture::G +( + const label speciei, + const scalar p, + const scalar T +) const +{ + return this->getLocalThermo(speciei).G(p, T); +} + + +template +Foam::scalar Foam::SpecieMixture::A +( + const label speciei, + const scalar p, + const scalar T +) const +{ + return this->getLocalThermo(speciei).A(p, T); +} + + +template +Foam::scalar Foam::SpecieMixture::mu +( + const label speciei, + const scalar p, + const scalar T +) const +{ + return this->getLocalThermo(speciei).mu(p, T); +} + + +template +Foam::scalar Foam::SpecieMixture::kappa +( + const label speciei, + const scalar p, + const scalar T +) const +{ + return this->getLocalThermo(speciei).kappa(p, T); +} + + +template +Foam::scalar Foam::SpecieMixture::alphah +( + const label speciei, + const scalar p, + const scalar T +) const +{ + return this->getLocalThermo(speciei).alphah(p, T); +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/reactionThermo/mixtures/SpecieMixture/SpecieMixture.H b/src/thermophysicalModels/reactionThermo/mixtures/SpecieMixture/SpecieMixture.H new file mode 100644 index 0000000000..ed237ef446 --- /dev/null +++ b/src/thermophysicalModels/reactionThermo/mixtures/SpecieMixture/SpecieMixture.H @@ -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 . + +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 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 + +// ************************************************************************* // diff --git a/src/thermophysicalModels/reactionThermo/mixtures/basicMultiComponentMixture/basicMultiComponentMixture.H b/src/thermophysicalModels/reactionThermo/mixtures/basicMultiComponentMixture/basicMultiComponentMixture.H index b6f06c0f82..80a9e7f056 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/basicMultiComponentMixture/basicMultiComponentMixture.H +++ b/src/thermophysicalModels/reactionThermo/mixtures/basicMultiComponentMixture/basicMultiComponentMixture.H @@ -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; }; diff --git a/src/thermophysicalModels/reactionThermo/mixtures/dieselMixture/dieselMixture.C b/src/thermophysicalModels/reactionThermo/mixtures/dieselMixture/dieselMixture.C index c1cb52de31..1b43304552 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/dieselMixture/dieselMixture.C +++ b/src/thermophysicalModels/reactionThermo/mixtures/dieselMixture/dieselMixture.C @@ -131,155 +131,4 @@ const ThermoType& Foam::dieselMixture::getLocalThermo } -template -Foam::scalar Foam::dieselMixture::nMoles -( - const label specieI -) const -{ - return getLocalThermo(specieI).nMoles(); -} - - -template -Foam::scalar Foam::dieselMixture::W -( - const label specieI -) const -{ - return getLocalThermo(specieI).W(); -} - - -template -Foam::scalar Foam::dieselMixture::Cp -( - const label specieI, - const scalar T -) const -{ - return getLocalThermo(specieI).Cp(T); -} - - -template -Foam::scalar Foam::dieselMixture::Cv -( - const label specieI, - const scalar T -) const -{ - return getLocalThermo(specieI).Cv(T); -} - - -template -Foam::scalar Foam::dieselMixture::Ha -( - const label specieI, - const scalar T -) const -{ - return getLocalThermo(specieI).Ha(T); -} - - -template -Foam::scalar Foam::dieselMixture::Hs -( - const label specieI, - const scalar T -) const -{ - return getLocalThermo(specieI).Hs(T); -} - - -template -Foam::scalar Foam::dieselMixture::Hc -( - const label specieI -) const -{ - return getLocalThermo(specieI).Hc(); -} - - -template -Foam::scalar Foam::dieselMixture::S -( - const label specieI, - const scalar T -) const -{ - return getLocalThermo(specieI).S(T); -} - - -template -Foam::scalar Foam::dieselMixture::Es -( - const label specieI, - const scalar T -) const -{ - return getLocalThermo(specieI).Es(T); -} - - -template -Foam::scalar Foam::dieselMixture::G -( - const label specieI, - const scalar T -) const -{ - return getLocalThermo(specieI).G(T); -} - - -template -Foam::scalar Foam::dieselMixture::A -( - const label specieI, - const scalar T -) const -{ - return getLocalThermo(specieI).A(T); -} - - -template -Foam::scalar Foam::dieselMixture::mu -( - const label specieI, - const scalar T -) const -{ - return getLocalThermo(specieI).mu(T); -} - - -template -Foam::scalar Foam::dieselMixture::kappa -( - const label specieI, - const scalar T -) const -{ - return getLocalThermo(specieI).kappa(T); -} - - -template -Foam::scalar Foam::dieselMixture::alphah -( - const label specieI, - const scalar T -) const -{ - return getLocalThermo(specieI).alphah(T); -} - - // ************************************************************************* // diff --git a/src/thermophysicalModels/reactionThermo/mixtures/dieselMixture/dieselMixture.H b/src/thermophysicalModels/reactionThermo/mixtures/dieselMixture/dieselMixture.H index 6a9435f75c..3e0c15583d 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/dieselMixture/dieselMixture.H +++ b/src/thermophysicalModels/reactionThermo/mixtures/dieselMixture/dieselMixture.H @@ -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; }; diff --git a/src/thermophysicalModels/reactionThermo/mixtures/egrMixture/egrMixture.C b/src/thermophysicalModels/reactionThermo/mixtures/egrMixture/egrMixture.C index 69c90d40c3..6994b0c64f 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/egrMixture/egrMixture.C +++ b/src/thermophysicalModels/reactionThermo/mixtures/egrMixture/egrMixture.C @@ -141,155 +141,4 @@ const ThermoType& Foam::egrMixture::getLocalThermo } -template -Foam::scalar Foam::egrMixture::nMoles -( - const label specieI -) const -{ - return getLocalThermo(specieI).nMoles(); -} - - -template -Foam::scalar Foam::egrMixture::W -( - const label specieI -) const -{ - return getLocalThermo(specieI).W(); -} - - -template -Foam::scalar Foam::egrMixture::Cp -( - const label specieI, - const scalar T -) const -{ - return getLocalThermo(specieI).Cp(T); -} - - -template -Foam::scalar Foam::egrMixture::Cv -( - const label specieI, - const scalar T -) const -{ - return getLocalThermo(specieI).Cv(T); -} - - -template -Foam::scalar Foam::egrMixture::Ha -( - const label specieI, - const scalar T -) const -{ - return getLocalThermo(specieI).Ha(T); -} - - -template -Foam::scalar Foam::egrMixture::Hs -( - const label specieI, - const scalar T -) const -{ - return getLocalThermo(specieI).Hs(T); -} - - -template -Foam::scalar Foam::egrMixture::Hc -( - const label specieI -) const -{ - return getLocalThermo(specieI).Hc(); -} - - -template -Foam::scalar Foam::egrMixture::S -( - const label specieI, - const scalar T -) const -{ - return getLocalThermo(specieI).S(T); -} - - -template -Foam::scalar Foam::egrMixture::Es -( - const label specieI, - const scalar T -) const -{ - return getLocalThermo(specieI).Es(T); -} - - -template -Foam::scalar Foam::egrMixture::G -( - const label specieI, - const scalar T -) const -{ - return getLocalThermo(specieI).G(T); -} - - -template -Foam::scalar Foam::egrMixture::A -( - const label specieI, - const scalar T -) const -{ - return getLocalThermo(specieI).A(T); -} - - -template -Foam::scalar Foam::egrMixture::mu -( - const label specieI, - const scalar T -) const -{ - return getLocalThermo(specieI).mu(T); -} - - -template -Foam::scalar Foam::egrMixture::kappa -( - const label specieI, - const scalar T -) const -{ - return getLocalThermo(specieI).kappa(T); -} - - -template -Foam::scalar Foam::egrMixture::alphah -( - const label specieI, - const scalar T -) const -{ - return getLocalThermo(specieI).alphah(T); -} - - // ************************************************************************* // diff --git a/src/thermophysicalModels/reactionThermo/mixtures/egrMixture/egrMixture.H b/src/thermophysicalModels/reactionThermo/mixtures/egrMixture/egrMixture.H index 517f038310..15c737ab8f 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/egrMixture/egrMixture.H +++ b/src/thermophysicalModels/reactionThermo/mixtures/egrMixture/egrMixture.H @@ -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; }; diff --git a/src/thermophysicalModels/reactionThermo/mixtures/homogeneousMixture/homogeneousMixture.C b/src/thermophysicalModels/reactionThermo/mixtures/homogeneousMixture/homogeneousMixture.C index 80d854f32f..f9c4f7a953 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/homogeneousMixture/homogeneousMixture.C +++ b/src/thermophysicalModels/reactionThermo/mixtures/homogeneousMixture/homogeneousMixture.C @@ -120,155 +120,4 @@ const ThermoType& Foam::homogeneousMixture::getLocalThermo } -template -Foam::scalar Foam::homogeneousMixture::nMoles -( - const label specieI -) const -{ - return getLocalThermo(specieI).nMoles(); -} - - -template -Foam::scalar Foam::homogeneousMixture::W -( - const label specieI -) const -{ - return getLocalThermo(specieI).W(); -} - - -template -Foam::scalar Foam::homogeneousMixture::Cp -( - const label specieI, - const scalar T -) const -{ - return getLocalThermo(specieI).Cp(T); -} - - -template -Foam::scalar Foam::homogeneousMixture::Cv -( - const label specieI, - const scalar T -) const -{ - return getLocalThermo(specieI).Cv(T); -} - - -template -Foam::scalar Foam::homogeneousMixture::Ha -( - const label specieI, - const scalar T -) const -{ - return getLocalThermo(specieI).Ha(T); -} - - -template -Foam::scalar Foam::homogeneousMixture::Hs -( - const label specieI, - const scalar T -) const -{ - return getLocalThermo(specieI).Hs(T); -} - - -template -Foam::scalar Foam::homogeneousMixture::Hc -( - const label specieI -) const -{ - return getLocalThermo(specieI).Hc(); -} - - -template -Foam::scalar Foam::homogeneousMixture::S -( - const label specieI, - const scalar T -) const -{ - return getLocalThermo(specieI).S(T); -} - - -template -Foam::scalar Foam::homogeneousMixture::Es -( - const label specieI, - const scalar T -) const -{ - return getLocalThermo(specieI).Es(T); -} - - -template -Foam::scalar Foam::homogeneousMixture::G -( - const label specieI, - const scalar T -) const -{ - return getLocalThermo(specieI).G(T); -} - - -template -Foam::scalar Foam::homogeneousMixture::A -( - const label specieI, - const scalar T -) const -{ - return getLocalThermo(specieI).A(T); -} - - -template -Foam::scalar Foam::homogeneousMixture::mu -( - const label specieI, - const scalar T -) const -{ - return getLocalThermo(specieI).mu(T); -} - - -template -Foam::scalar Foam::homogeneousMixture::kappa -( - const label specieI, - const scalar T -) const -{ - return getLocalThermo(specieI).kappa(T); -} - - -template -Foam::scalar Foam::homogeneousMixture::alphah -( - const label specieI, - const scalar T -) const -{ - return getLocalThermo(specieI).alphah(T); -} - - // ************************************************************************* // diff --git a/src/thermophysicalModels/reactionThermo/mixtures/homogeneousMixture/homogeneousMixture.H b/src/thermophysicalModels/reactionThermo/mixtures/homogeneousMixture/homogeneousMixture.H index b1859797c1..aa7853be12 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/homogeneousMixture/homogeneousMixture.H +++ b/src/thermophysicalModels/reactionThermo/mixtures/homogeneousMixture/homogeneousMixture.H @@ -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; }; diff --git a/src/thermophysicalModels/reactionThermo/mixtures/inhomogeneousMixture/inhomogeneousMixture.C b/src/thermophysicalModels/reactionThermo/mixtures/inhomogeneousMixture/inhomogeneousMixture.C index 5144ac2646..effc1a7b12 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/inhomogeneousMixture/inhomogeneousMixture.C +++ b/src/thermophysicalModels/reactionThermo/mixtures/inhomogeneousMixture/inhomogeneousMixture.C @@ -136,155 +136,4 @@ const ThermoType& Foam::inhomogeneousMixture::getLocalThermo } -template -Foam::scalar Foam::inhomogeneousMixture::nMoles -( - const label specieI -) const -{ - return getLocalThermo(specieI).nMoles(); -} - - -template -Foam::scalar Foam::inhomogeneousMixture::W -( - const label specieI -) const -{ - return getLocalThermo(specieI).W(); -} - - -template -Foam::scalar Foam::inhomogeneousMixture::Cp -( - const label specieI, - const scalar T -) const -{ - return getLocalThermo(specieI).Cp(T); -} - - -template -Foam::scalar Foam::inhomogeneousMixture::Cv -( - const label specieI, - const scalar T -) const -{ - return getLocalThermo(specieI).Cv(T); -} - - -template -Foam::scalar Foam::inhomogeneousMixture::Ha -( - const label specieI, - const scalar T -) const -{ - return getLocalThermo(specieI).Ha(T); -} - - -template -Foam::scalar Foam::inhomogeneousMixture::Hs -( - const label specieI, - const scalar T -) const -{ - return getLocalThermo(specieI).Hs(T); -} - - -template -Foam::scalar Foam::inhomogeneousMixture::Hc -( - const label specieI -) const -{ - return getLocalThermo(specieI).Hc(); -} - - -template -Foam::scalar Foam::inhomogeneousMixture::S -( - const label specieI, - const scalar T -) const -{ - return getLocalThermo(specieI).S(T); -} - - -template -Foam::scalar Foam::inhomogeneousMixture::Es -( - const label specieI, - const scalar T -) const -{ - return getLocalThermo(specieI).Es(T); -} - - -template -Foam::scalar Foam::inhomogeneousMixture::G -( - const label specieI, - const scalar T -) const -{ - return getLocalThermo(specieI).G(T); -} - - -template -Foam::scalar Foam::inhomogeneousMixture::A -( - const label specieI, - const scalar T -) const -{ - return getLocalThermo(specieI).A(T); -} - - -template -Foam::scalar Foam::inhomogeneousMixture::mu -( - const label specieI, - const scalar T -) const -{ - return getLocalThermo(specieI).mu(T); -} - - -template -Foam::scalar Foam::inhomogeneousMixture::kappa -( - const label specieI, - const scalar T -) const -{ - return getLocalThermo(specieI).kappa(T); -} - - -template -Foam::scalar Foam::inhomogeneousMixture::alphah -( - const label specieI, - const scalar T -) const -{ - return getLocalThermo(specieI).alphah(T); -} - - // ************************************************************************* // diff --git a/src/thermophysicalModels/reactionThermo/mixtures/inhomogeneousMixture/inhomogeneousMixture.H b/src/thermophysicalModels/reactionThermo/mixtures/inhomogeneousMixture/inhomogeneousMixture.H index d3277ebc58..29df9a1365 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/inhomogeneousMixture/inhomogeneousMixture.H +++ b/src/thermophysicalModels/reactionThermo/mixtures/inhomogeneousMixture/inhomogeneousMixture.H @@ -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; }; diff --git a/src/thermophysicalModels/reactionThermo/mixtures/multiComponentMixture/multiComponentMixture.C b/src/thermophysicalModels/reactionThermo/mixtures/multiComponentMixture/multiComponentMixture.C index 0b0cd39313..3583588e00 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/multiComponentMixture/multiComponentMixture.C +++ b/src/thermophysicalModels/reactionThermo/mixtures/multiComponentMixture/multiComponentMixture.C @@ -161,155 +161,4 @@ void Foam::multiComponentMixture::read } -template -Foam::scalar Foam::multiComponentMixture::nMoles -( - const label specieI -) const -{ - return speciesData_[specieI].nMoles(); -} - - -template -Foam::scalar Foam::multiComponentMixture::W -( - const label specieI -) const -{ - return speciesData_[specieI].W(); -} - - -template -Foam::scalar Foam::multiComponentMixture::Cp -( - const label specieI, - const scalar T -) const -{ - return speciesData_[specieI].Cp(T); -} - - -template -Foam::scalar Foam::multiComponentMixture::Cv -( - const label specieI, - const scalar T -) const -{ - return speciesData_[specieI].Cv(T); -} - - -template -Foam::scalar Foam::multiComponentMixture::Ha -( - const label specieI, - const scalar T -) const -{ - return speciesData_[specieI].Ha(T); -} - - -template -Foam::scalar Foam::multiComponentMixture::Hs -( - const label specieI, - const scalar T -) const -{ - return speciesData_[specieI].Hs(T); -} - - -template -Foam::scalar Foam::multiComponentMixture::Hc -( - const label specieI -) const -{ - return speciesData_[specieI].Hc(); -} - - -template -Foam::scalar Foam::multiComponentMixture::S -( - const label specieI, - const scalar T -) const -{ - return speciesData_[specieI].S(T); -} - - -template -Foam::scalar Foam::multiComponentMixture::Es -( - const label specieI, - const scalar T -) const -{ - return speciesData_[specieI].Es(T); -} - - -template -Foam::scalar Foam::multiComponentMixture::G -( - const label specieI, - const scalar T -) const -{ - return speciesData_[specieI].G(T); -} - - -template -Foam::scalar Foam::multiComponentMixture::A -( - const label specieI, - const scalar T -) const -{ - return speciesData_[specieI].A(T); -} - - -template -Foam::scalar Foam::multiComponentMixture::mu -( - const label specieI, - const scalar T -) const -{ - return speciesData_[specieI].mu(T); -} - - -template -Foam::scalar Foam::multiComponentMixture::kappa -( - const label specieI, - const scalar T -) const -{ - return speciesData_[specieI].kappa(T); -} - - -template -Foam::scalar Foam::multiComponentMixture::alphah -( - const label specieI, - const scalar T -) const -{ - return speciesData_[specieI].alphah(T); -} - - // ************************************************************************* // diff --git a/src/thermophysicalModels/reactionThermo/mixtures/multiComponentMixture/multiComponentMixture.H b/src/thermophysicalModels/reactionThermo/mixtures/multiComponentMixture/multiComponentMixture.H index 46b4a03b8a..50164015b0 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/multiComponentMixture/multiComponentMixture.H +++ b/src/thermophysicalModels/reactionThermo/mixtures/multiComponentMixture/multiComponentMixture.H @@ -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]; + } }; diff --git a/src/thermophysicalModels/reactionThermo/mixtures/veryInhomogeneousMixture/veryInhomogeneousMixture.C b/src/thermophysicalModels/reactionThermo/mixtures/veryInhomogeneousMixture/veryInhomogeneousMixture.C index c9d94a6a88..380730a16a 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/veryInhomogeneousMixture/veryInhomogeneousMixture.C +++ b/src/thermophysicalModels/reactionThermo/mixtures/veryInhomogeneousMixture/veryInhomogeneousMixture.C @@ -137,155 +137,4 @@ const ThermoType& Foam::veryInhomogeneousMixture::getLocalThermo } -template -Foam::scalar Foam::veryInhomogeneousMixture::nMoles -( - const label specieI -) const -{ - return getLocalThermo(specieI).nMoles(); -} - - -template -Foam::scalar Foam::veryInhomogeneousMixture::W -( - const label specieI -) const -{ - return getLocalThermo(specieI).W(); -} - - -template -Foam::scalar Foam::veryInhomogeneousMixture::Cp -( - const label specieI, - const scalar T -) const -{ - return getLocalThermo(specieI).Cp(T); -} - - -template -Foam::scalar Foam::veryInhomogeneousMixture::Cv -( - const label specieI, - const scalar T -) const -{ - return getLocalThermo(specieI).Cv(T); -} - - -template -Foam::scalar Foam::veryInhomogeneousMixture::Ha -( - const label specieI, - const scalar T -) const -{ - return getLocalThermo(specieI).Ha(T); -} - - -template -Foam::scalar Foam::veryInhomogeneousMixture::Hs -( - const label specieI, - const scalar T -) const -{ - return getLocalThermo(specieI).Hs(T); -} - - -template -Foam::scalar Foam::veryInhomogeneousMixture::Hc -( - const label specieI -) const -{ - return getLocalThermo(specieI).Hc(); -} - - -template -Foam::scalar Foam::veryInhomogeneousMixture::S -( - const label specieI, - const scalar T -) const -{ - return getLocalThermo(specieI).S(T); -} - - -template -Foam::scalar Foam::veryInhomogeneousMixture::Es -( - const label specieI, - const scalar T -) const -{ - return getLocalThermo(specieI).Es(T); -} - - -template -Foam::scalar Foam::veryInhomogeneousMixture::G -( - const label specieI, - const scalar T -) const -{ - return getLocalThermo(specieI).G(T); -} - - -template -Foam::scalar Foam::veryInhomogeneousMixture::A -( - const label specieI, - const scalar T -) const -{ - return getLocalThermo(specieI).A(T); -} - - -template -Foam::scalar Foam::veryInhomogeneousMixture::mu -( - const label specieI, - const scalar T -) const -{ - return getLocalThermo(specieI).mu(T); -} - - -template -Foam::scalar Foam::veryInhomogeneousMixture::kappa -( - const label specieI, - const scalar T -) const -{ - return getLocalThermo(specieI).kappa(T); -} - - -template -Foam::scalar Foam::veryInhomogeneousMixture::alphah -( - const label specieI, - const scalar T -) const -{ - return getLocalThermo(specieI).alphah(T); -} - - // ************************************************************************* // diff --git a/src/thermophysicalModels/reactionThermo/mixtures/veryInhomogeneousMixture/veryInhomogeneousMixture.H b/src/thermophysicalModels/reactionThermo/mixtures/veryInhomogeneousMixture/veryInhomogeneousMixture.H index 0bf5108f63..fcde427cfc 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/veryInhomogeneousMixture/veryInhomogeneousMixture.H +++ b/src/thermophysicalModels/reactionThermo/mixtures/veryInhomogeneousMixture/veryInhomogeneousMixture.H @@ -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; }; diff --git a/src/thermophysicalModels/reactionThermo/psiReactionThermo/hePsiReactionThermo/hePsiReactionThermo.C b/src/thermophysicalModels/reactionThermo/psiReactionThermo/hePsiReactionThermo/hePsiReactionThermo.C index b418b08fa6..81fa02f9fe 100644 --- a/src/thermophysicalModels/reactionThermo/psiReactionThermo/hePsiReactionThermo/hePsiReactionThermo.C +++ b/src/thermophysicalModels/reactionThermo/psiReactionThermo/hePsiReactionThermo/hePsiReactionThermo.C @@ -45,11 +45,17 @@ void Foam::hePsiReactionThermo::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::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::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]); } } } diff --git a/src/thermophysicalModels/reactionThermo/psiReactionThermo/heheuReactionThermo/heheuReactionThermo.C b/src/thermophysicalModels/reactionThermo/psiReactionThermo/heheuReactionThermo/heheuReactionThermo.C index 443ccddcd5..b0705c3261 100644 --- a/src/thermophysicalModels/reactionThermo/psiReactionThermo/heheuReactionThermo/heheuReactionThermo.C +++ b/src/thermophysicalModels/reactionThermo/psiReactionThermo/heheuReactionThermo/heheuReactionThermo.C @@ -47,14 +47,24 @@ void Foam::heheuReactionThermo::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::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::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::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 Foam::tmp Foam::heheuReactionThermo::heu ( + const scalarField& p, const scalarField& Tu, const labelList& cells ) const @@ -209,7 +229,7 @@ Foam::heheuReactionThermo::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 Foam::tmp Foam::heheuReactionThermo::heu ( + const scalarField& p, const scalarField& Tu, const label patchi ) const @@ -229,7 +250,8 @@ Foam::heheuReactionThermo::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::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::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::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::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] + ); } } diff --git a/src/thermophysicalModels/reactionThermo/psiReactionThermo/heheuReactionThermo/heheuReactionThermo.H b/src/thermophysicalModels/reactionThermo/psiReactionThermo/heheuReactionThermo/heheuReactionThermo.H index e03b5be6d9..93e6cc7041 100644 --- a/src/thermophysicalModels/reactionThermo/psiReactionThermo/heheuReactionThermo/heheuReactionThermo.H +++ b/src/thermophysicalModels/reactionThermo/psiReactionThermo/heheuReactionThermo/heheuReactionThermo.H @@ -114,6 +114,7 @@ public: //- Unburnt gas enthalpy for cell-set [J/kg] virtual tmp 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 heu ( + const scalarField& p, const scalarField& T, const label patchi ) const; diff --git a/src/thermophysicalModels/reactionThermo/psiReactionThermo/psiuReactionThermo/psiuReactionThermo.H b/src/thermophysicalModels/reactionThermo/psiReactionThermo/psiuReactionThermo/psiuReactionThermo.H index d01c4c6fa1..f27e3662c0 100644 --- a/src/thermophysicalModels/reactionThermo/psiReactionThermo/psiuReactionThermo/psiuReactionThermo.H +++ b/src/thermophysicalModels/reactionThermo/psiReactionThermo/psiuReactionThermo/psiuReactionThermo.H @@ -114,6 +114,7 @@ public: //- Unburnt gas enthalpy for cell-set [J/kg] virtual tmp 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 heu ( + const scalarField& p, const scalarField& T, const label patchi ) const = 0; diff --git a/src/thermophysicalModels/reactionThermo/rhoReactionThermo/heRhoReactionThermo/heRhoReactionThermo.C b/src/thermophysicalModels/reactionThermo/rhoReactionThermo/heRhoReactionThermo/heRhoReactionThermo.C index 53cf131bc6..b27fd9c958 100644 --- a/src/thermophysicalModels/reactionThermo/rhoReactionThermo/heRhoReactionThermo/heRhoReactionThermo.C +++ b/src/thermophysicalModels/reactionThermo/rhoReactionThermo/heRhoReactionThermo/heRhoReactionThermo.C @@ -46,12 +46,17 @@ void Foam::heRhoReactionThermo::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::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::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]); } } } diff --git a/src/thermophysicalModels/solidChemistryModel/ODESolidChemistryModel/ODESolidChemistryModel.C b/src/thermophysicalModels/solidChemistryModel/ODESolidChemistryModel/ODESolidChemistryModel.C index 6c68214b63..a7eb25f22e 100644 --- a/src/thermophysicalModels/solidChemistryModel/ODESolidChemistryModel/ODESolidChemistryModel.C +++ b/src/thermophysicalModels/solidChemistryModel/ODESolidChemistryModel/ODESolidChemistryModel.C @@ -737,6 +737,7 @@ template Foam::tmp Foam::ODESolidChemistryModel::gasHs ( + const volScalarField& p, const volScalarField& T, const label index ) const @@ -766,7 +767,7 @@ Foam::ODESolidChemistryModel::gasHs forAll(gasHs, cellI) { - gasHs[cellI] = mixture.Hs(T[cellI]); + gasHs[cellI] = mixture.Hs(p[cellI], T[cellI]); } return tHs; diff --git a/src/thermophysicalModels/solidChemistryModel/ODESolidChemistryModel/ODESolidChemistryModel.H b/src/thermophysicalModels/solidChemistryModel/ODESolidChemistryModel/ODESolidChemistryModel.H index b34765d114..7996257268 100644 --- a/src/thermophysicalModels/solidChemistryModel/ODESolidChemistryModel/ODESolidChemistryModel.H +++ b/src/thermophysicalModels/solidChemistryModel/ODESolidChemistryModel/ODESolidChemistryModel.H @@ -220,6 +220,7 @@ public: //- Return sensible enthalpy for gas i [J/Kg] virtual tmp gasHs ( + const volScalarField& p, const volScalarField& T, const label i ) const; diff --git a/src/thermophysicalModels/solidChemistryModel/solidChemistryModel/solidChemistryModel.H b/src/thermophysicalModels/solidChemistryModel/solidChemistryModel/solidChemistryModel.H index 970b8741de..92c1025c14 100644 --- a/src/thermophysicalModels/solidChemistryModel/solidChemistryModel/solidChemistryModel.H +++ b/src/thermophysicalModels/solidChemistryModel/solidChemistryModel/solidChemistryModel.H @@ -138,6 +138,7 @@ public: //- Return sensible enthalpy for gas i [J/Kg] virtual tmp gasHs ( + const volScalarField& p, const volScalarField& T, const label i ) const = 0; diff --git a/src/thermophysicalModels/specie/reaction/Reactions/ReversibleReaction/ReversibleReaction.C b/src/thermophysicalModels/specie/reaction/Reactions/ReversibleReaction/ReversibleReaction.C index 15ca24b90d..03e2c08244 100644 --- a/src/thermophysicalModels/specie/reaction/Reactions/ReversibleReaction/ReversibleReaction.C +++ b/src/thermophysicalModels/specie/reaction/Reactions/ReversibleReaction/ReversibleReaction.C @@ -100,7 +100,7 @@ Foam::scalar Foam::ReversibleReaction::kr const scalarField& c ) const { - return kfwd/this->Kc(T); + return kfwd/this->Kc(p, T); } diff --git a/src/thermophysicalModels/specie/thermo/absoluteEnthalpy/absoluteEnthalpy.H b/src/thermophysicalModels/specie/thermo/absoluteEnthalpy/absoluteEnthalpy.H index 87da23398f..d374a81d0b 100644 --- a/src/thermophysicalModels/specie/thermo/absoluteEnthalpy/absoluteEnthalpy.H +++ b/src/thermophysicalModels/specie/thermo/absoluteEnthalpy/absoluteEnthalpy.H @@ -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); } }; diff --git a/src/thermophysicalModels/specie/thermo/eConst/eConstThermo.H b/src/thermophysicalModels/specie/thermo/eConst/eConstThermo.H index f79745f965..0e3501a4b7 100644 --- a/src/thermophysicalModels/specie/thermo/eConst/eConstThermo.H +++ b/src/thermophysicalModels/specie/thermo/eConst/eConstThermo.H @@ -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 diff --git a/src/thermophysicalModels/specie/thermo/eConst/eConstThermoI.H b/src/thermophysicalModels/specie/thermo/eConst/eConstThermoI.H index 7465f0e887..752c6d1c1f 100644 --- a/src/thermophysicalModels/specie/thermo/eConst/eConstThermoI.H +++ b/src/thermophysicalModels/specie/thermo/eConst/eConstThermoI.H @@ -102,7 +102,8 @@ inline Foam::scalar Foam::eConstThermo::limit template inline Foam::scalar Foam::eConstThermo::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::cp template inline Foam::scalar Foam::eConstThermo::ha ( + const scalar p, const scalar T ) const { - return cp(T)*T + Hf_*this->W(); + return cp(p, T)*T + Hf_*this->W(); } template inline Foam::scalar Foam::eConstThermo::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::hc() const template inline Foam::scalar Foam::eConstThermo::s ( + const scalar p, const scalar T ) const { notImplemented ( - "scalar eConstThermo::s(const scalar) const" + "scalar eConstThermo::" + "s(const scalar p, const scalar) const" ); return T; } diff --git a/src/thermophysicalModels/specie/thermo/hConst/hConstThermo.H b/src/thermophysicalModels/specie/thermo/hConst/hConstThermo.H index adb5830f50..14068fbaef 100644 --- a/src/thermophysicalModels/specie/thermo/hConst/hConstThermo.H +++ b/src/thermophysicalModels/specie/thermo/hConst/hConstThermo.H @@ -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 diff --git a/src/thermophysicalModels/specie/thermo/hConst/hConstThermoI.H b/src/thermophysicalModels/specie/thermo/hConst/hConstThermoI.H index fd35d4d0c9..b7eda522b4 100644 --- a/src/thermophysicalModels/specie/thermo/hConst/hConstThermoI.H +++ b/src/thermophysicalModels/specie/thermo/hConst/hConstThermoI.H @@ -102,7 +102,8 @@ inline Foam::scalar Foam::hConstThermo::limit template inline Foam::scalar Foam::hConstThermo::cp ( - const scalar + const scalar p, + const scalar T ) const { return Cp_*this->W(); @@ -112,7 +113,7 @@ inline Foam::scalar Foam::hConstThermo::cp template inline Foam::scalar Foam::hConstThermo::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::ha template inline Foam::scalar Foam::hConstThermo::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::hc() const template inline Foam::scalar Foam::hConstThermo::s ( - const scalar T + const scalar p, const scalar T ) const { notImplemented ( - "scalar hConstThermo::s(const scalar T) const" + "scalar hConstThermo::" + "s(const scalar p, const scalar T) const" ); return T; } diff --git a/src/thermophysicalModels/specie/thermo/hPolynomial/hPolynomialThermo.H b/src/thermophysicalModels/specie/thermo/hPolynomial/hPolynomialThermo.H index 0501cde538..68b2ecd2d0 100644 --- a/src/thermophysicalModels/specie/thermo/hPolynomial/hPolynomialThermo.H +++ b/src/thermophysicalModels/specie/thermo/hPolynomial/hPolynomialThermo.H @@ -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 diff --git a/src/thermophysicalModels/specie/thermo/hPolynomial/hPolynomialThermoI.H b/src/thermophysicalModels/specie/thermo/hPolynomial/hPolynomialThermoI.H index 545eff3930..e06d563607 100644 --- a/src/thermophysicalModels/specie/thermo/hPolynomial/hPolynomialThermoI.H +++ b/src/thermophysicalModels/specie/thermo/hPolynomial/hPolynomialThermoI.H @@ -95,7 +95,7 @@ inline Foam::scalar Foam::hPolynomialThermo::limit template inline Foam::scalar Foam::hPolynomialThermo::cp ( - const scalar T + const scalar p, const scalar T ) const { return CpCoeffs_.value(T); @@ -105,7 +105,7 @@ inline Foam::scalar Foam::hPolynomialThermo::cp template inline Foam::scalar Foam::hPolynomialThermo::ha ( - const scalar T + const scalar p, const scalar T ) const { return hCoeffs_.value(T); @@ -115,10 +115,10 @@ inline Foam::scalar Foam::hPolynomialThermo::ha template inline Foam::scalar Foam::hPolynomialThermo::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 inline Foam::scalar Foam::hPolynomialThermo::s ( + const scalar p, const scalar T ) const { diff --git a/src/thermophysicalModels/specie/thermo/janaf/janafThermo.H b/src/thermophysicalModels/specie/thermo/janaf/janafThermo.H index 9f0c1f61ee..9407336600 100644 --- a/src/thermophysicalModels/specie/thermo/janaf/janafThermo.H +++ b/src/thermophysicalModels/specie/thermo/janaf/janafThermo.H @@ -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 diff --git a/src/thermophysicalModels/specie/thermo/janaf/janafThermoI.H b/src/thermophysicalModels/specie/thermo/janaf/janafThermoI.H index 3d58ad9315..1b0843f78d 100644 --- a/src/thermophysicalModels/specie/thermo/janaf/janafThermoI.H +++ b/src/thermophysicalModels/specie/thermo/janaf/janafThermoI.H @@ -159,6 +159,7 @@ Foam::janafThermo::lowCpCoeffs() const template inline Foam::scalar Foam::janafThermo::cp ( + const scalar p, const scalar T ) const { @@ -170,6 +171,7 @@ inline Foam::scalar Foam::janafThermo::cp template inline Foam::scalar Foam::janafThermo::ha ( + const scalar p, const scalar T ) const { @@ -185,10 +187,11 @@ inline Foam::scalar Foam::janafThermo::ha template inline Foam::scalar Foam::janafThermo::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::hc() const template inline Foam::scalar Foam::janafThermo::s ( + const scalar p, const scalar T ) const { diff --git a/src/thermophysicalModels/specie/thermo/sensibleEnthalpy/sensibleEnthalpy.H b/src/thermophysicalModels/specie/thermo/sensibleEnthalpy/sensibleEnthalpy.H index 88c2e486ec..e09e2a61f9 100644 --- a/src/thermophysicalModels/specie/thermo/sensibleEnthalpy/sensibleEnthalpy.H +++ b/src/thermophysicalModels/specie/thermo/sensibleEnthalpy/sensibleEnthalpy.H @@ -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); } }; diff --git a/src/thermophysicalModels/specie/thermo/sensibleInternalEnergy/sensibleInternalEnergy.H b/src/thermophysicalModels/specie/thermo/sensibleInternalEnergy/sensibleInternalEnergy.H index 2f33244b44..ddc48a2df0 100644 --- a/src/thermophysicalModels/specie/thermo/sensibleInternalEnergy/sensibleInternalEnergy.H +++ b/src/thermophysicalModels/specie/thermo/sensibleInternalEnergy/sensibleInternalEnergy.H @@ -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); } }; diff --git a/src/thermophysicalModels/specie/thermo/specieThermo/specieThermo.H b/src/thermophysicalModels/specie/thermo/specieThermo/specieThermo.H index b88cfc5517..6d5e1fd86a 100644 --- a/src/thermophysicalModels/specie/thermo/specieThermo/specieThermo.H +++ b/src/thermophysicalModels/specie/thermo/specieThermo/specieThermo.H @@ -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 diff --git a/src/thermophysicalModels/specie/thermo/specieThermo/specieThermoI.H b/src/thermophysicalModels/specie/thermo/specieThermo/specieThermoI.H index e7f78f5de8..8fa15c5350 100644 --- a/src/thermophysicalModels/specie/thermo/specieThermo/specieThermoI.H +++ b/src/thermophysicalModels/specie/thermo/specieThermo/specieThermoI.H @@ -41,9 +41,11 @@ template class Type> inline Foam::scalar Foam::specieThermo::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 { @@ -56,7 +58,8 @@ inline Foam::scalar Foam::specieThermo::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::heName() template class Type> inline Foam::scalar -Foam::specieThermo::he(const scalar T) const +Foam::specieThermo::he(const scalar p, const scalar T) const { - return Type >::he(*this, T); + return Type >::he(*this, p, T); } template class Type> inline Foam::scalar -Foam::specieThermo::cv(const scalar T) const +Foam::specieThermo::cv(const scalar p, const scalar T) const { - return this->cp(T) - this->RR; + return this->cp(p, T) - this->RR; } template class Type> inline Foam::scalar -Foam::specieThermo::cpv(const scalar T) const +Foam::specieThermo::cpv(const scalar p, const scalar T) const { - return Type >::cpv(*this, T); + return Type >::cpv(*this, p, T); } template class Type> inline Foam::scalar -Foam::specieThermo::gamma(const scalar T) const +Foam::specieThermo::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 Type> inline Foam::scalar -Foam::specieThermo::cpBycpv(const scalar T) const +Foam::specieThermo::cpBycpv(const scalar p, const scalar T) const { - return Type >::cpBycpv(*this, T); + return Type >::cpBycpv(*this, p, T); } template class Type> inline Foam::scalar -Foam::specieThermo::es(const scalar T) const +Foam::specieThermo::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 Type> inline Foam::scalar -Foam::specieThermo::ea(const scalar T) const +Foam::specieThermo::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 Type> inline Foam::scalar -Foam::specieThermo::g(const scalar T) const +Foam::specieThermo::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 Type> inline Foam::scalar -Foam::specieThermo::a(const scalar T) const +Foam::specieThermo::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 Type> inline Foam::scalar -Foam::specieThermo::Cpv(const scalar T) const +Foam::specieThermo::Cpv(const scalar p, const scalar T) const { - return this->cpv(T)/this->W(); + return this->cpv(p, T)/this->W(); } template class Type> inline Foam::scalar -Foam::specieThermo::Cp(const scalar T) const +Foam::specieThermo::Cp(const scalar p, const scalar T) const { - return this->cp(T)/this->W(); + return this->cp(p, T)/this->W(); } template class Type> inline Foam::scalar -Foam::specieThermo::Cv(const scalar T) const +Foam::specieThermo::Cv(const scalar p, const scalar T) const { - return this->cv(T)/this->W(); + return this->cv(p, T)/this->W(); } template class Type> inline Foam::scalar -Foam::specieThermo::HE(const scalar T) const +Foam::specieThermo::HE(const scalar p, const scalar T) const { - return Type >::HE(*this, T); + return Type >::HE(*this, p, T); } template class Type> inline Foam::scalar -Foam::specieThermo::H(const scalar T) const +Foam::specieThermo::H(const scalar p, const scalar T) const { - return this->h(T)/this->W(); + return this->h(p, T)/this->W(); } template class Type> inline Foam::scalar -Foam::specieThermo::Hs(const scalar T) const +Foam::specieThermo::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::Hc() const template class Type> inline Foam::scalar -Foam::specieThermo::Ha(const scalar T) const +Foam::specieThermo::Ha(const scalar p, const scalar T) const { - return this->ha(T)/this->W(); + return this->ha(p, T)/this->W(); } template class Type> inline Foam::scalar -Foam::specieThermo::S(const scalar T) const +Foam::specieThermo::S(const scalar p, const scalar T) const { - return this->s(T)/this->W(); + return this->s(p, T)/this->W(); } template class Type> inline Foam::scalar -Foam::specieThermo::E(const scalar T) const +Foam::specieThermo::E(const scalar p, const scalar T) const { - return this->e(T)/this->W(); + return this->e(p, T)/this->W(); } template class Type> inline Foam::scalar -Foam::specieThermo::Es(const scalar T) const +Foam::specieThermo::Es(const scalar p, const scalar T) const { - return this->es(T)/this->W(); + return this->es(p, T)/this->W(); } template class Type> inline Foam::scalar -Foam::specieThermo::Ea(const scalar T) const +Foam::specieThermo::Ea(const scalar p, const scalar T) const { - return this->ea(T)/this->W(); + return this->ea(p, T)/this->W(); } template class Type> inline Foam::scalar -Foam::specieThermo::G(const scalar T) const +Foam::specieThermo::G(const scalar p, const scalar T) const { - return this->g(T)/this->W(); + return this->g(p, T)/this->W(); } template class Type> inline Foam::scalar -Foam::specieThermo::A(const scalar T) const +Foam::specieThermo::A(const scalar p, const scalar T) const { - return this->a(T)/this->W(); + return this->a(p, T)/this->W(); } template class Type> inline Foam::scalar -Foam::specieThermo::K(const scalar T) const +Foam::specieThermo::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::K(const scalar T) const template class Type> inline Foam::scalar -Foam::specieThermo::Kp(const scalar T) const +Foam::specieThermo::Kp(const scalar p, const scalar T) const { - return K(T); + return K(p, T); } template class Type> inline Foam::scalar -Foam::specieThermo::Kc(const scalar T) const +Foam::specieThermo::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::Kc(const scalar T) const template class Type> inline Foam::scalar Foam::specieThermo::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::Kx template class Type> inline Foam::scalar Foam::specieThermo::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 Type> inline Foam::scalar Foam::specieThermo::THE ( const scalar he, + const scalar p, const scalar T0 ) const { - return Type >::THE(*this, he, T0); + return Type >::THE(*this, he, p, T0); } @@ -377,12 +381,14 @@ template class Type> inline Foam::scalar Foam::specieThermo::THs ( const scalar hs, + const scalar p, const scalar T0 ) const { return T ( hs, + p, T0, &specieThermo::Hs, &specieThermo::Cp, @@ -395,12 +401,14 @@ template class Type> inline Foam::scalar Foam::specieThermo::THa ( const scalar ht, + const scalar p, const scalar T0 ) const { return T ( ht, + p, T0, &specieThermo::Ha, &specieThermo::Cp, @@ -413,12 +421,14 @@ template class Type> inline Foam::scalar Foam::specieThermo::TEs ( const scalar es, + const scalar p, const scalar T0 ) const { return T ( es, + p, T0, &specieThermo::Es, &specieThermo::Cv, @@ -431,12 +441,14 @@ template class Type> inline Foam::scalar Foam::specieThermo::TEa ( const scalar e, + const scalar p, const scalar T0 ) const { return T ( ea, + p, T0, &specieThermo::Ea, &specieThermo::Cv, diff --git a/src/thermophysicalModels/specie/transport/const/constTransport.H b/src/thermophysicalModels/specie/transport/const/constTransport.H index aab02fb827..6b750b5cbc 100644 --- a/src/thermophysicalModels/specie/transport/const/constTransport.H +++ b/src/thermophysicalModels/specie/transport/const/constTransport.H @@ -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; diff --git a/src/thermophysicalModels/specie/transport/const/constTransportI.H b/src/thermophysicalModels/specie/transport/const/constTransportI.H index a087429121..9d6805eb0c 100644 --- a/src/thermophysicalModels/specie/transport/const/constTransportI.H +++ b/src/thermophysicalModels/specie/transport/const/constTransportI.H @@ -55,23 +55,35 @@ inline Foam::constTransport::constTransport // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template -inline Foam::scalar Foam::constTransport::mu(const scalar) const +inline Foam::scalar Foam::constTransport::mu +( + const scalar p, + const scalar T +) const { return mu_; } template -inline Foam::scalar Foam::constTransport::kappa(const scalar T) const +inline Foam::scalar Foam::constTransport::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 -inline Foam::scalar Foam::constTransport::alphah(const scalar T) const +inline Foam::scalar Foam::constTransport::alphah +( + const scalar p, + const scalar T +) const { - return mu(T)*rPr_; + return mu(p, T)*rPr_; } diff --git a/src/thermophysicalModels/specie/transport/polynomial/polynomialTransport.H b/src/thermophysicalModels/specie/transport/polynomial/polynomialTransport.H index a4ffbde2b7..d5a767fe44 100644 --- a/src/thermophysicalModels/specie/transport/polynomial/polynomialTransport.H +++ b/src/thermophysicalModels/specie/transport/polynomial/polynomialTransport.H @@ -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; diff --git a/src/thermophysicalModels/specie/transport/polynomial/polynomialTransportI.H b/src/thermophysicalModels/specie/transport/polynomial/polynomialTransportI.H index 57f546bd0d..a2ff3f4d22 100644 --- a/src/thermophysicalModels/specie/transport/polynomial/polynomialTransportI.H +++ b/src/thermophysicalModels/specie/transport/polynomial/polynomialTransportI.H @@ -104,6 +104,7 @@ Foam::polynomialTransport::New(const dictionary& dict) template inline Foam::scalar Foam::polynomialTransport::mu ( + const scalar p, const scalar T ) const { @@ -114,6 +115,7 @@ inline Foam::scalar Foam::polynomialTransport::mu template inline Foam::scalar Foam::polynomialTransport::kappa ( + const scalar p, const scalar T ) const { @@ -124,10 +126,10 @@ inline Foam::scalar Foam::polynomialTransport::kappa template inline Foam::scalar Foam::polynomialTransport::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); } diff --git a/src/thermophysicalModels/specie/transport/sutherland/sutherlandTransport.H b/src/thermophysicalModels/specie/transport/sutherland/sutherlandTransport.H index bb45f6bb13..5e91c15b76 100644 --- a/src/thermophysicalModels/specie/transport/sutherland/sutherlandTransport.H +++ b/src/thermophysicalModels/specie/transport/sutherland/sutherlandTransport.H @@ -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; diff --git a/src/thermophysicalModels/specie/transport/sutherland/sutherlandTransportI.H b/src/thermophysicalModels/specie/transport/sutherland/sutherlandTransportI.H index 2a718682ab..ac79418ed3 100644 --- a/src/thermophysicalModels/specie/transport/sutherland/sutherlandTransportI.H +++ b/src/thermophysicalModels/specie/transport/sutherland/sutherlandTransportI.H @@ -129,7 +129,11 @@ Foam::sutherlandTransport::New // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template -inline Foam::scalar Foam::sutherlandTransport::mu(const scalar T) const +inline Foam::scalar Foam::sutherlandTransport::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::mu(const scalar T) const template inline Foam::scalar Foam::sutherlandTransport::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 inline Foam::scalar Foam::sutherlandTransport::alphah ( + const scalar p, const scalar T ) const { - return kappa(T)/this->Cp(T); + return kappa(p, T)/this->Cp(p, T); } diff --git a/src/thermophysicalModels/thermalPorousZone/thermalModel/fixedTemperature/fixedTemperature.C b/src/thermophysicalModels/thermalPorousZone/thermalModel/fixedTemperature/fixedTemperature.C index d455704328..152c075bfe 100644 --- a/src/thermophysicalModels/thermalPorousZone/thermalModel/fixedTemperature/fixedTemperature.C +++ b/src/thermophysicalModels/thermalPorousZone/thermalModel/fixedTemperature/fixedTemperature.C @@ -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)); } } diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/htcConv/htcConvFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/htcConv/htcConvFvPatchScalarField.C index a47fd5cbc3..0d88cdcc3e 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/htcConv/htcConvFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/htcConv/htcConvFvPatchScalarField.C @@ -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); diff --git a/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/temperatureThermoBaffle1D/temperatureThermoBaffle1DFvPatchScalarField.C b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/temperatureThermoBaffle1D/temperatureThermoBaffle1DFvPatchScalarField.C index 0c09e6a10e..c69709cffc 100644 --- a/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/temperatureThermoBaffle1D/temperatureThermoBaffle1DFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/temperatureThermoBaffle1D/temperatureThermoBaffle1DFvPatchScalarField.C @@ -208,7 +208,6 @@ void temperatureThermoBaffle1DFvPatchScalarField::updateCoeffs() if (baffleActivated_) { - const fvPatch& nbrPatch = patch().boundaryMesh()[mpp.samplePolyPatch().index()]; @@ -230,9 +229,11 @@ void temperatureThermoBaffle1DFvPatchScalarField::updateCoeffs() const scalarField& Tp = patch().template lookupPatchField(TName_); + const scalarField& pp = model.thermo().p().boundaryField()[patchI]; + tmp 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::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::updateCoeffs() const scalarField nbrCpw ( - model.thermo().Cp(nbrField.patchInternalField(), nbrPatchI) + model.thermo().Cp(nbrHwPp, nbrField.patchInternalField(), nbrPatchI) ); scalarField nbrh