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:
@ -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);
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user