mirror of
https://github.com/OpenFOAM/OpenFOAM-6.git
synced 2025-12-08 06:57:46 +00:00
Standardized the selection of required and optional fields in BCs, fvOptions, functionObjects etc.
In most boundary conditions, fvOptions etc. required and optional fields
to be looked-up from the objectRegistry are selected by setting the
keyword corresponding to the standard field name in the BC etc. to the
appropriate name in the objectRegistry. Usually a default is provided
with sets the field name to the keyword name, e.g. in the
totalPressureFvPatchScalarField the velocity is selected by setting the
keyword 'U' to the appropriate name which defaults to 'U':
Property | Description | Required | Default value
U | velocity field name | no | U
phi | flux field name | no | phi
.
.
.
However, in some BCs and functionObjects and many fvOptions another
convention is used in which the field name keyword is appended by 'Name'
e.g.
Property | Description | Required | Default value
pName | pressure field name | no | p
UName | velocity field name | no | U
This difference in convention is unnecessary and confusing, hinders code
and dictionary reuse and complicates code maintenance. In this commit
the appended 'Name' is removed from the field selection keywords
standardizing OpenFOAM on the first convention above.
This commit is contained in:
@ -59,9 +59,6 @@ functions
|
||||
|
||||
setFormat vtk; //gnuplot, raw etc. See sampleDict.
|
||||
|
||||
// Velocity field to use for tracking.
|
||||
UName U;
|
||||
|
||||
// Interpolation method. Default is cellPoint. See sampleDict.
|
||||
//interpolationScheme pointMVC;
|
||||
|
||||
|
||||
@ -324,9 +324,9 @@ bool Foam::functionObjects::streamLine::read(const dictionary& dict)
|
||||
Info<< type() << " " << name() << ":" << nl;
|
||||
|
||||
dict.lookup("fields") >> fields_;
|
||||
if (dict.found("UName"))
|
||||
if (dict.found("U"))
|
||||
{
|
||||
dict.lookup("UName") >> UName_;
|
||||
dict.lookup("U") >> UName_;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -40,7 +40,6 @@ Description
|
||||
libs ("libfieldFunctionObjects.so");
|
||||
...
|
||||
setFormat vtk;
|
||||
UName U;
|
||||
trackForward yes;
|
||||
fields
|
||||
(
|
||||
@ -66,15 +65,15 @@ Description
|
||||
\heading Function object usage
|
||||
\table
|
||||
Property | Description | Required | Default value
|
||||
type | type name: streamLine | yes |
|
||||
setFormat | output data type | yes |
|
||||
UName | tracking velocity field name | yes |
|
||||
fields | fields to sample | yes |
|
||||
lifetime | maximum number of particle tracking steps | yes |
|
||||
trackLength | tracking segment length | no |
|
||||
nSubCycle | number of tracking steps per cell | no|
|
||||
cloudName | cloud name to use | yes |
|
||||
seedSampleSet| seeding method (see below)| yes |
|
||||
type | Type name: streamLine | yes |
|
||||
setFormat | Output data type | yes |
|
||||
U | Tracking velocity field name | yes |
|
||||
fields | Fields to sample | yes |
|
||||
lifetime | Maximum number of particle tracking steps | yes |
|
||||
trackLength | Tracking segment length | no |
|
||||
nSubCycle | Number of tracking steps per cell | no|
|
||||
cloudName | Cloud name to use | yes |
|
||||
seedSampleSet| Seeding method (see below)| yes |
|
||||
\endtable
|
||||
|
||||
\linebreak
|
||||
|
||||
@ -92,7 +92,7 @@ functions
|
||||
setFormat vtk; //gnuplot; //xmgr; //raw; //jplot;
|
||||
|
||||
// Velocity field to use for tracking.
|
||||
UName UNear;
|
||||
U UNear;
|
||||
|
||||
// Interpolation method. Default is cellPoint. See sampleDict.
|
||||
//interpolationScheme pointMVC;
|
||||
|
||||
@ -441,9 +441,9 @@ bool Foam::functionObjects::wallBoundedStreamLine::read(const dictionary& dict)
|
||||
{
|
||||
//dict_ = dict;
|
||||
dict.lookup("fields") >> fields_;
|
||||
if (dict.found("UName"))
|
||||
if (dict.found("U"))
|
||||
{
|
||||
dict.lookup("UName") >> UName_;
|
||||
dict.lookup("U") >> UName_;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -40,7 +40,7 @@ Description
|
||||
libs ("libfieldFunctionObjects.so");
|
||||
...
|
||||
setFormat vtk;
|
||||
UName UNear;
|
||||
U UNear;
|
||||
trackForward yes;
|
||||
fields
|
||||
(
|
||||
@ -65,15 +65,15 @@ Description
|
||||
\heading Function object usage
|
||||
\table
|
||||
Property | Description | Required | Default value
|
||||
type | type name: wallBoundedStreamLine| yes |
|
||||
setFormat | output data type | yes |
|
||||
UName | tracking velocity field name | yes |
|
||||
fields | fields to sample | yes |
|
||||
lifetime | maximum number of particle tracking steps | yes |
|
||||
trackLength | tracking segment length | no |
|
||||
nSubCycle | number of tracking steps per cell | no|
|
||||
cloudName | cloud name to use | yes |
|
||||
seedSampleSet| seeding method (see below)| yes |
|
||||
type | Type name: wallBoundedStreamLine| yes |
|
||||
setFormat | Output data type | yes |
|
||||
U | Tracking velocity field name | yes |
|
||||
fields | Fields to sample | yes |
|
||||
lifetime | Maximum number of particle tracking steps | yes |
|
||||
trackLength | Tracking segment length | no |
|
||||
nSubCycle | Number of tracking steps per cell | no|
|
||||
cloudName | Cloud name to use | yes |
|
||||
seedSampleSet| Seeding method (see below)| yes |
|
||||
\endtable
|
||||
|
||||
\linebreak
|
||||
|
||||
@ -624,14 +624,14 @@ bool Foam::functionObjects::forces::read(const dictionary& dict)
|
||||
if (directForceDensity_)
|
||||
{
|
||||
// Optional entry for fDName
|
||||
fDName_ = dict.lookupOrDefault<word>("fDName", "fD");
|
||||
fDName_ = dict.lookupOrDefault<word>("fD", "fD");
|
||||
}
|
||||
else
|
||||
{
|
||||
// Optional entries U and p
|
||||
pName_ = dict.lookupOrDefault<word>("pName", "p");
|
||||
UName_ = dict.lookupOrDefault<word>("UName", "U");
|
||||
rhoName_ = dict.lookupOrDefault<word>("rhoName", "rho");
|
||||
pName_ = dict.lookupOrDefault<word>("p", "p");
|
||||
UName_ = dict.lookupOrDefault<word>("U", "U");
|
||||
rhoName_ = dict.lookupOrDefault<word>("rho", "rho");
|
||||
|
||||
// Reference density needed for incompressible calculations
|
||||
rhoRef_ = readScalar(dict.lookup("rhoInf"));
|
||||
|
||||
@ -57,15 +57,15 @@ Description
|
||||
\heading Function object usage
|
||||
\table
|
||||
Property | Description | Required | Default value
|
||||
type | type name: forces | yes |
|
||||
log | write force data to standard output | no | no
|
||||
patches | patches included in the forces calculation | yes |
|
||||
pName | pressure field name | no | p
|
||||
UName | velocity field name | no | U
|
||||
rhoName | density field name (see below) | no | rho
|
||||
CofR | centre of rotation (see below) | no |
|
||||
directForceDensity | force density supplied directly (see below)|no|no
|
||||
fDName | name of force density field (see below) | no | fD
|
||||
type | Type name: forces | yes |
|
||||
log | Write force data to standard output | no | no
|
||||
patches | Patches included in the forces calculation | yes |
|
||||
p | Pressure field name | no | p
|
||||
U | Velocity field name | no | U
|
||||
rho | Density field name (see below) | no | rho
|
||||
CofR | Centre of rotation (see below) | no |
|
||||
directForceDensity | Force density supplied directly (see below)|no|no
|
||||
fD | Name of force density field (see below) | no | fD
|
||||
\endtable
|
||||
|
||||
Bin data is optional, but if the dictionary is present, the entries must
|
||||
@ -77,7 +77,7 @@ Description
|
||||
\endtable
|
||||
|
||||
Note
|
||||
- For incompressible cases, set \c rhoName to \c rhoInf. You will then be
|
||||
- For incompressible cases, set \c rho to \c rhoInf. You will then be
|
||||
required to provide a \c rhoInf value corresponding to the free-stream
|
||||
constant density.
|
||||
- If the force density is supplied directly, set the \c directForceDensity
|
||||
@ -222,7 +222,7 @@ protected:
|
||||
//- Dynamic viscosity field
|
||||
tmp<volScalarField> mu() const;
|
||||
|
||||
//- Return rho if rhoName is specified otherwise rhoRef
|
||||
//- Return rho if specified otherwise rhoRef
|
||||
tmp<volScalarField> rho() const;
|
||||
|
||||
//- Return rhoRef if the pressure field is dynamic, i.e. p/rho
|
||||
|
||||
@ -240,9 +240,9 @@ Foam::functionObjects::pressureTools::~pressureTools()
|
||||
|
||||
bool Foam::functionObjects::pressureTools::read(const dictionary& dict)
|
||||
{
|
||||
dict.readIfPresent("pName", pName_);
|
||||
dict.readIfPresent("UName", UName_);
|
||||
dict.readIfPresent("rhoName", rhoName_);
|
||||
dict.readIfPresent("p", pName_);
|
||||
dict.readIfPresent("U", UName_);
|
||||
dict.readIfPresent("rho", rhoName_);
|
||||
|
||||
if (rhoName_ == "rhoInf")
|
||||
{
|
||||
|
||||
@ -64,8 +64,8 @@ Foam::functionObjects::blendingFactor::~blendingFactor()
|
||||
|
||||
bool Foam::functionObjects::blendingFactor::read(const dictionary& dict)
|
||||
{
|
||||
phiName_ = dict.lookupOrDefault<word>("phiName", "phi");
|
||||
dict.lookup("fieldName") >> fieldName_;
|
||||
phiName_ = dict.lookupOrDefault<word>("phi", "phi");
|
||||
dict.lookup("field") >> fieldName_;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -197,9 +197,9 @@ bool Foam::functionObjects::scalarTransport::read(const dictionary& dict)
|
||||
{
|
||||
Info<< type() << ":" << nl;
|
||||
|
||||
phiName_ = dict.lookupOrDefault<word>("phiName", "phi");
|
||||
UName_ = dict.lookupOrDefault<word>("UName", "U");
|
||||
rhoName_ = dict.lookupOrDefault<word>("rhoName", "rho");
|
||||
phiName_ = dict.lookupOrDefault<word>("phi", "phi");
|
||||
UName_ = dict.lookupOrDefault<word>("U", "U");
|
||||
rhoName_ = dict.lookupOrDefault<word>("rho", "rho");
|
||||
|
||||
userDT_ = false;
|
||||
if (dict.readIfPresent("DT", DT_))
|
||||
|
||||
@ -116,7 +116,7 @@ Foam::functionObjects::yPlus::~yPlus()
|
||||
bool Foam::functionObjects::yPlus::read(const dictionary& dict)
|
||||
{
|
||||
writeFiles::read(dict);
|
||||
phiName_ = dict.lookupOrDefault<word>("phiName", "phi");
|
||||
phiName_ = dict.lookupOrDefault<word>("phi", "phi");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user