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