mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
functionObjects::scalarTransport: Added support for optional laminar and turbulent diffusion coefficients
Description
Evolves a passive scalar transport equation.
- To specify the field name set the \c field entry
- To employ the same numerical schemes as another field set
the \c schemesField entry,
- A constant diffusivity may be specified with the \c D entry,
- Alternatively if a turbulence model is available a turbulent diffusivity
may be constructed from the laminar and turbulent viscosities using the
optional diffusivity coefficients \c alphaD and \c alphaDt (which default
to 1):
\verbatim
D = alphaD*nu + alphaDt*nut
\endverbatim
Resolves feature request https://bugs.openfoam.org/view.php?id=2453
This commit is contained in:
@ -89,7 +89,7 @@ Foam::tmp<Foam::volScalarField> Foam::functionObjects::scalarTransport::D
|
|||||||
turbulenceModel::propertiesName
|
turbulenceModel::propertiesName
|
||||||
);
|
);
|
||||||
|
|
||||||
return model.nuEff();
|
return alphaD_*model.nu() + alphaDt_*model.nut();
|
||||||
}
|
}
|
||||||
else if (mesh_.foundObject<cmpModel>(turbulenceModel::propertiesName))
|
else if (mesh_.foundObject<cmpModel>(turbulenceModel::propertiesName))
|
||||||
{
|
{
|
||||||
@ -98,7 +98,7 @@ Foam::tmp<Foam::volScalarField> Foam::functionObjects::scalarTransport::D
|
|||||||
turbulenceModel::propertiesName
|
turbulenceModel::propertiesName
|
||||||
);
|
);
|
||||||
|
|
||||||
return model.muEff();
|
return alphaD_*model.mu() + alphaDt_*model.mut();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -169,11 +169,9 @@ bool Foam::functionObjects::scalarTransport::read(const dictionary& dict)
|
|||||||
rhoName_ = dict.lookupOrDefault<word>("rho", "rho");
|
rhoName_ = dict.lookupOrDefault<word>("rho", "rho");
|
||||||
schemesField_ = dict.lookupOrDefault<word>("schemesField", fieldName_);
|
schemesField_ = dict.lookupOrDefault<word>("schemesField", fieldName_);
|
||||||
|
|
||||||
constantD_ = false;
|
constantD_ = dict.readIfPresent("D", D_);
|
||||||
if (dict.readIfPresent("D", D_))
|
alphaD_ = dict.lookupOrDefault("alphat", 1.0);
|
||||||
{
|
alphaDt_ = dict.lookupOrDefault("alphaDt", 1.0);
|
||||||
constantD_ = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
dict.readIfPresent("nCorr", nCorr_);
|
dict.readIfPresent("nCorr", nCorr_);
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -30,11 +30,18 @@ Group
|
|||||||
Description
|
Description
|
||||||
Evolves a passive scalar transport equation.
|
Evolves a passive scalar transport equation.
|
||||||
|
|
||||||
- To specify the field name set the 'field' entry
|
- To specify the field name set the \c field entry
|
||||||
- To employ the same numerical schemes as another field set
|
- To employ the same numerical schemes as another field set
|
||||||
the 'schemesField' entry,
|
the \c schemesField entry,
|
||||||
- The diffusivity can be set manually using the 'D' entry, or retrieved
|
- A constant diffusivity may be specified with the \c D entry,
|
||||||
from the turbulence model (if applicable).
|
|
||||||
|
- Alternatively if a turbulence model is available a turbulent diffusivity
|
||||||
|
may be constructed from the laminar and turbulent viscosities using the
|
||||||
|
optional diffusivity coefficients \c alphaD and \c alphaDt (which default
|
||||||
|
to 1):
|
||||||
|
\verbatim
|
||||||
|
D = alphaD*nu + alphaDt*nut
|
||||||
|
\endverbatim
|
||||||
|
|
||||||
See also
|
See also
|
||||||
Foam::functionObjects::fvMeshFunctionObject
|
Foam::functionObjects::fvMeshFunctionObject
|
||||||
@ -83,6 +90,12 @@ class scalarTransport
|
|||||||
//- Flag to indicate whether a constant, uniform D_ is specified
|
//- Flag to indicate whether a constant, uniform D_ is specified
|
||||||
bool constantD_;
|
bool constantD_;
|
||||||
|
|
||||||
|
//- Laminar diffusion coefficient (optional)
|
||||||
|
scalar alphaD_;
|
||||||
|
|
||||||
|
//- Turbulent diffusion coefficient (optional)
|
||||||
|
scalar alphaDt_;
|
||||||
|
|
||||||
//- Number of corrector iterations (optional)
|
//- Number of corrector iterations (optional)
|
||||||
label nCorr_;
|
label nCorr_;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user