Skip to content

Function1 objectRegistry access

Andrew Heather requested to merge feature-functionObject-Function1 into develop

Summary

Cross reference EP 1657

Details of new models

Function1's

  • Function1 : The Function1 class can now be created using an objectRegistry, 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, other Function1s
  • functionObjectValue : set the value according to the result of a function object
  • sample : set the value according to a field value
  • limitRange : renamed to inputValueMapper and extended to include operations using function object results

Function object updates

  • sampledSets : extended to store the set min, max and average values in its results dictionary
  • reference : the reference value refValue is now set according to a Function1 type. To recover the old behaviour (sampling a field value) users can employ the new sample Function1 type.
  • registered fields are now prefixed - typically by <function_object_name>: - to avoid name collisions on registration, e.g. you can now have multiple fieldAverage 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 result average(p) is created.
    • The sample average(p) value is supplied to a valueAverage function object to perform time averaging. This creates the result average(p)Mean.
    • The reference function object's refValue makes use of the new functionObjectValue Function1, where the value average(p)Mean is retrieved from the average1 function object to determine the final reference field.
    • A second reference function object to shows how to recover the old function object behaviour.

Risks

Testing required

  • TimeFunction1 has been deprecated

  • check that previous behaviours are maintained, e.g. for lagrangian injection models when using engineTime

Edited by Andrew Heather

Merge request reports