fluidThermophysicalTransportModel: Removed alphaEff from the public interface

alphaEff is now an internal field used only for the implicit energy correction
term, kappaEff, q and divq are the general and rational interface to thermal
transport.

XiFoam and PDRFoam now explicitly instantiate a unityLewisEddyDiffusivity
fluidThermophysicalTransportModel as the the unity Lewis number approximation is
hard-coded into the formulation of the energy/composition system.
This commit is contained in:
Henry Weller
2022-11-01 12:43:25 +00:00
parent 7d045de80a
commit 63feb9ad33
15 changed files with 53 additions and 47 deletions

View File

@ -10,7 +10,7 @@
? mvConvection->fvcDiv(fvc::absolute(phi, rho, U), p/rho) ? mvConvection->fvcDiv(fvc::absolute(phi, rho, U), p/rho)
: -dpdt : -dpdt
) )
- fvm::laplacian(thermophysicalTransport->alphaEff(), hea) + thermophysicalTransport.divq(hea)
+ fvModels.source(rho, hea) + fvModels.source(rho, hea)
); );

View File

@ -12,7 +12,7 @@ if (ign.ignited())
*rho/thermo.rhou() *rho/thermo.rhou()
: -dpdt*rho/thermo.rhou() : -dpdt*rho/thermo.rhou()
) )
- fvm::laplacian(thermophysicalTransport->alphaEff(), heau) + thermophysicalTransport.divq(heau)
// These terms cannot be used in partially-premixed combustion due to // These terms cannot be used in partially-premixed combustion due to
// the resultant inconsistency between ft and heau transport. // the resultant inconsistency between ft and heau transport.

View File

@ -70,7 +70,8 @@ Description
#include "fvCFD.H" #include "fvCFD.H"
#include "psiuMulticomponentThermo.H" #include "psiuMulticomponentThermo.H"
#include "compressibleMomentumTransportModels.H" #include "compressibleMomentumTransportModels.H"
#include "fluidThermoThermophysicalTransportModel.H" #include "RASThermophysicalTransportModel.H"
#include "unityLewisEddyDiffusivity.H"
#include "laminarFlameSpeed.H" #include "laminarFlameSpeed.H"
#include "XiModel.H" #include "XiModel.H"
#include "PDRDragModel.H" #include "PDRDragModel.H"
@ -144,7 +145,7 @@ int main(int argc, char *argv[])
if (pimple.turbCorr()) if (pimple.turbCorr())
{ {
turbulence->correct(); turbulence->correct();
thermophysicalTransport->correct(); thermophysicalTransport.correct();
} }
} }

View File

@ -58,15 +58,17 @@ autoPtr<compressible::RASModel> turbulence
); );
Info<< "Creating thermophysical transport model\n" << endl; Info<< "Creating thermophysical transport model\n" << endl;
autoPtr<RASFluidThermophysicalTransportModel> turbulenceThermophysicalTransportModels::unityLewisEddyDiffusivity
thermophysicalTransport <
( RASThermophysicalTransportModel
RASFluidThermophysicalTransportModel::New <
( ThermophysicalTransportModel
turbulence(), <
thermo compressibleMomentumTransportModel,
) fluidThermo
); >
>
> thermophysicalTransport(turbulence(), thermo, true);
Info<< "Creating field dpdt\n" << endl; Info<< "Creating field dpdt\n" << endl;
volScalarField dpdt volScalarField dpdt

View File

@ -52,7 +52,8 @@ Description
#include "fvCFD.H" #include "fvCFD.H"
#include "psiuMulticomponentThermo.H" #include "psiuMulticomponentThermo.H"
#include "compressibleMomentumTransportModels.H" #include "compressibleMomentumTransportModels.H"
#include "fluidThermoThermophysicalTransportModel.H" #include "RASThermophysicalTransportModel.H"
#include "unityLewisEddyDiffusivity.H"
#include "laminarFlameSpeed.H" #include "laminarFlameSpeed.H"
#include "ignition.H" #include "ignition.H"
#include "Switch.H" #include "Switch.H"
@ -177,7 +178,7 @@ int main(int argc, char *argv[])
if (pimple.turbCorr()) if (pimple.turbCorr())
{ {
turbulence->correct(); turbulence->correct();
thermophysicalTransport->correct(); thermophysicalTransport.correct();
} }
} }

View File

@ -52,7 +52,7 @@ if (ign.ignited())
+ mvConvection->fvmDiv(phi, b) + mvConvection->fvmDiv(phi, b)
+ fvm::div(phiSt, b) + fvm::div(phiSt, b)
- fvm::Sp(fvc::div(phiSt), b) - fvm::Sp(fvc::div(phiSt), b)
- fvm::laplacian(thermophysicalTransport->alphaEff(), b) - fvm::laplacian(thermophysicalTransport.DEff(b), b)
== ==
fvModels.source(rho, b) fvModels.source(rho, b)
); );
@ -105,7 +105,7 @@ if (ign.ignited())
phiSt phiSt
- fvc::interpolate - fvc::interpolate
( (
fvc::laplacian(thermophysicalTransport->alphaEff(), b)/mgb fvc::laplacian(thermophysicalTransport.DEff(b), b)/mgb
)*nf )*nf
+ fvc::interpolate(rho)*fvc::interpolate(Su*(1.0/Xi - Xi))*nf + fvc::interpolate(rho)*fvc::interpolate(Su*(1.0/Xi - Xi))*nf
); );

View File

@ -59,10 +59,17 @@ autoPtr<compressible::momentumTransportModel> turbulence
); );
Info<< "Creating thermophysical transport model\n" << endl; Info<< "Creating thermophysical transport model\n" << endl;
autoPtr<fluidThermoThermophysicalTransportModel> thermophysicalTransport turbulenceThermophysicalTransportModels::unityLewisEddyDiffusivity
( <
fluidThermoThermophysicalTransportModel::New(turbulence(), thermo) RASThermophysicalTransportModel
); <
ThermophysicalTransportModel
<
compressibleMomentumTransportModel,
fluidThermo
>
>
> thermophysicalTransport(turbulence(), thermo, true);
Info<< "Creating field dpdt\n" << endl; Info<< "Creating field dpdt\n" << endl;
volScalarField dpdt volScalarField dpdt

View File

@ -17,7 +17,7 @@ if (composition.contains("ft"))
( (
fvm::ddt(rho, ft) fvm::ddt(rho, ft)
+ mvConvection->fvmDiv(phi, ft) + mvConvection->fvmDiv(phi, ft)
- fvm::laplacian(thermophysicalTransport->alphaEff(), ft) - fvm::laplacian(thermophysicalTransport.DEff(ft), ft)
== ==
fvModels.source(rho, ft) fvModels.source(rho, ft)
); );

View File

@ -87,9 +87,6 @@ public:
//- Access function to fluid thermophysical properties //- Access function to fluid thermophysical properties
virtual const fluidThermo& thermo() const = 0; virtual const fluidThermo& thermo() const = 0;
//- Effective thermal turbulent diffusivity of mixture [kg/m/s]
virtual tmp<volScalarField> alphaEff() const = 0;
//- Effective mass diffusion coefficient //- Effective mass diffusion coefficient
// for a given specie mass-fraction [kg/m/s] // for a given specie mass-fraction [kg/m/s]
virtual tmp<volScalarField> DEff(const volScalarField& Yi) const = 0; virtual tmp<volScalarField> DEff(const volScalarField& Yi) const = 0;

View File

@ -154,9 +154,6 @@ public:
// of mixture for patch [W/m/K] // of mixture for patch [W/m/K]
virtual tmp<scalarField> kappaEff(const label patchi) const = 0; virtual tmp<scalarField> kappaEff(const label patchi) const = 0;
//- Effective thermal turbulent diffusivity of mixture [kg/m/s]
virtual tmp<volScalarField> alphaEff() const = 0;
//- Correct the LES transport //- Correct the LES transport
virtual void correct(); virtual void correct();

View File

@ -154,9 +154,6 @@ public:
// of mixture for patch [W/m/K] // of mixture for patch [W/m/K]
virtual tmp<scalarField> kappaEff(const label patchi) const = 0; virtual tmp<scalarField> kappaEff(const label patchi) const = 0;
//- Effective thermal turbulent diffusivity of mixture [kg/m/s]
virtual tmp<volScalarField> alphaEff() const = 0;
//- Correct the RAS transport //- Correct the RAS transport
virtual void correct(); virtual void correct();

View File

@ -85,6 +85,13 @@ protected:
virtual void correctAlphat(); virtual void correctAlphat();
//- Effective thermal turbulent diffusivity of mixture [kg/m/s]
// Used for the implicit energy correction on the temperature laplacian
virtual tmp<volScalarField> alphaEff() const
{
return this->thermo().kappa()/this->thermo().Cpv() + alphat();
}
public: public:
@ -151,12 +158,6 @@ public:
+ this->thermo().Cp().boundaryField()[patchi]*alphat(patchi); + this->thermo().Cp().boundaryField()[patchi]*alphat(patchi);
} }
//- Effective thermal turbulent diffusivity of mixture [kg/m/s]
virtual tmp<volScalarField> alphaEff() const
{
return this->thermo().kappa()/this->thermo().Cpv() + alphat();
}
//- Effective mass diffusion coefficient //- Effective mass diffusion coefficient
// for a given specie mass-fraction [kg/m/s] // for a given specie mass-fraction [kg/m/s]
virtual tmp<volScalarField> DEff(const volScalarField& Yi) const; virtual tmp<volScalarField> DEff(const volScalarField& Yi) const;

View File

@ -53,7 +53,8 @@ unityLewisEddyDiffusivity<TurbulenceThermophysicalTransportModel>::
unityLewisEddyDiffusivity unityLewisEddyDiffusivity
( (
const momentumTransportModel& momentumTransport, const momentumTransportModel& momentumTransport,
const thermoModel& thermo const thermoModel& thermo,
const bool allowDefaultPrt
) )
: :
unityLewisEddyDiffusivity unityLewisEddyDiffusivity
@ -61,7 +62,7 @@ unityLewisEddyDiffusivity
typeName, typeName,
momentumTransport, momentumTransport,
thermo, thermo,
false allowDefaultPrt
) )
{ {
this->printCoeffs(typeName); this->printCoeffs(typeName);

View File

@ -82,6 +82,13 @@ protected:
virtual void correctAlphat(); virtual void correctAlphat();
//- Effective thermal turbulent diffusivity of mixture [kg/m/s]
// Used for the implicit energy correction on the temperature laplacian
virtual tmp<volScalarField> alphaEff() const
{
return this->thermo().kappa()/this->thermo().Cpv() + alphat();
}
public: public:
@ -106,7 +113,8 @@ public:
unityLewisEddyDiffusivity unityLewisEddyDiffusivity
( (
const momentumTransportModel& momentumTransport, const momentumTransportModel& momentumTransport,
const thermoModel& thermo const thermoModel& thermo,
const bool allowDefaultPrt = false
); );
//- Construct from a type name, a momentum transport model and a thermo //- Construct from a type name, a momentum transport model and a thermo
@ -159,12 +167,6 @@ public:
+ this->thermo().Cp().boundaryField()[patchi]*alphat(patchi); + this->thermo().Cp().boundaryField()[patchi]*alphat(patchi);
} }
//- Effective thermal turbulent diffusivity of mixture [kg/m/s]
virtual tmp<volScalarField> alphaEff() const
{
return this->thermo().kappa()/this->thermo().Cpv() + alphat();
}
//- Effective mass diffusion coefficient //- Effective mass diffusion coefficient
// for a given specie mass-fraction [kg/m/s] // for a given specie mass-fraction [kg/m/s]
virtual tmp<volScalarField> DEff(const volScalarField& Yi) const virtual tmp<volScalarField> DEff(const volScalarField& Yi) const

View File

@ -113,7 +113,7 @@ Foam::tmp<Foam::volScalarField> Foam::fv::volumeFractionSource::D
fieldName == ttm.thermo().T().name() fieldName == ttm.thermo().T().name()
? ttm.kappaEff() ? ttm.kappaEff()
: fieldName == ttm.thermo().he().name() : fieldName == ttm.thermo().he().name()
? ttm.alphaEff() ? ttm.kappaEff()/ttm.thermo().Cpv()
: ttm.momentumTransport().rho()*ttm.momentumTransport().nuEff(); : ttm.momentumTransport().rho()*ttm.momentumTransport().nuEff();
} }
else else