FunctorCoordinatesFunctionAux

Auxiliary Kernel that creates and updates a field variable by sampling a function with functors (variables, functions, others) as the coordinates.

The FunctorCoordinatesFunctionAux lets users pass variables, functions, postprocessors and other Functors as time/coordinates arguments to a function, in order to set an auxiliary variable. It is generally useful when the function shape is only available as a Function, even though it would often be more appropriate to use a material property.

warningwarning

If any of the arguments are nonlinear variables or depend on nonlinear variables, you should not use the FunctorCoordinatesFunctionAux when also using automatic differentiation and Newton's method. Auxiliary variables cannot store derivatives with regards to the nonlinear variables, so the Jacobian for Newton's method would be incomplete.

warningwarning

If using auxiliary variables as arguments to the FunctorCoordinatesFunctionAux, you must make sure the AuxKernels computing these auxiliary variables are executed on an execute_on schedule happening before the "execute_on" schedule of the FunctorCoordinatesFunctionAux. This is because the auxiliary variables are read from the system solution vector, which is only updated after the execution of all auxiliary kernels on a given execute_on schedule. You can check that the ordering of execution of auxiliary kernels is happening on a previous execute_on schedule using the "show_execution_order" parameter in the [Debug] block.

Example syntax

In this example, the FunctorCoordinatesFunctionAux to evaluate the simple correlation written with a time t dependency in Function density_function. The temperature, an auxiliary variable, is passed as the time functor.

[Functions]
  [density_correlation]
    type = ParsedFunction
    expression = '900 - t'
  []
  [multi_dependency]
    type = ParsedFunction
    expression = 't*((x*x)+(y*y) + z)'
  []
  [y_function]
    type = ParsedFunction
    expression = 'y'
  []

  # Function used as a functor for the test
  [time_function]
    type = ParsedFunction
    expression = '1 + 2 * t'
  []
[]

[AuxKernels]
  [set_density]
    type = FunctorCoordinatesFunctionAux
    variable = density
    function = density_correlation
    t_functor = 'temperature'
    x_functor = 0
    y_functor = 0
    z_functor = 0
  []
  [set_y]
    type = FunctorAux
    functor = 'y_function'
    variable = 'y_var'
    # this auxkernel must execute before the y_var functor is used
    # in the FunctorCoordinatesFunctionAux if we want y to be up to date!
    execute_on = 'INITIAL'
  []
  [set_complex_dependency_fv]
    type = FunctorCoordinatesFunctionAux
    variable = multiple_dependency_test
    function = multi_dependency
    t_functor = 'time_function'
    x_functor = 'x_var'
    y_functor = 'y_var'
    z_functor = 'z_pp'
  []
  [set_complex_dependency_higher_order]
    type = FunctorCoordinatesFunctionAux
    variable = higher_order_test
    function = multi_dependency
    t_functor = 'time_function'
    x_functor = 'x_var'
    y_functor = 'y_var'
    z_functor = 'z_pp'
  []
[]
(moose/test/tests/auxkernels/functor_coordinates_function_aux/test.i)

Input Parameters

  • functionThe function to use as the value

    C++ Type:FunctionName

    Unit:(no unit assumed)

    Controllable:No

    Description:The function to use as the value

  • t_functorThe functor to use for the time function argument. A functor is any of the following: a variable, a functor material property, a function, a post-processor, or a number.

    C++ Type:MooseFunctorName

    Unit:(no unit assumed)

    Controllable:No

    Description:The functor to use for the time function argument. A functor is any of the following: a variable, a functor material property, a function, a post-processor, or a number.

  • variableThe name of the variable that this object applies to

    C++ Type:AuxVariableName

    Unit:(no unit assumed)

    Controllable:No

    Description:The name of the variable that this object applies to

  • x_functorThe functor to use for the X coordinate function argument. A functor is any of the following: a variable, a functor material property, a function, a post-processor, or a number.

    C++ Type:MooseFunctorName

    Unit:(no unit assumed)

    Controllable:No

    Description:The functor to use for the X coordinate function argument. A functor is any of the following: a variable, a functor material property, a function, a post-processor, or a number.

  • y_functorThe functor to use for the Y coordinate function argument. A functor is any of the following: a variable, a functor material property, a function, a post-processor, or a number.

    C++ Type:MooseFunctorName

    Unit:(no unit assumed)

    Controllable:No

    Description:The functor to use for the Y coordinate function argument. A functor is any of the following: a variable, a functor material property, a function, a post-processor, or a number.

  • z_functorThe functor to use for the Z coordinate function argument. A functor is any of the following: a variable, a functor material property, a function, a post-processor, or a number.

    C++ Type:MooseFunctorName

    Unit:(no unit assumed)

    Controllable:No

    Description:The functor to use for the Z coordinate function argument. A functor is any of the following: a variable, a functor material property, a function, a post-processor, or a number.

Required Parameters

  • blockThe list of blocks (ids or names) that this object will be applied

    C++ Type:std::vector<SubdomainName>

    Unit:(no unit assumed)

    Controllable:No

    Description:The list of blocks (ids or names) that this object will be applied

  • boundaryThe list of boundaries (ids or names) from the mesh where this object applies

    C++ Type:std::vector<BoundaryName>

    Unit:(no unit assumed)

    Controllable:No

    Description:The list of boundaries (ids or names) from the mesh where this object applies

  • check_boundary_restrictedTrueWhether to check for multiple element sides on the boundary in the case of a boundary restricted, element aux variable. Setting this to false will allow contribution to a single element's elemental value(s) from multiple boundary sides on the same element (example: when the restricted boundary exists on two or more sides of an element, such as at a corner of a mesh

    Default:True

    C++ Type:bool

    Unit:(no unit assumed)

    Controllable:No

    Description:Whether to check for multiple element sides on the boundary in the case of a boundary restricted, element aux variable. Setting this to false will allow contribution to a single element's elemental value(s) from multiple boundary sides on the same element (example: when the restricted boundary exists on two or more sides of an element, such as at a corner of a mesh

  • execute_onLINEAR TIMESTEP_ENDThe list of flag(s) indicating when this object should be executed. For a description of each flag, see https://mooseframework.inl.gov/source/interfaces/SetupInterface.html.

    Default:LINEAR TIMESTEP_END

    C++ Type:ExecFlagEnum

    Unit:(no unit assumed)

    Options:NONE, INITIAL, LINEAR, NONLINEAR_CONVERGENCE, NONLINEAR, POSTCHECK, TIMESTEP_END, TIMESTEP_BEGIN, MULTIAPP_FIXED_POINT_END, MULTIAPP_FIXED_POINT_BEGIN, FINAL, CUSTOM, PRE_DISPLACE

    Controllable:No

    Description:The list of flag(s) indicating when this object should be executed. For a description of each flag, see https://mooseframework.inl.gov/source/interfaces/SetupInterface.html.

  • factor1A factor to apply on the functor. A functor is any of the following: a variable, a functor material property, a function, a post-processor, or a number.

    Default:1

    C++ Type:MooseFunctorName

    Unit:(no unit assumed)

    Controllable:No

    Description:A factor to apply on the functor. A functor is any of the following: a variable, a functor material property, a function, a post-processor, or a number.

  • prop_getter_suffixAn optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.

    C++ Type:MaterialPropertyName

    Unit:(no unit assumed)

    Controllable:No

    Description:An optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.

  • use_interpolated_stateFalseFor the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.

    Default:False

    C++ Type:bool

    Unit:(no unit assumed)

    Controllable:No

    Description:For the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.

Optional Parameters

  • control_tagsAdds user-defined labels for accessing object parameters via control logic.

    C++ Type:std::vector<std::string>

    Unit:(no unit assumed)

    Controllable:No

    Description:Adds user-defined labels for accessing object parameters via control logic.

  • enableTrueSet the enabled status of the MooseObject.

    Default:True

    C++ Type:bool

    Unit:(no unit assumed)

    Controllable:Yes

    Description:Set the enabled status of the MooseObject.

  • seed0The seed for the master random number generator

    Default:0

    C++ Type:unsigned int

    Unit:(no unit assumed)

    Controllable:No

    Description:The seed for the master random number generator

  • use_displaced_meshFalseWhether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.

    Default:False

    C++ Type:bool

    Unit:(no unit assumed)

    Controllable:No

    Description:Whether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.

Advanced Parameters