diff --git a/src/ThermophysicalTransportModels/fluid/derivedFvPatchFields/convectiveHeatTransfer/convectiveHeatTransferFvPatchScalarField.C b/src/ThermophysicalTransportModels/fluid/derivedFvPatchFields/convectiveHeatTransfer/convectiveHeatTransferFvPatchScalarField.C index c75a0f0dcb..3d0ea3620b 100644 --- a/src/ThermophysicalTransportModels/fluid/derivedFvPatchFields/convectiveHeatTransfer/convectiveHeatTransferFvPatchScalarField.C +++ b/src/ThermophysicalTransportModels/fluid/derivedFvPatchFields/convectiveHeatTransfer/convectiveHeatTransferFvPatchScalarField.C @@ -107,19 +107,16 @@ void convectiveHeatTransferFvPatchScalarField::updateCoeffs() const compressibleMomentumTransportModel& turbModel = ttm.momentumTransport(); - const scalarField alphaEffw(ttm.alphaEff(patchi)); - const tmp tnuw = turbModel.nu(patchi); const scalarField& nuw = tnuw(); const scalarField& rhow = turbModel.rho().boundaryField()[patchi]; const vectorField& Uc = turbModel.U(); const vectorField& Uw = turbModel.U().boundaryField()[patchi]; - const scalarField& Tw = ttm.thermo().T().boundaryField()[patchi]; - const scalarField Cpw(ttm.thermo().Cp(Tw, patchi)); + const scalarField Cpw(ttm.thermo().Cp().boundaryField()[patchi]); - const scalarField kappaw(Cpw*alphaEffw); - const scalarField Pr(rhow*nuw*Cpw/kappaw); + const scalarField kappaEffw(ttm.kappaEff(patchi)); + const scalarField Pr(rhow*nuw*Cpw/kappaEffw); scalarField& htc = *this; forAll(htc, facei) @@ -130,11 +127,11 @@ void convectiveHeatTransferFvPatchScalarField::updateCoeffs() if (Re < 5.0E+05) { - htc[facei] = 0.664*sqrt(Re)*cbrt(Pr[facei])*kappaw[facei]/L_; + htc[facei] = 0.664*sqrt(Re)*cbrt(Pr[facei])*kappaEffw[facei]/L_; } else { - htc[facei] = 0.037*pow(Re, 0.8)*cbrt(Pr[facei])*kappaw[facei]/L_; + htc[facei] = 0.037*pow(Re, 0.8)*cbrt(Pr[facei])*kappaEffw[facei]/L_; } } diff --git a/src/ThermophysicalTransportModels/fluid/derivedFvPatchFields/externalCoupledTemperatureMixed/externalCoupledTemperatureMixedFvPatchScalarField.C b/src/ThermophysicalTransportModels/fluid/derivedFvPatchFields/externalCoupledTemperatureMixed/externalCoupledTemperatureMixedFvPatchScalarField.C index f97721d2f9..3a7022d94d 100644 --- a/src/ThermophysicalTransportModels/fluid/derivedFvPatchFields/externalCoupledTemperatureMixed/externalCoupledTemperatureMixedFvPatchScalarField.C +++ b/src/ThermophysicalTransportModels/fluid/derivedFvPatchFields/externalCoupledTemperatureMixed/externalCoupledTemperatureMixedFvPatchScalarField.C @@ -120,15 +120,11 @@ void Foam::externalCoupledTemperatureMixedFvPatchScalarField::transferData internalField().group() ); - const basicThermo& thermo = ttm.thermo(); - - const fvPatchScalarField& hep = thermo.he().boundaryField()[patchi]; - - qDot = ttm.alphaEff(patchi)*hep.snGrad(); - // patch temperature [K] const scalarField Tp(*this); + qDot = ttm.kappaEff(patchi)*snGrad(); + // near wall cell temperature [K] const scalarField Tc(patchInternalField()); diff --git a/src/ThermophysicalTransportModels/fluid/derivedFvPatchFields/totalFlowRateAdvectiveDiffusive/totalFlowRateAdvectiveDiffusiveFvPatchScalarField.C b/src/ThermophysicalTransportModels/fluid/derivedFvPatchFields/totalFlowRateAdvectiveDiffusive/totalFlowRateAdvectiveDiffusiveFvPatchScalarField.C index 43cadc07c3..afa992d561 100644 --- a/src/ThermophysicalTransportModels/fluid/derivedFvPatchFields/totalFlowRateAdvectiveDiffusive/totalFlowRateAdvectiveDiffusiveFvPatchScalarField.C +++ b/src/ThermophysicalTransportModels/fluid/derivedFvPatchFields/totalFlowRateAdvectiveDiffusive/totalFlowRateAdvectiveDiffusiveFvPatchScalarField.C @@ -157,7 +157,10 @@ void Foam::totalFlowRateAdvectiveDiffusiveFvPatchScalarField::updateCoeffs() const fvsPatchField& phip = patch().lookupPatchField(phiName_); - const scalarField alphap(ttm.alphaEff(patchi)); + const scalarField alphap + ( + ttm.kappaEff(patchi)/ttm.thermo().Cpv().boundaryField()[patchi] + ); refValue() = massFluxFraction_; refGrad() = 0.0; diff --git a/src/ThermophysicalTransportModels/fluid/laminar/laminarThermophysicalTransportModel/laminarThermophysicalTransportModel.H b/src/ThermophysicalTransportModels/fluid/laminar/laminarThermophysicalTransportModel/laminarThermophysicalTransportModel.H index 493abda3da..0becc988be 100644 --- a/src/ThermophysicalTransportModels/fluid/laminar/laminarThermophysicalTransportModel/laminarThermophysicalTransportModel.H +++ b/src/ThermophysicalTransportModels/fluid/laminar/laminarThermophysicalTransportModel/laminarThermophysicalTransportModel.H @@ -170,7 +170,7 @@ public: return volScalarField::New ( "alphaEff", - this->thermo().alphahe() + this->thermo().kappa()/this->thermo().Cpv() ); } @@ -178,7 +178,9 @@ public: // for patch [kg/m/s] virtual tmp alphaEff(const label patchi) const { - return this->thermo().alphahe(patchi); + return + this->thermo().kappa().boundaryField()[patchi] + /this->thermo().Cpv().boundaryField()[patchi]; } //- Effective mass diffusion coefficient diff --git a/src/ThermophysicalTransportModels/fluid/laminar/unityLewisFourier/unityLewisFourier.C b/src/ThermophysicalTransportModels/fluid/laminar/unityLewisFourier/unityLewisFourier.C index 214b51bc53..5fc8abd7d0 100644 --- a/src/ThermophysicalTransportModels/fluid/laminar/unityLewisFourier/unityLewisFourier.C +++ b/src/ThermophysicalTransportModels/fluid/laminar/unityLewisFourier/unityLewisFourier.C @@ -98,7 +98,10 @@ unityLewisFourier::q() const "q", this->momentumTransport().alphaRhoPhi().group() ), - -fvc::interpolate(this->alpha()*this->thermo().alphahe()) + -fvc::interpolate + ( + this->alpha()*this->thermo().kappa()/this->thermo().Cpv() + ) *fvc::snGrad(this->thermo().he()) ); } @@ -109,7 +112,16 @@ tmp unityLewisFourier:: divq(volScalarField& he) const { - return -fvm::laplacian(this->alpha()*this->thermo().alphahe(), he); + volScalarField alphahe + ( + volScalarField::New + ( + "alphahe", + this->thermo().kappa()/this->thermo().Cpv() + ) + ); + + return -fvm::laplacian(this->alpha()*alphahe, he); } diff --git a/src/ThermophysicalTransportModels/fluid/turbulence/LES/LESThermophysicalTransportModel/LESThermophysicalTransportModel.H b/src/ThermophysicalTransportModels/fluid/turbulence/LES/LESThermophysicalTransportModel/LESThermophysicalTransportModel.H index 4e7ed9451f..d40a6c5686 100644 --- a/src/ThermophysicalTransportModels/fluid/turbulence/LES/LESThermophysicalTransportModel/LESThermophysicalTransportModel.H +++ b/src/ThermophysicalTransportModels/fluid/turbulence/LES/LESThermophysicalTransportModel/LESThermophysicalTransportModel.H @@ -157,10 +157,6 @@ public: //- Effective thermal turbulent diffusivity of mixture [kg/m/s] virtual tmp alphaEff() const = 0; - //- Effective thermal turbulent diffusivity of mixture - // for patch [kg/m/s] - virtual tmp alphaEff(const label patchi) const = 0; - //- Correct the LES transport virtual void correct(); diff --git a/src/ThermophysicalTransportModels/fluid/turbulence/RAS/RASThermophysicalTransportModel/RASThermophysicalTransportModel.H b/src/ThermophysicalTransportModels/fluid/turbulence/RAS/RASThermophysicalTransportModel/RASThermophysicalTransportModel.H index 7fbe5a5c06..7761ecd64b 100644 --- a/src/ThermophysicalTransportModels/fluid/turbulence/RAS/RASThermophysicalTransportModel/RASThermophysicalTransportModel.H +++ b/src/ThermophysicalTransportModels/fluid/turbulence/RAS/RASThermophysicalTransportModel/RASThermophysicalTransportModel.H @@ -157,10 +157,6 @@ public: //- Effective thermal turbulent diffusivity of mixture [kg/m/s] virtual tmp alphaEff() const = 0; - //- Effective thermal turbulent diffusivity of mixture - // for patch [kg/m/s] - virtual tmp alphaEff(const label patchi) const = 0; - //- Correct the RAS transport virtual void correct(); diff --git a/src/ThermophysicalTransportModels/fluid/turbulence/eddyDiffusivity/eddyDiffusivity.H b/src/ThermophysicalTransportModels/fluid/turbulence/eddyDiffusivity/eddyDiffusivity.H index 25e174511f..8569b3fafc 100644 --- a/src/ThermophysicalTransportModels/fluid/turbulence/eddyDiffusivity/eddyDiffusivity.H +++ b/src/ThermophysicalTransportModels/fluid/turbulence/eddyDiffusivity/eddyDiffusivity.H @@ -154,14 +154,17 @@ public: //- Effective thermal turbulent diffusivity of mixture [kg/m/s] virtual tmp alphaEff() const { - return this->thermo().alphahe() + alphat(); + return this->thermo().kappa()/this->thermo().Cpv() + alphat(); } //- Effective thermal turbulent diffusivity of mixture // for patch [kg/m/s] virtual tmp alphaEff(const label patchi) const { - return this->thermo().alphahe(patchi) + alphat(patchi); + return + this->thermo().kappa().boundaryField()[patchi] + /this->thermo().Cpv().boundaryField()[patchi] + + alphat(patchi); } //- Effective mass diffusion coefficient diff --git a/src/ThermophysicalTransportModels/fluid/turbulence/unityLewisEddyDiffusivity/unityLewisEddyDiffusivity.H b/src/ThermophysicalTransportModels/fluid/turbulence/unityLewisEddyDiffusivity/unityLewisEddyDiffusivity.H index ac59babe8a..5a01b9240c 100644 --- a/src/ThermophysicalTransportModels/fluid/turbulence/unityLewisEddyDiffusivity/unityLewisEddyDiffusivity.H +++ b/src/ThermophysicalTransportModels/fluid/turbulence/unityLewisEddyDiffusivity/unityLewisEddyDiffusivity.H @@ -162,14 +162,17 @@ public: //- Effective thermal turbulent diffusivity of mixture [kg/m/s] virtual tmp alphaEff() const { - return this->thermo().alphahe() + alphat(); + return this->thermo().kappa()/this->thermo().Cpv() + alphat(); } //- Effective thermal turbulent diffusivity of mixture // for patch [kg/m/s] virtual tmp alphaEff(const label patchi) const { - return this->thermo().alphahe(patchi) + alphat(patchi); + return + this->thermo().kappa().boundaryField()[patchi] + /this->thermo().Cpv().boundaryField()[patchi] + + alphat(patchi); } //- Effective mass diffusion coefficient diff --git a/src/functionObjects/field/turbulenceFields/turbulenceFields.C b/src/functionObjects/field/turbulenceFields/turbulenceFields.C index 53064a351c..038c03d182 100644 --- a/src/functionObjects/field/turbulenceFields/turbulenceFields.C +++ b/src/functionObjects/field/turbulenceFields/turbulenceFields.C @@ -57,7 +57,7 @@ const char* Foam::NamedEnum "omega", "nut", "nuEff", - "alphaEff", + "kappaEff", "R", "devTau" }; @@ -196,9 +196,9 @@ bool Foam::functionObjects::turbulenceFields::execute() processField(f, model.nuEff()); break; } - case compressibleField::alphaEff: + case compressibleField::kappaEff: { - processField(f, ttm.alphaEff()); + processField(f, ttm.kappaEff()); break; } case compressibleField::R: diff --git a/src/functionObjects/field/turbulenceFields/turbulenceFields.H b/src/functionObjects/field/turbulenceFields/turbulenceFields.H index e0e10b91e2..a5c59ea533 100644 --- a/src/functionObjects/field/turbulenceFields/turbulenceFields.H +++ b/src/functionObjects/field/turbulenceFields/turbulenceFields.H @@ -67,7 +67,7 @@ Usage nuEff | effective turbulence viscosity (incompressible) nut | turbulence viscosity (compressible) nuEff | effective turbulence viscosity (compressible) - alphaEff | effective turbulence thermal diffusivity (compressible) + kappaEff | effective turbulence thermal diffusivity (compressible) R | Reynolds stress tensor devSigma | Deviatoric part of the effective Reynolds stress \ (incompressible) @@ -115,7 +115,7 @@ public: omega, nut, nuEff, - alphaEff, + kappaEff, R, devTau }; diff --git a/src/fvModels/derived/solidEquilibriumEnergySource/solidEquilibriumEnergySource.C b/src/fvModels/derived/solidEquilibriumEnergySource/solidEquilibriumEnergySource.C index 4e50d5a9b2..3782fb6e3c 100644 --- a/src/fvModels/derived/solidEquilibriumEnergySource/solidEquilibriumEnergySource.C +++ b/src/fvModels/derived/solidEquilibriumEnergySource/solidEquilibriumEnergySource.C @@ -148,7 +148,11 @@ void Foam::fv::solidEquilibriumEnergySource::addSup const word& fieldName ) const { - const volScalarField alphahe(solidThermo().alphahe()); + const volScalarField alphahe + ( + "alphahe", + solidThermo().kappa()/solidThermo().Cpv() + ); const volScalarField& A = solidAlpha(); const volScalarField B(1 - A); @@ -172,7 +176,11 @@ void Foam::fv::solidEquilibriumEnergySource::addSup const word& fieldName ) const { - const volScalarField alphahe(alpha*solidThermo().alphahe()); + const volScalarField alphahe + ( + "alphahe", + solidThermo().kappa()/solidThermo().Cpv() + ); const volScalarField& A = solidAlpha(); const volScalarField B(1 - A); diff --git a/src/lagrangian/parcel/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilm.C b/src/lagrangian/parcel/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilm.C index 45a726aa1e..43db27dee5 100644 --- a/src/lagrangian/parcel/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilm.C +++ b/src/lagrangian/parcel/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilm.C @@ -503,7 +503,7 @@ void Foam::ThermoSurfaceFilm::cacheFilmFields filmModel.toPrimary(filmPatchi, TFilmPatch_); CpFilmPatch_ = - thermalFilmModel.thermo().Cpv()().boundaryField()[filmPatchi]; + thermalFilmModel.thermo().Cpv().boundaryField()[filmPatchi]; filmModel.toPrimary(filmPatchi, CpFilmPatch_); } diff --git a/src/regionModels/thermalBaffle/thermalBaffle/thermalBaffle.C b/src/regionModels/thermalBaffle/thermalBaffle/thermalBaffle.C index c433515773..60cd9c7b21 100644 --- a/src/regionModels/thermalBaffle/thermalBaffle/thermalBaffle.C +++ b/src/regionModels/thermalBaffle/thermalBaffle/thermalBaffle.C @@ -297,17 +297,14 @@ void thermalBaffle::info() forAll(coupledPatches, i) { const label patchi = coupledPatches[i]; - const fvPatchScalarField& phe = thermo_->he().boundaryField()[patchi]; - const word patchName = regionMesh().boundary()[patchi].name(); - Info<< indent << "Q : " << patchName << indent - << - gSum - ( - mag(regionMesh().Sf().boundaryField()[patchi]) - *phe.snGrad() - *thermo_->alphahe(patchi) - ) + Info<< indent << "Q : " << regionMesh().boundary()[patchi].name() + << indent + << gSum + ( + regionMesh().magSf().boundaryField()[patchi] + *thermophysicalTransport_->q()().boundaryField()[patchi] + ) << endl; } } diff --git a/src/thermophysicalModels/basic/basicThermo/basicThermo.H b/src/thermophysicalModels/basic/basicThermo/basicThermo.H index 78bd0e9f13..316fa24eb6 100644 --- a/src/thermophysicalModels/basic/basicThermo/basicThermo.H +++ b/src/thermophysicalModels/basic/basicThermo/basicThermo.H @@ -370,6 +370,9 @@ public: //- Heat capacity at constant volume [J/kg/K] virtual const volScalarField& Cv() const = 0; + //- Heat capacity at constant pressure/volume [J/kg/K] + virtual const volScalarField& Cpv() const = 0; + // Access to transport state variables @@ -400,24 +403,12 @@ public: const label patchi ) const = 0; - //- Heat capacity at constant pressure/volume [J/kg/K] - virtual tmp Cpv() const = 0; - //- Heat capacity at constant pressure/volume for patch [J/kg/K] virtual tmp Cpv ( const scalarField& T, const label patchi ) const = 0; - - - // Fields derived from transport state variables - - //- Thermal diffusivity of energy of mixture [kg/m/s] - virtual tmp alphahe() const = 0; - - //- Thermal diffusivity of energy of mixture for patch [kg/m/s] - virtual tmp alphahe(const label patchi) const = 0; }; diff --git a/src/thermophysicalModels/basic/heThermo/heThermo.C b/src/thermophysicalModels/basic/heThermo/heThermo.C index 551bb09b03..b5909c1d95 100644 --- a/src/thermophysicalModels/basic/heThermo/heThermo.C +++ b/src/thermophysicalModels/basic/heThermo/heThermo.C @@ -265,6 +265,21 @@ Foam::heThermo::~heThermo() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +template +const Foam::volScalarField& +Foam::heThermo::Cpv() const +{ + if (MixtureType::thermoType::enthalpy()) + { + return Cp_; + } + else + { + return Cv_; + } +} + + template Foam::tmp Foam::heThermo::he ( @@ -563,21 +578,6 @@ Foam::tmp Foam::heThermo::Cpv } -template -Foam::tmp -Foam::heThermo::Cpv() const -{ - if (MixtureType::thermoType::enthalpy()) - { - return Cp_; - } - else - { - return Cv_; - } -} - - template Foam::tmp Foam::heThermo::THE ( @@ -670,36 +670,6 @@ Foam::tmp Foam::heThermo::W } -template -Foam::tmp -Foam::heThermo::alphahe() const -{ - if (MixtureType::thermoType::enthalpy()) - { - return volScalarField::New("alphahe", this->kappa_/Cp_); - } - else - { - return volScalarField::New("alphahe", this->kappa_/Cv_); - } -} - - -template -Foam::tmp -Foam::heThermo::alphahe(const label patchi) const -{ - if (MixtureType::thermoType::enthalpy()) - { - return this->kappa_.boundaryField()[patchi]/Cp_.boundaryField()[patchi]; - } - else - { - return this->kappa_.boundaryField()[patchi]/Cv_.boundaryField()[patchi]; - } -} - - template bool Foam::heThermo::read() { diff --git a/src/thermophysicalModels/basic/heThermo/heThermo.H b/src/thermophysicalModels/basic/heThermo/heThermo.H index 3b75b43357..0a7f2ba3ec 100644 --- a/src/thermophysicalModels/basic/heThermo/heThermo.H +++ b/src/thermophysicalModels/basic/heThermo/heThermo.H @@ -209,6 +209,9 @@ public: return Cv_; } + //- Heat capacity at constant pressure/volume [J/kg/K] + virtual const volScalarField& Cpv() const; + // Fields derived from thermodynamic state variables @@ -342,9 +345,6 @@ public: const label patchi ) const; - //- Heat capacity at constant pressure/volume [J/kg/K] - virtual tmp Cpv() const; - //- Molecular weight [kg/kmol] virtual tmp W() const; @@ -352,15 +352,6 @@ public: virtual tmp W(const label patchi) const; - // Fields derived from transport state variables - - //- Thermal diffusivity of energy of mixture [kg/m/s] - virtual tmp alphahe() const; - - //- Thermal diffusivity of energy of mixture for patch [kg/m/s] - virtual tmp alphahe(const label patchi) const; - - //- Read thermophysical properties dictionary virtual bool read(); }; diff --git a/src/thermophysicalModels/solidThermo/constSolidThermo/constSolidThermo.C b/src/thermophysicalModels/solidThermo/constSolidThermo/constSolidThermo.C index 8260d2ecdb..722560b840 100644 --- a/src/thermophysicalModels/solidThermo/constSolidThermo/constSolidThermo.C +++ b/src/thermophysicalModels/solidThermo/constSolidThermo/constSolidThermo.C @@ -170,6 +170,12 @@ Foam::constSolidThermo::~constSolidThermo() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +const Foam::volScalarField& Foam::constSolidThermo::Cpv() const +{ + return Cv_; +} + + Foam::volScalarField& Foam::constSolidThermo::he() { return e_; @@ -367,12 +373,6 @@ Foam::tmp Foam::constSolidThermo::Cv } -Foam::tmp Foam::constSolidThermo::Cpv() const -{ - return Cv_; -} - - Foam::tmp Foam::constSolidThermo::Cpv ( const scalarField& T, @@ -383,23 +383,6 @@ Foam::tmp Foam::constSolidThermo::Cpv } -Foam::tmp Foam::constSolidThermo::alphahe() const -{ - NotImplemented; - return tmp(nullptr); -} - - -Foam::tmp Foam::constSolidThermo::alphahe -( - const label patchi -) const -{ - NotImplemented; - return tmp(nullptr); -} - - Foam::tmp Foam::constSolidThermo::Kappa() const { NotImplemented; diff --git a/src/thermophysicalModels/solidThermo/constSolidThermo/constSolidThermo.H b/src/thermophysicalModels/solidThermo/constSolidThermo/constSolidThermo.H index ba2901009c..06af005ac4 100644 --- a/src/thermophysicalModels/solidThermo/constSolidThermo/constSolidThermo.H +++ b/src/thermophysicalModels/solidThermo/constSolidThermo/constSolidThermo.H @@ -179,6 +179,9 @@ public: //- Heat capacity at constant volume [J/kg/K] virtual const volScalarField& Cv() const; + //- Heat capacity at constant pressure/volume [J/kg/K] + virtual const volScalarField& Cpv() const; + // Fields derived from thermodynamic state variables @@ -295,9 +298,6 @@ public: const label patchi ) const; - //- Heat capacity at constant pressure/volume [J/kg/K] - virtual tmp Cpv() const; - //- Heat capacity at constant pressure/volume for patch [J/kg/K] virtual tmp Cpv ( @@ -305,15 +305,6 @@ public: const label patchi ) const; - - // Fields derived from transport state variables - - //- Thermal diffusivity for energy of mixture [kg/m/s] - virtual tmp alphahe() const; - - //- Thermal diffusivity for energy of mixture for patch [kg/m/s] - virtual tmp alphahe(const label patchi) const; - //- Return true if thermal conductivity is isotropic virtual bool isotropic() const {