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]
  [porosity]
    type = ADGenericFunctorMaterial
    prop_names = 'porosity'
    prop_values = '0.5'
  []
  [base_friction]
    type = ADGenericVectorFunctorMaterial
    prop_names = 'Darcy Forchheimer'
    prop_values = '220 240 260 0 0 0'
  []
  [diode]
    type = NSFVFrictionFlowDiodeFunctorMaterial
    direction = '1 0 0'
    additional_linear_resistance = '4000 0 0'
    additional_quadratic_resistance = '0 0 0'
    base_linear_friction_coefs = 'Darcy'
    base_quadratic_friction_coefs = 'Forchheimer'
    sum_linear_friction_name = 'diode_linear'
    sum_quadratic_friction_name = 'diode_quad'
    block = '2'
    turn_on_diode = true
  []
  [combine_linear_friction]
    type = ADPiecewiseByBlockVectorFunctorMaterial
    prop_name = 'combined_linear'
    subdomain_to_prop_value = '1 Darcy
                               2 diode_linear'
  []
  [combine_quadratic_friction]
    type = ADPiecewiseByBlockVectorFunctorMaterial
    prop_name = 'combined_quadratic'
    subdomain_to_prop_value = '1 Forchheimer
                               2 diode_quad'
  []
[]
(contrib/moose/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]
  [time_based]
    type = BoolFunctionControl
    function = time_function
    parameter = 'FunctorMaterials/diode/turn_on_diode'
    execute_on = timestep_begin
  []
[]

[Functions]
  [time_function]
    type = ParsedFunction
    expression = 'if(t<0.1, 0, 1)'
  []
[]
(contrib/moose/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]
  [pdrop_based]
    type = BoolFunctionControl
    function = pdrop_positive
    parameter = 'FunctorMaterials/diode/turn_on_diode'
    execute_on = timestep_begin
  []
[]

[Postprocessors]
  [pdrop_diode]
    type = PressureDrop
    upstream_boundary = 'diode_inlet'
    downstream_boundary = 'top_left'
    weighting_functor = 'momentum'
    boundary = 'diode_inlet top_left'
    pressure = pressure
  []
[]

[Functions]
  [pdrop_positive]
    type = ParsedFunction
    expression = 'if(pdrop_diode>100, 1, 0)'
    symbol_names = pdrop_diode
    symbol_values = pdrop_diode
  []
[]
(contrib/moose/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]
  [flow_based]
    type = BoolFunctionControl
    function = velocity_big_enough
    parameter = 'FunctorMaterials/diode/turn_on_diode'
    execute_on = timestep_begin
  []
[]

[Postprocessors]
  [flow_diode]
    type = VolumetricFlowRate
    boundary = 'diode_inlet'
    vel_x = superficial_vel_x
    vel_y = superficial_vel_y
    advected_quantity = ${rho}
  []
[]

[Functions]
  [velocity_big_enough]
    type = ParsedFunction
    expression = 'if(flow_diode<-0.4, 1, 0)'
    symbol_names = flow_diode
    symbol_values = flow_diode
  []
[]
(contrib/moose/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 post-processor, 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 post-processor, 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 post-processor, 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 post-processor, 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 post-processor, 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 post-processor, 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 post-processor, 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 post-processor, or a number.

  • turn_on_diodeFalseWhether to add the additional friction

    Default:False

    C++ Type:bool

    Unit:(no unit assumed)

    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>

    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

  • constant_onNONEWhen ELEMENT, MOOSE will only call computeQpProperties() for the 0th quadrature point, and then copy that value to the other qps.When SUBDOMAIN, MOOSE will only call computeQpProperties() for the 0th quadrature point, and then copy that value to the other qps. Evaluations on element qps will be skipped

    Default:NONE

    C++ Type:MooseEnum

    Unit:(no unit assumed)

    Options:NONE, ELEMENT, SUBDOMAIN

    Controllable:No

    Description:When ELEMENT, MOOSE will only call computeQpProperties() for the 0th quadrature point, and then copy that value to the other qps.When SUBDOMAIN, MOOSE will only call computeQpProperties() for the 0th quadrature point, and then copy that value to the other qps. Evaluations on element qps will be skipped

  • 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

    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, 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.

  • 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.

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

    Default:True

    C++ Type:bool

    Unit:(no unit assumed)

    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

    Unit:(no unit assumed)

    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>

    Unit:(no unit assumed)

    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>

    Unit:(no unit assumed)

    Controllable:No

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

Outputs Parameters