ENH: Forces function object - more feedback at run-time for user field selections
This commit is contained in:
parent
17260280a4
commit
58471a332b
@ -722,11 +722,11 @@ Foam::functionObjects::forces::forces
|
|||||||
forceBinFilePtr_(),
|
forceBinFilePtr_(),
|
||||||
momentBinFilePtr_(),
|
momentBinFilePtr_(),
|
||||||
patchSet_(),
|
patchSet_(),
|
||||||
pName_(word::null),
|
pName_("p"),
|
||||||
UName_(word::null),
|
UName_("U"),
|
||||||
rhoName_(word::null),
|
rhoName_("rho"),
|
||||||
directForceDensity_(false),
|
directForceDensity_(false),
|
||||||
fDName_(""),
|
fDName_("fD"),
|
||||||
rhoRef_(VGREAT),
|
rhoRef_(VGREAT),
|
||||||
pRef_(0),
|
pRef_(0),
|
||||||
coordSys_(),
|
coordSys_(),
|
||||||
@ -767,11 +767,11 @@ Foam::functionObjects::forces::forces
|
|||||||
forceBinFilePtr_(),
|
forceBinFilePtr_(),
|
||||||
momentBinFilePtr_(),
|
momentBinFilePtr_(),
|
||||||
patchSet_(),
|
patchSet_(),
|
||||||
pName_(word::null),
|
pName_("p"),
|
||||||
UName_(word::null),
|
UName_("U"),
|
||||||
rhoName_(word::null),
|
rhoName_("rho"),
|
||||||
directForceDensity_(false),
|
directForceDensity_(false),
|
||||||
fDName_(""),
|
fDName_("fD"),
|
||||||
rhoRef_(VGREAT),
|
rhoRef_(VGREAT),
|
||||||
pRef_(0),
|
pRef_(0),
|
||||||
coordSys_(),
|
coordSys_(),
|
||||||
@ -826,14 +826,26 @@ bool Foam::functionObjects::forces::read(const dictionary& dict)
|
|||||||
if (directForceDensity_)
|
if (directForceDensity_)
|
||||||
{
|
{
|
||||||
// Optional entry for fDName
|
// Optional entry for fDName
|
||||||
fDName_ = dict.lookupOrDefault<word>("fD", "fD");
|
if (dict.readIfPresent<word>("fD", fDName_))
|
||||||
|
{
|
||||||
|
Info<< " fD: " << fDName_ << endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Optional entries U and p
|
// Optional field name entries
|
||||||
pName_ = dict.lookupOrDefault<word>("p", "p");
|
if (dict.readIfPresent<word>("p", pName_))
|
||||||
UName_ = dict.lookupOrDefault<word>("U", "U");
|
{
|
||||||
rhoName_ = dict.lookupOrDefault<word>("rho", "rho");
|
Info<< " p: " << pName_ << endl;
|
||||||
|
}
|
||||||
|
if (dict.readIfPresent<word>("U", UName_))
|
||||||
|
{
|
||||||
|
Info<< " U: " << UName_ << endl;
|
||||||
|
}
|
||||||
|
if (dict.readIfPresent<word>("rho", rhoName_))
|
||||||
|
{
|
||||||
|
Info<< " rho: " << rhoName_ << endl;
|
||||||
|
}
|
||||||
|
|
||||||
// Reference density needed for incompressible calculations
|
// Reference density needed for incompressible calculations
|
||||||
if (rhoName_ == "rhoInf")
|
if (rhoName_ == "rhoInf")
|
||||||
@ -843,11 +855,12 @@ bool Foam::functionObjects::forces::read(const dictionary& dict)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Reference pressure, 0 by default
|
// Reference pressure, 0 by default
|
||||||
pRef_ = dict.lookupOrDefault<scalar>("pRef", 0);
|
if (dict.readIfPresent<scalar>("pRef", pRef_))
|
||||||
Info<< " Reference pressure (pRef) set to " << pRef_ << endl;
|
{
|
||||||
|
Info<< " Reference pressure (pRef) set to " << pRef_ << endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
dict.readIfPresent("porosity", porosity_);
|
dict.readIfPresent("porosity", porosity_);
|
||||||
if (porosity_)
|
if (porosity_)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user