fluidThermo: Moved kappaEff and alphaEff into ThermophysicalTransportModels

This completes the separation between thermodynamics and thermophysical
transport modelling and all models and boundary conditions involving heat
transfer now obtain the transport coefficients from the appropriate
ThermophysicalTransportModels rather than from fluidThermo.
This commit is contained in:
Henry Weller
2022-09-07 18:31:04 +01:00
parent 461075725d
commit 6d563efec1
14 changed files with 84 additions and 232 deletions

View File

@ -138,44 +138,37 @@ Foam::compressibleInterPhaseTransportModel::compressibleInterPhaseTransportModel
Foam::tmp<Foam::volScalarField> Foam::tmp<Foam::volScalarField>
Foam::compressibleInterPhaseTransportModel::alphaEff() const Foam::compressibleInterPhaseTransportModel::alphaEff() const
{ {
/* ***HGW
if (twoPhaseTransport_) if (twoPhaseTransport_)
{ {
return return
mixture_.alpha1()*mixture_.thermo1().alphaEff mixture_.alpha1()
( *(
turbulence1_->alphat() mixture_.thermo1().kappa()
) + mixture_.thermo1().rho()*mixture_.thermo1().Cp()
+ mixture_.alpha2()*mixture_.thermo2().alphaEff *turbulence1_->nut()
( )/mixture_.thermo1().Cv()
turbulence2_->alphat() + mixture_.alpha2()
); *(
mixture_.thermo2().kappa()
+ mixture_.thermo2().rho()*mixture_.thermo2().Cp()
*turbulence2_->nut()
)/mixture_.thermo2().Cv();
} }
else else
{
return mixture_.alphaEff(turbulence_->alphat());
}
*/
if (twoPhaseTransport_)
{ {
return return
mixture_.alpha1()*mixture_.thermo1().alphaEff mixture_.alpha1()
( *(
mixture_.thermo1().rho()*turbulence1_->nut() mixture_.thermo1().kappa()
) + mixture_.thermo1().rho()*mixture_.thermo1().Cp()
+ mixture_.alpha2()*mixture_.thermo2().alphaEff *turbulence_->nut()
( )/mixture_.thermo1().Cv()
mixture_.thermo2().rho()*turbulence2_->nut() + mixture_.alpha2()
); *(
} mixture_.thermo2().kappa()
else + mixture_.thermo2().rho()*mixture_.thermo2().Cp()
{ *turbulence_->nut()
const volScalarField alphat(mixture_.rho()*turbulence_->nut()); )/mixture_.thermo2().Cv();
return
mixture_.alpha1()*mixture_.thermo1().alphaEff(alphat)
+ mixture_.alpha2()*mixture_.thermo2().alphaEff(alphat);
} }
} }

View File

@ -115,6 +115,7 @@ public:
// Member Functions // Member Functions
//- Return the effective temperature transport coefficient //- Return the effective temperature transport coefficient
// derived from the phase internal energy equations i.e. <kappa/Cv>
tmp<volScalarField> alphaEff() const; tmp<volScalarField> alphaEff() const;
//- Return the effective momentum stress divergence //- Return the effective momentum stress divergence

View File

@ -2,7 +2,7 @@
fvScalarMatrix TEqn fvScalarMatrix TEqn
( (
fvm::ddt(rho, T) + fvm::div(mixture.rhoPhi(), T) - fvm::Sp(contErr, T) fvm::ddt(rho, T) + fvm::div(mixture.rhoPhi(), T) - fvm::Sp(contErr, T)
- fvm::laplacian(mixture.alphaEff(rho*turbulence->nut()), T) - fvm::laplacian(mixture.alphaEff(turbulence->nut()), T)
+ ( + (
fvc::div(fvc::absolute(phi, U), p)()() // - contErr/rho*p fvc::div(fvc::absolute(phi, U), p)()() // - contErr/rho*p
+ (fvc::ddt(rho, K) + fvc::div(mixture.rhoPhi(), K))()() + (fvc::ddt(rho, K) + fvc::div(mixture.rhoPhi(), K))()()

View File

@ -247,16 +247,28 @@ Foam::tmp<Foam::scalarField> Foam::compressibleMultiphaseMixture::nu
Foam::tmp<Foam::volScalarField> Foam::compressibleMultiphaseMixture::alphaEff Foam::tmp<Foam::volScalarField> Foam::compressibleMultiphaseMixture::alphaEff
( (
const volScalarField& alphat const volScalarField& nut
) const ) const
{ {
PtrDictionary<phaseModel>::const_iterator phasei = phases_.begin(); PtrDictionary<phaseModel>::const_iterator phasei = phases_.begin();
tmp<volScalarField> talphaEff(phasei()*phasei().thermo().alphaEff(alphat)); tmp<volScalarField> talphaEff
(
phasei()
*(
phasei().thermo().kappa()
+ phasei().thermo().rho()*phasei().thermo().Cp()*nut
)/phasei().thermo().Cv()
);
for (++phasei; phasei != phases_.end(); ++phasei) for (++phasei; phasei != phases_.end(); ++phasei)
{ {
talphaEff.ref() += phasei()*phasei().thermo().alphaEff(alphat); talphaEff.ref() +=
phasei()
*(
phasei().thermo().kappa()
+ phasei().thermo().rho()*phasei().thermo().Cp()*nut
)/phasei().thermo().Cv();
} }
return talphaEff; return talphaEff;

View File

@ -263,10 +263,11 @@ public:
//- Kinematic viscosity of mixture for patch [m^2/s] //- Kinematic viscosity of mixture for patch [m^2/s]
virtual tmp<scalarField> nu(const label patchi) const; virtual tmp<scalarField> nu(const label patchi) const;
//- Effective thermal diffusivity of mixture [W/m/K] //- Return the effective temperature transport coefficient
// derived from the phase internal energy equations i.e. <kappa/Cv>
virtual tmp<volScalarField> alphaEff virtual tmp<volScalarField> alphaEff
( (
const volScalarField& alphat const volScalarField& nut
) const; ) const;
//- Return the phase-averaged reciprocal Cv //- Return the phase-averaged reciprocal Cv

View File

@ -191,7 +191,7 @@ void alphatJayatillekeWallFunctionFvPatchScalarField::updateCoeffs()
const fvPatchScalarField& hew = ttm.thermo().he().boundaryField()[patchi]; const fvPatchScalarField& hew = ttm.thermo().he().boundaryField()[patchi];
// Heat flux [W/m^2] - lagging alphatw // Heat flux [W/m^2] - lagging alphatw
const scalarField qDot(ttm.thermo().alphaEff(alphatw, patchi)*hew.snGrad()); const scalarField qDot(ttm.alphaEff(patchi)*hew.snGrad());
// Populate boundary values // Populate boundary values
forAll(alphatw, facei) forAll(alphatw, facei)

View File

@ -71,36 +71,21 @@ Foam::tmp<Foam::scalarField> Foam::temperatureCoupledBase::kappa
const word& phase(Tp.internalField().group()); const word& phase(Tp.internalField().group());
const word fluidThermoName const word ttmName
( (
IOobject::groupName(physicalProperties::typeName, phase) IOobject::groupName
(
thermophysicalTransportModel::typeName,
phase
)
); );
if (mesh.foundObject<fluidThermo>(fluidThermoName)) if (mesh.foundObject<thermophysicalTransportModel>(ttmName))
{ {
static word ttmName const thermophysicalTransportModel& ttm =
( mesh.lookupObject<thermophysicalTransportModel>(ttmName);
IOobject::groupName
(
thermophysicalTransportModel::typeName,
phase
)
);
if (mesh.foundObject<thermophysicalTransportModel>(ttmName)) return ttm.kappaEff(patchi);
{
const thermophysicalTransportModel& ttm =
mesh.lookupObject<thermophysicalTransportModel>(ttmName);
return ttm.kappaEff(patchi);
}
else
{
const fluidThermo& thermo =
mesh.lookupObject<fluidThermo>(fluidThermoName);
return thermo.kappa().boundaryField()[patchi];
}
} }
else if (mesh.foundObject<solidThermo>(physicalProperties::typeName)) else if (mesh.foundObject<solidThermo>(physicalProperties::typeName))
{ {

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2020-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2020-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -139,35 +139,29 @@ public:
// of mixture [W/m/K] // of mixture [W/m/K]
virtual tmp<volScalarField> kappaEff() const virtual tmp<volScalarField> kappaEff() const
{ {
return this->thermo().kappaEff(alphat()); return this->thermo().kappa() + this->thermo().Cp()*alphat();
} }
//- Effective thermal turbulent diffusivity for temperature //- Effective thermal turbulent diffusivity for temperature
// of mixture for patch [W/m/K] // of mixture for patch [W/m/K]
virtual tmp<scalarField> kappaEff(const label patchi) const virtual tmp<scalarField> kappaEff(const label patchi) const
{ {
return this->thermo().kappaEff return
( this->thermo().kappa().boundaryField()[patchi]
alphat(patchi), + this->thermo().Cp().boundaryField()[patchi]*alphat(patchi);
patchi
);
} }
//- Effective thermal turbulent diffusivity of mixture [kg/m/s] //- Effective thermal turbulent diffusivity of mixture [kg/m/s]
virtual tmp<volScalarField> alphaEff() const virtual tmp<volScalarField> alphaEff() const
{ {
return this->thermo().alphaEff(alphat()); return this->thermo().alphahe() + alphat();
} }
//- Effective thermal turbulent diffusivity of mixture //- Effective thermal turbulent diffusivity of mixture
// for patch [kg/m/s] // for patch [kg/m/s]
virtual tmp<scalarField> alphaEff(const label patchi) const virtual tmp<scalarField> alphaEff(const label patchi) const
{ {
return this->thermo().alphaEff return this->thermo().alphahe(patchi) + alphat(patchi);
(
alphat(patchi),
patchi
);
} }
//- Effective mass diffusion coefficient //- Effective mass diffusion coefficient

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2020-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2020-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -129,7 +129,10 @@ nonUnityLewisEddyDiffusivity<TurbulenceThermophysicalTransportModel>::q() const
fvc::interpolate fvc::interpolate
( (
this->alpha() this->alpha()
*this->thermo().alphaEff((this->Prt_/Sct_)*this->alphat()) *(
this->thermo().kappa()/this->thermo().Cp()
+ (this->Prt_/Sct_)*this->alphat()
)
)*hGradY; )*hGradY;
} }
@ -185,7 +188,10 @@ nonUnityLewisEddyDiffusivity<TurbulenceThermophysicalTransportModel>::divq
fvc::interpolate fvc::interpolate
( (
this->alpha() this->alpha()
*this->thermo().alphaEff((this->Prt_/Sct_)*this->alphat()) *(
this->thermo().kappa()/this->thermo().Cp()
+ (this->Prt_/Sct_)*this->alphat()
)
)*hGradY*he.mesh().magSf() )*hGradY*he.mesh().magSf()
); );

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2020-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2020-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -125,7 +125,8 @@ public:
return volScalarField::New return volScalarField::New
( (
"DEff", "DEff",
this->thermo().alphaEff((this->Prt_/Sct_)*this->alphat()) this->thermo().kappa()/this->thermo().Cp()
+ (this->Prt_/Sct_)*this->alphat()
); );
} }
@ -137,11 +138,10 @@ public:
const label patchi const label patchi
) const ) const
{ {
return this->thermo().alphaEff return
( this->thermo().kappa().boundaryField()[patchi]
this->Prt_.value()/Sct_.value()*this->alphat(patchi), /this->thermo().Cp().boundaryField()[patchi]
patchi + this->Prt_.value()/Sct_.value()*this->alphat(patchi);
);
} }
//- Return the heat flux [W/m^2] //- Return the heat flux [W/m^2]

View File

@ -147,35 +147,29 @@ public:
// of mixture [W/m/K] // of mixture [W/m/K]
virtual tmp<volScalarField> kappaEff() const virtual tmp<volScalarField> kappaEff() const
{ {
return this->thermo().kappaEff(alphat()); return this->thermo().kappa() + this->thermo().Cp()*alphat();
} }
//- Effective thermal turbulent diffusivity for temperature //- Effective thermal turbulent diffusivity for temperature
// of mixture for patch [W/m/K] // of mixture for patch [W/m/K]
virtual tmp<scalarField> kappaEff(const label patchi) const virtual tmp<scalarField> kappaEff(const label patchi) const
{ {
return this->thermo().kappaEff return
( this->thermo().kappa().boundaryField()[patchi]
alphat(patchi), + this->thermo().Cp().boundaryField()[patchi]*alphat(patchi);
patchi
);
} }
//- Effective thermal turbulent diffusivity of mixture [kg/m/s] //- Effective thermal turbulent diffusivity of mixture [kg/m/s]
virtual tmp<volScalarField> alphaEff() const virtual tmp<volScalarField> alphaEff() const
{ {
return this->thermo().alphaEff(alphat()); return this->thermo().alphahe() + alphat();
} }
//- Effective thermal turbulent diffusivity of mixture //- Effective thermal turbulent diffusivity of mixture
// for patch [kg/m/s] // for patch [kg/m/s]
virtual tmp<scalarField> alphaEff(const label patchi) const virtual tmp<scalarField> alphaEff(const label patchi) const
{ {
return this->thermo().alphaEff return this->thermo().alphahe(patchi) + alphat(patchi);
(
alphat(patchi),
patchi
);
} }
//- Effective mass diffusion coefficient //- Effective mass diffusion coefficient

View File

@ -144,39 +144,6 @@ public:
//- Kinematic viscosity of mixture for patch [m^2/s] //- Kinematic viscosity of mixture for patch [m^2/s]
virtual tmp<scalarField> nu(const label patchi) const; virtual tmp<scalarField> nu(const label patchi) const;
// Fields derived from transport state variables
//- Effective thermal turbulent conductivity of mixture
// for patch [W/m/K]
virtual tmp<volScalarField> kappaEff
(
const volScalarField&
) const = 0;
//- Effective thermal turbulent conductivity of mixture
// for patch [W/m/K]
virtual tmp<scalarField> kappaEff
(
const scalarField& alphat,
const label patchi
) const = 0;
//- Effective turbulent thermal diffusivity of energy
// of mixture [kg/m/s]
virtual tmp<volScalarField> alphaEff
(
const volScalarField& alphat
) const = 0;
//- Effective turbulent thermal diffusivity of energy
// of mixture for patch [kg/m/s]
virtual tmp<scalarField> alphaEff
(
const scalarField& alphat,
const label patchi
) const = 0;
}; };

View File

@ -700,78 +700,6 @@ Foam::heThermo<BasicThermo, MixtureType>::alphahe(const label patchi) const
} }
template<class BasicThermo, class MixtureType>
Foam::tmp<Foam::volScalarField>
Foam::heThermo<BasicThermo, MixtureType>::kappaEff
(
const volScalarField& alphat
) const
{
return volScalarField::New("kappaEff", this->kappa_ + Cp_*alphat);
}
template<class BasicThermo, class MixtureType>
Foam::tmp<Foam::scalarField>
Foam::heThermo<BasicThermo, MixtureType>::kappaEff
(
const scalarField& alphat,
const label patchi
) const
{
return
this->kappa_.boundaryField()[patchi]
+ Cp(this->T_.boundaryField()[patchi], patchi)*alphat;
}
template<class BasicThermo, class MixtureType>
Foam::tmp<Foam::volScalarField>
Foam::heThermo<BasicThermo, MixtureType>::alphaEff
(
const volScalarField& alphat
) const
{
if (MixtureType::thermoType::enthalpy())
{
return volScalarField::New("alphaEff", this->kappa_/Cp_ + alphat);
}
else
{
return volScalarField::New
(
"alphaEff",
(this->kappa_ + Cp_*alphat)/Cv_
);
}
}
template<class BasicThermo, class MixtureType>
Foam::tmp<Foam::scalarField>
Foam::heThermo<BasicThermo, MixtureType>::alphaEff
(
const scalarField& alphat,
const label patchi
) const
{
if (MixtureType::thermoType::enthalpy())
{
return
this->kappa_.boundaryField()[patchi]/Cp_.boundaryField()[patchi]
+ alphat;
}
else
{
return
(
this->kappa_.boundaryField()[patchi]
+ Cp_.boundaryField()[patchi]*alphat
)/Cv_.boundaryField()[patchi];
}
}
template<class BasicThermo, class MixtureType> template<class BasicThermo, class MixtureType>
bool Foam::heThermo<BasicThermo, MixtureType>::read() bool Foam::heThermo<BasicThermo, MixtureType>::read()
{ {

View File

@ -360,35 +360,6 @@ public:
//- Thermal diffusivity of energy of mixture for patch [kg/m/s] //- Thermal diffusivity of energy of mixture for patch [kg/m/s]
virtual tmp<scalarField> alphahe(const label patchi) const; virtual tmp<scalarField> alphahe(const label patchi) const;
//- Effective thermal turbulent conductivity of mixture [W/m/K]
virtual tmp<volScalarField> kappaEff
(
const volScalarField&
) const;
//- Effective thermal turbulent conductivity of mixture
// for patch [W/m/K]
virtual tmp<scalarField> kappaEff
(
const scalarField& alphat,
const label patchi
) const;
//- Effective turbulent thermal diffusivity of energy
// of mixture [kg/m/s]
virtual tmp<volScalarField> alphaEff
(
const volScalarField& alphat
) const;
//- Effective turbulent thermal diffusivity of energy
// of mixture for patch [kg/m/s]
virtual tmp<scalarField> alphaEff
(
const scalarField& alphat,
const label patchi
) const;
//- Read thermophysical properties dictionary //- Read thermophysical properties dictionary
virtual bool read(); virtual bool read();