mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
functionObjects: Clear the result field from the objectRegistry if the argument fields are not available
This is needed to handle the processing of many time directories, some of which may have the required fields and some not.
This commit is contained in:
@ -45,6 +45,27 @@ namespace functionObjects
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
bool Foam::functionObjects::enstrophy::calc()
|
||||
{
|
||||
if (foundField<volVectorField>(fieldName_))
|
||||
{
|
||||
return store
|
||||
(
|
||||
resultName_,
|
||||
0.5*magSqr(fvc::curl(lookupField<volVectorField>(fieldName_)))
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::functionObjects::enstrophy::enstrophy
|
||||
@ -64,25 +85,4 @@ Foam::functionObjects::enstrophy::~enstrophy()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
bool Foam::functionObjects::enstrophy::execute(const bool postProcess)
|
||||
{
|
||||
if (foundField<volVectorField>(fieldName_))
|
||||
{
|
||||
return store
|
||||
(
|
||||
resultName_,
|
||||
0.5*magSqr(fvc::curl(lookupField<volVectorField>(fieldName_)))
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
Reference in New Issue
Block a user