mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: scaleFactor for fieldValue function-objects is 'sticky' (issue #331)
- if set in a dictionary and later removed, the intermediate value is retained rather than reverting to a normal default value. - same applies for a few other function objects and their variables
This commit is contained in:
@ -157,7 +157,7 @@ Foam::functionObjects::PecletNo::~PecletNo()
|
|||||||
|
|
||||||
bool Foam::functionObjects::PecletNo::read(const dictionary& dict)
|
bool Foam::functionObjects::PecletNo::read(const dictionary& dict)
|
||||||
{
|
{
|
||||||
dict.readIfPresent("rho", rhoName_);
|
rhoName_ = dict.lookupOrDefault<word>("rho", "rho");
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -117,8 +117,13 @@ bool Foam::functionObjects::blendingFactor::read(const dictionary& dict)
|
|||||||
writeFile::read(dict);
|
writeFile::read(dict);
|
||||||
|
|
||||||
phiName_ = dict.lookupOrDefault<word>("phi", "phi");
|
phiName_ = dict.lookupOrDefault<word>("phi", "phi");
|
||||||
dict.readIfPresent("tolerance", tolerance_);
|
|
||||||
if ((tolerance_ < 0) || (tolerance_ > 1))
|
tolerance_ = 0.001;
|
||||||
|
if
|
||||||
|
(
|
||||||
|
dict.readIfPresent("tolerance", tolerance_)
|
||||||
|
&& (tolerance_ < 0 || tolerance_ > 1)
|
||||||
|
)
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "tolerance must be in the range 0 to 1. Supplied value: "
|
<< "tolerance must be in the range 0 to 1. Supplied value: "
|
||||||
|
|||||||
@ -97,7 +97,7 @@ bool Foam::functionObjects::fieldValue::read(const dictionary& dict)
|
|||||||
|
|
||||||
dict.lookup("fields") >> fields_;
|
dict.lookup("fields") >> fields_;
|
||||||
dict.lookup("writeFields") >> writeFields_;
|
dict.lookup("writeFields") >> writeFields_;
|
||||||
dict.readIfPresent("scaleFactor", scaleFactor_);
|
scaleFactor_ = dict.lookupOrDefault<scalar>("scaleFactor", 1.0);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -70,7 +70,7 @@ protected:
|
|||||||
|
|
||||||
// Protected data
|
// Protected data
|
||||||
|
|
||||||
//- Optional scale value
|
//- Optional scaling factor
|
||||||
scalar scaleFactor_;
|
scalar scaleFactor_;
|
||||||
|
|
||||||
//- Construction dictionary
|
//- Construction dictionary
|
||||||
|
|||||||
@ -616,9 +616,9 @@ bool Foam::functionObjects::fluxSummary::read(const dictionary& dict)
|
|||||||
writeFile::read(dict);
|
writeFile::read(dict);
|
||||||
|
|
||||||
mode_ = modeTypeNames_.read(dict.lookup("mode"));
|
mode_ = modeTypeNames_.read(dict.lookup("mode"));
|
||||||
phiName_= dict.lookupOrDefault<word>("phi", "phi");
|
phiName_ = dict.lookupOrDefault<word>("phi", "phi");
|
||||||
dict.readIfPresent("scaleFactor", scaleFactor_);
|
scaleFactor_ = dict.lookupOrDefault<scalar>("scaleFactor", 1.0);
|
||||||
dict.readIfPresent("tolerance", tolerance_);
|
tolerance_ = dict.lookupOrDefault<scalar>("tolerance", 0.8);
|
||||||
|
|
||||||
// Initialise with capacity of 10 faceZones
|
// Initialise with capacity of 10 faceZones
|
||||||
DynamicList<vector> refDir(10);
|
DynamicList<vector> refDir(10);
|
||||||
|
|||||||
@ -232,8 +232,8 @@ bool Foam::functionObjects::pressure::read(const dictionary& dict)
|
|||||||
{
|
{
|
||||||
fieldExpression::read(dict);
|
fieldExpression::read(dict);
|
||||||
|
|
||||||
dict.readIfPresent("U", UName_);
|
UName_ = dict.lookupOrDefault<word>("U", "U");
|
||||||
dict.readIfPresent("rho", rhoName_);
|
rhoName_ = dict.lookupOrDefault<word>("rho", "rho");
|
||||||
|
|
||||||
if (rhoName_ == "rhoInf")
|
if (rhoName_ == "rhoInf")
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user