mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
functionObjects::Q: Result field named "Q" if the field is "U" otherwise "Q(<fieldName>)"
This commit is contained in:
@ -34,6 +34,7 @@ histogram/histogram.C
|
|||||||
|
|
||||||
fieldExpression/fieldExpression.C
|
fieldExpression/fieldExpression.C
|
||||||
components/components.C
|
components/components.C
|
||||||
|
randomise/randomise.C
|
||||||
div/div.C
|
div/div.C
|
||||||
grad/grad.C
|
grad/grad.C
|
||||||
mag/mag.C
|
mag/mag.C
|
||||||
|
|||||||
@ -77,8 +77,20 @@ Foam::functionObjects::Q::Q
|
|||||||
const dictionary& dict
|
const dictionary& dict
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
fieldExpression(name, runTime, dict, "U", "Q")
|
fieldExpression(name, runTime, dict, "U")
|
||||||
{}
|
{
|
||||||
|
if (resultName_.empty())
|
||||||
|
{
|
||||||
|
if (fieldName_ != "U")
|
||||||
|
{
|
||||||
|
resultName_ = "Q(" + fieldName_ + ')';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
resultName_ = 'Q';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|||||||
@ -77,7 +77,7 @@ bool Foam::functionObjects::fieldExpression::read(const dictionary& dict)
|
|||||||
{
|
{
|
||||||
fvMeshFunctionObject::read(dict);
|
fvMeshFunctionObject::read(dict);
|
||||||
|
|
||||||
if (fieldName_ == word::null || dict.found("field"))
|
if (fieldName_.empty() || dict.found("field"))
|
||||||
{
|
{
|
||||||
dict.lookup("field") >> fieldName_;
|
dict.lookup("field") >> fieldName_;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user