mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: blendingFactor function object - always include field name in result name
This commit is contained in:
@ -79,7 +79,7 @@ Foam::functionObjects::blendingFactor::blendingFactor
|
|||||||
{
|
{
|
||||||
read(dict);
|
read(dict);
|
||||||
writeFileHeader(file());
|
writeFileHeader(file());
|
||||||
setResultName(typeName, fieldName_);
|
setResultName(typeName, "");
|
||||||
|
|
||||||
tmp<volScalarField> indicatorPtr
|
tmp<volScalarField> indicatorPtr
|
||||||
(
|
(
|
||||||
@ -113,24 +113,28 @@ Foam::functionObjects::blendingFactor::~blendingFactor()
|
|||||||
|
|
||||||
bool Foam::functionObjects::blendingFactor::read(const dictionary& dict)
|
bool Foam::functionObjects::blendingFactor::read(const dictionary& dict)
|
||||||
{
|
{
|
||||||
fieldExpression::read(dict);
|
if (fieldExpression::read(dict) && writeFile::read(dict))
|
||||||
writeFile::read(dict);
|
|
||||||
|
|
||||||
phiName_ = dict.lookupOrDefault<word>("phi", "phi");
|
|
||||||
|
|
||||||
tolerance_ = 0.001;
|
|
||||||
if
|
|
||||||
(
|
|
||||||
dict.readIfPresent("tolerance", tolerance_)
|
|
||||||
&& (tolerance_ < 0 || tolerance_ > 1)
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
phiName_ = dict.lookupOrDefault<word>("phi", "phi");
|
||||||
<< "tolerance must be in the range 0 to 1. Supplied value: "
|
|
||||||
<< tolerance_ << exit(FatalError);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
tolerance_ = 0.001;
|
||||||
|
if
|
||||||
|
(
|
||||||
|
dict.readIfPresent("tolerance", tolerance_)
|
||||||
|
&& (tolerance_ < 0 || tolerance_ > 1)
|
||||||
|
)
|
||||||
|
{
|
||||||
|
FatalErrorInFunction
|
||||||
|
<< "tolerance must be in the range 0 to 1. Supplied value: "
|
||||||
|
<< tolerance_ << exit(FatalError);
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user