NSFVFrictionFlowDiodeFunctorMaterial

Increases the anistropic friction coefficients, linear or quadratic, by K_i * |direction_i| when the diode is turned on with a boolean

This material is meant to be used to implement a simplistic volumetric flow diode. The parameter "additional_linear_resistance" and "additional_quadratic_resistance" should be chosen such that the flow is sufficiently vanished in the direction opposite the diode.

warningwarning

The operation of the diode is controlled with the "turn_on_diode" parameter. If this parameter is false, the 'diode' does NOT create any flow restriction.

Example input file syntax

Simple always-on friction term

In this example the friction flow diode is added to a porous media simulation. The combined_linear/quadratic friction coefficients contain both the diode friction coefficients and the base porous media friction.

The friction coefficients are then combined using a PiecewiseByBlockVectorFunctorMaterial ADPiecewiseByBlockVectorFunctorMaterial to have a uniform name over the whole domain for friction coefficients.

[FunctorMaterials<<<{"href": "../../syntax/FunctorMaterials/index.html"}>>>]
  [porosity]
    type = ADGenericFunctorMaterial<<<{"description": "FunctorMaterial object for declaring properties that are populated by evaluation of a Functor (a constant, variable, function or functor material property) objects.", "href": "GenericFunctorMaterial.html"}>>>
    prop_names<<<{"description": "The names of the properties this material will have"}>>> = 'porosity'
    prop_values<<<{"description": "The corresponding names of the functors that are going to provide the values for the variables. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number."}>>> = '0.5'
  []
  [base_friction]
    type = ADGenericVectorFunctorMaterial<<<{"description": "FunctorMaterial object for declaring vector properties that are populated by evaluation of functor (constants, functions, variables, matprops) object.", "href": "GenericVectorFunctorMaterial.html"}>>>
    prop_names<<<{"description": "The names of the properties this material will have"}>>> = 'Darcy Forchheimer'
    prop_values<<<{"description": "The corresponding names of the functors that are going to provide the values for the vector material properties. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number."}>>> = '220 240 260 0 0 0'
  []
  [diode]
    type = NSFVFrictionFlowDiodeFunctorMaterial<<<{"description": "Increases the anistropic friction coefficients, linear or quadratic, by K_i * |direction_i| when the diode is turned on with a boolean", "href": "NSFVFrictionFlowDiodeFunctorMaterial.html"}>>>
    direction<<<{"description": "Direction of the diode"}>>> = '1 0 0'
    additional_linear_resistance<<<{"description": "Additional linear friction factor"}>>> = '4000 0 0'
    additional_quadratic_resistance<<<{"description": "Additional quadratic friction factor"}>>> = '0 0 0'
    base_linear_friction_coefs<<<{"description": "Name of the base anistropic Darcy/linear friction functor. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number."}>>> = 'Darcy'
    base_quadratic_friction_coefs<<<{"description": "Name of the base anistropic Forchheimer/quadratic friction functor. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number."}>>> = 'Forchheimer'
    sum_linear_friction_name<<<{"description": "Name of the additional Darcy/linear friction functor. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number."}>>> = 'diode_linear'
    sum_quadratic_friction_name<<<{"description": "Name of the additional Forchheimer/quadratic friction functor. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number."}>>> = 'diode_quad'
    block<<<{"description": "The list of blocks (ids or names) that this object will be applied"}>>> = '2'
    turn_on_diode<<<{"description": "Whether to add the additional friction"}>>> = true
  []
  [combine_linear_friction]
    type = ADPiecewiseByBlockVectorFunctorMaterial<<<{"description": "Computes a property value on a per-subdomain basis", "href": "PiecewiseByBlockFunctorMaterial.html"}>>>
    prop_name<<<{"description": "The name of the property to declare. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number."}>>> = 'combined_linear'
    subdomain_to_prop_value<<<{"description": "Map from subdomain to property value. The value may be a constant or any kind of functor (functions, variables, functor material properties)"}>>> = '1 Darcy
                               2 diode_linear'
  []
  [combine_quadratic_friction]
    type = ADPiecewiseByBlockVectorFunctorMaterial<<<{"description": "Computes a property value on a per-subdomain basis", "href": "PiecewiseByBlockFunctorMaterial.html"}>>>
    prop_name<<<{"description": "The name of the property to declare. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number."}>>> = 'combined_quadratic'
    subdomain_to_prop_value<<<{"description": "Map from subdomain to property value. The value may be a constant or any kind of functor (functions, variables, functor material properties)"}>>> = '1 Forchheimer
                               2 diode_quad'
  []
[]
(modules/navier_stokes/test/tests/finite_volume/materials/flow_diode/friction.i)

Dynamic operation of a diode

In this example, we show three Control strategies for the diode. The idea of these controls is to detect a condition in which the flow should be blocked, because it's going in the way opposite the direction of the diode, or because it meets a criterion that is outlined in the postprocessors and functions involved to describe it.

The first strategy is simply to block the flow at a given time.

[Controls<<<{"href": "../../syntax/Controls/index.html"}>>>]
  [time_based]
    type = BoolFunctionControl<<<{"description": "Sets the value of a 'bool' input parameters to the value of a provided function.", "href": "../controls/BoolFunctionControl.html"}>>>
    function<<<{"description": "The function to use for controlling the specified parameter."}>>> = time_function
    parameter<<<{"description": "The input parameter(s) to control. Specify a single parameter name and all parameters in all objects matching the name will be updated"}>>> = 'FunctorMaterials/diode/turn_on_diode'
    execute_on<<<{"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."}>>> = timestep_begin
  []
[]

[Functions<<<{"href": "../../syntax/Functions/index.html"}>>>]
  [time_function]
    type = ParsedFunction<<<{"description": "Function created by parsing a string", "href": "../functions/MooseParsedFunction.html"}>>>
    expression<<<{"description": "The user defined function."}>>> = 'if(t<0.1, 0, 1)'
  []
[]
(modules/navier_stokes/test/tests/finite_volume/materials/flow_diode/transient_operation.i)

The second strategy is to look at the pressure drop across the diode, and block (add friction to) the flow if it exceeds a certain value. If it exceeds a certain value, then in all likelihood means that the flow is flowing through the diode in the direction of decreasing pressure.

[Controls<<<{"href": "../../syntax/Controls/index.html"}>>>]
  [pdrop_based]
    type = BoolFunctionControl<<<{"description": "Sets the value of a 'bool' input parameters to the value of a provided function.", "href": "../controls/BoolFunctionControl.html"}>>>
    function<<<{"description": "The function to use for controlling the specified parameter."}>>> = pdrop_positive
    parameter<<<{"description": "The input parameter(s) to control. Specify a single parameter name and all parameters in all objects matching the name will be updated"}>>> = 'FunctorMaterials/diode/turn_on_diode'
    execute_on<<<{"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."}>>> = timestep_begin
  []
[]

[Postprocessors<<<{"href": "../../syntax/Postprocessors/index.html"}>>>]
  [pdrop_diode]
    type = PressureDrop<<<{"description": "Computes the pressure drop between an upstream and a downstream boundary.", "href": "../postprocessors/PressureDrop.html"}>>>
    upstream_boundary<<<{"description": "The upstream surface (must also be specified in 'boundary' parameter"}>>> = 'diode_inlet'
    downstream_boundary<<<{"description": "The downstream surface (must also be specified in 'boundary' parameter"}>>> = 'top_left'
    weighting_functor<<<{"description": "A vector functor to compute a flux to weigh the pressure for the pressure average computations. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number."}>>> = 'momentum'
    boundary<<<{"description": "The list of boundary IDs from the mesh where this object applies"}>>> = 'diode_inlet top_left'
    pressure<<<{"description": "The pressure functor. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number."}>>> = pressure
  []
[]

[Functions<<<{"href": "../../syntax/Functions/index.html"}>>>]
  [pdrop_positive]
    type = ParsedFunction<<<{"description": "Function created by parsing a string", "href": "../functions/MooseParsedFunction.html"}>>>
    expression<<<{"description": "The user defined function."}>>> = 'if(pdrop_diode>100, 1, 0)'
    symbol_names<<<{"description": "Symbols (excluding t,x,y,z) that are bound to the values provided by the corresponding items in the vals vector."}>>> = pdrop_diode
    symbol_values<<<{"description": "Constant numeric values, postprocessor names, function names, and scalar variables corresponding to the symbols in symbol_names."}>>> = pdrop_diode
  []
[]
(modules/navier_stokes/test/tests/finite_volume/materials/flow_diode/transient_operation.i)

The final strategy is to compute the mass flow rate through the diode, and block (add friction to) the flow if it exceeds a certain value.

[Controls<<<{"href": "../../syntax/Controls/index.html"}>>>]
  [flow_based]
    type = BoolFunctionControl<<<{"description": "Sets the value of a 'bool' input parameters to the value of a provided function.", "href": "../controls/BoolFunctionControl.html"}>>>
    function<<<{"description": "The function to use for controlling the specified parameter."}>>> = velocity_big_enough
    parameter<<<{"description": "The input parameter(s) to control. Specify a single parameter name and all parameters in all objects matching the name will be updated"}>>> = 'FunctorMaterials/diode/turn_on_diode'
    execute_on<<<{"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."}>>> = timestep_begin
  []
[]

[Postprocessors<<<{"href": "../../syntax/Postprocessors/index.html"}>>>]
  [flow_diode]
    type = VolumetricFlowRate<<<{"description": "Computes the volumetric flow rate of an advected quantity through a sideset.", "href": "../postprocessors/VolumetricFlowRate.html"}>>>
    boundary<<<{"description": "The list of boundary IDs from the mesh where this object applies"}>>> = 'diode_inlet'
    vel_x<<<{"description": "The x-axis velocity"}>>> = superficial_vel_x
    vel_y<<<{"description": "The y-axis velocity"}>>> = superficial_vel_y
    advected_quantity<<<{"description": "The quantity to advect. This is the canonical parameter to set the advected quantity when finite volume is being used. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number."}>>> = ${rho}
  []
[]

[Functions<<<{"href": "../../syntax/Functions/index.html"}>>>]
  [velocity_big_enough]
    type = ParsedFunction<<<{"description": "Function created by parsing a string", "href": "../functions/MooseParsedFunction.html"}>>>
    expression<<<{"description": "The user defined function."}>>> = 'if(flow_diode<-0.4, 1, 0)'
    symbol_names<<<{"description": "Symbols (excluding t,x,y,z) that are bound to the values provided by the corresponding items in the vals vector."}>>> = flow_diode
    symbol_values<<<{"description": "Constant numeric values, postprocessor names, function names, and scalar variables corresponding to the symbols in symbol_names."}>>> = flow_diode
  []
[]
(modules/navier_stokes/test/tests/finite_volume/materials/flow_diode/transient_operation.i)
commentnote

All these strategies are workarounds for the fact that looking at the local velocity (in multi-dimensional space) to apply a friction term based on this local velocity, rather than an average quantity, seems to be numerically unstable.

Input Parameters

  • additional_linear_resistanceAdditional linear friction factor

    C++ Type:libMesh::VectorValue<double>

    Unit:(no unit assumed)

    Controllable:No

    Description:Additional linear friction factor

  • additional_quadratic_resistanceAdditional quadratic friction factor

    C++ Type:libMesh::VectorValue<double>

    Unit:(no unit assumed)

    Controllable:No

    Description:Additional quadratic friction factor

  • base_linear_friction_coefsName of the base anistropic Darcy/linear friction functor. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.

    C++ Type:MooseFunctorName

    Unit:(no unit assumed)

    Controllable:No

    Description:Name of the base anistropic Darcy/linear friction functor. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.

  • base_quadratic_friction_coefsName of the base anistropic Forchheimer/quadratic friction functor. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.

    C++ Type:MooseFunctorName

    Unit:(no unit assumed)

    Controllable:No

    Description:Name of the base anistropic Forchheimer/quadratic friction functor. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.

  • directionDirection of the diode

    C++ Type:libMesh::VectorValue<double>

    Unit:(no unit assumed)

    Controllable:No

    Description:Direction of the diode

  • sum_linear_friction_nameName of the additional Darcy/linear friction functor. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.

    C++ Type:MooseFunctorName

    Unit:(no unit assumed)

    Controllable:No

    Description:Name of the additional Darcy/linear friction functor. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.

  • sum_quadratic_friction_nameName of the additional Forchheimer/quadratic friction functor. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.

    C++ Type:MooseFunctorName

    Unit:(no unit assumed)

    Controllable:No

    Description:Name of the additional Forchheimer/quadratic friction functor. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.

  • turn_on_diodeFalseWhether to add the additional friction

    Default:False

    C++ Type:bool

    Controllable:Yes

    Description:Whether to add the additional friction

Required Parameters

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

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

    Controllable:No

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

  • declare_suffixAn optional suffix parameter that can be appended to any declared 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 declared properties. The suffix will be prepended with a '_' character.

  • execute_onALWAYSThe 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:ALWAYS

    C++ Type:ExecFlagEnum

    Options:XFEM_MARK, FORWARD, ADJOINT, HOMOGENEOUS_FORWARD, ADJOINT_TIMESTEP_BEGIN, ADJOINT_TIMESTEP_END, NONE, INITIAL, LINEAR, LINEAR_CONVERGENCE, NONLINEAR, NONLINEAR_CONVERGENCE, POSTCHECK, TIMESTEP_END, TIMESTEP_BEGIN, MULTIAPP_FIXED_POINT_END, MULTIAPP_FIXED_POINT_BEGIN, MULTIAPP_FIXED_POINT_CONVERGENCE, FINAL, CUSTOM, ALWAYS

    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.

Optional Parameters

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

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

    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

    Controllable:Yes

    Description:Set the enabled status of the MooseObject.

  • implicitTrueDetermines whether this object is calculated using an implicit or explicit form

    Default:True

    C++ Type:bool

    Controllable:No

    Description:Determines whether this object is calculated using an implicit or explicit form

  • seed0The seed for the master random number generator

    Default:0

    C++ Type:unsigned int

    Controllable:No

    Description:The seed for the master random number generator

Advanced Parameters

  • output_propertiesList of material properties, from this material, to output (outputs must also be defined to an output type)

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

    Controllable:No

    Description:List of material properties, from this material, to output (outputs must also be defined to an output type)

  • outputsnone Vector of output names where you would like to restrict the output of variables(s) associated with this object

    Default:none

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

    Controllable:No

    Description:Vector of output names where you would like to restrict the output of variables(s) associated with this object

Outputs Parameters

Input Files