Function1 objectRegistry access
Summary
Cross reference EP 1657
Details of new models
Function1's
-
Function1
: The Function1 class can now be created using anobjectRegistry
, i.e. mesh or time databases, allowing other registered objects to be retrieved, e.g. fields, models, function object state and results information- change propagated across all
Function1
instances, e.g. boundary conditions, function objects, otherFunction1s
- change propagated across all
-
functionObjectValue
: set thevalue
according to the result of a function object -
sample
: set thevalue
according to a field value -
limitRange
: renamed toinputValueMapper
and extended to include operations using function object results
Function object updates
-
sampledSets
: extended to store the setmin
,max
andaverage
values in its results dictionary -
reference
: the reference valuerefValue
is now set according to aFunction1
type. To recover the old behaviour (sampling a field value) users can employ the newsample
Function1 type. - registered fields are now prefixed - typically by
<function_object_name>:
- to avoid name collisions on registration, e.g. you can now have multiplefieldAverage
function objects that act on the same field
Test case
-
$FOAM_TUTORIALS/incompressible/simpleFoam/simpleCar
- Sample the pressure field using a
sets
function object; the resultaverage(p)
is created. - The sample
average(p)
value is supplied to avalueAverage
function object to perform time averaging. This creates the resultaverage(p)Mean
. - The
reference
function object'srefValue
makes use of the newfunctionObjectValue
Function1, where the valueaverage(p)Mean
is retrieved from theaverage1
function object to determine the final reference field. - A second
reference
function object to shows how to recover the old function object behaviour.
- Sample the pressure field using a
Risks
Testing required
-
TimeFunction1
has been deprecated -
check that previous behaviours are maintained, e.g. for lagrangian injection models when using
engineTime
Merge request reports
Activity
changed milestone to %v2112
added boundary conditions enhancement post-processing labels
assigned to @mark
added 1 commit
- e71b88c2 - ENH: LimitRange Function1 - extended and renamed
- Resolved by Andrew Heather
May make sense to split off a
inputValueMapperBase
with the min/max/Function1 + the enumeration names. That would save scalar/vector/... versions of each of these, and could also be useful in its own right as a standalone scalar Function1 (if that is what we want).Edited by Mark OLESEN
- Resolved by Andrew Heather
Hey everybody, I tested the latest development regarding:
- Naming conflicts
- reference pressure capability
- Retrieving FO values within the Function1 (functionObjectValue) class
Everything works as expected. Additionally, I checked the inputValueMapper for a flux-based-rpm table. Works smoothly. However, the output of the info text:
Using fanFluxMaster 1 function object value
should be deactivated or better, could be turned on viadebug
variable and additionally, the quantity should be outputted:Using fanFluxMaster 1 function object value: 231.24
Works. Thanks.
Perhaps a general hook? To be added on a per-dictionary basis.
debugFunction1 true;
Edited by Mark OLESENadded 1 commit
- 3b80c66b - ENH: LimitRange Function1 - extended and renamed
Perfect. Looks good.
Edited by Tobias Holzmann- Resolved by Andrew Heather
Note the new
sample
Function1
currently stores the sample mesh cell on construction - this will fail for moving meshes. Need to add an option to reset, or query e.g. the points eventNo.
added 12 commits
- c89c35dc - ENH: Added new sample Function1
- e1674cbd - ENH: Refactored TimeFunction1 - now possible using Function1 directly
- f04ef414 - ENH: add caching selector to PatchFunction1
- 020cf042 - ENH: Deprecated TimeFunction1 usage in favour of Function1
- 4b51bd2e - ENH: function objects - apply scoped name when registering objects
- 66dcdfbd - TUT: Added example showing use of functionObject result lookup from a Function1
- 9bf3c9c7 - ENH: Function1's - added objectRegistry access
- 0d0fbd14 - STYLE: renamed convertTimeBase to more descriptive userTimeToTime
- 2de2fde9 - ENH: Function1 - updated time-based Function1 usage
- 4a845999 - ENH: LimitRange Function1 - extended and renamed
- d99cf3d4 - BUG: dsmcFields fails with scoped field names
- b2560298 - ENH: add Function1 wrapping for functionObject trigger
Toggle commit listadded 28 commits
-
b2560298...f078643f - 10 commits from branch
develop
- b19e767b - ENH: sampledSets - added min,max,average values to the results dict
- aeef9625 - ENH: Refactored stateFunctionObject
- c1a04abd - ENH: Function1 - added optional objectRegistry reference
- 70b55be6 - COMP: Function1 - propagated API change resulting from new objectRegistry access
- 2c2310dc - ENH: reference function object - retrieve reference using Function1
- bc2b469f - ENH: Added new Function1: FunctionObjectValue
- b9b011f5 - ENH: Added new sample Function1
- f29eb55c - ENH: Refactored TimeFunction1 - now possible using Function1 directly
- 925a2e72 - ENH: add caching selector to PatchFunction1
- 9194cd52 - ENH: Deprecated TimeFunction1 usage in favour of Function1
- c233961d - ENH: function objects - apply scoped name when registering objects
- 889bc171 - TUT: Added example showing use of functionObject result lookup from a Function1
- 098aec49 - ENH: Function1's - added objectRegistry access
- f6ee1811 - STYLE: renamed convertTimeBase to more descriptive userTimeToTime
- ba45fb2c - ENH: Function1 - updated time-based Function1 usage
- 89ddc271 - ENH: LimitRange Function1 - extended and renamed
- 30a2fa4b - BUG: dsmcFields fails with scoped field names
- adcf41bd - ENH: add Function1 wrapping for functionObject trigger
Toggle commit list-
b2560298...f078643f - 10 commits from branch
mentioned in commit adbcd3a1