physicalProperties: Standardised incompressible and compressible solver fluid properties

to provide a single consistent code and user interface to the specification of
physical properties in both single-phase and multi-phase solvers.  This redesign
simplifies usage and reduces code duplication in run-time selectable solver
options such as 'functionObjects' and 'fvModels'.

* physicalProperties
  Single abstract base-class for all fluid and solid physical property classes.

  Physical properties for a single fluid or solid within a region are now read
  from the 'constant/<region>/physicalProperties' dictionary.

  Physical properties for a phase fluid or solid within a region are now read
  from the 'constant/<region>/physicalProperties.<phase>' dictionary.

  This replaces the previous inconsistent naming convention of
  'transportProperties' for incompressible solvers and
  'thermophysicalProperties' for compressible solvers.

  Backward-compatibility is provided by the solvers reading
  'thermophysicalProperties' or 'transportProperties' if the
  'physicalProperties' dictionary does not exist.

* phaseProperties
  All multi-phase solvers (VoF and Euler-Euler) now read the list of phases and
  interfacial models and coefficients from the
  'constant/<region>/phaseProperties' dictionary.

  Backward-compatibility is provided by the solvers reading
  'thermophysicalProperties' or 'transportProperties' if the 'phaseProperties'
  dictionary does not exist.  For incompressible VoF solvers the
  'transportProperties' is automatically upgraded to 'phaseProperties' and the
  two 'physicalProperties.<phase>' dictionary for the phase properties.

* viscosity
  Abstract base-class (interface) for all fluids.

  Having a single interface for the viscosity of all types of fluids facilitated
  a substantial simplification of the 'momentumTransport' library, avoiding the
  need for a layer of templating and providing total consistency between
  incompressible/compressible and single-phase/multi-phase laminar, RAS and LES
  momentum transport models.  This allows the generalised Newtonian viscosity
  models to be used in the same form within laminar as well as RAS and LES
  momentum transport closures in any solver.  Strain-rate dependent viscosity
  modelling is particularly useful with low-Reynolds number turbulence closures
  for non-Newtonian fluids where the effect of bulk shear near the walls on the
  viscosity is a dominant effect.  Within this framework it would also be
  possible to implement generalised Newtonian models dependent on turbulent as
  well as mean strain-rate if suitable model formulations are available.

* visosityModel
  Run-time selectable Newtonian viscosity model for incompressible fluids
  providing the 'viscosity' interface for 'momentumTransport' models.

  Currently a 'constant' Newtonian viscosity model is provided but the structure
  supports more complex functions of time, space and fields registered to the
  region database.

  Strain-rate dependent non-Newtonian viscosity models have been removed from
  this level and handled in a more general way within the 'momentumTransport'
  library, see section 'viscosity' above.

  The 'constant' viscosity model is selected in the 'physicalProperties'
  dictionary by

      viscosityModel  constant;

  which is equivalent to the previous entry in the 'transportProperties'
  dictionary

      transportModel  Newtonian;

  but backward-compatibility is provided for both the keyword and model
  type.

* thermophysicalModels
  To avoid propagating the unnecessary constructors from 'dictionary' into the
  new 'physicalProperties' abstract base-class this entire structure has been
  removed from the 'thermophysicalModels' library.  The only use for this
  constructor was in 'thermalBaffle' which now reads the 'physicalProperties'
  dictionary from the baffle region directory which is far simpler and more
  consistent and significantly reduces the amount of constructor code in the
  'thermophysicalModels' library.

* compressibleInterFoam
  The creation of the 'viscosity' interface for the 'momentumTransport' models
  allows the complex 'twoPhaseMixtureThermo' derived from 'rhoThermo' to be
  replaced with the much simpler 'compressibleTwoPhaseMixture' derived from the
  'viscosity' interface, avoiding the myriad of unused thermodynamic functions
  required by 'rhoThermo' to be defined for the mixture.

  Same for 'compressibleMultiphaseMixture' in 'compressibleMultiphaseInterFoam'.

This is a significant improvement in code and input consistency, simplifying
maintenance and further development as well as enhancing usability.

Henry G. Weller
CFD Direct Ltd.
This commit is contained in:
Henry Weller
2021-07-30 17:19:54 +01:00
parent 4aacb80bae
commit 65ef2cf331
1103 changed files with 10982 additions and 11445 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2016-2019 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2016-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -52,11 +52,11 @@ bool Foam::functionObjects::MachNo::calc()
if
(
foundObject<volVectorField>(fieldName_)
&& foundObject<fluidThermo>(fluidThermo::dictName)
&& foundObject<fluidThermo>(physicalProperties::typeName)
)
{
const fluidThermo& thermo =
lookupObject<fluidThermo>(fluidThermo::dictName);
lookupObject<fluidThermo>(physicalProperties::typeName);
const volVectorField& U = lookupObject<volVectorField>(fieldName_);

View File

@ -5,10 +5,10 @@ EXE_INC = \
-I$(LIB_SRC)/fileFormats/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/surfMesh/lnInclude \
-I$(LIB_SRC)/transportModels/lnInclude \
-I$(LIB_SRC)/physicalProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidThermo/lnInclude \
-I$(LIB_SRC)/transportModels/lnInclude \
-I$(LIB_SRC)/physicalProperties/lnInclude \
-I$(LIB_SRC)/MomentumTransportModels/momentumTransportModels/lnInclude \
-I$(LIB_SRC)/MomentumTransportModels/incompressible/lnInclude \
-I$(LIB_SRC)/MomentumTransportModels/compressible/lnInclude \
@ -18,7 +18,7 @@ LIB_LIBS = \
-lfiniteVolume \
-lfluidThermophysicalModels \
-lsolidThermo \
-ltransportModels \
-lphysicalProperties \
-lmomentumTransportModels \
-lincompressibleMomentumTransportModels \
-lcompressibleMomentumTransportModels \

View File

@ -175,19 +175,16 @@ bool Foam::functionObjects::age::execute()
const volScalarField& rho =
mesh_.lookupObject<volScalarField>(rhoName_);
tmp<volScalarField> tmuEff;
word laplacianScheme;
const word laplacianScheme("laplacian(muEff," + schemesField_ + ")");
tmp<volScalarField> tnuEff;
if (diffusion_)
{
tmuEff =
tnuEff =
mesh_.lookupObject<momentumTransportModel>
(
momentumTransportModel::typeName
).muEff();
laplacianScheme =
"laplacian(" + tmuEff().name() + ',' + schemesField_ + ")";
).nuEff();
}
for (int i=0; i<=nCorr_; i++)
@ -199,7 +196,7 @@ bool Foam::functionObjects::age::execute()
if (diffusion_)
{
ageEqn -= fvm::laplacian(tmuEff(), age, laplacianScheme);
ageEqn -= fvm::laplacian(rho*tnuEff(), age, laplacianScheme);
}
ageEqn.relax(relaxCoeff);

View File

@ -26,8 +26,8 @@ License
#include "shearStress.H"
#include "volFields.H"
#include "surfaceFields.H"
#include "kinematicMomentumTransportModel.H"
#include "dynamicMomentumTransportModel.H"
#include "incompressibleMomentumTransportModel.H"
#include "compressibleMomentumTransportModel.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //

View File

@ -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-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -85,7 +85,7 @@ bool Foam::functionObjects::totalEnthalpy::execute()
const word thermoName
(
IOobject::groupName(fluidThermo::dictName, phaseName_)
IOobject::groupName(physicalProperties::typeName, phaseName_)
);
if (mesh_.foundObject<fluidThermo>(thermoName))

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2013-2020 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,7 +24,7 @@ License
\*---------------------------------------------------------------------------*/
#include "turbulenceFields.H"
#include "kinematicMomentumTransportModel.H"
#include "incompressibleMomentumTransportModel.H"
#include "thermophysicalTransportModel.H"
#include "addToRunTimeSelectionTable.H"
@ -55,8 +55,8 @@ const char* Foam::NamedEnum
"k",
"epsilon",
"omega",
"mut",
"muEff",
"nut",
"nuEff",
"alphaEff",
"R",
"devTau"
@ -194,14 +194,14 @@ bool Foam::functionObjects::turbulenceFields::execute()
processField<scalar>(f, omega(model));
break;
}
case compressibleField::mut:
case compressibleField::nut:
{
processField<scalar>(f, model.mut());
processField<scalar>(f, model.nut());
break;
}
case compressibleField::muEff:
case compressibleField::nuEff:
{
processField<scalar>(f, model.muEff());
processField<scalar>(f, model.nuEff());
break;
}
case compressibleField::alphaEff:
@ -252,14 +252,14 @@ bool Foam::functionObjects::turbulenceFields::execute()
processField<scalar>(f, omega(model));
break;
}
case compressibleField::mut:
case compressibleField::nut:
{
processField<scalar>(f, model.mut());
processField<scalar>(f, model.nut());
break;
}
case compressibleField::muEff:
case compressibleField::nuEff:
{
processField<scalar>(f, model.muEff());
processField<scalar>(f, model.nuEff());
break;
}
case compressibleField::R:

View File

@ -65,8 +65,8 @@ Usage
omega | turbulence specific dissipation rate
nut | turbulence viscosity (incompressible)
nuEff | effective turbulence viscosity (incompressible)
mut | turbulence viscosity (compressible)
muEff | effective turbulence viscosity (compressible)
nut | turbulence viscosity (compressible)
nuEff | effective turbulence viscosity (compressible)
alphaEff | effective turbulence thermal diffusivity (compressible)
R | Reynolds stress tensor
devSigma | Deviatoric part of the effective Reynolds stress \
@ -113,8 +113,8 @@ public:
k,
epsilon,
omega,
mut,
muEff,
nut,
nuEff,
alphaEff,
R,
devTau

View File

@ -210,10 +210,10 @@ bool Foam::functionObjects::wallHeatFlux::execute()
return store(name, calcWallHeatFlux(ttm.q()));
}
else if (foundObject<solidThermo>(solidThermo::dictName))
else if (foundObject<solidThermo>(physicalProperties::typeName))
{
const solidThermo& thermo =
lookupObject<solidThermo>(solidThermo::dictName);
lookupObject<solidThermo>(physicalProperties::typeName);
return store(name, calcWallHeatFlux(thermo.q()));
}

View File

@ -24,8 +24,9 @@ License
\*---------------------------------------------------------------------------*/
#include "wallHeatTransferCoeff.H"
#include "kinematicMomentumTransportModel.H"
#include "dynamicMomentumTransportModel.H"
#include "incompressibleMomentumTransportModel.H"
#include "compressibleMomentumTransportModel.H"
#include "fvsPatchField.H"
#include "basicThermo.H"
#include "wallPolyPatch.H"
#include "addToRunTimeSelectionTable.H"
@ -100,7 +101,7 @@ bool Foam::functionObjects::wallHeatTransferCoeff::read(const dictionary& dict)
fvMeshFunctionObject::read(dict);
writeLocalObjects::read(dict);
if (!foundObject<basicThermo>(basicThermo::dictName))
if (!foundObject<basicThermo>(physicalProperties::typeName))
{
rho_.read(dict);
Cp_.read(dict);
@ -173,14 +174,14 @@ bool Foam::functionObjects::wallHeatTransferCoeff::execute()
tmp<volScalarField> thtc;
thtc = coeffModel_->htcByRhoCp(mmtm, patchSet_);
if (!foundObject<basicThermo>(basicThermo::dictName))
if (!foundObject<basicThermo>(physicalProperties::typeName))
{
thtc.ref() *= rho_*Cp_;
}
else
{
const basicThermo& thermo =
lookupObject<basicThermo>(basicThermo::dictName);
lookupObject<basicThermo>(physicalProperties::typeName);
thtc.ref() *= thermo.rho()*thermo.Cp();
}

View File

@ -24,8 +24,8 @@ License
\*---------------------------------------------------------------------------*/
#include "ReynoldsAnalogy.H"
#include "kinematicMomentumTransportModel.H"
#include "dynamicMomentumTransportModel.H"
#include "incompressibleMomentumTransportModel.H"
#include "compressibleMomentumTransportModel.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //

View File

@ -24,7 +24,7 @@ License
\*---------------------------------------------------------------------------*/
#include "kappaEff.H"
#include "kinematicMomentumTransportModel.H"
#include "incompressibleMomentumTransportModel.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //

View File

@ -24,7 +24,7 @@ License
\*---------------------------------------------------------------------------*/
#include "wallHeatTransferCoeffModel.H"
#include "dynamicMomentumTransportModel.H"
#include "compressibleMomentumTransportModel.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //

View File

@ -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-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -36,7 +36,7 @@ SourceFiles
#ifndef wallHeatTransferCoeffModel_H
#define wallHeatTransferCoeffModel_H
#include "kinematicMomentumTransportModel.H"
#include "incompressibleMomentumTransportModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -26,8 +26,8 @@ License
#include "wallShearStress.H"
#include "volFields.H"
#include "surfaceFields.H"
#include "kinematicMomentumTransportModel.H"
#include "dynamicMomentumTransportModel.H"
#include "incompressibleMomentumTransportModel.H"
#include "compressibleMomentumTransportModel.H"
#include "wallPolyPatch.H"
#include "addToRunTimeSelectionTable.H"

View File

@ -1,6 +1,6 @@
EXE_INC = \
-I$(LIB_SRC)/fileFormats/lnInclude \
-I$(LIB_SRC)/transportModels/lnInclude \
-I$(LIB_SRC)/physicalProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/MomentumTransportModels/momentumTransportModels/lnInclude \
-I$(LIB_SRC)/MomentumTransportModels/incompressible/lnInclude \
@ -12,7 +12,7 @@ EXE_INC = \
LIB_LIBS = \
-lfluidThermophysicalModels \
-ltransportModels \
-lphysicalProperties \
-lmomentumTransportModels \
-lincompressibleMomentumTransportModels \
-lcompressibleMomentumTransportModels \

View File

@ -26,10 +26,10 @@ License
#include "forces.H"
#include "fvcGrad.H"
#include "porosityModel.H"
#include "kinematicMomentumTransportModel.H"
#include "dynamicMomentumTransportModel.H"
#include "phaseKinematicMomentumTransportModel.H"
#include "phaseDynamicMomentumTransportModel.H"
#include "incompressibleMomentumTransportModel.H"
#include "compressibleMomentumTransportModel.H"
#include "phaseIncompressibleMomentumTransportModel.H"
#include "phaseCompressibleMomentumTransportModel.H"
#include "fluidThermo.H"
#include "addToRunTimeSelectionTable.H"
@ -265,18 +265,18 @@ Foam::functionObjects::forces::devTau() const
return model.devTau();
}
else if (obr_.foundObject<dictionary>("transportProperties"))
else if (obr_.foundObject<dictionary>("physicalProperties"))
{
// Legacy support for icoFoam
const dictionary& transportProperties =
obr_.lookupObject<dictionary>("transportProperties");
const dictionary& physicalProperties =
obr_.lookupObject<dictionary>("physicalProperties");
const dimensionedScalar nu
(
"nu",
dimViscosity,
transportProperties.lookup("nu")
physicalProperties.lookup("nu")
);
const volVectorField& U = obr_.lookupObject<volVectorField>(UName_);
@ -312,41 +312,41 @@ Foam::tmp<Foam::volScalarField> Foam::functionObjects::forces::mu() const
const incompressible::momentumTransportModel& model =
obr_.lookupObject<icoModel>(modelName);
return rho()*model.transport().nu();
return rho()*model.nu();
}
else if (obr_.foundObject<cmpModel>(modelName))
{
const cmpModel& model =
obr_.lookupObject<cmpModel>(modelName);
return model.transport().mu();
return model.rho()*model.nu();
}
else if (obr_.foundObject<phaseIcoModel>(phaseModelName))
{
const phaseIcoModel& model =
obr_.lookupObject<phaseIcoModel>(phaseModelName);
return rho()*model.transport().nu();
return rho()*model.nu();
}
else if (obr_.foundObject<phaseCmpModel>(phaseModelName))
{
const phaseCmpModel& model =
obr_.lookupObject<phaseCmpModel>(phaseModelName);
return model.transport().mu();
return model.rho()*model.nu();
}
else if (obr_.foundObject<dictionary>("transportProperties"))
else if (obr_.foundObject<dictionary>("physicalProperties"))
{
// Legacy support for icoFoam
const dictionary& transportProperties =
obr_.lookupObject<dictionary>("transportProperties");
const dictionary& physicalProperties =
obr_.lookupObject<dictionary>("physicalProperties");
const dimensionedScalar nu
(
"nu",
dimViscosity,
transportProperties.lookup("nu")
physicalProperties.lookup("nu")
);
return rho()*nu;

View File

@ -1,6 +1,6 @@
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/transportModels/lnInclude \
-I$(LIB_SRC)/physicalProperties/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/lagrangian/parcel/lnInclude \
@ -10,7 +10,7 @@ EXE_INC = \
LIB_LIBS = \
-lfiniteVolume \
-ltransportModels \
-lphysicalProperties \
-lmeshTools \
-llagrangian \
-llagrangianParcel \

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2016-2020 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2016-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,7 +24,7 @@ License
\*---------------------------------------------------------------------------*/
#include "particles.H"
#include "singlePhaseTransportModel.H"
#include "viscosityModel.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -66,15 +66,15 @@ Foam::functionObjects::particles::particles
),
dimensionedVector(dimAcceleration, Zero)
),
laminarTransport_
viscosity_
(
mesh_.lookupObject<singlePhaseTransportModel>("transportProperties")
mesh_.lookupObject<viscosityModel>(physicalProperties::typeName)
),
rhoValue_
(
"rho",
dimDensity,
laminarTransport_
viscosity_
),
rho_
(
@ -87,7 +87,7 @@ Foam::functionObjects::particles::particles
mesh_,
rhoValue_
),
mu_("mu", rhoValue_*laminarTransport_.nu()),
mu_("mu", rhoValue_*viscosity_.nu()),
U_
(
mesh_.lookupObject<volVectorField>(dict.lookupOrDefault<word>("U", "U"))
@ -131,7 +131,7 @@ bool Foam::functionObjects::particles::read
bool Foam::functionObjects::particles::execute()
{
mu_ = rhoValue_*laminarTransport_.nu();
mu_ = rhoValue_*viscosity_.nu();
cloudPtr_->evolve();

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2016-2020 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2016-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -33,7 +33,7 @@ Description
parcels without affecting the flow-field.
The cloud requires the density of the fluid which is looked-up from
constant/transportProperties dictionary and the acceleration due to gravity
constant/phaseProperties dictionary and the acceleration due to gravity
which is read from the constant/g file if present or defaults to zero.
The cloud properties are read from the constant/<cloudName>Properties
@ -77,7 +77,7 @@ SourceFiles
namespace Foam
{
class singlePhaseTransportModel;
class viscosityModel;
namespace functionObjects
{
@ -95,8 +95,8 @@ class particles
//- Optional acceleration due to gravity
uniformDimensionedVectorField g_;
//- Reference to the laminar transport model
const singlePhaseTransportModel& laminarTransport_;
//- Reference to the carrier fluid viscosity model
const viscosityModel& viscosity_;
//- Uniform density value
dimensionedScalar rhoValue_;

View File

@ -1,5 +1,5 @@
EXE_INC = \
-I$(LIB_SRC)/transportModels/lnInclude \
-I$(LIB_SRC)/physicalProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/MomentumTransportModels/momentumTransportModels/lnInclude \
-I$(LIB_SRC)/MomentumTransportModels/incompressible/lnInclude \
@ -9,7 +9,7 @@ EXE_INC = \
LIB_LIBS = \
-lfluidThermophysicalModels \
-ltransportModels \
-lphysicalProperties \
-lmomentumTransportModels \
-lincompressibleMomentumTransportModels \
-lcompressibleMomentumTransportModels \

View File

@ -245,7 +245,7 @@ Foam::functionObjects::phaseScalarTransport::D
(
"D" + s_.name(),
mesh_,
dimensionedScalar(alphaPhi.dimensions()/dimLength, D_)
dimensionedScalar(dimViscosity, D_)
);
}
@ -256,8 +256,8 @@ Foam::functionObjects::phaseScalarTransport::D
mesh_.foundObject<momentumTransportModel>(namePhase)
? namePhase
: mesh_.foundObject<momentumTransportModel>(nameNoPhase)
? nameNoPhase
: word::null;
? nameNoPhase
: word::null;
if (name == word::null)
{
@ -272,19 +272,7 @@ Foam::functionObjects::phaseScalarTransport::D
const momentumTransportModel& turbulence =
mesh_.lookupObject<momentumTransportModel>(name);
if (alphaPhi.dimensions() == dimVolume/dimTime)
{
return alphaD_*turbulence.nu() + alphaDt_*turbulence.nut();
}
else if (alphaPhi.dimensions() == dimMass/dimTime)
{
return alphaD_*turbulence.mu() + alphaDt_*turbulence.mut();
}
else
{
PhiDimensionErrorInFunction(alphaPhi);
return tmp<volScalarField>(nullptr);
}
return alphaD_*turbulence.nu() + alphaDt_*turbulence.nut();
}
@ -448,7 +436,7 @@ bool Foam::functionObjects::phaseScalarTransport::execute()
+ fvm::div(alphaPhi, s_, divScheme)
- fvm::laplacian
(
fvc::interpolate(alpha)*fvc::interpolate(D),
fvc::interpolate(alpha)*fvc::interpolate(rho*D),
s_,
laplacianScheme
)

View File

@ -31,8 +31,8 @@ License
#include "fvmSup.H"
#include "fvModels.H"
#include "fvConstraints.H"
#include "kinematicMomentumTransportModel.H"
#include "dynamicMomentumTransportModel.H"
#include "incompressibleMomentumTransportModel.H"
#include "compressibleMomentumTransportModel.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -60,10 +60,7 @@ Foam::tmp<Foam::volScalarField> Foam::functionObjects::scalarTransport::D
const surfaceScalarField& phi
) const
{
typedef incompressible::momentumTransportModel icoModel;
typedef compressible::momentumTransportModel cmpModel;
word Dname("D" + s_.name());
const word Dname("D" + s_.name());
if (constantD_)
{
@ -71,26 +68,24 @@ Foam::tmp<Foam::volScalarField> Foam::functionObjects::scalarTransport::D
(
Dname,
mesh_,
dimensionedScalar(Dname, phi.dimensions()/dimLength, D_)
dimensionedScalar(Dname, dimViscosity, D_)
);
}
else if (mesh_.foundObject<icoModel>(momentumTransportModel::typeName))
{
const icoModel& model = mesh_.lookupObject<icoModel>
else if
(
mesh_.foundObject<momentumTransportModel>
(
momentumTransportModel::typeName
);
return alphaD_*model.nu() + alphaDt_*model.nut();
}
else if (mesh_.foundObject<cmpModel>(momentumTransportModel::typeName))
)
)
{
const cmpModel& model = mesh_.lookupObject<cmpModel>
(
momentumTransportModel::typeName
);
const momentumTransportModel& turbulence =
mesh_.lookupObject<momentumTransportModel>
(
momentumTransportModel::typeName
);
return alphaD_*model.mu() + alphaDt_*model.mut();
return alphaD_*turbulence.nu() + alphaDt_*turbulence.nut();
}
else
{
@ -186,20 +181,17 @@ bool Foam::functionObjects::scalarTransport::execute()
Foam::fvConstraints::New(mesh_)
);
if (phi.dimensions() == dimMass/dimTime)
if (phi.dimensions() == dimVolume/dimTime)
{
const volScalarField& rho =
mesh_.lookupObject<volScalarField>(rhoName_);
for (int i=0; i<=nCorr_; i++)
{
fvScalarMatrix sEqn
(
fvm::ddt(rho, s_)
fvm::ddt(s_)
+ fvm::div(phi, s_, divScheme)
- fvm::laplacian(D, s_, laplacianScheme)
==
fvModels.source(rho, s_)
fvModels.source(s_)
);
sEqn.relax(relaxCoeff);
@ -211,17 +203,20 @@ bool Foam::functionObjects::scalarTransport::execute()
fvConstraints.constrain(s_);
}
}
else if (phi.dimensions() == dimVolume/dimTime)
else if (phi.dimensions() == dimMass/dimTime)
{
const volScalarField& rho =
mesh_.lookupObject<volScalarField>(rhoName_);
for (int i=0; i<=nCorr_; i++)
{
fvScalarMatrix sEqn
(
fvm::ddt(s_)
fvm::ddt(rho, s_)
+ fvm::div(phi, s_, divScheme)
- fvm::laplacian(D, s_, laplacianScheme)
- fvm::laplacian(rho*D, s_, laplacianScheme)
==
fvModels.source(s_)
fvModels.source(rho, s_)
);
sEqn.relax(relaxCoeff);