functionObjects::fieldValues::volFieldValue: Added support for VolInternalField

It is now possible to calculate field values of VolInternalFields, e.g. the
cached kEpsilon:G field in the
tutorials/modules/incompressibleFluid/pitzDailySteady case:

    #includeFunc cellMax(kEpsilon:G)
This commit is contained in:
Henry Weller
2023-03-15 13:59:29 +00:00
parent 839fc789d5
commit 496850ebb2
2 changed files with 13 additions and 10 deletions

View File

@ -34,7 +34,11 @@ bool Foam::functionObjects::fieldValues::volFieldValue::validField
const word& fieldName const word& fieldName
) const ) const
{ {
if (obr_.foundObject<VolField<Type>>(fieldName)) if
(
obr_.foundObject<VolField<Type>>(fieldName)
|| obr_.foundObject<VolInternalField<Type>>(fieldName)
)
{ {
return true; return true;
} }
@ -55,6 +59,14 @@ Foam::functionObjects::fieldValues::volFieldValue::getFieldValues
return filterField(obr_.lookupObject<VolField<Type>>(fieldName)); return filterField(obr_.lookupObject<VolField<Type>>(fieldName));
} }
if (obr_.foundObject<VolInternalField<Type>>(fieldName))
{
return filterField
(
obr_.lookupObject<VolInternalField<Type>>(fieldName)
);
}
FatalErrorInFunction FatalErrorInFunction
<< "Field " << fieldName << " not found in database" << "Field " << fieldName << " not found in database"
<< abort(FatalError); << abort(FatalError);

View File

@ -61,15 +61,6 @@ class fieldsExpression
{ {
protected: protected:
// Protected typedefs
//- Internal field typedef that doesn't go via the
// GeometricField::Internal typedef, and therefore allows template
// argument deduction of the Type
template<class Type>
using VolInternalField = DimensionedField<Type, volMesh>;
// Protected member data // Protected member data
//- Names of fields to process //- Names of fields to process