functionObjects: yPlus: Added support for phases
The yPlus function object can now take a "phase" keyword which defines
the name of the phase for which to write yPlus. For example, to write
yPlus for a phase named "liquid", the following entry can be used:
yPlus1
{
type yPlus;
libs ("libfieldFunctionObjects.so");
phase liquid;
}
Note that this will only be necessary in Euler-Euler type simulations
where the phases have separate turbulence models. For VoF, the phase
name will not be required.
Patch contributed by Juho Peltola, VTT.
This commit is contained in:
@ -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) 2013-2018 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2019 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -71,7 +71,7 @@ Foam::tmp<Foam::volScalarField> Foam::functionObjects::yPlus::calcYPlus
|
|||||||
(
|
(
|
||||||
volScalarField::New
|
volScalarField::New
|
||||||
(
|
(
|
||||||
type(),
|
IOobject::groupName(type(), phaseName_),
|
||||||
mesh_,
|
mesh_,
|
||||||
dimensionedScalar(dimless, 0)
|
dimensionedScalar(dimless, 0)
|
||||||
)
|
)
|
||||||
@ -133,11 +133,12 @@ Foam::functionObjects::yPlus::yPlus
|
|||||||
:
|
:
|
||||||
fvMeshFunctionObject(name, runTime, dict),
|
fvMeshFunctionObject(name, runTime, dict),
|
||||||
logFiles(obr_, name),
|
logFiles(obr_, name),
|
||||||
writeLocalObjects(obr_, log)
|
writeLocalObjects(obr_, log),
|
||||||
|
phaseName_(dict.lookupOrDefault<word>("phase", word::null))
|
||||||
{
|
{
|
||||||
read(dict);
|
read(dict);
|
||||||
resetName(typeName);
|
resetName(IOobject::groupName(typeName, phaseName_));
|
||||||
resetLocalObjectName(typeName);
|
resetLocalObjectName(IOobject::groupName(typeName, phaseName_));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -160,14 +161,17 @@ bool Foam::functionObjects::yPlus::read(const dictionary& dict)
|
|||||||
|
|
||||||
bool Foam::functionObjects::yPlus::execute()
|
bool Foam::functionObjects::yPlus::execute()
|
||||||
{
|
{
|
||||||
if (mesh_.foundObject<turbulenceModel>(turbulenceModel::propertiesName))
|
if (mesh_.foundObject<turbulenceModel>
|
||||||
|
(
|
||||||
|
IOobject::groupName(turbulenceModel::propertiesName, phaseName_))
|
||||||
|
)
|
||||||
{
|
{
|
||||||
const turbulenceModel& model = mesh_.lookupObject<turbulenceModel>
|
const turbulenceModel& model = mesh_.lookupObject<turbulenceModel>
|
||||||
(
|
(
|
||||||
turbulenceModel::propertiesName
|
IOobject::groupName(turbulenceModel::propertiesName, phaseName_)
|
||||||
);
|
);
|
||||||
|
|
||||||
word name(type());
|
word name(IOobject::groupName(type(), phaseName_));
|
||||||
|
|
||||||
return store(name, calcYPlus(model));
|
return store(name, calcYPlus(model));
|
||||||
}
|
}
|
||||||
@ -191,7 +195,10 @@ bool Foam::functionObjects::yPlus::write()
|
|||||||
logFiles::write();
|
logFiles::write();
|
||||||
|
|
||||||
const volScalarField& yPlus =
|
const volScalarField& yPlus =
|
||||||
mesh_.lookupObject<volScalarField>(type());
|
mesh_.lookupObject<volScalarField>
|
||||||
|
(
|
||||||
|
IOobject::groupName(type(), phaseName_)
|
||||||
|
);
|
||||||
|
|
||||||
const volScalarField::Boundary& yPlusBf = yPlus.boundaryField();
|
const volScalarField::Boundary& yPlusBf = yPlus.boundaryField();
|
||||||
const fvPatchList& patches = mesh_.boundary();
|
const fvPatchList& patches = mesh_.boundary();
|
||||||
|
|||||||
@ -26,7 +26,7 @@ Class
|
|||||||
|
|
||||||
Description
|
Description
|
||||||
Evaluates and outputs turbulence y+ for models. Values written to
|
Evaluates and outputs turbulence y+ for models. Values written to
|
||||||
time directories as field 'yPlus'.
|
time directories as field 'yPlus' or 'yPlus.phase'.
|
||||||
|
|
||||||
Example of function object specification:
|
Example of function object specification:
|
||||||
\verbatim
|
\verbatim
|
||||||
@ -42,6 +42,7 @@ Usage
|
|||||||
\table
|
\table
|
||||||
Property | Description | Required | Default value
|
Property | Description | Required | Default value
|
||||||
type | type name: yPlus | yes |
|
type | type name: yPlus | yes |
|
||||||
|
phase | phase name | no | none
|
||||||
\endtable
|
\endtable
|
||||||
|
|
||||||
Note
|
Note
|
||||||
@ -89,6 +90,16 @@ class yPlus
|
|||||||
public logFiles,
|
public logFiles,
|
||||||
public writeLocalObjects
|
public writeLocalObjects
|
||||||
{
|
{
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Protected data
|
||||||
|
|
||||||
|
//- Optional phase name [K]
|
||||||
|
word phaseName_;
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
//- File header information
|
//- File header information
|
||||||
|
|||||||
Reference in New Issue
Block a user