From cc96abda03745b1a86d34f02ff5e0585635ddf1e Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Mon, 10 Jan 2022 20:19:00 +0000 Subject: [PATCH] basicThermo: Cache thermal conductivity kappa rather than thermal diffusivity alpha Now that Cp and Cv are cached it is more convenient and consistent and slightly more efficient to cache thermal conductivity kappa rather than thermal diffusivity alpha which is not a fundamental property, the appropriate form depending on the energy solved for. kappa is converted into the appropriate thermal diffusivity for the energy form solved for by dividing by the corresponding cached heat capacity when required, which is efficient. --- ...ayatillekeWallFunctionFvPatchScalarField.C | 8 ++- ...allBoilingWallFunctionFvPatchScalarField.C | 9 ++- .../StationaryPhaseModel.C | 6 +- .../solidDisplacementThermo.C | 27 +++----- .../solidDisplacementThermo.H | 18 ++--- ...ayatillekeWallFunctionFvPatchScalarField.C | 8 ++- ...oupledTemperatureMixedFvPatchScalarField.C | 4 +- .../temperatureCoupledBase.C | 6 +- .../laminar/Fourier/Fourier.C | 4 +- .../laminarThermophysicalTransportModel.H | 4 +- .../unityLewisFourier/unityLewisFourier.C | 6 +- .../unityLewisFourier/unityLewisFourier.H | 8 ++- .../unityLewisEddyDiffusivity.H | 9 ++- ...alphatFilmWallFunctionFvPatchScalarField.C | 11 ++- .../thermalBaffle/thermalBaffle.C | 22 +++--- .../thermalBaffle/thermalBaffle.H | 4 +- .../basic/basicThermo/basicThermo.C | 21 ++---- .../basic/basicThermo/basicThermo.H | 66 +++++++----------- .../basic/fluidThermo/fluidThermo.H | 17 ++--- .../basic/heThermo/heThermo.C | 69 +++++-------------- .../basic/heThermo/heThermo.H | 30 ++++---- .../basic/psiThermo/hePsiThermo.C | 23 +++---- .../basic/rhoThermo/heRhoThermo.C | 23 +++---- .../mixtures/SpecieMixture/SpecieMixture.H | 12 +--- .../psiuReactionThermo/heheuPsiThermo.C | 23 +++---- .../solidThermo/solidThermo/heSolidThermo.C | 37 +++++----- .../cylinder/constant/cloudProperties | 2 +- .../hotBoxes/constant/cloudProperties | 2 +- .../splashPanel/constant/cloudProperties | 2 +- .../aachenBomb/constant/cloudProperties | 2 +- .../filter/constant/cloudProperties | 2 +- .../parcelInBox/constant/cloudProperties | 2 +- .../constant/coalCloudProperties | 2 +- .../constant/limestoneCloudProperties | 2 +- .../verticalChannel/constant/cloudProperties | 2 +- .../constant/cloudProperties | 2 +- .../constant/cloudProperties | 2 +- .../system/baffle3DRegion/fvSchemes | 2 +- .../laminar/cylinder/constant/cloudProperties | 2 +- 39 files changed, 217 insertions(+), 284 deletions(-) diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/derivedFvPatchFields/alphatPhaseJayatillekeWallFunction/alphatPhaseJayatillekeWallFunctionFvPatchScalarField.C b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/derivedFvPatchFields/alphatPhaseJayatillekeWallFunction/alphatPhaseJayatillekeWallFunctionFvPatchScalarField.C index 1e7706caae..5c64356994 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/derivedFvPatchFields/alphatPhaseJayatillekeWallFunction/alphatPhaseJayatillekeWallFunctionFvPatchScalarField.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/derivedFvPatchFields/alphatPhaseJayatillekeWallFunction/alphatPhaseJayatillekeWallFunctionFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -185,7 +185,11 @@ alphatPhaseJayatillekeWallFunctionFvPatchScalarField::calcAlphat const tmp tnuw = turbModel.nu(patchi); const scalarField& nuw = tnuw(); - const tmp talphaw = phase.thermo().alpha(patchi); + const tmp talphaw + ( + phase.thermo().kappa().boundaryField()[patchi] + /phase.thermo().Cp().boundaryField()[patchi] + ); const scalarField& alphaw = talphaw(); const tmp tk = turbModel.k(); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C index f87ab5c8c7..3e5952d0d7 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseCompressibleMomentumTransportModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -356,7 +356,12 @@ void alphatWallBoilingWallFunctionFvPatchScalarField::updateCoeffs() const rhoThermo& lThermo = liquid.thermo(); - const scalarField& alphaw = lThermo.alpha(patchi); + const tmp talphaw + ( + lThermo.kappa().boundaryField()[patchi] + /lThermo.Cp().boundaryField()[patchi] + ); + const scalarField& alphaw = talphaw(); const tmp tk = turbModel.k(); const volScalarField& k = tk(); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/phaseModel/StationaryPhaseModel/StationaryPhaseModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/phaseModel/StationaryPhaseModel/StationaryPhaseModel.C index c22c2afedb..b5c9b0607e 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/phaseModel/StationaryPhaseModel/StationaryPhaseModel.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/phaseModel/StationaryPhaseModel/StationaryPhaseModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -280,7 +280,7 @@ template Foam::tmp Foam::StationaryPhaseModel::kappaEff(const label patchi) const { - return this->thermo().kappa(patchi); + return this->thermo().kappa().boundaryField()[patchi]; } @@ -318,7 +318,7 @@ Foam::StationaryPhaseModel::divq(volScalarField& he) const return -fvm::laplacian ( - fvc::interpolate(alpha)*fvc::interpolate(this->thermo().alpha()), + fvc::interpolate(alpha)*fvc::interpolate(this->thermo().alphahe()), he ); } diff --git a/applications/solvers/stressAnalysis/solidDisplacementFoam/solidDisplacementThermo/solidDisplacementThermo.C b/applications/solvers/stressAnalysis/solidDisplacementFoam/solidDisplacementThermo/solidDisplacementThermo.C index f131937f91..85ea6ddbdb 100644 --- a/applications/solvers/stressAnalysis/solidDisplacementFoam/solidDisplacementThermo/solidDisplacementThermo.C +++ b/applications/solvers/stressAnalysis/solidDisplacementFoam/solidDisplacementThermo/solidDisplacementThermo.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2019-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2019-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -399,7 +399,13 @@ Foam::tmp Foam::solidDisplacementThermo::THE } -Foam::tmp Foam::solidDisplacementThermo::Cp() const +const Foam::volScalarField& Foam::solidDisplacementThermo::Cp() const +{ + return Cp_; +} + + +const Foam::volScalarField& Foam::solidDisplacementThermo::Cv() const { return Cp_; } @@ -415,12 +421,6 @@ Foam::tmp Foam::solidDisplacementThermo::Cp } -Foam::tmp Foam::solidDisplacementThermo::Cv() const -{ - return Cp_; -} - - Foam::tmp Foam::solidDisplacementThermo::Cv ( const scalarField& T, @@ -447,21 +447,12 @@ Foam::tmp Foam::solidDisplacementThermo::Cpv } -Foam::tmp Foam::solidDisplacementThermo::kappa() const +const Foam::volScalarField& Foam::solidDisplacementThermo::kappa() const { return kappa_; } -Foam::tmp Foam::solidDisplacementThermo::kappa -( - const label patchi -) const -{ - return kappa_.boundaryField()[patchi]; -} - - Foam::tmp Foam::solidDisplacementThermo::alphahe() const { NotImplemented; diff --git a/applications/solvers/stressAnalysis/solidDisplacementFoam/solidDisplacementThermo/solidDisplacementThermo.H b/applications/solvers/stressAnalysis/solidDisplacementFoam/solidDisplacementThermo/solidDisplacementThermo.H index 6c0f67e502..663e5c2554 100644 --- a/applications/solvers/stressAnalysis/solidDisplacementFoam/solidDisplacementThermo/solidDisplacementThermo.H +++ b/applications/solvers/stressAnalysis/solidDisplacementFoam/solidDisplacementThermo/solidDisplacementThermo.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2019-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2019-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -168,10 +168,16 @@ public: virtual const volScalarField& he() const; //- Heat capacity at constant pressure [J/kg/K] - virtual tmp Cp() const; + virtual const volScalarField& Cp() const; //- Heat capacity at constant volume [J/kg/K] - virtual tmp Cv() const; + virtual const volScalarField& Cv() const; + + + // Access to transport state variables + + //- Thermal diffusivity for temperature of mixture [W/m/K] + virtual const volScalarField& kappa() const; // Fields derived from thermodynamic state variables @@ -302,12 +308,6 @@ public: // Fields derived from transport state variables - //- Thermal diffusivity for temperature of mixture [W/m/K] - virtual tmp kappa() const; - - //- Thermal diffusivity for temperature of mixture for patch [W/m/K] - virtual tmp kappa(const label patchi) const; - //- Thermal diffusivity for energy of mixture [kg/m/s] virtual tmp alphahe() const; diff --git a/src/ThermophysicalTransportModels/derivedFvPatchFields/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C b/src/ThermophysicalTransportModels/derivedFvPatchFields/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C index 19f22a0b8d..170cae2268 100644 --- a/src/ThermophysicalTransportModels/derivedFvPatchFields/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C +++ b/src/ThermophysicalTransportModels/derivedFvPatchFields/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -171,7 +171,11 @@ void alphatJayatillekeWallFunctionFvPatchScalarField::updateCoeffs() const tmp tnuw = turbModel.nu(patchi); const scalarField& nuw = tnuw(); - const tmp talphaw = ttm.thermo().alpha(patchi); + const tmp talphaw + ( + ttm.thermo().kappa().boundaryField()[patchi] + /ttm.thermo().Cp().boundaryField()[patchi] + ); const scalarField& alphaw = talphaw(); scalarField& alphatw = *this; diff --git a/src/ThermophysicalTransportModels/derivedFvPatchFields/externalCoupledTemperatureMixed/externalCoupledTemperatureMixedFvPatchScalarField.C b/src/ThermophysicalTransportModels/derivedFvPatchFields/externalCoupledTemperatureMixed/externalCoupledTemperatureMixedFvPatchScalarField.C index 722300841b..2697f27811 100644 --- a/src/ThermophysicalTransportModels/derivedFvPatchFields/externalCoupledTemperatureMixed/externalCoupledTemperatureMixedFvPatchScalarField.C +++ b/src/ThermophysicalTransportModels/derivedFvPatchFields/externalCoupledTemperatureMixed/externalCoupledTemperatureMixedFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2013-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -142,7 +142,7 @@ void Foam::externalCoupledTemperatureMixedFvPatchScalarField::transferData const fvPatchScalarField& hep = thermo.he().boundaryField()[patchi]; - qDot = thermo.alpha().boundaryField()[patchi]*hep.snGrad(); + qDot = thermo.alphahe(patchi)*hep.snGrad(); } else { diff --git a/src/ThermophysicalTransportModels/derivedFvPatchFields/temperatureCoupledBase/temperatureCoupledBase.C b/src/ThermophysicalTransportModels/derivedFvPatchFields/temperatureCoupledBase/temperatureCoupledBase.C index e09bcdcdfb..b9f36f71c8 100644 --- a/src/ThermophysicalTransportModels/derivedFvPatchFields/temperatureCoupledBase/temperatureCoupledBase.C +++ b/src/ThermophysicalTransportModels/derivedFvPatchFields/temperatureCoupledBase/temperatureCoupledBase.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -99,7 +99,7 @@ Foam::tmp Foam::temperatureCoupledBase::kappa const fluidThermo& thermo = mesh.lookupObject(fluidThermoName); - return thermo.kappa(patchi); + return thermo.kappa().boundaryField()[patchi]; } } else if (mesh.foundObject(physicalProperties::typeName)) @@ -116,7 +116,7 @@ Foam::tmp Foam::temperatureCoupledBase::kappa } else { - return thermo.kappa(patchi); + return thermo.kappa().boundaryField()[patchi]; } } else diff --git a/src/ThermophysicalTransportModels/laminar/Fourier/Fourier.C b/src/ThermophysicalTransportModels/laminar/Fourier/Fourier.C index f82e512e06..62a627ba7d 100644 --- a/src/ThermophysicalTransportModels/laminar/Fourier/Fourier.C +++ b/src/ThermophysicalTransportModels/laminar/Fourier/Fourier.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2020-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -130,7 +130,7 @@ Fourier::divq(volScalarField& he) const // Return heat flux source as an implicit energy correction // to the temperature gradient flux return - -correction(fvm::laplacian(this->alpha()*thermo.alpha(), he)) + -correction(fvm::laplacian(this->alpha()*thermo.alphahe(), he)) -fvc::laplacian(this->alpha()*thermo.kappa(), thermo.T()); } diff --git a/src/ThermophysicalTransportModels/laminar/laminarThermophysicalTransportModel/laminarThermophysicalTransportModel.H b/src/ThermophysicalTransportModels/laminar/laminarThermophysicalTransportModel/laminarThermophysicalTransportModel.H index a5815c4f07..393a4805c0 100644 --- a/src/ThermophysicalTransportModels/laminar/laminarThermophysicalTransportModel/laminarThermophysicalTransportModel.H +++ b/src/ThermophysicalTransportModels/laminar/laminarThermophysicalTransportModel/laminarThermophysicalTransportModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2020-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2020-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -161,7 +161,7 @@ public: // of mixture for patch [W/m/K] virtual tmp kappaEff(const label patchi) const { - return this->thermo().kappa(patchi); + return this->thermo().kappa().boundaryField()[patchi]; } //- Effective thermal turbulent diffusivity of mixture [kg/m/s] diff --git a/src/ThermophysicalTransportModels/laminar/unityLewisFourier/unityLewisFourier.C b/src/ThermophysicalTransportModels/laminar/unityLewisFourier/unityLewisFourier.C index 64b700b509..214b51bc53 100644 --- a/src/ThermophysicalTransportModels/laminar/unityLewisFourier/unityLewisFourier.C +++ b/src/ThermophysicalTransportModels/laminar/unityLewisFourier/unityLewisFourier.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2020-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2020-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -98,7 +98,7 @@ unityLewisFourier::q() const "q", this->momentumTransport().alphaRhoPhi().group() ), - -fvc::interpolate(this->alpha()*this->thermo().alpha()) + -fvc::interpolate(this->alpha()*this->thermo().alphahe()) *fvc::snGrad(this->thermo().he()) ); } @@ -109,7 +109,7 @@ tmp unityLewisFourier:: divq(volScalarField& he) const { - return -fvm::laplacian(this->alpha()*this->thermo().alpha(), he); + return -fvm::laplacian(this->alpha()*this->thermo().alphahe(), he); } diff --git a/src/ThermophysicalTransportModels/laminar/unityLewisFourier/unityLewisFourier.H b/src/ThermophysicalTransportModels/laminar/unityLewisFourier/unityLewisFourier.H index 29abda7c0c..b97b8cb083 100644 --- a/src/ThermophysicalTransportModels/laminar/unityLewisFourier/unityLewisFourier.H +++ b/src/ThermophysicalTransportModels/laminar/unityLewisFourier/unityLewisFourier.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2020-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2020-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -113,7 +113,7 @@ public: return volScalarField::New ( "DEff", - this->thermo().alpha() + this->thermo().kappa()/this->thermo().Cp() ); } @@ -125,7 +125,9 @@ public: const label patchi ) const { - return this->thermo().alpha(patchi); + return + this->thermo().kappa().boundaryField()[patchi] + /this->thermo().Cp().boundaryField()[patchi]; } //- Return the heat flux [W/m^2] diff --git a/src/ThermophysicalTransportModels/turbulence/unityLewisEddyDiffusivity/unityLewisEddyDiffusivity.H b/src/ThermophysicalTransportModels/turbulence/unityLewisEddyDiffusivity/unityLewisEddyDiffusivity.H index 05a461ec4f..a67deed171 100644 --- a/src/ThermophysicalTransportModels/turbulence/unityLewisEddyDiffusivity/unityLewisEddyDiffusivity.H +++ b/src/ThermophysicalTransportModels/turbulence/unityLewisEddyDiffusivity/unityLewisEddyDiffusivity.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2020-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2020-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -185,7 +185,7 @@ public: return volScalarField::New ( "DEff", - this->thermo().alpha() + alphat() + this->thermo().kappa()/this->thermo().Cp() + alphat() ); } @@ -197,7 +197,10 @@ public: const label patchi ) const { - return this->thermo().alpha(patchi) + alphat(patchi); + return + this->thermo().kappa().boundaryField()[patchi] + /this->thermo().Cp().boundaryField()[patchi] + + alphat(patchi); } //- Return the heat flux [W/m^2] diff --git a/src/regionModels/surfaceFilmModels/derivedFvPatchFields/wallFunctions/alphatFilmWallFunction/alphatFilmWallFunctionFvPatchScalarField.C b/src/regionModels/surfaceFilmModels/derivedFvPatchFields/wallFunctions/alphatFilmWallFunction/alphatFilmWallFunctionFvPatchScalarField.C index 40add7c0ed..57a107cd3b 100644 --- a/src/regionModels/surfaceFilmModels/derivedFvPatchFields/wallFunctions/alphatFilmWallFunction/alphatFilmWallFunctionFvPatchScalarField.C +++ b/src/regionModels/surfaceFilmModels/derivedFvPatchFields/wallFunctions/alphatFilmWallFunction/alphatFilmWallFunctionFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -166,8 +166,13 @@ void alphatFilmWallFunctionFvPatchScalarField::updateCoeffs() const volScalarField& k = tk(); const tmp tnuw = turbModel.nu(patchi); const scalarField& nuw = tnuw(); - const tmp talpha = ttm.thermo().alpha(patchi); - const scalarField& alphaw = talpha(); + + const tmp talphaw + ( + ttm.thermo().kappa().boundaryField()[patchi] + /ttm.thermo().Cp().boundaryField()[patchi] + ); + const scalarField& alphaw = talphaw(); const scalar Cmu25 = pow(Cmu_, 0.25); diff --git a/src/regionModels/thermalBaffleModels/thermalBaffle/thermalBaffle.C b/src/regionModels/thermalBaffleModels/thermalBaffle/thermalBaffle.C index d05edde07d..48e88ef16d 100644 --- a/src/regionModels/thermalBaffleModels/thermalBaffle/thermalBaffle.C +++ b/src/regionModels/thermalBaffleModels/thermalBaffle/thermalBaffle.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -83,7 +83,7 @@ void thermalBaffle::solveEnergy() volScalarField& Q = tQ.ref(); volScalarField rho("rho", thermo_->rho()); - volScalarField alpha("alpha", thermo_->alpha()); + volScalarField alphahe(thermo_->alphahe()); // If region is one-dimension variable thickness @@ -106,7 +106,7 @@ void thermalBaffle::solveEnergy() rho[cellId] *= delta_.value()/thickness_[localFacei]; - alpha[cellId] *= delta_.value()/thickness_[localFacei]; + alphahe[cellId] *= delta_.value()/thickness_[localFacei]; } } } @@ -117,8 +117,8 @@ void thermalBaffle::solveEnergy() fvScalarMatrix hEqn ( - fvm::ddt(rho, h_) - - fvm::laplacian(alpha, h_) + fvm::ddt(rho, he_) + - fvm::laplacian(alphahe, he_) == Q ); @@ -127,7 +127,7 @@ void thermalBaffle::solveEnergy() { surfaceScalarField phiMesh ( - fvc::interpolate(rho*h_)*regionMesh().phi() + fvc::interpolate(rho*he_)*regionMesh().phi() ); hEqn -= fvc::div(phiMesh); @@ -155,7 +155,7 @@ thermalBaffle::thermalBaffle thermalBaffleModel(modelType, mesh, dict), nNonOrthCorr_(solution().lookup