- functorThe name of the functor for which to find the extrema. 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:The name of the functor for which to find the extrema. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
ElementExtremeFunctorValue
Finds either the min or max elemental value of a functor over the domain.
You can optionally provide a "proxy_functor", which will change the behavior of this postprocessor to find the element at which the proxy functor reaches the max/min value, and then return the value of the specified functor at that element.
Like the ElementExtremeValue postprocessor, this postprocessor can also operate on both elemental and nodal variables. However, unlike the ElementExtremeValue postprocessor, this postprocessor does not examine the quadrature point values, but instead passes the element argument to the functor.
Example Input File Syntax
[Postprocessors<<<{"href": "../../syntax/Postprocessors/index.html"}>>>]
[max_u]
type = ADElementExtremeFunctorValue<<<{"description": "Finds either the min or max elemental value of a functor over the domain.", "href": "ElementExtremeFunctorValue.html"}>>>
functor<<<{"description": "The name of the functor for which to find the extrema. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number."}>>> = 'u'
[]
[min_w_f]
type = ElementExtremeFunctorValue<<<{"description": "Finds either the min or max elemental value of a functor over the domain.", "href": "ElementExtremeFunctorValue.html"}>>>
functor<<<{"description": "The name of the functor for which to find the extrema. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number."}>>> = 'w_f'
value_type<<<{"description": "Type of extreme value to return. 'max' returns the maximum value. 'min' returns the minimum value. 'max_abs' returns the maximum of the absolute value."}>>> = min
[]
[max_v_x]
type = ADElementExtremeFunctorValue<<<{"description": "Finds either the min or max elemental value of a functor over the domain.", "href": "ElementExtremeFunctorValue.html"}>>>
functor<<<{"description": "The name of the functor for which to find the extrema. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number."}>>> = 'v_x'
[]
[min_v_y]
type = ADElementExtremeFunctorValue<<<{"description": "Finds either the min or max elemental value of a functor over the domain.", "href": "ElementExtremeFunctorValue.html"}>>>
functor<<<{"description": "The name of the functor for which to find the extrema. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number."}>>> = 'v_y'
value_type<<<{"description": "Type of extreme value to return. 'max' returns the maximum value. 'min' returns the minimum value. 'max_abs' returns the maximum of the absolute value."}>>> = min
[]
# because we set v_x and v_y equal to the x and y coordinates, these two postprocessors
# should just return the point at which u reaches a maximum value
[max_v_from_proxy_x]
type = ADElementExtremeFunctorValue<<<{"description": "Finds either the min or max elemental value of a functor over the domain.", "href": "ElementExtremeFunctorValue.html"}>>>
functor<<<{"description": "The name of the functor for which to find the extrema. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number."}>>> = v_x
proxy_functor<<<{"description": "The name of the functor to use to identify the location at which the functor value should be taken; if not provided, this defaults to the 'functor' parameter. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number."}>>> = u
value_type<<<{"description": "Type of extreme value to return. 'max' returns the maximum value. 'min' returns the minimum value. 'max_abs' returns the maximum of the absolute value."}>>> = max
[]
[max_v_from_proxy_y]
type = ADElementExtremeFunctorValue<<<{"description": "Finds either the min or max elemental value of a functor over the domain.", "href": "ElementExtremeFunctorValue.html"}>>>
functor<<<{"description": "The name of the functor for which to find the extrema. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number."}>>> = v_y
proxy_functor<<<{"description": "The name of the functor to use to identify the location at which the functor value should be taken; if not provided, this defaults to the 'functor' parameter. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number."}>>> = u
value_type<<<{"description": "Type of extreme value to return. 'max' returns the maximum value. 'min' returns the minimum value. 'max_abs' returns the maximum of the absolute value."}>>> = max
[]
# because we set v_x and v_y equal to the x and y coordinates, these two postprocessors
# should just return the point at which w reaches a minimum value
[min_v_from_proxy_x]
type = ADElementExtremeFunctorValue<<<{"description": "Finds either the min or max elemental value of a functor over the domain.", "href": "ElementExtremeFunctorValue.html"}>>>
functor<<<{"description": "The name of the functor for which to find the extrema. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number."}>>> = v_x
proxy_functor<<<{"description": "The name of the functor to use to identify the location at which the functor value should be taken; if not provided, this defaults to the 'functor' parameter. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number."}>>> = w
value_type<<<{"description": "Type of extreme value to return. 'max' returns the maximum value. 'min' returns the minimum value. 'max_abs' returns the maximum of the absolute value."}>>> = min
[]
[min_v_from_proxy_y]
type = ADElementExtremeFunctorValue<<<{"description": "Finds either the min or max elemental value of a functor over the domain.", "href": "ElementExtremeFunctorValue.html"}>>>
functor<<<{"description": "The name of the functor for which to find the extrema. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number."}>>> = v_y
proxy_functor<<<{"description": "The name of the functor to use to identify the location at which the functor value should be taken; if not provided, this defaults to the 'functor' parameter. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number."}>>> = w
value_type<<<{"description": "Type of extreme value to return. 'max' returns the maximum value. 'min' returns the minimum value. 'max_abs' returns the maximum of the absolute value."}>>> = min
[]
[](test/tests/postprocessors/element_extreme_functor_value/extreme_proxy_value.i)Input 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
- proxy_functorThe name of the functor to use to identify the location at which the functor value should be taken; if not provided, this defaults to the 'functor' parameter. 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:The name of the functor to use to identify the location at which the functor value should be taken; if not provided, this defaults to the 'functor' parameter. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
- scale1Scaling factor to apply to functor value
Default:1
C++ Type:Real
Unit:(no unit assumed)
Controllable:No
Description:Scaling factor to apply to functor value
- value_typemaxType of extreme value to return. 'max' returns the maximum value. 'min' returns the minimum value. 'max_abs' returns the maximum of the absolute value.
Default:max
C++ Type:MooseEnum
Options:max, min, max_abs
Controllable:No
Description:Type of extreme value to return. 'max' returns the maximum value. 'min' returns the minimum value. 'max_abs' returns the maximum of the absolute value.
Optional Parameters
- allow_duplicate_execution_on_initialFalseIn the case where this UserObject is depended upon by an initial condition, allow it to be executed twice during the initial setup (once before the IC and again after mesh adaptivity (if applicable).
Default:False
C++ Type:bool
Controllable:No
Description:In the case where this UserObject is depended upon by an initial condition, allow it to be executed twice during the initial setup (once before the IC and again after mesh adaptivity (if applicable).
- execute_onTIMESTEP_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:TIMESTEP_END
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, MULTISYSTEM_FIXED_POINT_ITERATION_END, FINAL, CUSTOM, TRANSFER
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.
- execution_order_group0Execution order groups are executed in increasing order (e.g., the lowest number is executed first). Note that negative group numbers may be used to execute groups before the default (0) group. Please refer to the user object documentation for ordering of user object execution within a group.
Default:0
C++ Type:int
Controllable:No
Description:Execution order groups are executed in increasing order (e.g., the lowest number is executed first). Note that negative group numbers may be used to execute groups before the default (0) group. Please refer to the user object documentation for ordering of user object execution within a group.
- force_postauxFalseForces the UserObject to be executed in POSTAUX
Default:False
C++ Type:bool
Controllable:No
Description:Forces the UserObject to be executed in POSTAUX
- force_preauxFalseForces the UserObject to be executed in PREAUX
Default:False
C++ Type:bool
Controllable:No
Description:Forces the UserObject to be executed in PREAUX
- force_preicFalseForces the UserObject to be executed in PREIC during initial setup
Default:False
C++ Type:bool
Controllable:No
Description:Forces the UserObject to be executed in PREIC during initial setup
Execution Scheduling 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
- outputsVector of output names where you would like to restrict the output of variables(s) associated with this object
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
- 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
- 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
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
- 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
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.
Material Property Retrieval Parameters
Input Files
- (modules/heat_transfer/test/tests/radiation_participating_media/rad_T_coupled_medium_1d_G.i)
- (modules/heat_transfer/test/tests/radiation_participating_media/rad_isothermal_medium_1d.i)
- (modules/solid_properties/test/tests/materials/thermal_solid_functor_properties/base.i)
- (test/tests/functormaterials/with_suffix/functor_material.i)
- (modules/navier_stokes/test/tests/finite_volume/two_phase/mixture_model/lid-driven-two-phase.i)
- (test/tests/functors/get_functor/get_functor.i)
- (test/tests/postprocessors/element_extreme_functor_value/extreme_abs_value.i)
- (test/tests/functormaterials/functor_change/nonlinear.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/pump/pump_as_volume_force_loop_pressure_corrected.i)
- (modules/heat_transfer/test/tests/fvbcs/fv_marshak_bc/rad_istothermal_medium_2d.i)
- (modules/navier_stokes/test/tests/finite_volume/pins/mms/linear-segregated/interface-reconstruction/interface-reconstruction.i)
- (modules/thermal_hydraulics/test/tests/functormaterials/conjugate_ht_numbers/conjugate_ht_numbers.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/pump/pump_loop.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/pump/pump_loop_negative_rotation.i)
- (test/tests/functormaterials/time_derivatives/functor_time_derivatives.i)
- (modules/navier_stokes/test/tests/postprocessors/rayleigh/natural_convection.i)
- (test/tests/functormaterials/parsed_functor_material/parsed_functor_material.i)
- (test/tests/postprocessors/element_extreme_functor_value/extreme_proxy_value.i)
- (modules/navier_stokes/test/tests/finite_volume/two_phase/mixture_model/lid-driven-two-phase-physics.i)
- (modules/navier_stokes/test/tests/finite_volume/fviks/convection/convection_channel.i)
- (modules/navier_stokes/test/tests/finite_volume/two_phase/mixture_model/segregated/lid-driven-two-phase-physics.i)
- (modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/linear-segregated/radial-baffle-rz/radial-baffle-rz.i)
- (modules/heat_transfer/test/tests/functormaterials/churchill_chu_htc/churchill_chu_htc.i)
- (test/tests/functormaterials/functor_change/time_step.i)
- (modules/navier_stokes/test/tests/functormaterials/torchscript_profile_functor_material/transient.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/pump/pump_and_counterpump_loop.i)
- (modules/navier_stokes/test/tests/functormaterials/torchscript_profile_functor_material/profile.i)
- (modules/heat_transfer/test/tests/functormaterials/fin_enhancement_factor/fin_enhancement_factor.i)
- (modules/navier_stokes/test/tests/finite_volume/two_phase/mixture_model/segregated/rayleigh-bernard-two-phase-physics.i)
- (modules/heat_transfer/test/tests/functormaterials/P1_radiation/P1_radiation_material_test.i)
- (modules/heat_transfer/test/tests/radiation_participating_media/rad_T_coupled_medium_1d_T.i)
- (modules/heat_transfer/test/tests/fvbcs/fv_marshak_bc/rad_istothermal_medium_1d.i)
- (test/tests/functormaterials/functor_change/multisystem_fp.i)
- (modules/navier_stokes/test/tests/finite_volume/wcns/materials/enthalpy_computation.i)
- (modules/navier_stokes/test/tests/finite_volume/pins/mms/linear-segregated/smooth-properties/smooth-properties.i)
- (modules/heat_transfer/test/tests/radiation_participating_media/rad_T_coupled_medium_1d.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/pump/pump_as_volume_force_loop_force_corrected.i)
- (modules/heat_transfer/test/tests/functormaterials/fin_efficiency/fin_efficiency.i)
- (modules/navier_stokes/test/tests/finite_volume/two_phase/mixture_model/rayleigh-bernard-two-phase.i)
- (modules/navier_stokes/test/tests/finite_volume/physics/restart/2d_channel_scalar_turbulence_init.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/natural_convection/fuel_cavity.i)
- (modules/heat_transfer/test/tests/functormaterials/convection_heat_flux/convection_heat_flux.i)
- (modules/navier_stokes/test/tests/finite_volume/two_phase/mixture_model/segregated/rayleigh-bernard-two-phase-physics_heated.i)
- (test/tests/functormaterials/functor_change/fp_parent.i)
- (modules/navier_stokes/test/tests/finite_volume/pins/mms/linear-segregated/hydrostatic-jump/hydrostatic-jump.i)
proxy_functor
C++ Type:MooseFunctorName
Unit:(no unit assumed)
Controllable:No
Description:The name of the functor to use to identify the location at which the functor value should be taken; if not provided, this defaults to the 'functor' parameter. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
(test/tests/postprocessors/element_extreme_functor_value/extreme_proxy_value.i)
[Problem]
type = FEProblem
solve = false
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 40
ny = 40
[]
[AuxVariables]
[u]
type = MooseVariableFVReal
[]
[w]
type = MooseVariableFVReal
[]
[v_x]
type = MooseVariableFVReal
[]
[v_y]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[u]
type = FunctionAux
variable = u
function = u_f
[]
[w]
type = FunctionAux
variable = w
function = w_f
[]
[v_x]
type = FunctionAux
variable = v_x
function = v_x_f
[]
[v_y]
type = FunctionAux
variable = v_y
function = v_y_f
[]
[]
[Functions]
[u_f] # reaches a maximum value at (0.5, 0.6)
type = ParsedFunction
expression = 'sin(pi*x)*sin(pi*y/1.2)'
[]
[w_f] # reaches a minium expression at (0.7, 0.8)
type = ParsedFunction
expression = '-sin(pi*x/1.4)*sin(pi*y/1.6)'
[]
[v_x_f]
type = ParsedFunction
expression = 'x'
[]
[v_y_f]
type = ParsedFunction
expression = 'y'
[]
[]
[Postprocessors]
[max_u]
type = ADElementExtremeFunctorValue
functor = 'u'
[]
[min_w_f]
type = ElementExtremeFunctorValue
functor = 'w_f'
value_type = min
[]
[max_v_x]
type = ADElementExtremeFunctorValue
functor = 'v_x'
[]
[min_v_y]
type = ADElementExtremeFunctorValue
functor = 'v_y'
value_type = min
[]
# because we set v_x and v_y equal to the x and y coordinates, these two postprocessors
# should just return the point at which u reaches a maximum value
[max_v_from_proxy_x]
type = ADElementExtremeFunctorValue
functor = v_x
proxy_functor = u
value_type = max
[]
[max_v_from_proxy_y]
type = ADElementExtremeFunctorValue
functor = v_y
proxy_functor = u
value_type = max
[]
# because we set v_x and v_y equal to the x and y coordinates, these two postprocessors
# should just return the point at which w reaches a minimum value
[min_v_from_proxy_x]
type = ADElementExtremeFunctorValue
functor = v_x
proxy_functor = w
value_type = min
[]
[min_v_from_proxy_y]
type = ADElementExtremeFunctorValue
functor = v_y
proxy_functor = w
value_type = min
[]
[]
[Executioner]
type = Steady
[]
[Outputs]
csv = true
[]
(modules/heat_transfer/test/tests/radiation_participating_media/rad_T_coupled_medium_1d_G.i)
# This input file is the subapp for a test verifying T-G coupling using MultiApps fixed point iterations
# This simulation is a 1D test with Dirichlet BCs on the left and right of the domain. Marshak BCs are
# applied at the boundaries for G.
sigma_a = 0.33333
diffusion_coef = ${fparse 1/(3*sigma_a)}
b_eps = 1.0
r_wall_temp = 400.0
l_wall_temp = 300.0
[Mesh]
[mesh]
type = GeneratedMeshGenerator
dim = 1
nx = 100
xmin = -0.5
xmax = 0.5
[]
[]
[Problem]
linear_sys_names = 'radiation_system'
previous_nl_solution_required = true
[]
[Variables]
[G]
type = MooseLinearVariableFVReal
solver_sys = 'radiation_system'
initial_condition = 3400
[]
[]
[AuxVariables]
[T]
type = MooseLinearVariableFVReal
initial_condition = 350
[]
[]
[LinearFVKernels]
[G_diffusion]
type = LinearFVDiffusion
variable = G
diffusion_coeff = ${diffusion_coef}
[]
[source_and_sink]
type = LinearFVP1RadiationSourceSink
variable = G
temperature_radiation = 'T'
absorption_coeff = ${sigma_a}
[]
[]
[LinearFVBCs]
[right_bc_G]
type = LinearFVP1RadiationMarshakBC
boundary = 'right'
variable = G
temperature_radiation = ${r_wall_temp}
coeff_diffusion = ${diffusion_coef}
boundary_emissivity = ${b_eps}
[]
[left_bc_G]
type = LinearFVP1RadiationMarshakBC
boundary = 'left'
variable = G
temperature_radiation = ${l_wall_temp}
coeff_diffusion = ${diffusion_coef}
boundary_emissivity = ${b_eps}
[]
[]
[Postprocessors]
[mean_value_G]
type = ElementIntegralFunctorPostprocessor
functor = G
[]
[max_value_G]
type = ElementExtremeFunctorValue
functor = G
[]
[mean_value_T]
type = ElementIntegralFunctorPostprocessor
functor = T
[]
[max_value_T]
type = ElementExtremeFunctorValue
functor = T
[]
[]
[Executioner]
type = Steady
solve_type = 'Linear'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
l_abs_tol = 1e-16
l_tol = 1e-16
nl_abs_tol = 1e-16
[]
(modules/heat_transfer/test/tests/radiation_participating_media/rad_isothermal_medium_1d.i)
# The test guarantees that the P1 radiation model in the Linear FV system matches the analytical solution
# for the incident radiation G under adiabatic and radiative interaction with the environment.
# This simulation is a 1D test with adiabatic Neumann BC on the left of the domain and a Marshak BC on
# the right of the domain, with varying wall temperatures.
# Assuming isothermal conditions along the volume, the analytical solution for this problem is:
# G(x) = G_bc * cosh(theta x) + 4*sigma*T^4, where:
# -theta = sqrt(absorption_coeff/diffusion_coef)
# G_bc = (4*sigma*(pow(wall_temperature,4)-pow(temperature_radiation,4))/(2*diffusion_coef*theta*sinh(theta)+cosh(theta)))
diffusion_coef = 1e-1
sigma_a = 1.0
temperature_radiation = 100.0
wall_temperature = 100.0
theta = ${fparse sqrt(sigma_a/diffusion_coef)}
eps_w = 1.0
G_bc = ${fparse 4*sigma*(pow(wall_temperature,4)-pow(temperature_radiation,4))/
(2*(2-eps_w)/eps_w*diffusion_coef*theta*sinh(theta)+cosh(theta))}
sigma = 5.670374419e-8
[Mesh]
[mesh]
type = GeneratedMeshGenerator
dim = 1
nx = 50
xmin = 0
xmax = 1
[]
[]
[Problem]
linear_sys_names = 'radiation_system'
previous_nl_solution_required = true
[]
[Variables]
[G]
type = MooseLinearVariableFVReal
solver_sys = 'radiation_system'
initial_condition = 1
[]
[]
[AuxVariables]
[G_analytic]
type = MooseLinearVariableFVReal
[]
[]
[AuxKernels]
[populate_analytical]
type = FunctorAux
functor = analytical_sol
variable = G_analytic
[]
[]
[LinearFVKernels]
[G_diffusion]
type = LinearFVDiffusion
variable = G
diffusion_coeff = ${diffusion_coef}
[]
[source_and_sink]
type = LinearFVP1RadiationSourceSink
variable = G
temperature_radiation = ${temperature_radiation}
absorption_coeff = ${sigma_a}
[]
[]
[LinearFVBCs]
[right_bc]
type = LinearFVP1RadiationMarshakBC
boundary = 'right'
variable = G
temperature_radiation = ${wall_temperature}
coeff_diffusion = ${diffusion_coef}
boundary_emissivity = ${eps_w}
[]
[]
[Functions]
[analytical_sol]
type = ParsedFunction
symbol_names = 'a'
symbol_values = '${fparse sqrt(sigma_a / diffusion_coef)}'
expression = '${G_bc} * cosh(${theta}*x) + 4* ${sigma} * ${temperature_radiation}^4'
[]
[]
[Postprocessors]
[mean_value]
type = ElementIntegralFunctorPostprocessor
functor = G
[]
[max_value]
type = ElementExtremeFunctorValue
functor = G
[]
[mean_value_analytic]
type = ElementIntegralFunctorPostprocessor
functor = analytical_sol
[]
[relative_difference]
type = RelativeDifferencePostprocessor
value1 = mean_value
value2 = mean_value_analytic
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
nl_abs_tol = 1e-12
[]
[Outputs]
file_base = rad_isothermal_medium_1d_adiabatic
csv = true
execute_on = timestep_end
[]
(modules/solid_properties/test/tests/materials/thermal_solid_functor_properties/base.i)
T_initial = 300
[GlobalParams]
execute_on = 'INITIAL'
[]
[Mesh]
type = GeneratedMesh
dim = 1
xmin = 0
xmax = 1
nx = 1
[]
[SolidProperties]
[ss316_sp]
type = ThermalSS316Properties
[]
[]
[FunctorMaterials]
[sp_mat]
type = ThermalSolidPropertiesFunctorMaterial
temperature = T
sp = ss316_sp
specific_heat = cp
density = rho
thermal_conductivity = k
specific_internal_energy = e
[]
[]
[AuxVariables]
[T]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[T_ak]
type = ConstantAux
variable = T
value = ${T_initial}
[]
[]
[Postprocessors]
[cp]
type = ElementExtremeFunctorValue
functor = 'cp'
[]
[k]
type = ElementExtremeFunctorValue
functor = 'k'
[]
[density]
type = ElementExtremeFunctorValue
functor = 'rho'
[]
[e]
type = ElementExtremeFunctorValue
functor = 'e'
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[Outputs]
csv = true
[]
(test/tests/functormaterials/with_suffix/functor_material.i)
[Mesh]
type = GeneratedMesh
dim = 3
nx = 2
ny = 2
nz = 2
xmin = 0.0
xmax = 4.0
ymin = 0.0
ymax = 6.0
zmin = 0.0
zmax = 10.0
[]
[FunctorMaterials]
[fmat]
type = GenericFunctorMaterial
prop_values = '1 2'
prop_names = 'prop1 prop2'
[]
[]
[Postprocessors]
[get_prop1]
type = ElementExtremeFunctorValue
functor = prop1
value_type = max
execute_on = 'INITIAL'
[]
[get_prop2]
type = ElementExtremeFunctorValue
functor = prop2
value_type = max
execute_on = 'INITIAL'
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[Debug]
show_functors = true
[]
[Outputs]
csv = true
execute_on = 'INITIAL'
[]
(modules/navier_stokes/test/tests/finite_volume/two_phase/mixture_model/lid-driven-two-phase.i)
mu = 1.0
rho = 1.0e3
mu_d = 0.3
rho_d = 1.0
dp = 0.01
U_lid = 0.1
g = -9.81
[GlobalParams]
velocity_interp_method = 'rc'
advected_interp_method = 'upwind'
rhie_chow_user_object = 'rc'
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = .1
ymin = 0
ymax = .1
nx = 5
ny = 5
[]
[]
[Variables]
[vel_x]
type = INSFVVelocityVariable
[]
[vel_y]
type = INSFVVelocityVariable
[]
[pressure]
type = INSFVPressureVariable
[]
[phase_2]
type = INSFVScalarFieldVariable
[]
[lambda]
family = SCALAR
order = FIRST
[]
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = vel_x
v = vel_y
pressure = pressure
[]
[]
[FVKernels]
[mass]
type = INSFVMassAdvection
variable = pressure
rho = 'rho_mixture'
[]
[mean_zero_pressure]
type = FVPointValueConstraint
variable = pressure
lambda = lambda
point = '0 0 0'
[]
[u_time]
type = INSFVMomentumTimeDerivative
variable = vel_x
rho = 'rho_mixture'
momentum_component = 'x'
[]
[u_advection]
type = INSFVMomentumAdvection
variable = vel_x
rho = 'rho_mixture'
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = vel_x
mu = 'mu_mixture'
momentum_component = 'x'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = vel_x
momentum_component = 'x'
pressure = pressure
[]
[u_buoyant]
type = INSFVMomentumGravity
variable = vel_x
rho = 'rho_mixture'
momentum_component = 'x'
gravity = '0 ${g} 0'
[]
# NOTE: the friction terms for u and v are missing
[v_time]
type = INSFVMomentumTimeDerivative
variable = vel_y
rho = 'rho_mixture'
momentum_component = 'y'
[]
[v_advection]
type = INSFVMomentumAdvection
variable = vel_y
rho = 'rho_mixture'
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = vel_y
mu = 'mu_mixture'
momentum_component = 'y'
[]
[v_pressure]
type = INSFVMomentumPressure
variable = vel_y
momentum_component = 'y'
pressure = pressure
[]
[v_buoyant]
type = INSFVMomentumGravity
variable = vel_y
rho = 'rho_mixture'
momentum_component = 'y'
gravity = '0 ${g} 0'
[]
[phase_2_time]
type = FVFunctorTimeKernel
variable = phase_2
[]
[phase_2_advection]
type = INSFVScalarFieldAdvection
variable = phase_2
u_slip = 'vel_slip_x'
v_slip = 'vel_slip_y'
[]
[phase_2_diffusion]
type = FVDiffusion
variable = phase_2
coeff = 1e-3
[]
[]
[FVBCs]
[top_x]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'top'
function = ${U_lid}
[]
[no_slip_x]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'left right bottom'
function = 0
[]
[no_slip_y]
type = INSFVNoSlipWallBC
variable = vel_y
boundary = 'left right top bottom'
function = 0
[]
[bottom_phase_2]
type = FVDirichletBC
variable = phase_2
boundary = 'bottom'
value = 1.0
[]
[top_phase_2]
type = FVDirichletBC
variable = phase_2
boundary = 'top'
value = 0.0
[]
[]
[AuxVariables]
[U]
order = CONSTANT
family = MONOMIAL
fv = true
[]
[drag_coefficient]
type = MooseVariableFVReal
[]
[rho_mixture_var]
type = MooseVariableFVReal
[]
[mu_mixture_var]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[mag]
type = VectorMagnitudeAux
variable = U
x = vel_x
y = vel_y
[]
[populate_cd]
type = FunctorAux
variable = drag_coefficient
functor = 'Darcy_coefficient'
[]
[populate_rho_mixture_var]
type = FunctorAux
variable = rho_mixture_var
functor = 'rho_mixture'
[]
[populate_mu_mixture_var]
type = FunctorAux
variable = mu_mixture_var
functor = 'mu_mixture'
[]
[]
[FunctorMaterials]
[populate_u_slip]
type = WCNSFV2PSlipVelocityFunctorMaterial
slip_velocity_name = 'vel_slip_x'
momentum_component = 'x'
u = 'vel_x'
v = 'vel_y'
rho = ${rho}
mu = 'mu_mixture'
rho_d = ${rho_d}
particle_diameter = ${dp}
linear_coef_name = 'Darcy_coefficient'
gravity = '0 ${g} 0'
[]
[populate_v_slip]
type = WCNSFV2PSlipVelocityFunctorMaterial
slip_velocity_name = 'vel_slip_y'
momentum_component = 'y'
u = 'vel_x'
v = 'vel_y'
rho = ${rho}
mu = 'mu_mixture'
rho_d = ${rho_d}
particle_diameter = ${dp}
linear_coef_name = 'Darcy_coefficient'
gravity = '0 ${g} 0'
[]
[compute_phase_1]
type = ADParsedFunctorMaterial
property_name = phase_1
functor_names = 'phase_2'
expression = '1 - phase_2'
[]
[CD]
type = NSFVDispersePhaseDragFunctorMaterial
rho = 'rho_mixture'
mu = mu_mixture
u = 'vel_x'
v = 'vel_y'
particle_diameter = ${dp}
[]
[mixing_material]
type = NSFVMixtureFunctorMaterial
phase_1_names = '${rho_d} ${mu_d}'
phase_2_names = '${rho} ${mu}'
prop_names = 'rho_mixture mu_mixture'
phase_1_fraction = 'phase_2'
[]
[]
[Postprocessors]
[average_void]
type = ElementAverageValue
variable = 'phase_2'
[]
[max_y_velocity]
type = ElementExtremeValue
variable = 'vel_y'
value_type = max
[]
[min_y_velocity]
type = ElementExtremeValue
variable = 'vel_y'
value_type = min
[]
[max_x_velocity]
type = ElementExtremeValue
variable = 'vel_x'
value_type = max
[]
[min_x_velocity]
type = ElementExtremeValue
variable = 'vel_x'
value_type = min
[]
[max_x_slip_velocity]
type = ElementExtremeFunctorValue
functor = 'vel_slip_x'
value_type = max
[]
[max_y_slip_velocity]
type = ElementExtremeFunctorValue
functor = 'vel_slip_y'
value_type = max
[]
[max_drag_coefficient]
type = ElementExtremeFunctorValue
functor = 'drag_coefficient'
value_type = max
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
[TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 7
iteration_window = 2
growth_factor = 2.0
cutback_factor = 0.5
dt = 1e-3
[]
nl_max_its = 20
nl_rel_tol = 1e-03
nl_abs_tol = 1e-9
l_max_its = 5
end_time = 1e8
line_search=none
[]
[Outputs]
exodus = false
[CSV]
type = CSV
execute_on = 'FINAL'
execute_scalars_on = NONE
[]
[]
(test/tests/functors/get_functor/get_functor.i)
[GlobalParams]
execute_on = 'INITIAL'
[]
[Mesh]
type = GeneratedMesh
dim = 1
nx = 5
[]
[AuxVariables]
[testvar]
[]
[testppdot]
family = MONOMIAL
order = CONSTANT
[]
[testppdiv]
[]
[]
[AuxKernels]
[testvar_auxkern]
type = FunctionAux
variable = testvar
function = testvar_fn
execute_on = 'INITIAL'
[]
[testppdot_auxkern]
type = TimeDerivativeAux
variable = testppdot
functor = testpp
[]
[testppdiv_auxkern]
type = DivergenceAux
variable = testppdiv
u = testpp
v = testpp
w = testpp
[]
[]
[FunctorMaterials]
[testfmat]
type = GenericFunctorMaterial
prop_names = 'testfmprop'
prop_values = 'testfmat_fn'
[]
[]
[Functions]
[testvar_fn]
type = ParsedFunction
expression = '10*x'
[]
[testfmat_fn]
type = ParsedFunction
expression = '50*x'
[]
[testfn]
type = ParsedFunction
expression = '25*x'
[]
[]
[Postprocessors]
[testpp]
type = ConstantPostprocessor
value = 2
[]
[get_var]
type = ElementIntegralFunctorPostprocessor
functor = testvar
[]
[get_fn]
type = ElementExtremeFunctorValue
functor = testfn
value_type = max
[]
[get_fmprop]
type = ElementExtremeFunctorValue
functor = testfmprop
value_type = max
[]
[get_pp]
type = ElementExtremeFunctorValue
functor = testpp
value_type = max
execution_order_group = 1
[]
[get_ppdiv]
type = ElementAverageValue
variable = testppdiv
[]
[get_ppdot]
type = ElementAverageValue
variable = testppdot
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[Outputs]
csv = true
[]
(test/tests/postprocessors/element_extreme_functor_value/extreme_abs_value.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
xmax = 4
nx = 36
[]
[]
[Functions]
[f1]
type = PiecewiseLinear
x = '0 0.5 1.5 2.5 3.5 4'
y = '0.0 0.5 0.0 -1.5 -0.5 0.0'
axis = X
[]
[f2]
type = PiecewiseLinear
x = '0 0.5 1.5 2.5 3.5 4'
y = '1.0 0.0 -1.0 0.0 0.5 1.0'
axis = X
[]
[]
[Postprocessors]
[f1_max]
type = ElementExtremeFunctorValue
functor = f1
value_type = MAX_ABS
execute_on = 'initial timestep_end'
[]
[f2_proxy_max]
type = ElementExtremeFunctorValue
functor = f2
proxy_functor = f1
value_type = MAX_ABS
execute_on = 'initial timestep_end'
[]
[test]
type = ParsedPostprocessor
expression = 'abs(f1_max + 1.5) + abs(f2_proxy_max)'
pp_names = 'f1_max f2_proxy_max'
execute_on = 'initial timestep_end'
[]
[]
[UserObjects]
[kill]
type = Terminator
expression = 'test > 0'
error_level = ERROR
fail_mode = HARD
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
(test/tests/functormaterials/functor_change/nonlinear.i)
# Solves the equation
#
# U^2 = C
# U(0) = U0
C = 25.0
U0 = 1.0
[Mesh]
type = GeneratedMesh
dim = 1
nx = 1
[]
[Variables]
[U]
initial_condition = ${U0}
[]
[]
[FunctorMaterials]
[residual_fmat]
type = ADParsedFunctorMaterial
expression = 'U^2 - C'
functor_symbols = 'U C'
functor_names = 'U ${C}'
property_name = residual_prop
[]
[]
[Kernels]
[residual]
type = FunctorKernel
variable = U
functor = residual_prop
functor_on_rhs = false
[]
[]
[FunctorMaterials]
[mat]
type = ADFunctorChangeFunctorMaterial
functor = U
change_over = nonlinear
take_absolute_value = false
prop_name = U_change
[]
[]
[Postprocessors]
[U_avg]
type = AverageNodalVariableValue
variable = U
execute_on = 'NONLINEAR_CONVERGENCE'
[]
[U_max_change]
type = ElementExtremeFunctorValue
functor = U_change
value_type = max
execute_on = 'NONLINEAR_CONVERGENCE'
[]
[]
[Convergence]
[nl_conv]
type = IterationCountConvergence
max_iterations = 2
converge_at_max_iterations = true
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
line_search = none
nonlinear_convergence = nl_conv
[]
[Outputs]
[console]
type = Console
execute_postprocessors_on = 'NONLINEAR'
[]
[csv]
type = CSV
file_base = nonlinear
execute_on = 'NONLINEAR'
[]
[]
(modules/navier_stokes/test/tests/finite_volume/ins/pump/pump_as_volume_force_loop_pressure_corrected.i)
mu = 1.0
rho = 1.0
[Mesh]
[gen]
type = CartesianMeshGenerator
dim = 2
dx = '0.1 0.8 0.1'
dy = '0.1 0.8 0.1'
ix = '5 20 5'
iy = '5 20 5'
subdomain_id = '1 1 1
1 2 1
1 1 1'
[]
[delete_internal_part]
type = BlockDeletionGenerator
input = gen
block = '2'
new_boundary = 'wall-internal'
[]
[lump_bdries_to_wall]
type = RenameBoundaryGenerator
input = delete_internal_part
old_boundary = 'bottom right top left'
new_boundary = 'wall-external wall-external wall-external wall-external'
[]
[pump_domain]
type = ParsedSubdomainMeshGenerator
input = lump_bdries_to_wall
combinatorial_geometry = 'x > 0.3 & x < 0.7 & y > 0.5'
block_id = '3'
[]
[rename_blocks]
type = RenameBlockGenerator
input = pump_domain
old_block = '1 3'
new_block = 'pipe pump'
[]
[side_pump]
type = ParsedGenerateSideset
input = rename_blocks
included_subdomains = 'pump'
included_neighbors = 'pipe'
new_sideset_name = 'pump_side'
normal = '1 0 0'
combinatorial_geometry = 'x > 0.35'
[]
[]
[GlobalParams]
velocity_interp_method = 'rc'
advected_interp_method = 'upwind'
rhie_chow_user_object = 'rc'
[]
[Problem]
material_coverage_check = False
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = vel_x
v = vel_y
pressure = pressure
correct_volumetric_force = true
volumetric_force_functors = 'pump_force'
volume_force_correction_method = 'pressure-consistent'
[]
[]
[Variables]
[vel_x]
type = INSFVVelocityVariable
initial_condition = 1
[]
[vel_y]
type = INSFVVelocityVariable
initial_condition = 1
[]
[pressure]
type = INSFVPressureVariable
[]
[lambda]
family = SCALAR
order = FIRST
[]
[]
[AuxVariables]
[U]
order = CONSTANT
family = MONOMIAL
fv = true
[]
[]
[AuxKernels]
[mag]
type = VectorMagnitudeAux
variable = U
x = vel_x
y = vel_y
[]
[]
[FVKernels]
[mass]
type = INSFVMassAdvection
variable = pressure
rho = ${rho}
[]
[mean_zero_pressure]
type = FVIntegralValueConstraint
variable = pressure
lambda = lambda
phi0 = 0.0
[]
[u_advection]
type = INSFVMomentumAdvection
variable = vel_x
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = vel_x
mu = ${mu}
momentum_component = 'x'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = vel_x
momentum_component = 'x'
pressure = pressure
[]
[u_pump]
type = INSFVBodyForce
variable = vel_x
momentum_component = 'x'
functor = 'pump_force'
block = 'pump'
[]
[v_advection]
type = INSFVMomentumAdvection
variable = vel_y
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = vel_y
mu = ${mu}
momentum_component = 'y'
[]
[v_pressure]
type = INSFVMomentumPressure
variable = vel_y
momentum_component = 'y'
pressure = pressure
[]
[]
[FVBCs]
[walls-u]
type = INSFVNoSlipWallBC
boundary = 'wall-internal wall-external'
variable = vel_x
function = '0'
[]
[walls-v]
type = INSFVNoSlipWallBC
boundary = 'wall-internal wall-external'
variable = vel_y
function = '0'
[]
[]
[FunctorMaterials]
[pump_force]
type = PiecewiseByBlockFunctorMaterial
prop_name = 'pump_force'
subdomain_to_prop_value = 'pump 1000.0
pipe 0.0'
[]
[]
[Postprocessors]
[flow_rate]
type = Receiver
default = 1.0
[]
[flow_rate_to_pipe]
type = VolumetricFlowRate
advected_quantity = ${rho}
boundary = 'pump_side'
vel_x = 'vel_x'
vel_y = 'vel_y'
[]
[maximum_speed]
type = ADElementExtremeFunctorValue
functor = vel_x
value_type = max
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
nl_rel_tol = 1e-12
[]
[Outputs]
exodus = false
[out]
type = CSV
execute_on = FINAL
show = 'flow_rate_to_pipe maximum_speed'
[]
[]
(modules/heat_transfer/test/tests/fvbcs/fv_marshak_bc/rad_istothermal_medium_2d.i)
# The test gurantees that Marshak BCs yield the expected constant 2D solution
diffusion_coef = 1e-12
opacity = 1.0
temperature_radiation = 100.0
wall_temperature = ${fparse temperature_radiation / (4^(1/4))}
G_bc = 1.0
sigma = 5.670374419e-8
[Mesh]
[mesh]
type = GeneratedMeshGenerator
dim = 2
nx = 20
ny = 20
[]
[]
[Variables]
[G]
type = MooseVariableFVReal
initial_condition = 1
[]
[]
[FVKernels]
[G_diffusion]
type = FVDiffusion
variable = G
coeff = ${diffusion_coef}
[]
[source_and_sink]
type = FVThermalRadiationSourceSink
variable = G
temperature_radiation = ${temperature_radiation}
opacity = ${opacity}
[]
[]
[FVBCs]
[boundaries_bc]
type = FVMarshakRadiativeBC
boundary = 'left right'
variable = G
temperature_radiation = ${wall_temperature}
coeff_diffusion = ${diffusion_coef}
boundary_emissivity = 0.5
[]
[]
[Functions]
[analytical_sol]
type = ParsedFunction
symbol_names = 'a'
symbol_values = '${fparse sqrt(opacity / diffusion_coef)}'
expression = '${G_bc} * cosh(a*x) / cosh(a) + ${sigma} * ${temperature_radiation}^4 * (1.0 - cosh(a*x) / cosh(a))'
[]
[]
[Postprocessors]
[mean_value]
type = ElementIntegralFunctorPostprocessor
functor = G
[]
[max_value]
type = ElementExtremeFunctorValue
functor = G
[]
[relative_difference]
type = ParsedPostprocessor
pp_names = 'mean_value max_value'
expression = '(max_value / mean_value - 1.0) / mean_value'
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
nl_abs_tol = 1e-12
[]
[Outputs]
exodus = false
csv = true
[]
(modules/navier_stokes/test/tests/finite_volume/pins/mms/linear-segregated/interface-reconstruction/interface-reconstruction.i)
# Manufactured pressure-baffle problem whose superficial velocity is linear on each side of the
# baffle. In coordinates normal (r) and tangent (t) to the interface:
# - rho * U_r = mass_flux, so mass is conserved;
# - U_t = eps_s * tangential_velocity + tangential_slope_s * r, so the interstitial tangential
# velocity U_t / eps is continuous at r = 0 while the one-sided slopes may differ.
# The forcing balances advection and reaction exactly, so the pressure is constant on each side.
# Its jump is the BernoulliFormLossPressureJump with side velocities mass_flux / (rho eps_s):
# p_right - p_left = mass_flux^2 / (2 rho) * (1 / eps_left^2 - 1 / eps_right^2).
# With viscosity, the baffle transmits only a shear traction, and only from a clear side (unit
# porosity). Between two clear sides it is continuous, so the slopes must be equal. Two porous
# sides transmit none, so viscous cases with porosity below one on both sides need zero slopes. A
# clear side shears against the superficial velocity of a porous side at the interface, so with
# the clear side on the left the traction balance on both rows requires equal slopes and a
# continuous superficial tangential velocity, eps_left * tangential_velocity =
# eps_right * tangential_velocity, which with a porosity jump means tangential_velocity = 0.
# The normal velocity is constant and carries no viscous stress. A consistent scheme reproduces
# this piecewise-linear solution to round-off on uniform meshes.
rho = 1
eps_left = 1
eps_right = 1
mass_flux = 0.02
mu = 0
reaction = 10
tangential_velocity = 0.1
tangential_slope_left = 0.2
tangential_slope_right = 0.2
interface = 0.5
skew = 0
nx = 8
ny = 8
pressure_gradient_method = reconstructed
nonorthogonal = false
[Problem]
linear_sys_names = 'u_system v_system pressure_system'
previous_nl_solution_required = true
[]
[Mesh]
[generated]
type = GeneratedMeshGenerator
dim = 2
nx = ${nx}
ny = ${ny}
[]
[right]
type = ParsedSubdomainMeshGenerator
input = generated
combinatorial_geometry = 'x > ${interface}'
block_id = 2
block_name = right
[]
[left]
type = ParsedSubdomainMeshGenerator
input = right
combinatorial_geometry = 'x < ${interface}'
block_id = 1
block_name = left
[]
[skew]
type = ParsedNodeTransformGenerator
input = left
x_function = 'x + ${skew} * y'
[]
[baffle]
type = SideSetsBetweenSubdomainsGenerator
input = skew
primary_block = left
paired_block = right
new_boundary = baffle
[]
[]
[FVGradientMethods]
[jump_aware]
type = FVPressureJumpGreenGaussGradient
[]
[velocity_jump_aware]
type = FVVelocityJumpGreenGaussGradient
[]
[reconstructed]
type = FVReconstructedPressureGradient
base_gradient_method = jump_aware
gradient_relaxation = 1
[]
[]
[FVInterpolationMethods]
[average]
type = FVGeometricAverage
[]
[]
[UserObjects]
[pressure_jump]
type = BernoulliFormLossPressureJump
boundary = baffle
porosity = porosity
density = density
[]
[rc]
type = PorousRhieChowMassFlux
u = superficial_u
v = superficial_v
pressure = pressure
rho = density
porosity = porosity
p_diffusion_kernel = p_diffusion
pressure_jump_models = pressure_jump
pressure_projection_method = consistent
[]
[]
[Variables]
[superficial_u]
type = MooseLinearVariableFVReal
solver_sys = u_system
initial_condition = ${mass_flux}
gradient_method = velocity_jump_aware
[]
[superficial_v]
type = MooseLinearVariableFVReal
solver_sys = v_system
initial_condition = ${tangential_velocity}
gradient_method = velocity_jump_aware
[]
[pressure]
type = MooseLinearVariableFVReal
solver_sys = pressure_system
initial_condition = 0
gradient_method = jump_aware
[]
[]
[LinearFVKernels]
[u_advection]
type = LinearPWCNSFVMomentumFlux
variable = superficial_u
advected_interp_method_name = average
mu = viscosity
u = superficial_u
v = superficial_v
momentum_component = x
rhie_chow_user_object = rc
use_nonorthogonal_correction = ${nonorthogonal}
[]
[v_advection]
type = LinearPWCNSFVMomentumFlux
variable = superficial_v
advected_interp_method_name = average
mu = viscosity
u = superficial_u
v = superficial_v
momentum_component = y
rhie_chow_user_object = rc
use_nonorthogonal_correction = ${nonorthogonal}
[]
[u_pressure]
type = LinearPWCNSFVMomentumPressure
variable = superficial_u
pressure = pressure
porosity = porosity
momentum_component = x
gradient_method = ${pressure_gradient_method}
[]
[v_pressure]
type = LinearPWCNSFVMomentumPressure
variable = superficial_v
pressure = pressure
porosity = porosity
momentum_component = y
gradient_method = ${pressure_gradient_method}
[]
[u_source]
type = LinearFVSource
variable = superficial_u
source_density = forcing_u
[]
[u_reaction]
type = LinearFVReaction
variable = superficial_u
coeff = ${reaction}
[]
[v_source]
type = LinearFVSource
variable = superficial_v
source_density = forcing_v
[]
[v_reaction]
type = LinearFVReaction
variable = superficial_v
coeff = ${reaction}
[]
[p_diffusion]
type = LinearFVPressureCorrectionDiffusionJump
variable = pressure
rhie_chow_user_object = rc
use_nonorthogonal_correction = ${nonorthogonal}
[]
[HbyA_divergence]
type = LinearFVDivergence
variable = pressure
face_flux = HbyA
force_boundary_execution = true
[]
[]
[LinearFVBCs]
[velocity_x]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left right top bottom'
variable = superficial_u
functor = exact_u
[]
[velocity_y]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left right top bottom'
variable = superficial_v
functor = exact_v
[]
[pressure_flux]
type = LinearFVPressureFluxBC
boundary = 'left right top bottom'
variable = pressure
HbyA_flux = HbyA
Ainv = Ainv
rho = density
u = superficial_u
v = superficial_v
[]
[]
[FunctorMaterials]
[density]
type = ParsedFunctorMaterial
property_name = density
expression = '${rho}'
[]
[porosity]
type = ParsedFunctorMaterial
property_name = porosity
expression = 'if(x-${skew}*y<${interface},${eps_left},${eps_right})'
[]
[viscosity]
type = ParsedFunctorMaterial
property_name = viscosity
expression = '${mu}'
[]
[pressure_error]
type = ParsedFunctorMaterial
property_name = pressure_error
functor_names = 'pressure exact_pressure'
expression = 'pressure-exact_pressure'
[]
[]
[AuxVariables]
[reconstructed_grad_p]
family = MONOMIAL_VEC
order = CONSTANT
[]
[]
[AuxKernels]
[reconstructed_grad_p]
type = LinearFVGradientAux
variable = reconstructed_grad_p
linear_fv_variable = pressure
gradient_method = reconstructed
execute_on = FINAL
[]
[]
[Functions]
[normal_coordinate]
type = ParsedFunction
expression = '(x-skew*y-interface)/sqrt(1+skew^2)'
symbol_names = 'skew interface'
symbol_values = '${skew} ${interface}'
[]
[exact_normal_velocity]
type = ParsedFunction
expression = '${mass_flux}/${rho}'
[]
[exact_tangential_velocity]
type = ParsedFunction
expression = 'velocity*porosity+if(x-skew*y<interface,slope_left,slope_right)*r'
symbol_names = 'skew interface velocity porosity slope_left slope_right r'
symbol_values = '${skew} ${interface} ${tangential_velocity} exact_porosity ${tangential_slope_left} ${tangential_slope_right} normal_coordinate'
[]
[exact_pressure]
type = ParsedFunction
expression = 'if(x-skew*y<interface,0,mass_flux^2/(2*rho)*(1/eps_left^2-1/eps_right^2))'
symbol_names = 'skew interface mass_flux rho eps_left eps_right'
symbol_values = '${skew} ${interface} ${mass_flux} ${rho} ${eps_left} ${eps_right}'
[]
[exact_u]
type = ParsedFunction
expression = '(normal+skew*tangential)/sqrt(1+skew^2)'
symbol_names = 'skew normal tangential'
symbol_values = '${skew} exact_normal_velocity exact_tangential_velocity'
[]
[exact_v]
type = ParsedFunction
expression = '(-skew*normal+tangential)/sqrt(1+skew^2)'
symbol_names = 'skew normal tangential'
symbol_values = '${skew} exact_normal_velocity exact_tangential_velocity'
[]
[forcing_u]
type = ParsedFunction
expression = 'skew*mass_flux*slope/(porosity*sqrt(1+skew^2))+reaction*u'
symbol_names = 'skew interface mass_flux slope porosity reaction u'
symbol_values = '${skew} ${interface} ${mass_flux} tangential_slope exact_porosity ${reaction} exact_u'
[]
[forcing_v]
type = ParsedFunction
expression = 'mass_flux*slope/(porosity*sqrt(1+skew^2))+reaction*v'
symbol_names = 'skew interface mass_flux slope porosity reaction v'
symbol_values = '${skew} ${interface} ${mass_flux} tangential_slope exact_porosity ${reaction} exact_v'
[]
[tangential_slope]
type = ParsedFunction
expression = 'if(x-skew*y<interface,slope_left,slope_right)'
symbol_names = 'skew interface slope_left slope_right'
symbol_values = '${skew} ${interface} ${tangential_slope_left} ${tangential_slope_right}'
[]
[exact_porosity]
type = ParsedFunction
expression = 'if(x-skew*y<interface,eps_left,eps_right)'
symbol_names = 'skew interface eps_left eps_right'
symbol_values = '${skew} ${interface} ${eps_left} ${eps_right}'
[]
[]
[Executioner]
type = SIMPLE
momentum_l_abs_tol = 1e-12
pressure_l_abs_tol = 1e-12
momentum_l_tol = 0
pressure_l_tol = 0
momentum_l_max_its = 100
pressure_l_max_its = 100
rhie_chow_user_object = rc
momentum_systems = 'u_system v_system'
pressure_system = pressure_system
momentum_equation_relaxation = 0.7
pressure_variable_relaxation = 0.5
# A solution that is exact to round-off stalls the normalized residuals near 1e-6 instead of
# meeting the absolute tolerances, so run a fixed number of iterations instead.
num_iterations = 200
continue_on_max_its = true
pressure_absolute_tolerance = 1e-11
momentum_absolute_tolerance = 1e-11
momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
momentum_petsc_options_value = 'hypre boomeramg'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
pressure_petsc_options_value = 'hypre boomeramg'
print_fields = false
pin_pressure = true
pressure_pin_value = 0
pressure_pin_point = '0.25 0.5 0'
[]
[Postprocessors]
[h]
type = AverageElementSize
execute_on = FINAL
[]
[L2u]
type = ElementL2FunctorError
approximate = superficial_u
exact = exact_u
execute_on = FINAL
[]
[L2v]
type = ElementL2FunctorError
approximate = superficial_v
exact = exact_v
execute_on = FINAL
[]
[L2p]
type = ElementL2FunctorError
approximate = pressure
exact = exact_pressure
execute_on = FINAL
[]
[L2gradp]
type = ElementVectorL2Error
variable = reconstructed_grad_p
function_x = 0
function_y = 0
execute_on = FINAL
[]
[boundary_mass_balance]
type = VolumetricFlowRate
boundary = 'left right top bottom'
vel_x = superficial_u
vel_y = superficial_v
advected_quantity = density
rhie_chow_user_object = rc
execute_on = FINAL
[]
[max_pressure_error]
type = ElementExtremeFunctorValue
functor = pressure_error
value_type = max_abs
execute_on = FINAL
[]
[]
[Outputs]
exodus = false
[csv]
type = CSV
execute_on = FINAL
[]
[]
(modules/thermal_hydraulics/test/tests/functormaterials/conjugate_ht_numbers/conjugate_ht_numbers.i)
p_fluid = 1e5
T_fluid = 300
T_solid = 500
[Mesh]
type = GeneratedMesh
dim = 1
nx = 1
[]
[FluidProperties]
[fp_air]
type = IdealGasFluidProperties
[]
[]
[FunctorMaterials]
[q_fmat]
type = ADConjugateHTNumbersFunctorMaterial
Pr_name = Pr
Gr_name = Gr
p_fluid = ${p_fluid}
T_fluid = ${T_fluid}
T_solid = ${T_solid}
length = 0.01
fluid_properties = fp_air
[]
[]
[Postprocessors]
[Pr]
type = ADElementExtremeFunctorValue
functor = Pr
execute_on = 'INITIAL'
[]
[Gr]
type = ADElementExtremeFunctorValue
functor = Gr
execute_on = 'INITIAL'
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[Outputs]
csv = true
execute_on = 'INITIAL'
[]
(modules/navier_stokes/test/tests/finite_volume/ins/pump/pump_loop.i)
mu = 1.0
rho = 1.0
[Mesh]
[gen]
type = CartesianMeshGenerator
dim = 2
dx = '0.1 0.8 0.1'
dy = '0.1 0.8 0.1'
ix = '5 20 5'
iy = '5 20 5'
subdomain_id = '1 1 1
1 2 1
1 1 1'
[]
[delete_internal_part]
type = BlockDeletionGenerator
input = gen
block = '2'
new_boundary = 'wall-internal'
[]
[lump_bdries_to_wall]
type = RenameBoundaryGenerator
input = delete_internal_part
old_boundary = 'bottom right top left'
new_boundary = 'wall-external wall-external wall-external wall-external'
[]
[pump_domain]
type = ParsedSubdomainMeshGenerator
input = lump_bdries_to_wall
combinatorial_geometry = 'x > 0.3 & x < 0.4 & y > 0.5'
block_id = '3'
[]
[rename_blocks]
type = RenameBlockGenerator
input = pump_domain
old_block = '1 3'
new_block = 'pipe pump'
[]
[side_pump]
type = ParsedGenerateSideset
input = rename_blocks
included_subdomains = 'pump'
included_neighbors = 'pipe'
new_sideset_name = 'pump_side'
normal = '1 0 0'
combinatorial_geometry = 'x > 0.35'
[]
[]
[GlobalParams]
velocity_interp_method = 'rc'
advected_interp_method = 'upwind'
rhie_chow_user_object = 'rc'
[]
[Problem]
material_coverage_check = False
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = vel_x
v = vel_y
pressure = pressure
correct_volumetric_force = true
volumetric_force_functors = 'pump_volume_force'
volume_force_correction_method = 'pressure-consistent'
[]
[]
[Variables]
[vel_x]
type = INSFVVelocityVariable
initial_condition = 1
[]
[vel_y]
type = INSFVVelocityVariable
initial_condition = 1
[]
[pressure]
type = INSFVPressureVariable
[]
[lambda]
family = SCALAR
order = FIRST
[]
[]
[AuxVariables]
[U]
order = CONSTANT
family = MONOMIAL
fv = true
[]
[]
[AuxKernels]
[mag]
type = VectorMagnitudeAux
variable = U
x = vel_x
y = vel_y
[]
[]
[FVKernels]
[mass]
type = INSFVMassAdvection
variable = pressure
rho = ${rho}
[]
[mean_zero_pressure]
type = FVIntegralValueConstraint
variable = pressure
lambda = lambda
phi0 = 0.0
[]
[u_advection]
type = INSFVMomentumAdvection
variable = vel_x
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = vel_x
mu = ${mu}
momentum_component = 'x'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = vel_x
momentum_component = 'x'
pressure = pressure
[]
[u_pump]
type = INSFVPump
variable = vel_x
momentum_component = 'x'
pump_volume_force = 'pump_volume_force'
block = 'pump'
[]
[v_advection]
type = INSFVMomentumAdvection
variable = vel_y
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = vel_y
mu = ${mu}
momentum_component = 'y'
[]
[v_pressure]
type = INSFVMomentumPressure
variable = vel_y
momentum_component = 'y'
pressure = pressure
[]
[]
[FVBCs]
[walls-u]
type = INSFVNoSlipWallBC
boundary = 'wall-internal wall-external'
variable = vel_x
function = '0'
[]
[walls-v]
type = INSFVNoSlipWallBC
boundary = 'wall-internal wall-external'
variable = vel_y
function = '0'
[]
[]
[Functions]
[pump_head]
type = PiecewiseLinear
x = '0.0 10.0'
y = '1000.0 0.0'
[]
[]
[FunctorMaterials]
[pump_mat]
type = NSFVPumpFunctorMaterial
rho = ${rho}
speed = 'U'
pressure_head_function = 'pump_head'
rotation_speed = 120
rotation_speed_rated = 100
area_rated = 0.1
volume_rated = 0.01
flow_rate_rated = 1.0
flow_rate = 'flow_rate'
block = 'pump'
[]
[]
[Postprocessors]
[flow_rate]
type = Receiver
default = 1.0
[]
[flow_rate_to_pipe]
type = VolumetricFlowRate
advected_quantity = ${rho}
boundary = 'pump_side'
vel_x = 'vel_x'
vel_y = 'vel_y'
[]
[maximum_speed]
type = ADElementExtremeFunctorValue
functor = vel_x
value_type = max
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
nl_rel_tol = 1e-12
[]
[Outputs]
exodus = false
[out]
type = CSV
execute_on = FINAL
show = 'flow_rate_to_pipe maximum_speed'
[]
[]
(modules/navier_stokes/test/tests/finite_volume/ins/pump/pump_loop_negative_rotation.i)
mu = 1.0
rho = 1.0
[Mesh]
[gen]
type = CartesianMeshGenerator
dim = 2
dx = '0.1 0.8 0.1'
dy = '0.1 0.8 0.1'
ix = '5 20 5'
iy = '5 20 5'
subdomain_id = '1 1 1
1 2 1
1 1 1'
[]
[delete_internal_part]
type = BlockDeletionGenerator
input = gen
block = '2'
new_boundary = 'wall-internal'
[]
[lump_bdries_to_wall]
type = RenameBoundaryGenerator
input = delete_internal_part
old_boundary = 'bottom right top left'
new_boundary = 'wall-external wall-external wall-external wall-external'
[]
[pump_domain]
type = ParsedSubdomainMeshGenerator
input = lump_bdries_to_wall
combinatorial_geometry = 'x > 0.3 & x < 0.4 & y > 0.5'
block_id = '3'
[]
[rename_blocks]
type = RenameBlockGenerator
input = pump_domain
old_block = '1 3'
new_block = 'pipe pump'
[]
[side_pump]
type = ParsedGenerateSideset
input = rename_blocks
included_subdomains = 'pump'
included_neighbors = 'pipe'
new_sideset_name = 'pump_side'
normal = '1 0 0'
combinatorial_geometry = 'x > 0.35'
[]
[]
[GlobalParams]
velocity_interp_method = 'rc'
advected_interp_method = 'upwind'
rhie_chow_user_object = 'rc'
[]
[Problem]
material_coverage_check = False
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = vel_x
v = vel_y
pressure = pressure
correct_volumetric_force = true
volumetric_force_functors = 'pump_volume_force'
volume_force_correction_method = 'force-consistent'
[]
[]
[Variables]
[vel_x]
type = INSFVVelocityVariable
initial_condition = 1
[]
[vel_y]
type = INSFVVelocityVariable
initial_condition = 1
[]
[pressure]
type = INSFVPressureVariable
[]
[lambda]
family = SCALAR
order = FIRST
[]
[]
[AuxVariables]
[U]
order = CONSTANT
family = MONOMIAL
fv = true
[]
[]
[AuxKernels]
[mag]
type = VectorMagnitudeAux
variable = U
x = vel_x
y = vel_y
[]
[]
[FVKernels]
[mass]
type = INSFVMassAdvection
variable = pressure
rho = ${rho}
[]
[mean_zero_pressure]
type = FVIntegralValueConstraint
variable = pressure
lambda = lambda
phi0 = 0.0
[]
[u_advection]
type = INSFVMomentumAdvection
variable = vel_x
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = vel_x
mu = ${mu}
momentum_component = 'x'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = vel_x
momentum_component = 'x'
pressure = pressure
[]
[u_pump]
type = INSFVPump
variable = vel_x
momentum_component = 'x'
pump_volume_force = 'pump_volume_force'
block = 'pump'
[]
[v_advection]
type = INSFVMomentumAdvection
variable = vel_y
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = vel_y
mu = ${mu}
momentum_component = 'y'
[]
[v_pressure]
type = INSFVMomentumPressure
variable = vel_y
momentum_component = 'y'
pressure = pressure
[]
[]
[FVBCs]
[walls-u]
type = INSFVNoSlipWallBC
boundary = 'wall-internal wall-external'
variable = vel_x
function = '0'
[]
[walls-v]
type = INSFVNoSlipWallBC
boundary = 'wall-internal wall-external'
variable = vel_y
function = '0'
[]
[]
[Functions]
[pump_head_negative]
type = PiecewiseLinear
x = '0.0 10.0'
y = '1000.0 0.0'
[]
[]
[FunctorMaterials]
[pump_mat]
type = NSFVPumpFunctorMaterial
rho = ${rho}
speed = 'U'
rotation_speed = 120
rotation_speed_rated = 100
area_rated = 0.1
volume_rated = 0.01
flow_rate_rated = 1.0
flow_rate = 'flow_rate'
block = 'pump'
enable_negative_rotation = true
symmetric_negative_pressure_head = false
pressure_head_function_negative_rotation = 'pump_head_negative'
[]
[]
[Postprocessors]
[flow_rate]
type = Receiver
default = 1.0
[]
[flow_rate_to_pipe]
type = VolumetricFlowRate
advected_quantity = ${rho}
boundary = 'pump_side'
vel_x = 'vel_x'
vel_y = 'vel_y'
[]
[maximum_speed]
type = ADElementExtremeFunctorValue
functor = vel_x
value_type = max
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
nl_rel_tol = 1e-12
[]
[Outputs]
exodus = false
[out]
type = CSV
execute_on = FINAL
show = 'flow_rate_to_pipe maximum_speed'
[]
[]
(test/tests/functormaterials/time_derivatives/functor_time_derivatives.i)
[Mesh]
type = GeneratedMesh
dim = 3
nx = 2
ny = 2
nz = 2
xmin = 0.0
xmax = 4.0
ymin = 0.0
ymax = 6.0
zmin = 0.0
zmax = 10.0
[]
[Variables]
[v1]
[]
[]
[Kernels]
[time]
type = TimeDerivative
variable = v1
[]
[source]
type = BodyForce
variable = v1
function = 10
[]
[]
[Functions]
[f1]
type = ParsedFunction
expression = '- 4 * t'
[]
[f2]
type = ConstantFunction
value = 3
[]
[]
[AuxVariables]
[v2]
[AuxKernel]
type = ParsedAux
expression = '3 * t'
use_xyzt = true
[]
[]
[]
[FunctorMaterials]
[time_derivatives]
type = ADGenericFunctorTimeDerivativeMaterial
prop_names = 'f1dt f2dt v1dt v2dt'
prop_values = 'f1 f2 v1 v2'
[]
[]
[Postprocessors]
[f1_time]
type = ElementExtremeFunctorValue
functor = f1dt
value_type = max
execute_on = 'INITIAL'
[]
[f2_time]
type = ElementExtremeFunctorValue
functor = f2dt
value_type = max
execute_on = 'INITIAL'
[]
[v1_time]
type = ElementExtremeFunctorValue
functor = v1dt
value_type = max
# derivatives are not available on INITIAL and TIMESTEP_BEGIN
execute_on = 'TIMESTEP_END'
[]
[v2_time]
type = ElementExtremeFunctorValue
functor = v2dt
value_type = max
# derivatives are not available on INITIAL and TIMESTEP_BEGIN
execute_on = 'TIMESTEP_END'
[]
[]
[Executioner]
type = Transient
num_steps = 2
[]
[Outputs]
csv = true
[]
(modules/navier_stokes/test/tests/postprocessors/rayleigh/natural_convection.i)
mu = 1
rho = 1.1
beta = 1e-4
k = .01
cp = 1000
velocity_interp_method = 'rc'
advected_interp_method = 'average'
l = 4
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 1
ymin = 0
ymax = ${l}
nx = 8
ny = 8
[]
[]
[Variables]
[u]
type = INSFVVelocityVariable
[]
[v]
type = INSFVVelocityVariable
[]
[pressure]
type = INSFVPressureVariable
[]
[T]
type = INSFVEnergyVariable
[]
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = u
v = v
pressure = pressure
[]
[]
[FVKernels]
[mass_time]
type = WCNSFVMassTimeDerivative
variable = pressure
drho_dt = drho_dt
[]
[mass]
type = WCNSFVMassAdvection
variable = pressure
advected_interp_method = ${advected_interp_method}
velocity_interp_method = ${velocity_interp_method}
rho = ${rho}
rhie_chow_user_object = 'rc'
[]
[u_time]
type = WCNSFVMomentumTimeDerivative
variable = u
drho_dt = drho_dt
rho = rho
momentum_component = 'x'
rhie_chow_user_object = 'rc'
[]
[u_advection]
type = INSFVMomentumAdvection
variable = u
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
rho = ${rho}
momentum_component = 'x'
rhie_chow_user_object = 'rc'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = u
mu = ${mu}
momentum_component = 'x'
rhie_chow_user_object = 'rc'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = u
momentum_component = 'x'
pressure = pressure
rhie_chow_user_object = 'rc'
[]
[v_time]
type = WCNSFVMomentumTimeDerivative
variable = v
drho_dt = drho_dt
rho = rho
momentum_component = 'y'
rhie_chow_user_object = 'rc'
[]
[v_advection]
type = INSFVMomentumAdvection
variable = v
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
rho = ${rho}
momentum_component = 'y'
rhie_chow_user_object = 'rc'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = v
mu = ${mu}
momentum_component = 'y'
rhie_chow_user_object = 'rc'
[]
[v_pressure]
type = INSFVMomentumPressure
variable = v
momentum_component = 'y'
pressure = pressure
rhie_chow_user_object = 'rc'
[]
[temp_time]
type = WCNSFVEnergyTimeDerivative
variable = T
rho = rho
drho_dt = drho_dt
h = h
dh_dt = dh_dt
[]
[temp_conduction]
type = FVDiffusion
coeff = 'k'
variable = T
[]
[temp_advection]
type = INSFVEnergyAdvection
variable = T
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
rhie_chow_user_object = 'rc'
[]
[]
[FVBCs]
[no_slip_x]
type = INSFVNoSlipWallBC
variable = u
boundary = 'left right bottom top'
function = 0
[]
[no_slip_y]
type = INSFVNoSlipWallBC
variable = v
boundary = 'left right top bottom'
function = 0
[]
[T_hot]
type = FVDirichletBC
variable = T
boundary = 'bottom'
value = 1
[]
[T_cold]
type = FVDirichletBC
variable = T
boundary = 'top'
value = 0
[]
[]
[FluidProperties]
[fp]
type = SimpleFluidProperties
density0 = ${rho}
thermal_expansion = ${beta}
[]
[]
[FunctorMaterials]
[rho]
type = RhoFromPTFunctorMaterial
fp = fp
temperature = T
pressure = pressure
[]
[functor_constants]
type = ADGenericFunctorMaterial
prop_names = 'cp k'
prop_values = '${cp} ${k}'
[]
[ins_fv]
type = INSFVEnthalpyFunctorMaterial
temperature = 'T'
rho = ${rho}
[]
[]
[Executioner]
type = Transient
dt = 1
end_time = 10
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -ksp_gmres_restart -sub_pc_type -sub_pc_factor_shift_type'
petsc_options_value = 'asm 300 lu NONZERO'
nl_abs_tol = 1e-11
automatic_scaling = true
[]
[Postprocessors]
[rayleigh_1]
type = RayleighNumber
rho_min = rho_min
rho_max = rho_max
rho_ave = ${rho}
l = ${l}
mu_ave = ${mu}
k_ave = ${k}
cp_ave = ${cp}
gravity_magnitude = 9.81
[]
[rayleigh_2]
type = RayleighNumber
T_cold = T_min
T_hot = T_max
rho_ave = ${rho}
beta = ${beta}
l = ${l}
mu_ave = ${mu}
k_ave = ${k}
cp_ave = ${cp}
gravity_magnitude = 9.81
[]
[rho_min]
type = ADElementExtremeFunctorValue
functor = 'rho'
value_type = 'min'
[]
[rho_max]
type = ADElementExtremeFunctorValue
functor = 'rho'
value_type = 'max'
[]
[T_min]
type = ADElementExtremeFunctorValue
functor = 'T'
value_type = 'min'
[]
[T_max]
type = ADElementExtremeFunctorValue
functor = 'T'
value_type = 'max'
[]
[]
[Outputs]
csv = true
[]
(test/tests/functormaterials/parsed_functor_material/parsed_functor_material.i)
[Mesh]
type = GeneratedMesh
dim = 3
nx = 2
ny = 2
nz = 2
xmin = 0.0
xmax = 4.0
ymin = 0.0
ymax = 6.0
zmin = 0.0
zmax = 10.0
[]
[Functions]
[fn1]
type = ParsedFunction
# The max value on elements should be:
# 2 * 3 + 0.5 * 4.5 + 7.5 - 4 = 11.75
expression = '2 * x + 0.5 * y + z - t'
[]
[fn2]
type = ConstantFunction
value = 3
[]
[]
[FunctorMaterials]
[parsed_fmat]
type = ParsedFunctorMaterial
expression = 'A * B^2 + 2 + pi + e + t + x + y + z'
functor_names = 'fn1 fn2'
functor_symbols = 'A B'
property_name = 'prop1'
[]
[]
[Postprocessors]
# The value should be:
# 11.75 * 3^2 + 2 + pi + e + 4 + 3 + 4.5 + 7.5 = 132.60987448204884
[get_prop1]
type = ElementExtremeFunctorValue
functor = prop1
value_type = max
execute_on = 'INITIAL'
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
time = 4.0
[]
[Outputs]
csv = true
execute_on = 'INITIAL'
[]
(test/tests/postprocessors/element_extreme_functor_value/extreme_proxy_value.i)
[Problem]
type = FEProblem
solve = false
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 40
ny = 40
[]
[AuxVariables]
[u]
type = MooseVariableFVReal
[]
[w]
type = MooseVariableFVReal
[]
[v_x]
type = MooseVariableFVReal
[]
[v_y]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[u]
type = FunctionAux
variable = u
function = u_f
[]
[w]
type = FunctionAux
variable = w
function = w_f
[]
[v_x]
type = FunctionAux
variable = v_x
function = v_x_f
[]
[v_y]
type = FunctionAux
variable = v_y
function = v_y_f
[]
[]
[Functions]
[u_f] # reaches a maximum value at (0.5, 0.6)
type = ParsedFunction
expression = 'sin(pi*x)*sin(pi*y/1.2)'
[]
[w_f] # reaches a minium expression at (0.7, 0.8)
type = ParsedFunction
expression = '-sin(pi*x/1.4)*sin(pi*y/1.6)'
[]
[v_x_f]
type = ParsedFunction
expression = 'x'
[]
[v_y_f]
type = ParsedFunction
expression = 'y'
[]
[]
[Postprocessors]
[max_u]
type = ADElementExtremeFunctorValue
functor = 'u'
[]
[min_w_f]
type = ElementExtremeFunctorValue
functor = 'w_f'
value_type = min
[]
[max_v_x]
type = ADElementExtremeFunctorValue
functor = 'v_x'
[]
[min_v_y]
type = ADElementExtremeFunctorValue
functor = 'v_y'
value_type = min
[]
# because we set v_x and v_y equal to the x and y coordinates, these two postprocessors
# should just return the point at which u reaches a maximum value
[max_v_from_proxy_x]
type = ADElementExtremeFunctorValue
functor = v_x
proxy_functor = u
value_type = max
[]
[max_v_from_proxy_y]
type = ADElementExtremeFunctorValue
functor = v_y
proxy_functor = u
value_type = max
[]
# because we set v_x and v_y equal to the x and y coordinates, these two postprocessors
# should just return the point at which w reaches a minimum value
[min_v_from_proxy_x]
type = ADElementExtremeFunctorValue
functor = v_x
proxy_functor = w
value_type = min
[]
[min_v_from_proxy_y]
type = ADElementExtremeFunctorValue
functor = v_y
proxy_functor = w
value_type = min
[]
[]
[Executioner]
type = Steady
[]
[Outputs]
csv = true
[]
(modules/navier_stokes/test/tests/finite_volume/two_phase/mixture_model/lid-driven-two-phase-physics.i)
mu = 1.0
rho = 1.0e3
mu_d = 0.3
rho_d = 1.0
dp = 0.01
U_lid = 0.1
g = -9.81
velocity_interp_method = 'rc'
advected_interp_method = 'upwind'
k = 1
k_d = 1
cp = 1
cp_d = 1
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = .1
ymin = 0
ymax = .1
nx = 5
ny = 5
[]
[]
[Physics]
[NavierStokes]
[Flow]
[flow]
compressibility = 'incompressible'
density = 'rho_mixture'
dynamic_viscosity = 'mu_mixture'
# Initial conditions
initial_velocity = '0 0 0'
initial_pressure = 0
# Pressure pin
pin_pressure = true
pinned_pressure_type = 'point-value'
pinned_pressure_point = '0 0 0'
pinned_pressure_value = '0'
# Gravity
gravity = '0 ${g} 0'
# Boundary conditions are defined outside of the Physics
# Moving walls are not that common of a problem
mass_advection_interpolation = '${advected_interp_method}'
momentum_advection_interpolation = '${advected_interp_method}'
velocity_interpolation = '${velocity_interp_method}'
[]
[]
[TwoPhaseMixture]
[mixture]
phase_1_fraction_name = 'phase_1'
phase_2_fraction_name = 'phase_2'
add_phase_transport_equation = true
phase_advection_interpolation = '${advected_interp_method}'
phase_fraction_diffusivity = 1e-3
# We could consider adding fixed-value-yet-not-an-inlet
# boundary conditions to the TwoPhaseMixture physics
# Base phase material properties
phase_1_density_name = ${rho}
phase_1_viscosity_name = ${mu}
phase_1_specific_heat_name = ${cp}
phase_1_thermal_conductivity_name = ${k}
# Other phase material properties
phase_2_density_name = ${rho_d}
phase_2_viscosity_name = ${mu_d}
phase_2_specific_heat_name = ${cp_d}
phase_2_thermal_conductivity_name = ${k_d}
output_all_properties = true
# Friction model, not actually used!
use_dispersed_phase_drag_model = true
particle_diameter = ${dp}
[]
[]
[]
[]
[FVBCs]
[top_x]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'top'
function = ${U_lid}
[]
[no_slip_x]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'left right bottom'
function = 0
[]
[no_slip_y]
type = INSFVNoSlipWallBC
variable = vel_y
boundary = 'left right top bottom'
function = 0
[]
[bottom_phase_2]
type = FVDirichletBC
variable = phase_2
boundary = 'bottom'
value = 1.0
[]
[top_phase_2]
type = FVDirichletBC
variable = phase_2
boundary = 'top'
value = 0.0
[]
[]
[AuxVariables]
[drag_coefficient]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[populate_cd]
type = FunctorAux
variable = drag_coefficient
functor = 'Darcy_coefficient'
execute_on = 'TIMESTEP_END'
[]
[]
[Postprocessors]
[average_void]
type = ElementAverageValue
variable = 'phase_2'
[]
[max_y_velocity]
type = ElementExtremeValue
variable = 'vel_y'
value_type = max
[]
[min_y_velocity]
type = ElementExtremeValue
variable = 'vel_y'
value_type = min
[]
[max_x_velocity]
type = ElementExtremeValue
variable = 'vel_x'
value_type = max
[]
[min_x_velocity]
type = ElementExtremeValue
variable = 'vel_x'
value_type = min
[]
[max_x_slip_velocity]
type = ElementExtremeFunctorValue
functor = 'vel_slip_x'
value_type = max
[]
[max_y_slip_velocity]
type = ElementExtremeFunctorValue
functor = 'vel_slip_y'
value_type = max
[]
[max_drag_coefficient]
type = ElementExtremeFunctorValue
functor = 'drag_coefficient'
value_type = max
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
[TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 7
iteration_window = 2
growth_factor = 2.0
cutback_factor = 0.5
dt = 1e-3
[]
nl_max_its = 20
nl_rel_tol = 1e-03
nl_abs_tol = 1e-9
l_max_its = 5
end_time = 1e8
line_search=none
[]
[Outputs]
exodus = false
[CSV]
type = CSV
execute_on = 'FINAL'
execute_scalars_on = NONE
[]
[]
(modules/navier_stokes/test/tests/finite_volume/fviks/convection/convection_channel.i)
mu = 1
rho = 1
k = .01
cp = 1
[Mesh]
[cmg]
type = CartesianMeshGenerator
dim = 2
dx = '1 0.5'
dy = '1'
ix = '8 5'
iy = '8'
subdomain_id = '0 1'
[]
[interface]
type = SideSetsBetweenSubdomainsGenerator
input = 'cmg'
primary_block = 0
paired_block = 1
new_boundary = 'interface'
[]
[fluid_side]
type = BreakBoundaryOnSubdomainGenerator
input = 'interface'
boundaries = 'top bottom'
[]
[]
[GlobalParams]
# retain behavior at time of test creation
two_term_boundary_expansion = false
rhie_chow_user_object = 'rc'
advected_interp_method = 'average'
velocity_interp_method = 'rc'
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = u
v = v
block = 0
pressure = pressure
[]
[]
[Variables]
[u]
type = INSFVVelocityVariable
block = 0
initial_condition = 1e-6
[]
[v]
type = INSFVVelocityVariable
block = 0
initial_condition = 1e-6
[]
[pressure]
type = INSFVPressureVariable
block = 0
[]
[T]
type = INSFVEnergyVariable
block = 0
initial_condition = 1
[]
[Ts]
type = INSFVEnergyVariable
block = 1
[]
[lambda]
family = SCALAR
order = FIRST
[]
[]
[FVKernels]
[mass]
type = INSFVMassAdvection
variable = pressure
rho = ${rho}
[]
[mean_zero_pressure]
type = FVIntegralValueConstraint
variable = pressure
lambda = lambda
[]
[u_advection]
type = INSFVMomentumAdvection
variable = u
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = u
mu = ${mu}
momentum_component = 'x'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = u
momentum_component = 'x'
pressure = pressure
[]
[v_advection]
type = INSFVMomentumAdvection
variable = v
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = v
mu = ${mu}
momentum_component = 'y'
[]
[v_pressure]
type = INSFVMomentumPressure
variable = v
momentum_component = 'y'
pressure = pressure
[]
[temp_conduction]
type = FVDiffusion
coeff = 'k'
variable = T
[]
[temp_advection]
type = INSFVEnergyAdvection
variable = T
[]
[solid_temp_conduction]
type = FVDiffusion
coeff = 'k'
variable = Ts
[]
[]
[FVInterfaceKernels]
[convection]
type = FVConvectionCorrelationInterface
variable1 = T
variable2 = Ts
boundary = 'interface'
h = 5
T_solid = Ts
T_fluid = T
subdomain1 = 0
subdomain2 = 1
wall_cell_is_bulk = true
[]
[]
[FVBCs]
[walls_u]
type = INSFVNoSlipWallBC
variable = u
boundary = 'interface left'
function = 0
[]
[walls_v]
type = INSFVNoSlipWallBC
variable = v
boundary = 'interface left'
function = 0
[]
[inlet_u]
type = INSFVInletVelocityBC
variable = u
boundary = 'bottom_to_0'
functor = 0
[]
[inlet_v]
type = INSFVInletVelocityBC
variable = v
boundary = 'bottom_to_0'
functor = 1
[]
[inlet_T]
type = FVDirichletBC
variable = T
boundary = 'bottom_to_0'
value = 0.5
[]
[outlet]
type = INSFVMassAdvectionOutflowBC
variable = pressure
boundary = 'top_to_0'
u = u
v = v
rho = ${rho}
[]
[outlet_u]
type = INSFVMomentumAdvectionOutflowBC
variable = u
boundary = 'top_to_0'
u = u
v = v
momentum_component = 'x'
rho = ${rho}
[]
[outlet_v]
type = INSFVMomentumAdvectionOutflowBC
variable = v
boundary = 'top_to_0'
u = u
v = v
momentum_component = 'y'
rho = ${rho}
[]
[heater]
type = FVDirichletBC
variable = 'Ts'
boundary = 'right'
value = 10
[]
[]
[FunctorMaterials]
[functor_constants]
type = ADGenericFunctorMaterial
prop_names = 'cp k'
prop_values = '${cp} ${k}'
[]
[ins_fv]
type = INSFVEnthalpyFunctorMaterial
temperature = 'T'
rho = ${rho}
block = 0
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
petsc_options_iname = '-pc_type -sub_pc_type -sub_pc_factor_shift_type -ksp_gmres_restart'
petsc_options_value = 'asm lu NONZERO 200'
line_search = 'none'
nl_abs_tol = 1e-14
[]
[Postprocessors]
[max_T]
type = ADElementExtremeFunctorValue
functor = T
block = 0
[]
[max_Ts]
type = ADElementExtremeFunctorValue
functor = Ts
block = 1
[]
[mdot_out]
type = VolumetricFlowRate
boundary = 'top_to_0'
vel_x = u
vel_y = v
advected_quantity = ${rho}
[]
[]
[Outputs]
exodus = true
[]
(modules/navier_stokes/test/tests/finite_volume/two_phase/mixture_model/segregated/lid-driven-two-phase-physics.i)
mu = 1.0
rho = 1.0e3
mu_d = 0.3
rho_d = 5e2
dp = 0.01
U_lid = 0.1
advected_interp_method = 'upwind'
k = 1
k_d = 1
cp = 1
cp_d = 1
[Mesh]
inactive = 'make_skew'
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = .1
ymin = 0
ymax = .1
nx = 10
ny = 10
[]
[make_skew]
type = MoveNodeGenerator
input = 'gen'
node_id = 0
shift_position = '0.007 0.0021 0'
[]
[]
[Problem]
linear_sys_names = 'u_system v_system pressure_system phi_system'
[]
[Physics]
[NavierStokes]
[FlowSegregated]
[flow]
compressibility = 'incompressible'
density = 'rho_mixture'
dynamic_viscosity = 'mu_mixture'
# Initial conditions
initial_velocity = '1e-12 1e-12 0'
initial_pressure = 0.2
wall_boundaries = 'top left right bottom'
momentum_wall_types = 'noslip noslip noslip noslip'
momentum_wall_functors = '${U_lid} 0; 0 0; 0 0; 0 0'
orthogonality_correction = false
pressure_two_term_bc_expansion = true
momentum_advection_interpolation = ${advected_interp_method}
[]
[]
[TwoPhaseMixtureSegregated]
[mixture]
system_names = 'phi_system'
phase_1_fraction_name = 'phase_1'
phase_2_fraction_name = 'phase_2'
add_phase_transport_equation = true
phase_advection_interpolation = '${advected_interp_method}'
phase_fraction_diffusivity = 1e-3
# We could consider adding fixed-value-yet-not-an-inlet
# boundary conditions to the TwoPhaseMixture physics
# Base phase material properties
phase_1_density_name = ${rho}
phase_1_viscosity_name = ${mu}
phase_1_specific_heat_name = ${cp}
phase_1_thermal_conductivity_name = ${k}
# Other phase material properties
phase_2_density_name = ${rho_d}
phase_2_viscosity_name = ${mu_d}
phase_2_specific_heat_name = ${cp_d}
phase_2_thermal_conductivity_name = ${k_d}
output_all_properties = true
# Friction model, not actually used!
use_dispersed_phase_drag_model = true
particle_diameter = ${dp}
add_advection_slip_term = false
[]
[]
[]
[]
[LinearFVBCs]
[botttom-phase-2]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'bottom'
variable = phase_2
functor = '0'
[]
[top-phase-2]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'top'
variable = phase_2
functor = '1'
[]
[]
[Executioner]
type = PIMPLE
rhie_chow_user_object = 'ins_rhie_chow_interpolator'
dt = 1
end_time = 10
# Systems
momentum_systems = 'u_system v_system'
pressure_system = 'pressure_system'
active_scalar_systems = 'phi_system'
momentum_equation_relaxation = 0.8
active_scalar_equation_relaxation = '0.7'
pressure_variable_relaxation = 0.3
# We need to converge the problem to show conservation
num_iterations = 200
pressure_absolute_tolerance = 1e-10
momentum_absolute_tolerance = 1e-10
active_scalar_absolute_tolerance = '1e-10'
momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
momentum_petsc_options_value = 'hypre boomeramg'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
pressure_petsc_options_value = 'hypre boomeramg'
active_scalar_petsc_options_iname = '-pc_type -pc_factor_shift_type' # -pc_hypre_type'
active_scalar_petsc_options_value = 'lu NONZERO'
momentum_l_abs_tol = 1e-13
pressure_l_abs_tol = 1e-13
active_scalar_l_abs_tol = 1e-13
momentum_l_tol = 0
pressure_l_tol = 0
active_scalar_l_tol = 0
# print_fields = true
continue_on_max_its = true
pin_pressure = true
pressure_pin_value = 0.0
pressure_pin_point = '0.05 0.05 0.0'
[]
[Outputs]
exodus = true
[out]
type = CSV
execute_on = 'FINAL'
[]
[]
[AuxVariables]
[drag_coefficient]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[populate_cd]
type = FunctorAux
variable = drag_coefficient
functor = 'Darcy_coefficient'
execute_on = 'TIMESTEP_END'
[]
[]
[Postprocessors]
[average_void]
type = ElementAverageValue
variable = 'phase_2'
[]
[max_y_velocity]
type = ElementExtremeValue
variable = 'vel_y'
value_type = max
[]
[min_y_velocity]
type = ElementExtremeValue
variable = 'vel_y'
value_type = min
[]
[max_x_velocity]
type = ElementExtremeValue
variable = 'vel_x'
value_type = max
[]
[min_x_velocity]
type = ElementExtremeValue
variable = 'vel_x'
value_type = min
[]
[max_x_slip_velocity]
type = ElementExtremeFunctorValue
functor = 'vel_slip_x'
value_type = max
[]
[max_y_slip_velocity]
type = ElementExtremeFunctorValue
functor = 'vel_slip_y'
value_type = max
[]
[max_drag_coefficient]
type = ElementExtremeFunctorValue
functor = 'drag_coefficient'
value_type = max
[]
[]
(modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/linear-segregated/radial-baffle-rz/radial-baffle-rz.i)
# Steady inviscid radial outflow through a porous annulus (r < r0) into a region of unit porosity
# (r > r0), separated by a pressure baffle on the cylinder r = r0, in RZ coordinates with x as the
# radial direction. With mass flow per radian m and the friction
# f = mu D U + 0.5 rho F |U| / eps U of LinearFVMomentumFriction, the exact solution is
# U_r = m / (rho r), U_z = 0,
# p = -m^2 / (2 rho eps^2 r^2) - mu D m / (rho eps) ln(r) + F m^2 / (2 rho eps^2 r) + c
# in each region. At the baffle the pressure jumps by the Bernoulli and form-loss terms of
# BernoulliFormLossPressureJump, with the porous side as the lower-porosity reference. The flow is
# inviscid because baffle faces carry no normal viscous stress, which a viscous solution of this
# form would need.
rho = 1
m = 1
eps_bed = 0.4
# Darcy coefficients mu D of each region. Central advection of a divergence-free flow adds almost
# nothing to the momentum diagonal, so without viscosity the friction keeps the momentum systems
# nonsingular, and the plenum needs it too.
darcy_bed = 1
darcy_plenum = 0.5
forchheimer = 2
form_loss = 0.5
r_inner = 1
r_baffle = 1.5
r_outer = 2
height = 0.25
nx = 8
ny = 2
[Problem]
linear_sys_names = 'u_system v_system pressure_system'
previous_nl_solution_required = true
[]
[Mesh]
[generated]
type = GeneratedMeshGenerator
dim = 2
xmin = ${r_inner}
xmax = ${r_outer}
ymax = ${height}
nx = ${nx}
ny = ${ny}
[]
[bed]
type = ParsedSubdomainMeshGenerator
input = generated
combinatorial_geometry = 'x < ${r_baffle}'
block_id = 1
block_name = bed
[]
[plenum]
type = ParsedSubdomainMeshGenerator
input = bed
combinatorial_geometry = 'x > ${r_baffle}'
block_id = 2
block_name = plenum
[]
[baffle]
type = SideSetsBetweenSubdomainsGenerator
input = plenum
primary_block = bed
paired_block = plenum
new_boundary = baffle
[]
coord_type = RZ
rz_coord_axis = Y
[]
[FVGradientMethods]
[jump_aware]
type = FVPressureJumpGreenGaussGradient
[]
[velocity_jump_aware]
type = FVVelocityJumpGreenGaussGradient
[]
[reconstructed]
type = FVReconstructedPressureGradient
base_gradient_method = jump_aware
gradient_relaxation = 1
[]
[]
[FVInterpolationMethods]
[average]
type = FVGeometricAverage
[]
[]
[UserObjects]
[pressure_jump]
type = BernoulliFormLossPressureJump
boundary = baffle
porosity = porosity
density = ${rho}
form_loss = ${form_loss}
[]
[rc]
type = PorousRhieChowMassFlux
u = superficial_u
v = superficial_v
pressure = pressure
rho = ${rho}
porosity = porosity
p_diffusion_kernel = p_diffusion
pressure_projection_method = consistent
pressure_jump_models = pressure_jump
[]
[]
[Variables]
[superficial_u]
type = MooseLinearVariableFVReal
solver_sys = u_system
initial_condition = 0
gradient_method = velocity_jump_aware
[]
[superficial_v]
type = MooseLinearVariableFVReal
solver_sys = v_system
initial_condition = 0
gradient_method = velocity_jump_aware
[]
[pressure]
type = MooseLinearVariableFVReal
solver_sys = pressure_system
initial_condition = 0
gradient_method = jump_aware
[]
[]
[LinearFVKernels]
[u_advection_stress]
type = LinearPWCNSFVMomentumFlux
variable = superficial_u
advected_interp_method_name = average
mu = 0
u = superficial_u
v = superficial_v
momentum_component = x
rhie_chow_user_object = rc
use_nonorthogonal_correction = false
[]
[v_advection_stress]
type = LinearPWCNSFVMomentumFlux
variable = superficial_v
advected_interp_method_name = average
mu = 0
u = superficial_u
v = superficial_v
momentum_component = y
rhie_chow_user_object = rc
use_nonorthogonal_correction = false
[]
[u_pressure]
type = LinearPWCNSFVMomentumPressure
variable = superficial_u
pressure = pressure
porosity = porosity
momentum_component = x
gradient_method = reconstructed
[]
[v_pressure]
type = LinearPWCNSFVMomentumPressure
variable = superficial_v
pressure = pressure
porosity = porosity
momentum_component = y
gradient_method = reconstructed
[]
[u_friction]
type = LinearFVMomentumFriction
variable = superficial_u
Darcy_name = darcy
Forchheimer_name = forchheimer
mu = 1
rho = ${rho}
porosity = porosity
u = superficial_u
v = superficial_v
momentum_component = x
[]
[v_friction]
type = LinearFVMomentumFriction
variable = superficial_v
Darcy_name = darcy
Forchheimer_name = forchheimer
mu = 1
rho = ${rho}
porosity = porosity
u = superficial_u
v = superficial_v
momentum_component = y
[]
[p_diffusion]
type = LinearFVPressureCorrectionDiffusionJump
variable = pressure
rhie_chow_user_object = rc
use_nonorthogonal_correction = false
[]
[HbyA_divergence]
type = LinearFVDivergence
variable = pressure
face_flux = HbyA
force_boundary_execution = true
[]
[]
[LinearFVBCs]
[velocity_x]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left right top bottom'
variable = superficial_u
functor = exact_u
[]
[velocity_y]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left right top bottom'
variable = superficial_v
functor = 0
[]
[pressure_flux]
type = LinearFVPressureFluxBC
boundary = 'left right top bottom'
variable = pressure
HbyA_flux = HbyA
Ainv = Ainv
rho = ${rho}
u = superficial_u
v = superficial_v
[]
[]
[FunctorMaterials]
[porosity]
type = PiecewiseByBlockFunctorMaterial
prop_name = porosity
subdomain_to_prop_value = 'bed ${eps_bed} plenum 1'
[]
[friction_bed]
type = GenericVectorFunctorMaterial
prop_names = 'darcy forchheimer'
prop_values = '${darcy_bed} ${darcy_bed} ${darcy_bed} ${forchheimer} ${forchheimer} ${forchheimer}'
block = bed
[]
[friction_plenum]
type = GenericVectorFunctorMaterial
prop_names = 'darcy forchheimer'
prop_values = '${darcy_plenum} ${darcy_plenum} ${darcy_plenum} 0 0 0'
block = plenum
[]
[pressure_difference]
type = ParsedFunctorMaterial
property_name = pressure_difference
functor_names = 'pressure exact_pressure'
expression = 'pressure-exact_pressure'
[]
# The pin fixes the pressure of the cell containing the pin point, so the computed pressure is
# compared after removing the mean difference to the exact pressure.
[shifted_pressure]
type = ParsedFunctorMaterial
property_name = shifted_pressure
functor_names = 'pressure mean_pressure_difference'
expression = 'pressure-mean_pressure_difference'
[]
[pressure_error]
type = ParsedFunctorMaterial
property_name = pressure_error
functor_names = 'shifted_pressure exact_pressure'
expression = 'shifted_pressure-exact_pressure'
[]
[u_error]
type = ParsedFunctorMaterial
property_name = u_error
functor_names = 'superficial_u exact_u'
expression = 'superficial_u-exact_u'
[]
[]
[Functions]
[exact_u]
type = ParsedFunction
expression = '${m}/(${rho}*x)'
[]
[bed_pressure]
type = ParsedFunction
expression = '-${m}^2/(2*${rho}*${eps_bed}^2*x^2) - ${darcy_bed}*${m}/(${rho}*${eps_bed})*log(x) '
'+ ${forchheimer}*${m}^2/(2*${rho}*${eps_bed}^2*x)'
[]
[plenum_pressure]
type = ParsedFunction
expression = '-${m}^2/(2*${rho}*x^2) - ${darcy_plenum}*${m}/${rho}*log(x)'
[]
# p_plenum(r0) - p_bed(r0) = 0.5 rho u0^2 (1/eps_bed^2 - 1) - 0.5 K rho (u0/eps_bed)^2 with
# u0 = m / (rho r0).
[exact_pressure]
type = ParsedFunction
symbol_names = 'pb pp u0'
symbol_values = 'bed_pressure plenum_pressure ${fparse m / (rho * r_baffle)}'
expression = 'if(x < ${r_baffle}, pb, pp + '
'(-${m}^2/(2*${rho}*${eps_bed}^2*${r_baffle}^2) - ${darcy_bed}*${m}/(${rho}*${eps_bed})*log(${r_baffle}) '
'+ ${forchheimer}*${m}^2/(2*${rho}*${eps_bed}^2*${r_baffle}) + ${m}^2/(2*${rho}*${r_baffle}^2) '
'+ ${darcy_plenum}*${m}/${rho}*log(${r_baffle})) '
'+ 0.5*${rho}*u0^2*(1/${eps_bed}^2 - 1) - 0.5*${form_loss}*${rho}*(u0/${eps_bed})^2)'
[]
[]
[Executioner]
type = SIMPLE
momentum_l_abs_tol = 1e-12
pressure_l_abs_tol = 1e-12
momentum_l_tol = 0
pressure_l_tol = 0
momentum_l_max_its = 100
pressure_l_max_its = 100
rhie_chow_user_object = rc
momentum_systems = 'u_system v_system'
pressure_system = pressure_system
# Without viscosity nothing damps round-off in the axial velocity, and at a momentum relaxation
# of 0.5 the iteration amplifies it by about 1% per iteration on the twice-refined mesh.
momentum_equation_relaxation = 0.3
pressure_variable_relaxation = 0.2
num_iterations = 3000
pressure_absolute_tolerance = 1e-9
# The exact axial velocity is zero, so the axial momentum system has a vanishing normalization
# factor and its normalized residual stays O(1e-2) at round-off. Its tolerance is therefore not
# used as a convergence criterion; L2v checks the axial velocity instead.
momentum_absolute_tolerance = '1e-9 1'
momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
momentum_petsc_options_value = 'hypre boomeramg'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
pressure_petsc_options_value = 'hypre boomeramg'
print_fields = false
pin_pressure = true
pressure_pin_value = 0
pressure_pin_point = '${fparse 0.5 * (r_baffle + r_outer)} ${fparse 0.5 * height} 0'
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
[]
[]
[Postprocessors]
[mean_pressure_difference]
type = ElementAverageFunctorPostprocessor
functor = pressure_difference
execute_on = FINAL
# Must run before the pressure errors that subtract it.
execution_order_group = -1
outputs = none
[]
[h]
type = AverageElementSize
execute_on = FINAL
[]
[L2u]
type = ElementL2FunctorError
approximate = superficial_u
exact = exact_u
execute_on = FINAL
[]
[L2v]
type = ElementL2FunctorError
approximate = superficial_v
exact = 0
execute_on = FINAL
[]
[L2p]
type = ElementL2FunctorError
approximate = shifted_pressure
exact = exact_pressure
execute_on = FINAL
[]
# The maximum pointwise errors detect cell-to-cell oscillations that the L2 norms average out.
[max_u_error]
type = ElementExtremeFunctorValue
functor = u_error
value_type = max_abs
execute_on = FINAL
[]
[max_v_error]
type = ElementExtremeFunctorValue
functor = superficial_v
value_type = max_abs
execute_on = FINAL
[]
[max_p_error]
type = ElementExtremeFunctorValue
functor = pressure_error
value_type = max_abs
execute_on = FINAL
[]
[]
(modules/heat_transfer/test/tests/functormaterials/churchill_chu_htc/churchill_chu_htc.i)
k_fluid = 0.05
dia = 0.02
Gr = 8e5
Pr = 0.7
[Mesh]
type = GeneratedMesh
dim = 1
nx = 1
[]
[FunctorMaterials]
[CC_htc]
type = ADChurchillChuHTCFunctorMaterial
Pr = ${Pr}
Gr = ${Gr}
k_fluid = ${k_fluid}
diameter = ${dia}
htc_name = htc
[]
[]
[Postprocessors]
[htc]
type = ADElementExtremeFunctorValue
functor = htc
execute_on = 'INITIAL'
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[Outputs]
csv = true
execute_on = 'INITIAL'
[]
(test/tests/functormaterials/functor_change/time_step.i)
# Solves the IVP
#
# dU/dt = -C U
# U(0) = U0
C = 1.0
U0 = 1.0
[Mesh]
type = GeneratedMesh
dim = 1
nx = 1
[]
[Variables]
[U]
initial_condition = ${U0}
[]
[]
[Kernels]
[time_derivative]
type = TimeDerivative
variable = U
[]
[source]
type = Reaction
variable = U
rate = ${C}
[]
[]
[FunctorMaterials]
[mat]
type = ADFunctorChangeFunctorMaterial
functor = U
change_over = time_step
take_absolute_value = false
prop_name = U_change
[]
[]
[Postprocessors]
[U_avg]
type = AverageNodalVariableValue
variable = U
execute_on = 'INITIAL TIMESTEP_END'
[]
[U_max_change]
type = ElementExtremeFunctorValue
functor = U_change
value_type = max
execute_on = 'INITIAL TIMESTEP_END'
[]
[]
[Executioner]
type = Transient
dt = 1.0
num_steps = 5
solve_type = NEWTON
[]
[Outputs]
csv = true
[]
(modules/navier_stokes/test/tests/functormaterials/torchscript_profile_functor_material/transient.i)
# Regression test for the execute_on schedule of TorchScript1DProfileFunctorMaterial.
#
# The model inputs come from time-varying postprocessors (a_in = 10 + t and
# b_in = 5 - t). With execute_on = timestep_begin the material re-runs inference
# at the start of every step, so the published profiles track the inputs instead
# of staying frozen at their initial-setup values.
#
# profile_direction is perpendicular to the 1D mesh, so the profile coordinate
# s = 0 at every point and each functor reduces to its station-0 value (the raw
# model input a or b). The sampled value is therefore independent of position,
# and the reporters below equal the model inputs exactly.
#
# timestepSetup() runs before the timestep-begin postprocessors are recomputed
# (TransientBase::takeStep advances time, calls timestepSetup(), then
# onTimestepBegin()), so each step rebuilds the profiles from the input value as
# it stood at the *start* of the step -- a one-step visibility lag. The gold
# therefore shows profile_a_value = 10 then 11 (not 11 then 12) across the steps
# at t = 1 and t = 2.
[Mesh]
type = GeneratedMesh
dim = 1
nx = 4
xmin = 2
xmax = 6
[]
[Functions]
[a_func]
type = ParsedFunction
expression = '10 + t'
[]
[b_func]
type = ParsedFunction
expression = '5 - t'
[]
[]
[UserObjects]
[profile_network]
type = TorchScriptUserObject
filename = two_profiles.pt
load_during_construction = true
execute_on = NONE
[]
[]
[FunctorMaterials]
[profiles]
type = TorchScript1DProfileFunctorMaterial
torch_script_userobject = profile_network
input_names = 'a_in b_in'
profile_names = 'profile_a profile_b'
profile_coordinates = '0 1 2'
profile_origin = '0 0 0'
profile_direction = '0 1 0'
tensor_dtype = float64
execute_on = 'timestep_begin'
[]
[]
[Postprocessors]
[a_in]
type = FunctionValuePostprocessor
function = a_func
execute_on = 'INITIAL TIMESTEP_BEGIN'
outputs = none
[]
[b_in]
type = FunctionValuePostprocessor
function = b_func
execute_on = 'INITIAL TIMESTEP_BEGIN'
outputs = none
[]
[profile_a_value]
type = ADElementExtremeFunctorValue
functor = profile_a
value_type = max
execute_on = TIMESTEP_END
[]
[profile_b_value]
type = ADElementExtremeFunctorValue
functor = profile_b
value_type = max
execute_on = TIMESTEP_END
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Transient
start_time = 0
dt = 1
num_steps = 2
[]
[Outputs]
csv = true
execute_on = 'TIMESTEP_END'
[]
(modules/navier_stokes/test/tests/finite_volume/ins/pump/pump_and_counterpump_loop.i)
mu = 1.0
rho = 1.0
[Mesh]
[gen]
type = CartesianMeshGenerator
dim = 2
dx = '0.1 0.8 0.1'
dy = '0.1 0.8 0.1'
ix = '5 20 5'
iy = '5 20 5'
subdomain_id = '1 1 1
1 2 1
1 1 1'
[]
[delete_internal_part]
type = BlockDeletionGenerator
input = gen
block = '2'
new_boundary = 'wall-internal'
[]
[lump_bdries_to_wall]
type = RenameBoundaryGenerator
input = delete_internal_part
old_boundary = 'bottom right top left'
new_boundary = 'wall-external wall-external wall-external wall-external'
[]
[pump_1_domain]
type = ParsedSubdomainMeshGenerator
input = lump_bdries_to_wall
combinatorial_geometry = 'x > 0.3 & x < 0.4 & y > 0.5'
block_id = '3'
[]
[pump_2_domain]
type = ParsedSubdomainMeshGenerator
input = pump_1_domain
combinatorial_geometry = 'x > 0.5 & y > 0.3 & y < 0.4'
block_id = '4'
[]
[rename_blocks]
type = RenameBlockGenerator
input = pump_2_domain
old_block = '1 3 4'
new_block = 'pipe pump_1 pump_2'
[]
[side_pump]
type = ParsedGenerateSideset
input = rename_blocks
included_subdomains = 'pump_1'
included_neighbors = 'pipe'
new_sideset_name = 'pump_side'
normal = '1 0 0'
combinatorial_geometry = 'x > 0.35'
[]
[]
[GlobalParams]
velocity_interp_method = 'rc'
advected_interp_method = 'upwind'
rhie_chow_user_object = 'rc'
[]
[Problem]
material_coverage_check = False
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = vel_x
v = vel_y
pressure = pressure
correct_volumetric_force = true
volumetric_force_functors = 'pump_volume_force_1 pump_volume_force_2'
[]
[]
[Variables]
[vel_x]
type = INSFVVelocityVariable
initial_condition = 1
[]
[vel_y]
type = INSFVVelocityVariable
initial_condition = 1
[]
[pressure]
type = INSFVPressureVariable
[]
[lambda]
family = SCALAR
order = FIRST
[]
[]
[AuxVariables]
[U]
order = CONSTANT
family = MONOMIAL
fv = true
[]
[]
[AuxKernels]
[mag]
type = VectorMagnitudeAux
variable = U
x = vel_x
y = vel_y
[]
[]
[FVKernels]
[mass]
type = INSFVMassAdvection
variable = pressure
rho = ${rho}
[]
[mean_zero_pressure]
type = FVIntegralValueConstraint
variable = pressure
lambda = lambda
phi0 = 0.0
[]
[u_advection]
type = INSFVMomentumAdvection
variable = vel_x
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = vel_x
mu = ${mu}
momentum_component = 'x'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = vel_x
momentum_component = 'x'
pressure = pressure
[]
[u_pump_1]
type = INSFVPump
variable = vel_x
momentum_component = 'x'
pump_volume_force = 'pump_volume_force_1'
block = 'pump_1'
[]
[v_advection]
type = INSFVMomentumAdvection
variable = vel_y
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = vel_y
mu = ${mu}
momentum_component = 'y'
[]
[v_pressure]
type = INSFVMomentumPressure
variable = vel_y
momentum_component = 'y'
pressure = pressure
[]
[u_pump_2]
type = INSFVPump
variable = vel_y
momentum_component = 'y'
pump_volume_force = 'pump_volume_force_2'
block = 'pump_2'
[]
[]
[FVBCs]
[walls-u]
type = INSFVNoSlipWallBC
boundary = 'wall-internal wall-external'
variable = vel_x
function = '0'
[]
[walls-v]
type = INSFVNoSlipWallBC
boundary = 'wall-internal wall-external'
variable = vel_y
function = '0'
[]
[]
[Functions]
[pump_head]
type = PiecewiseLinear
x = '0.0 10.0'
y = '1000.0 0.0'
[]
[]
[FunctorMaterials]
[pump_mat_1]
type = NSFVPumpFunctorMaterial
rho = ${rho}
speed = 'U'
pressure_head_function = 'pump_head'
rotation_speed = 120
rotation_speed_rated = 100
area_rated = 0.1
volume_rated = 0.01
flow_rate_rated = 1.0
flow_rate = 'flow_rate'
block = 'pump_1'
pump_force_name = 'pump_volume_force_1'
[]
[pump_mat_2]
type = NSFVPumpFunctorMaterial
rho = ${rho}
speed = 'U'
pressure_head_function = 'pump_head'
rotation_speed = 50
rotation_speed_rated = 100
area_rated = 0.1
volume_rated = 0.01
flow_rate_rated = 1.0
flow_rate = 'flow_rate'
block = 'pump_2'
pump_force_name = 'pump_volume_force_2'
[]
[]
[Postprocessors]
[flow_rate]
type = Receiver
default = 1.0
[]
[flow_rate_to_pipe]
type = VolumetricFlowRate
advected_quantity = ${rho}
boundary = 'pump_side'
vel_x = 'vel_x'
vel_y = 'vel_y'
[]
[maximum_speed]
type = ADElementExtremeFunctorValue
functor = vel_x
value_type = max
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
nl_rel_tol = 1e-12
[]
[Outputs]
exodus = false
[out]
type = CSV
execute_on = FINAL
show = 'flow_rate_to_pipe maximum_speed'
[]
[]
(modules/navier_stokes/test/tests/functormaterials/torchscript_profile_functor_material/profile.i)
[Mesh]
type = GeneratedMesh
dim = 1
nx = 4
xmin = 2
xmax = 6
[]
[UserObjects]
[profile_network]
type = TorchScriptUserObject
filename = two_profiles.pt
load_during_construction = true
execute_on = NONE
[]
[]
[FunctorMaterials]
[profiles]
type = TorchScript1DProfileFunctorMaterial
torch_script_userobject = profile_network
input_values = '10 5'
profile_names = 'profile_a profile_b'
profile_coordinates = '0 1 2'
profile_origin = '2 0 0'
profile_direction = '2 0 0'
coordinate_scale = 2
out_of_range_behavior = error
[]
[]
[Postprocessors]
[a_max]
type = ADElementExtremeFunctorValue
functor = profile_a
value_type = max
execute_on = INITIAL
[]
[a_min]
type = ADElementExtremeFunctorValue
functor = profile_a
value_type = min
execute_on = INITIAL
[]
[b_max]
type = ADElementExtremeFunctorValue
functor = profile_b
value_type = max
execute_on = INITIAL
[]
[b_min]
type = ADElementExtremeFunctorValue
functor = profile_b
value_type = min
execute_on = INITIAL
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[Outputs]
csv = true
execute_on = INITIAL
[]
(modules/heat_transfer/test/tests/functormaterials/fin_enhancement_factor/fin_enhancement_factor.i)
[Mesh]
type = GeneratedMesh
dim = 1
nx = 1
[]
[FunctorMaterials]
[fin_fmat]
type = FinEnhancementFactorFunctorMaterial
fin_efficiency = 0.6
fin_area_fraction = 0.95
area_increase_factor = 5.0
fin_enhancement_factor_name = factor
[]
[]
[Postprocessors]
[fin_enhancement_factor]
type = ElementExtremeFunctorValue
functor = factor
execute_on = 'INITIAL'
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[Outputs]
csv = true
execute_on = 'INITIAL'
[]
(modules/navier_stokes/test/tests/finite_volume/two_phase/mixture_model/segregated/rayleigh-bernard-two-phase-physics.i)
mu = 1.0
rho = 1e3
mu_d = 0.3
rho_d = 1.0
dp = 0.01
U_lid = 0.0
g = -9.81
advected_interp_method = 'upwind'
# Currently required
k = 1
k_d = 1
cp = 1
cp_d = 1
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = .1
ymin = 0
ymax = .1
nx = 11
ny = 11
[]
[]
[Problem]
linear_sys_names = 'u_system v_system pressure_system phi_system'
[]
[Physics]
[NavierStokes]
[FlowSegregated]
[flow]
compressibility = 'incompressible'
density = 'rho_mixture'
dynamic_viscosity = 'mu_mixture'
gravity = '0 ${g} 0'
# Initial conditions
initial_velocity = '1e-12 1e-12 0'
initial_pressure = 0.2
wall_boundaries = 'top left right bottom'
momentum_wall_types = 'noslip noslip noslip noslip'
momentum_wall_functors = '${U_lid} 0; 0 0; 0 0; 0 0'
orthogonality_correction = false
pressure_two_term_bc_expansion = true
momentum_advection_interpolation = ${advected_interp_method}
[]
[]
[TwoPhaseMixtureSegregated]
[mixture]
system_names = 'phi_system'
phase_1_fraction_name = 'phase_1'
phase_2_fraction_name = 'phase_2'
add_phase_transport_equation = true
phase_advection_interpolation = '${advected_interp_method}'
phase_fraction_diffusivity = 1e-3
# We could consider adding fixed-value-yet-not-an-inlet
# boundary conditions to the TwoPhaseMixture physics
# Base phase material properties
phase_1_density_name = ${rho}
phase_1_viscosity_name = ${mu}
phase_1_specific_heat_name = ${cp}
phase_1_thermal_conductivity_name = ${k}
# Other phase material properties
phase_2_density_name = ${rho_d}
phase_2_viscosity_name = ${mu_d}
phase_2_specific_heat_name = ${cp_d}
phase_2_thermal_conductivity_name = ${k_d}
output_all_properties = true
# Friction model, not actually used!
use_dispersed_phase_drag_model = true
particle_diameter = ${dp}
add_advection_slip_term = false
# To match Rayleigh Bernard nonlinear test setup
add_gravity_term_in_slip_velocity = false
[]
[]
[]
[]
[LinearFVBCs]
[botttom-phase-2]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'bottom'
variable = phase_2
functor = '1'
[]
[top-phase-2]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'top'
variable = phase_2
functor = '0'
[]
[]
[Executioner]
type = PIMPLE
rhie_chow_user_object = 'ins_rhie_chow_interpolator'
end_time = 1e8
[TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 10
iteration_window = 2
growth_factor = 2
cutback_factor = 0.5
dt = 1e-3
[]
# Systems
momentum_systems = 'u_system v_system'
pressure_system = 'pressure_system'
active_scalar_systems = 'phi_system'
momentum_equation_relaxation = 0.8
active_scalar_equation_relaxation = '0.7'
pressure_variable_relaxation = 0.3
# We need to converge the problem to show conservation
num_iterations = 200
pressure_absolute_tolerance = 1e-10
momentum_absolute_tolerance = 1e-10
active_scalar_absolute_tolerance = '1e-10'
momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
momentum_petsc_options_value = 'hypre boomeramg'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
pressure_petsc_options_value = 'hypre boomeramg'
active_scalar_petsc_options_iname = '-pc_type -pc_factor_shift_type' # -pc_hypre_type'
active_scalar_petsc_options_value = 'lu NONZERO'
momentum_l_abs_tol = 1e-13
pressure_l_abs_tol = 1e-13
active_scalar_l_abs_tol = 1e-13
momentum_l_tol = 0
pressure_l_tol = 0
active_scalar_l_tol = 0
# print_fields = true
continue_on_max_its = true
pin_pressure = true
pressure_pin_value = 0.0
pressure_pin_point = '0.0 0.0 0.0'
[]
[Outputs]
exodus = false
[out]
type = CSV
execute_on = 'FINAL'
[]
[]
[AuxVariables]
[U]
order = CONSTANT
family = MONOMIAL
fv = true
[]
[]
[Postprocessors]
[average_void]
type = ElementAverageValue
variable = 'phase_2'
[]
[max_y_velocity]
type = ElementExtremeValue
variable = 'vel_y'
value_type = max
[]
[min_y_velocity]
type = ElementExtremeValue
variable = 'vel_y'
value_type = min
[]
[max_x_velocity]
type = ElementExtremeValue
variable = 'vel_x'
value_type = max
[]
[min_x_velocity]
type = ElementExtremeValue
variable = 'vel_x'
value_type = min
[]
[max_x_slip_velocity]
type = ElementExtremeFunctorValue
functor = 'vel_slip_x'
value_type = max
[]
[max_y_slip_velocity]
type = ElementExtremeFunctorValue
functor = 'vel_slip_y'
value_type = max
[]
[max_drag_coefficient_x]
type = ElementExtremeFunctorValue
functor = 'Darcy_coefficient_vec_out_x'
value_type = max
[]
[max_drag_coefficient_y]
type = ElementExtremeFunctorValue
functor = 'Darcy_coefficient_vec_out_y'
value_type = max
[]
[]
(modules/heat_transfer/test/tests/functormaterials/P1_radiation/P1_radiation_material_test.i)
opacity = 1.0
P1_sigma_scattering = 1.0
[Mesh]
type = GeneratedMesh
dim = 1
nx = 1
[]
[FunctorMaterials]
[diff_coef_non_AD]
type = RadiativeP1DiffusionCoefficientMaterial
opacity = ${opacity}
sigma_scat_eff = ${P1_sigma_scattering}
P1_diff_coef_name = 'diff_coef_non_AD'
[]
[diff_coef_AD]
type = ADRadiativeP1DiffusionCoefficientMaterial
opacity = ${opacity}
sigma_scat_eff = ${P1_sigma_scattering}
P1_diff_coef_name = 'diff_coef_AD'
[]
[]
[Postprocessors]
[value_non_AD]
type = ElementExtremeFunctorValue
functor = 'diff_coef_non_AD'
execute_on = 'initial'
[]
[value_AD]
type = ADElementExtremeFunctorValue
functor = 'diff_coef_AD'
execute_on = 'initial'
[]
[relative_difference]
type = RelativeDifferencePostprocessor
value1 = value_non_AD
value2 = value_AD
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[Outputs]
csv = true
execute_on = 'INITIAL'
[]
(modules/heat_transfer/test/tests/radiation_participating_media/rad_T_coupled_medium_1d_T.i)
# The test guarantees that the P1 radiation model in the Linear FV system using the linear system solver
# can be used with MultiApps. The solution update of the energy system is relaxed to improve convergence
# of the coupled energy and radiative systems.
# This simulation is a 1D test with Dirichlet BCs on the left and right of the domain. Marshak BCs are
# applied at the boundaries for G.
k = 1.0
sigma_a = 0.33333
r_wall_temp = 400.0
l_wall_temp = 300.0
[Mesh]
[salt_mesh]
type = GeneratedMeshGenerator
dim = 1
nx = 100
xmin = -0.5
xmax = 0.5
[]
[]
[Problem]
linear_sys_names = 'energy_system'
previous_nl_solution_required = true
[]
[Variables]
[T]
type = MooseLinearVariableFVReal
solver_sys = 'energy_system'
initial_condition = 350
[]
[]
[AuxVariables]
[G]
type = MooseLinearVariableFVReal
initial_condition = 3400
[]
[]
[LinearFVKernels]
[temp_conduction]
type = LinearFVDiffusion
diffusion_coeff = ${k}
variable = T
[]
[temp_radiation]
type = LinearFVP1TemperatureSourceSink
variable = T
G = 'G'
absorption_coeff = ${sigma_a}
[]
[]
[LinearFVBCs]
[left_bc_T]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = T
boundary = 'left'
functor = ${l_wall_temp}
[]
[right_bc_T]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = T
boundary = 'right'
functor = ${r_wall_temp}
[]
[]
[Postprocessors]
[mean_value_G]
type = ElementIntegralFunctorPostprocessor
functor = G
[]
[max_value_G]
type = ElementExtremeFunctorValue
functor = G
[]
[mean_value_T]
type = ElementIntegralFunctorPostprocessor
functor = T
[]
[max_value_T]
type = ElementExtremeFunctorValue
functor = T
[]
[]
[Executioner]
type = Steady
solve_type = 'Linear'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
l_abs_tol = 1e-14
l_tol = 1e-14
nl_abs_tol = 1e-14
# MultiApp fixed point iteration parameters
fixed_point_min_its = 2
fixed_point_max_its = 500
relaxation_factor = 0.9
transformed_variables = 'T'
fixed_point_rel_tol = 1e-12
fixed_point_abs_tol = 1e-12
[]
[Outputs]
csv = true
exodus = true
execute_on = timestep_end
[]
[MultiApps]
[sub_app]
type = FullSolveMultiApp
input_files = 'rad_T_coupled_medium_1d_G.i'
[]
[]
[Transfers]
[push]
type = MultiAppCopyTransfer
to_multi_app = sub_app
source_variable = 'T'
variable = 'T'
[]
[pull]
type = MultiAppCopyTransfer
from_multi_app = sub_app
source_variable = 'G'
variable = 'G'
[]
[]
(modules/heat_transfer/test/tests/fvbcs/fv_marshak_bc/rad_istothermal_medium_1d.i)
# The test gurantees that Marshak BCs yield the expected constant 1D solution
diffusion_coef = 1e-12
opacity = 1.0
temperature_radiation = 100.0
wall_temperature = ${fparse temperature_radiation / (4^(1/4))}
G_bc = 1.0
sigma = 5.670374419e-8
[Mesh]
[mesh]
type = GeneratedMeshGenerator
dim = 1
nx = 50
[]
[]
[Variables]
[G]
type = MooseVariableFVReal
initial_condition = 1
[]
[]
[FVKernels]
[G_diffusion]
type = FVDiffusion
variable = G
coeff = ${diffusion_coef}
[]
[source_and_sink]
type = FVThermalRadiationSourceSink
variable = G
temperature_radiation = ${temperature_radiation}
opacity = ${opacity}
[]
[]
[FVBCs]
[right_bc]
type = FVMarshakRadiativeBC
boundary = 'right'
variable = G
temperature_radiation = ${wall_temperature}
coeff_diffusion = ${diffusion_coef}
boundary_emissivity = 1.0
[]
[]
[Functions]
[analytical_sol]
type = ParsedFunction
symbol_names = 'a'
symbol_values = '${fparse sqrt(opacity / diffusion_coef)}'
expression = '${G_bc} * cosh(a*x) / cosh(a) + ${sigma} * ${temperature_radiation}^4 * (1.0 - cosh(a*x) / cosh(a))'
[]
[]
[Postprocessors]
[mean_value]
type = ElementIntegralFunctorPostprocessor
functor = G
[]
[max_value]
type = ElementExtremeFunctorValue
functor = G
[]
[relative_difference]
type = ParsedPostprocessor
pp_names = 'mean_value max_value'
expression = '(max_value / mean_value - 1.0) / mean_value'
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
nl_abs_tol = 1e-12
[]
[Outputs]
exodus = false
csv = true
[]
(test/tests/functormaterials/functor_change/multisystem_fp.i)
!include ../../multisystem/picard/nonlinearfe_nonlinearfe/multi_system.i
[AuxVariables]
[ucopy]
[]
[]
[AuxKernels]
[ucopy_kernel]
type = CopyValueAux
variable = ucopy
source = u
execute_on = 'MULTISYSTEM_FIXED_POINT_ITERATION_END'
[]
[]
[FunctorMaterials]
[u_change_mat]
type = ADFunctorChangeFunctorMaterial
functor = u
change_over = multisystem_fixed_point
take_absolute_value = false
prop_name = u_change
[]
[ucopy_change_mat]
type = ADFunctorChangeFunctorMaterial
functor = ucopy
change_over = multisystem_fixed_point
take_absolute_value = false
prop_name = ucopy_change
[]
[]
[Postprocessors]
[u_change_max]
type = ElementExtremeFunctorValue
functor = u_change
value_type = max
execute_on = 'MULTISYSTEM_FIXED_POINT_ITERATION_END'
[]
[ucopy_change_max]
type = ElementExtremeFunctorValue
functor = ucopy_change
value_type = max
force_postaux = true
execute_on = 'MULTISYSTEM_FIXED_POINT_ITERATION_END'
[]
[]
[Convergence]
[u_change_conv]
type = MultiPostprocessorConvergence
postprocessors = 'u_change_max ucopy_change_max'
tolerances = '1e-6 1e-6'
max_iterations = 10
verbose = true
[]
[]
[Executioner]
multi_system_fixed_point_convergence := u_change_conv
[]
[Outputs]
file_base := multisystem_fp
[]
(modules/navier_stokes/test/tests/finite_volume/wcns/materials/enthalpy_computation.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 2
ymin = 0
ymax = 1
nx = 5
ny = 5
[]
[]
[AuxVariables]
[pressure]
type = INSFVPressureVariable
[]
[T_fluid]
type = INSFVEnergyVariable
[]
[]
[FVICs]
[p]
type = FVFunctionIC
variable = 'pressure'
function = '1e5 + 1e4 * x + 5e3 * y'
[]
[T]
type = FVFunctionIC
variable = T_fluid
function = '300 + 20 * x + 100 * y'
[]
[]
[FluidProperties]
[fp]
type = LeadBismuthFluidProperties
[]
[]
[FunctorMaterials]
[fluid_props_to_mat_props]
type = GeneralFunctorFluidProps
fp = fp
pressure = 'pressure'
T_fluid = 'T_fluid'
speed = '1'
# For porous flow
characteristic_length = 2
porosity = 1
[]
[compute_cp]
type = INSFVEnthalpyFunctorMaterial
# Use these for non constant cp
# fp = fp
# pressure = 'pressure'
temperature = 'T_fluid'
cp = 'cp'
rho = 'rho'
[]
[]
T_mo = 398
[Postprocessors]
[min_T]
type = ElementExtremeFunctorValue
value_type = 'min'
functor = 'T_fluid'
[]
[max_T]
type = ElementExtremeFunctorValue
functor = 'T_fluid'
[]
[min_h]
type = ElementExtremeFunctorValue
value_type = 'min'
functor = 'h'
[]
[max_h]
type = ElementExtremeFunctorValue
value_type = 'max'
functor = 'h'
[]
[min_rho_h]
type = ElementExtremeFunctorValue
value_type = 'min'
functor = 'rho_h'
[]
[max_rho_h]
type = ElementExtremeFunctorValue
value_type = 'max'
functor = 'rho_h'
[]
[expected_min_h]
type = ParsedPostprocessor
expression = '164.8 * (min_T - T_mo) - 1.97e-2 * (min_T * min_T - T_mo * T_mo) +
(1.25e-5 / 3) * (min_T * min_T * min_T - T_mo * T_mo * T_mo) + 4.56e+5 * (1. / min_T - 1. / T_mo)'
pp_names = 'min_T'
constant_names = 'T_mo'
constant_expressions = '${T_mo}'
[]
[expected_max_h]
type = ParsedPostprocessor
expression = '164.8 * (max_T - T_mo) - 1.97e-2 * (max_T * max_T - T_mo * T_mo) +
(1.25e-5 / 3) * (max_T * max_T * max_T - T_mo * T_mo * T_mo) + 4.56e+5 * (1. / max_T - 1. / T_mo)'
pp_names = 'max_T'
constant_names = 'T_mo'
constant_expressions = '${T_mo}'
[]
[]
[Executioner]
type = Transient
end_time = 0.1
dt = 0.1
[]
[Outputs]
csv = true
hide = 'min_T max_T'
[]
[Problem]
solve = false
[]
(modules/navier_stokes/test/tests/finite_volume/pins/mms/linear-segregated/smooth-properties/smooth-properties.i)
# Manufactured solution with continuously varying density and viscosity, optionally crossed by a
# pressure baffle with a porosity jump. In coordinates normal (xn) and tangent (xt) to the line
# x - skew * y = 0.5:
# - rho = 1 + xn/2 + xt/4 + xn xt/5 and mu = mu0 (m0 + 4 xn^2)(1 + xt^2) are smooth. With m0 = 0.05
# the viscosity varies by a factor of 40 across the domain and by a factor of several between
# neighboring cells on the coarse meshes.
# - rho U = curl(psi), psi = xt/2 + xt^2/10 + eps (xn (xt/10 - 3/10) + xn^2/5), so the mass flux is
# divergence-free. U.n is continuous across xn = 0 and U_t jumps with eps, while the interstitial
# tangential velocity U_t / eps is continuous.
# - The pressure is smooth on each side. With a baffle, the right side adds the
# BernoulliFormLossPressureJump evaluated with the interface density and normal velocity.
# The forcing contains the porous advection div(rho U U / eps), the full stress
# div(mu (grad U + grad U^T - 2/3 div U I)) of superficial velocity, eps grad p, and a reaction k U.
# Without a baffle (baffle = 0), eps_left = eps_right must hold.
# The expressions were generated with sympy.
eps_left = 1
eps_right = 1
form_loss = 0
mu0 = 0.01
m0 = 0.05
reaction = 1
skew = 0
nx = 8
ny = 8
# Set baffle = 1 together with UserObjects/rc/pressure_jump_models=pressure_jump to make the
# interface a pressure baffle; otherwise it is an ordinary internal face.
baffle = 0
deviatoric = true
# Porosity of the side whose interstitial velocity is the form-loss reference: the lower one, the
# BernoulliFormLossPressureJump default.
eps_ref = '${fparse min(eps_left, eps_right)}'
[Problem]
linear_sys_names = 'u_system v_system pressure_system'
previous_nl_solution_required = true
[]
[Mesh]
[generated]
type = GeneratedMeshGenerator
dim = 2
nx = ${nx}
ny = ${ny}
[]
[right]
type = ParsedSubdomainMeshGenerator
input = generated
combinatorial_geometry = 'x > 0.5'
block_id = 2
block_name = right
[]
[left]
type = ParsedSubdomainMeshGenerator
input = right
combinatorial_geometry = 'x < 0.5'
block_id = 1
block_name = left
[]
[skew]
type = ParsedNodeTransformGenerator
input = left
x_function = 'x + ${skew} * y'
[]
[baffle]
type = SideSetsBetweenSubdomainsGenerator
input = skew
primary_block = left
paired_block = right
new_boundary = baffle
[]
[]
[FVGradientMethods]
[jump_aware]
type = FVPressureJumpGreenGaussGradient
[]
[velocity_jump_aware]
type = FVVelocityJumpGreenGaussGradient
[]
# The reconstructed pressure gradient keeps the cell pressure gradient consistent with the face
# fluxes and suppresses odd-even pressure modes.
[reconstructed]
type = FVReconstructedPressureGradient
base_gradient_method = jump_aware
gradient_relaxation = 1
[]
[]
[FVInterpolationMethods]
[average]
type = FVGeometricAverage
[]
[]
[UserObjects]
[pressure_jump]
type = BernoulliFormLossPressureJump
boundary = baffle
porosity = porosity
density = density
form_loss = ${form_loss}
[]
[rc]
type = PorousRhieChowMassFlux
u = superficial_u
v = superficial_v
pressure = pressure
rho = density
porosity = porosity
p_diffusion_kernel = p_diffusion
pressure_projection_method = consistent
[]
[]
[Variables]
[superficial_u]
type = MooseLinearVariableFVReal
solver_sys = u_system
initial_condition = 0
gradient_method = velocity_jump_aware
[]
[superficial_v]
type = MooseLinearVariableFVReal
solver_sys = v_system
initial_condition = 0
gradient_method = velocity_jump_aware
[]
[pressure]
type = MooseLinearVariableFVReal
solver_sys = pressure_system
initial_condition = 0
gradient_method = jump_aware
[]
[]
[LinearFVKernels]
[u_advection_stress]
type = LinearPWCNSFVMomentumFlux
variable = superficial_u
advected_interp_method_name = average
mu = viscosity
u = superficial_u
v = superficial_v
momentum_component = x
rhie_chow_user_object = rc
use_nonorthogonal_correction = true
use_deviatoric_terms = ${deviatoric}
[]
[v_advection_stress]
type = LinearPWCNSFVMomentumFlux
variable = superficial_v
advected_interp_method_name = average
mu = viscosity
u = superficial_u
v = superficial_v
momentum_component = y
rhie_chow_user_object = rc
use_nonorthogonal_correction = true
use_deviatoric_terms = ${deviatoric}
[]
[u_pressure]
type = LinearPWCNSFVMomentumPressure
variable = superficial_u
pressure = pressure
porosity = porosity
momentum_component = x
gradient_method = reconstructed
[]
[v_pressure]
type = LinearPWCNSFVMomentumPressure
variable = superficial_v
pressure = pressure
porosity = porosity
momentum_component = y
gradient_method = reconstructed
[]
[u_source]
type = LinearFVSource
variable = superficial_u
source_density = forcing_u
[]
[v_source]
type = LinearFVSource
variable = superficial_v
source_density = forcing_v
[]
[u_reaction]
type = LinearFVReaction
variable = superficial_u
coeff = ${reaction}
[]
[v_reaction]
type = LinearFVReaction
variable = superficial_v
coeff = ${reaction}
[]
[p_diffusion]
type = LinearFVPressureCorrectionDiffusionJump
variable = pressure
rhie_chow_user_object = rc
use_nonorthogonal_correction = true
[]
[HbyA_divergence]
type = LinearFVDivergence
variable = pressure
face_flux = HbyA
force_boundary_execution = true
[]
[]
[LinearFVBCs]
[velocity_x]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left right top bottom'
variable = superficial_u
functor = exact_u
[]
[velocity_y]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left right top bottom'
variable = superficial_v
functor = exact_v
[]
[pressure_flux]
type = LinearFVPressureFluxBC
boundary = 'left right top bottom'
variable = pressure
HbyA_flux = HbyA
Ainv = Ainv
rho = density
u = superficial_u
v = superficial_v
# The two-term boundary pressure expansion is inaccurate on this nonorthogonal mesh.
use_two_term_expansion = false
[]
[]
[FunctorMaterials]
[density]
type = ParsedFunctorMaterial
property_name = density
functor_names = 'xn xt'
expression = '1+xn/2+xt/4+xn*xt/5'
[]
[viscosity]
type = ParsedFunctorMaterial
property_name = viscosity
functor_names = 'xn xt'
expression = '${mu0}*(${m0}+4*xn^2)*(1+xt^2)'
[]
[porosity]
type = ParsedFunctorMaterial
property_name = porosity
functor_names = 'exact_porosity'
expression = 'exact_porosity'
[]
[pressure_error]
type = ParsedFunctorMaterial
property_name = pressure_error
functor_names = 'pressure exact_pressure'
expression = 'pressure-exact_pressure'
[]
[u_error]
type = ParsedFunctorMaterial
property_name = u_error
functor_names = 'superficial_u exact_u'
expression = 'superficial_u-exact_u'
[]
[v_error]
type = ParsedFunctorMaterial
property_name = v_error
functor_names = 'superficial_v exact_v'
expression = 'superficial_v-exact_v'
[]
[]
[Functions]
[xn]
type = ParsedFunction
expression = '(x-${skew}*y-0.5)/sqrt(1+${skew}^2)'
[]
[xt]
type = ParsedFunction
expression = '(${skew}*x+y)/sqrt(1+${skew}^2)'
[]
# Side indicator: 1 on the right of the interface when it is a baffle, otherwise 0.
[rs]
type = ParsedFunction
expression = 'if(x-${skew}*y>0.5,${baffle},0)'
[]
[exact_porosity]
type = ParsedFunction
expression = 'if(x-${skew}*y<0.5,${eps_left},${eps_right})'
[]
[exact_normal_velocity]
type = ParsedFunction
symbol_names = 'xn xt eps'
symbol_values = 'xn xt exact_porosity'
expression = '2*(eps*xn + 2*xt + 5)/(4*xn*xt + 10*xn + 5*xt + 20)'
[]
[exact_tangential_velocity]
type = ParsedFunction
symbol_names = 'xn xt eps'
symbol_values = 'xn xt exact_porosity'
expression = '2*eps*(-4*xn - xt + 3)/(4*xn*xt + 10*xn + 5*xt + 20)'
[]
[exact_pressure]
type = ParsedFunction
symbol_names = 'xn xt rs el er eref K'
symbol_values = 'xn xt rs ${eps_left} ${eps_right} ${eps_ref} ${form_loss}'
expression = '(el^2*er^2*eref^2*(xt + 4)*((4*xn + 1)^2 + 2*(4*xn + 1)*(2*xt - 1) + 4*(2*xt - 1)^2)/160 - '
'rs*(2*xt + 5)^2*(K*el^2*er^2 + eref^2*(el^2 - er^2))/50)/(el^2*er^2*eref^2*(xt + 4))'
[]
[forcing_normal]
type = ParsedFunction
symbol_names = 'xn xt eps mu0 m0 k'
symbol_values = 'xn xt exact_porosity ${mu0} ${m0} ${reaction}'
expression = '(3*eps^2*(2*xn + xt)*(4*xn*xt + 10*xn + 5*xt + 20)^3 + 60*eps*k*(eps*xn + 2*xt + '
'5)*(4*xn*xt + 10*xn + 5*xt + 20)^2 + 320*eps*mu0*xn*(xt^2 + 1)*(eps*(4*xn + 5)*(4*xn + xt '
'- 3) - 2*(2*xt + 5)*(eps*xn + 2*xt + 5))*(4*xn*xt + 10*xn + 5*xt + 20) + 40*eps*mu0*(m0 + '
'4*xn^2)*(xt^2 + 1)*(2*eps*(16*xn - 1)*(4*xn*xt + 10*xn + 5*xt + 20) - 3*(4*xn + '
'5)*(-2*eps*(2*xt + 5)*(4*xn + xt - 3) + (4*xn + 5)*(eps*xn + 2*xt + 5)) + 12*(2*xt + '
'5)*(eps*(4*xn*xt + 10*xn + 5*xt + 20) - 2*(2*xt + 5)*(eps*xn + 2*xt + 5)) + 4*(2*xt + '
'5)*(-eps*(4*xn + 5)*(4*xn + xt - 3) + 2*(2*xt + 5)*(eps*xn + 2*xt + 5)) - 3*(4*xn*xt + '
'10*xn + 5*xt + 20)*(2*eps*(4*xn + 5) + eps*(2*xt + 5) + 2*eps*(4*xn + xt - 3) - 8*xn - '
'10)) - 120*eps*mu0*(8*xn*(xt^2 + 1)*(eps*(4*xn*xt + 10*xn + 5*xt + 20) - 2*(2*xt + '
'5)*(eps*xn + 2*xt + 5)) + xt*(m0 + 4*xn^2)*(2*eps*(2*xt + 5)*(4*xn + xt - 3) + 2*(1 - '
'2*eps)*(4*xn*xt + 10*xn + 5*xt + 20) - (4*xn + 5)*(eps*xn + 2*xt + 5)))*(4*xn*xt + 10*xn + '
'5*xt + 20) + 6*(eps*(eps*xn - 8*xn + 11)*(4*xn*xt + 10*xn + 5*xt + 20) + (eps*(4*xn + '
'5)*(4*xn + xt - 3) - 2*(2*xt + 5)*(eps*xn + 2*xt + 5))*(eps*xn + 2*xt + 5))*(4*xn*xt + '
'10*xn + 5*xt + 20))/(30*eps*(4*xn*xt + 10*xn + 5*xt + 20)^3)'
[]
[forcing_tangential]
type = ParsedFunction
symbol_names = 'xn xt eps rs el er eref K mu0 m0 k'
symbol_values = 'xn xt exact_porosity rs ${eps_left} ${eps_right} ${eps_ref} ${form_loss} ${mu0} ${m0} ${reaction}'
expression = '(-1200*el^2*eps*er^2*eref^2*k*(xt + 4)^2*(4*xn + xt - 3)*(4*xn*xt + 10*xn + 5*xt + 20)^2 + '
'1600*el^2*er^2*eref^2*mu0*xt*(m0 + 4*xn^2)*(xt + 4)^2*(eps*(4*xn + 5)*(4*xn + xt - 3) - '
'2*(2*xt + 5)*(eps*xn + 2*xt + 5))*(4*xn*xt + 10*xn + 5*xt + 20) + '
'400*el^2*er^2*eref^2*mu0*(m0 + 4*xn^2)*(xt + 4)^2*(xt^2 + 1)*(12*eps*(4*xn + 5)*(-4*xn*xt '
'- 10*xn - 5*xt + (4*xn + 5)*(4*xn + xt - 3) - 20) - 4*(4*xn + 5)*(eps*(4*xn + 5)*(4*xn + '
'xt - 3) - 2*(2*xt + 5)*(eps*xn + 2*xt + 5)) + 12*(2*xt + 5)*(2*eps*(2*xt + 5)*(4*xn + xt - '
'3) - (4*xn + 5)*(eps*xn + 2*xt + 5)) - 2*(4*eps*xn - eps*(4*xn + 5) + 16*xt + 40)*(4*xn*xt '
'+ 10*xn + 5*xt + 20) + 3*(4*xn*xt + 10*xn + 5*xt + 20)*(4*eps*xn + eps*(4*xn + 5) - '
'16*eps*(2*xt + 5) + 16*xt + 40)) - 4800*el^2*er^2*eref^2*mu0*(xt + 4)^2*(eps*xt*(m0 + '
'4*xn^2)*(-4*xn*xt - 10*xn - 5*xt + (4*xn + 5)*(4*xn + xt - 3) - 20) + 2*xn*(xt^2 + '
'1)*(2*eps*(2*xt + 5)*(4*xn + xt - 3) + 2*(1 - 2*eps)*(4*xn*xt + 10*xn + 5*xt + 20) - (4*xn '
'+ 5)*(eps*xn + 2*xt + 5)))*(4*xn*xt + 10*xn + 5*xt + 20) + 120*el^2*er^2*eref^2*(xt + '
'4)^2*(-(eps*(4*xn + 5)*(4*xn + xt - 3) - 2*(2*xt + 5)*(eps*xn + 2*xt + 5))*(4*xn + xt - 3) '
'+ (-4*eps*xn + eps*(4*xn + xt - 3) - 8*xt - 20)*(4*xn*xt + 10*xn + 5*xt + 20))*(4*xn*xt + '
'10*xn + 5*xt + 20) - 3*eps*(5*el^2*er^2*eref^2*(xt + 4)^2*(-4*xn - 8*xt + 3) + 4*rs*(2*xt '
'+ 5)*(4*K*el^2*er^2*(xt + 4) - K*el^2*er^2*(2*xt + 5) + eref^2*(-el^2 + er^2)*(2*xt + 5) + '
'4*eref^2*(el^2 - er^2)*(xt + 4)))*(4*xn*xt + 10*xn + 5*xt + '
'20)^3)/(600*el^2*er^2*eref^2*(xt + 4)^2*(4*xn*xt + 10*xn + 5*xt + 20)^3)'
[]
[exact_u]
type = ParsedFunction
expression = '(un+${skew}*ut)/sqrt(1+${skew}^2)'
symbol_names = 'un ut'
symbol_values = 'exact_normal_velocity exact_tangential_velocity'
[]
[exact_v]
type = ParsedFunction
expression = '(-${skew}*un+ut)/sqrt(1+${skew}^2)'
symbol_names = 'un ut'
symbol_values = 'exact_normal_velocity exact_tangential_velocity'
[]
[forcing_u]
type = ParsedFunction
expression = '(fn+${skew}*ft)/sqrt(1+${skew}^2)'
symbol_names = 'fn ft'
symbol_values = 'forcing_normal forcing_tangential'
[]
[forcing_v]
type = ParsedFunction
expression = '(-${skew}*fn+ft)/sqrt(1+${skew}^2)'
symbol_names = 'fn ft'
symbol_values = 'forcing_normal forcing_tangential'
[]
[]
[Executioner]
type = SIMPLE
momentum_l_abs_tol = 1e-12
pressure_l_abs_tol = 1e-12
momentum_l_tol = 0
pressure_l_tol = 0
momentum_l_max_its = 100
pressure_l_max_its = 100
rhie_chow_user_object = rc
momentum_systems = 'u_system v_system'
pressure_system = pressure_system
momentum_equation_relaxation = 0.5
pressure_variable_relaxation = 0.2
num_iterations = 3000
pressure_absolute_tolerance = 1e-9
momentum_absolute_tolerance = 1e-9
momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
momentum_petsc_options_value = 'hypre boomeramg'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
pressure_petsc_options_value = 'hypre boomeramg'
print_fields = false
# The exact pressure is zero at (xn, xt) = (-1/4, 1/2), on the left side.
pin_pressure = true
pressure_pin_value = 0
pressure_pin_point = '${fparse 0.5 + (-0.25 + skew * (0.5 - 0.5 * skew / sqrt(1 + skew^2))) / sqrt(1 + skew^2)} '
'${fparse (0.25 * skew + 0.5 - 0.5 * skew / sqrt(1 + skew^2)) / sqrt(1 + skew^2)} 0'
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
[]
[]
[Postprocessors]
[h]
type = AverageElementSize
execute_on = FINAL
[]
[L2u]
type = ElementL2FunctorError
approximate = superficial_u
exact = exact_u
execute_on = FINAL
[]
[L2v]
type = ElementL2FunctorError
approximate = superficial_v
exact = exact_v
execute_on = FINAL
[]
[L2p]
type = ElementL2FunctorError
approximate = pressure
exact = exact_pressure
execute_on = FINAL
[]
# The maximum pointwise errors detect cell-to-cell oscillations that the L2 norms average out.
[max_u_error]
type = ElementExtremeFunctorValue
functor = u_error
value_type = max_abs
execute_on = FINAL
[]
[max_v_error]
type = ElementExtremeFunctorValue
functor = v_error
value_type = max_abs
execute_on = FINAL
[]
[max_p_error]
type = ElementExtremeFunctorValue
functor = pressure_error
value_type = max_abs
execute_on = FINAL
[]
[]
(modules/heat_transfer/test/tests/radiation_participating_media/rad_T_coupled_medium_1d.i)
# The test guarantees that the P1 participating media radiation model in the LinearFV
# system can couple with the energy equation of a semi-transparent fluid with fixed
# temperatures at the left and right walls.
# A simple multi-linear system solver approach is used. Due to the strong coupling between T and G
# multi-system fixed point iterations need to be set.
k = 1e-2
sigma_a = 1.
G_diffusion_coef = ${fparse 1/(3*sigma_a)}
sigma = 5.670374419e-8
[Mesh]
[mesh]
type = GeneratedMeshGenerator
dim = 1
nx = 20
xmin = 0
xmax = 1
[]
[]
[Problem]
linear_sys_names = 'energy_system radiation_system'
previous_nl_solution_required = true
[]
[Variables]
[T]
type = MooseLinearVariableFVReal
solver_sys = 'energy_system'
initial_condition = 100
[]
[G]
type = MooseLinearVariableFVReal
solver_sys = 'radiation_system'
initial_condition = ${fparse sigma*100^4}
[]
[]
[LinearFVKernels]
[temp_conduction]
type = LinearFVDiffusion
diffusion_coeff = ${k}
variable = T
[]
[temp_radiation]
type = LinearFVP1TemperatureSourceSink
variable = T
G = 'G'
absorption_coeff = ${sigma_a}
[]
[G_diffusion]
type = LinearFVDiffusion
variable = G
diffusion_coeff = ${G_diffusion_coef}
[]
[source_and_sink]
type = LinearFVP1RadiationSourceSink
variable = G
temperature_radiation = 'T'
absorption_coeff = ${sigma_a}
[]
[]
[LinearFVBCs]
[right_bc_G]
type = LinearFVP1RadiationMarshakBC
boundary = 'right'
variable = G
temperature_radiation = 'T'
coeff_diffusion = ${G_diffusion_coef}
boundary_emissivity = 1.0
[]
[right_bc_T]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = T
boundary = 'right'
functor = 100.
[]
[left_bc_T]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = T
boundary = 'left'
functor = 50.
[]
[left_bc_G]
type = LinearFVP1RadiationMarshakBC
boundary = 'left'
variable = G
temperature_radiation = 'T'
coeff_diffusion = ${G_diffusion_coef}
boundary_emissivity = 1.0
[]
[]
[Postprocessors]
[mean_value_G]
type = ElementIntegralFunctorPostprocessor
functor = G
[]
[max_value_G]
type = ElementExtremeFunctorValue
functor = G
[]
[mean_value_T]
type = ElementIntegralFunctorPostprocessor
functor = T
[]
[max_value_T]
type = ElementExtremeFunctorValue
functor = T
[]
[]
[Convergence]
[linear]
type = IterationCountConvergence
max_iterations = 70
converge_at_max_iterations = true
[]
[]
[Executioner]
type = Steady
solve_type = 'Linear' #'NEWTON'
petsc_options_iname = '-energy_system_pc_type -energy_system_pc_factor_shift_type -radiation_system_pc_type -radiation_system_pc_factor_shift_type'
petsc_options_value = 'hypre boomeramg hypre boomeramg'
l_abs_tol = 1e-14
l_tol = 1e-14
nl_abs_tol = 1e-14
multi_system_fixed_point=true
multi_system_fixed_point_convergence=linear
[]
[Outputs]
#file_base = rad_isothermal_medium_1d_adiabatic
csv = true
exodus = true
execute_on = timestep_end
[]
(modules/navier_stokes/test/tests/finite_volume/ins/pump/pump_as_volume_force_loop_force_corrected.i)
mu = 1.0
rho = 1.0
[Mesh]
[gen]
type = CartesianMeshGenerator
dim = 2
dx = '0.1 0.8 0.1'
dy = '0.1 0.8 0.1'
ix = '5 20 5'
iy = '5 20 5'
subdomain_id = '1 1 1
1 2 1
1 1 1'
[]
[delete_internal_part]
type = BlockDeletionGenerator
input = gen
block = '2'
new_boundary = 'wall-internal'
[]
[lump_bdries_to_wall]
type = RenameBoundaryGenerator
input = delete_internal_part
old_boundary = 'bottom right top left'
new_boundary = 'wall-external wall-external wall-external wall-external'
[]
[pump_domain]
type = ParsedSubdomainMeshGenerator
input = lump_bdries_to_wall
combinatorial_geometry = 'x > 0.3 & x < 0.7 & y > 0.5'
block_id = '3'
[]
[rename_blocks]
type = RenameBlockGenerator
input = pump_domain
old_block = '1 3'
new_block = 'pipe pump'
[]
[side_pump]
type = ParsedGenerateSideset
input = rename_blocks
included_subdomains = 'pump'
included_neighbors = 'pipe'
new_sideset_name = 'pump_side'
normal = '1 0 0'
combinatorial_geometry = 'x > 0.35'
[]
[]
[GlobalParams]
velocity_interp_method = 'rc'
advected_interp_method = 'upwind'
rhie_chow_user_object = 'rc'
[]
[Problem]
material_coverage_check = False
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = vel_x
v = vel_y
pressure = pressure
correct_volumetric_force = true
volumetric_force_functors = 'pump_force'
volume_force_correction_method = 'force-consistent'
[]
[]
[Variables]
[vel_x]
type = INSFVVelocityVariable
initial_condition = 1
[]
[vel_y]
type = INSFVVelocityVariable
initial_condition = 1
[]
[pressure]
type = INSFVPressureVariable
[]
[lambda]
family = SCALAR
order = FIRST
[]
[]
[AuxVariables]
[U]
order = CONSTANT
family = MONOMIAL
fv = true
[]
[]
[AuxKernels]
[mag]
type = VectorMagnitudeAux
variable = U
x = vel_x
y = vel_y
[]
[]
[FVKernels]
[mass]
type = INSFVMassAdvection
variable = pressure
rho = ${rho}
[]
[mean_zero_pressure]
type = FVIntegralValueConstraint
variable = pressure
lambda = lambda
phi0 = 0.0
[]
[u_advection]
type = INSFVMomentumAdvection
variable = vel_x
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = vel_x
mu = ${mu}
momentum_component = 'x'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = vel_x
momentum_component = 'x'
pressure = pressure
[]
[u_pump]
type = INSFVBodyForce
variable = vel_x
momentum_component = 'x'
functor = 'pump_force'
block = 'pump'
[]
[v_advection]
type = INSFVMomentumAdvection
variable = vel_y
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = vel_y
mu = ${mu}
momentum_component = 'y'
[]
[v_pressure]
type = INSFVMomentumPressure
variable = vel_y
momentum_component = 'y'
pressure = pressure
[]
[]
[FVBCs]
[walls-u]
type = INSFVNoSlipWallBC
boundary = 'wall-internal wall-external'
variable = vel_x
function = '0'
[]
[walls-v]
type = INSFVNoSlipWallBC
boundary = 'wall-internal wall-external'
variable = vel_y
function = '0'
[]
[]
[FunctorMaterials]
[pump_force]
type = PiecewiseByBlockFunctorMaterial
prop_name = 'pump_force'
subdomain_to_prop_value = 'pump 1000.0
pipe 0.0'
[]
[]
[Postprocessors]
[flow_rate]
type = Receiver
default = 1.0
[]
[flow_rate_to_pipe]
type = VolumetricFlowRate
advected_quantity = ${rho}
boundary = 'pump_side'
vel_x = 'vel_x'
vel_y = 'vel_y'
[]
[maximum_speed]
type = ADElementExtremeFunctorValue
functor = vel_x
value_type = max
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
nl_rel_tol = 1e-12
[]
[Outputs]
exodus = false
[out]
type = CSV
execute_on = FINAL
show = 'flow_rate_to_pipe maximum_speed'
[]
[]
(modules/heat_transfer/test/tests/functormaterials/fin_efficiency/fin_efficiency.i)
# This example uses rectangular fins
width = 1.0
thickness = 0.001
perimeter = ${fparse 2 * width + 2 * thickness}
area = ${fparse width * thickness}
[Mesh]
type = GeneratedMesh
dim = 1
nx = 1
[]
[FunctorMaterials]
[fin_fmat]
type = FinEfficiencyFunctorMaterial
fin_height = 0.01
fin_perimeter_area_ratio = ${fparse perimeter / area}
heat_transfer_coefficient = 25.0
thermal_conductivity = 15.0
fin_efficiency_name = efficiency
[]
[]
[Postprocessors]
[fin_efficiency]
type = ElementExtremeFunctorValue
functor = efficiency
execute_on = 'INITIAL'
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[Outputs]
csv = true
execute_on = 'INITIAL'
[]
(modules/navier_stokes/test/tests/finite_volume/two_phase/mixture_model/rayleigh-bernard-two-phase.i)
mu = 1.0
rho = 1e3
mu_d = 0.3
rho_d = 1.0
dp = 0.01
U_lid = 0.0
g = -9.81
[GlobalParams]
velocity_interp_method = 'rc'
advected_interp_method = 'upwind'
rhie_chow_user_object = 'rc'
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = .1
ymin = 0
ymax = .1
nx = 11
ny = 11
[]
[]
[Variables]
[vel_x]
type = INSFVVelocityVariable
[]
[vel_y]
type = INSFVVelocityVariable
[]
[pressure]
type = INSFVPressureVariable
[]
[phase_2]
type = INSFVScalarFieldVariable
[]
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = vel_x
v = vel_y
pressure = pressure
[]
[]
[Correctors]
[pin_pressure]
type = NSPressurePin
variable = pressure
pin_type = point-value
point = '0 0 0'
[]
[]
[FVKernels]
[mass]
type = INSFVMassAdvection
variable = pressure
rho = 'rho_mixture'
[]
[u_time]
type = INSFVMomentumTimeDerivative
variable = vel_x
rho = 'rho_mixture'
momentum_component = 'x'
[]
[u_advection]
type = INSFVMomentumAdvection
variable = vel_x
rho = 'rho_mixture'
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = vel_x
mu = 'mu_mixture'
momentum_component = 'x'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = vel_x
momentum_component = 'x'
pressure = pressure
[]
[u_buoyant]
type = INSFVMomentumGravity
variable = vel_x
rho = 'rho_mixture'
momentum_component = 'x'
gravity = '0 ${g} 0'
[]
[v_time]
type = INSFVMomentumTimeDerivative
variable = vel_y
rho = 'rho_mixture'
momentum_component = 'y'
[]
[v_advection]
type = INSFVMomentumAdvection
variable = vel_y
rho = 'rho_mixture'
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = vel_y
mu = 'mu_mixture'
momentum_component = 'y'
[]
[v_pressure]
type = INSFVMomentumPressure
variable = vel_y
momentum_component = 'y'
pressure = pressure
[]
[v_buoyant]
type = INSFVMomentumGravity
variable = vel_y
rho = 'rho_mixture'
momentum_component = 'y'
gravity = '0 ${g} 0'
[]
[phase_2_time]
type = FVFunctorTimeKernel
variable = phase_2
[]
[phase_2_advection]
type = INSFVScalarFieldAdvection
variable = phase_2
u_slip = 'vel_slip_x'
v_slip = 'vel_slip_y'
[]
[phase_2_diffusion]
type = FVDiffusion
variable = phase_2
coeff = 1e-3
[]
[]
[FVBCs]
[top_x]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'top'
function = ${U_lid}
[]
[no_slip_x]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'left right bottom'
function = 0
[]
[no_slip_y]
type = INSFVNoSlipWallBC
variable = vel_y
boundary = 'left right top bottom'
function = 0
[]
[bottom_phase_2]
type = FVDirichletBC
variable = phase_2
boundary = 'bottom'
value = 1.0
[]
[top_phase_2]
type = FVDirichletBC
variable = phase_2
boundary = 'top'
value = 0.0
[]
[]
[AuxVariables]
[U]
order = CONSTANT
family = MONOMIAL
fv = true
[]
[drag_coefficient]
type = MooseVariableFVReal
[]
[rho_mixture_var]
type = MooseVariableFVReal
[]
[mu_mixture_var]
type = MooseVariableFVReal
[]
[phase_1]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[mag]
type = VectorMagnitudeAux
variable = U
x = vel_x
y = vel_y
[]
[populate_cd]
type = FunctorAux
variable = drag_coefficient
functor = 'Darcy_coefficient'
[]
[populate_rho_mixture_var]
type = FunctorAux
variable = rho_mixture_var
functor = 'rho_mixture'
[]
[populate_mu_mixture_var]
type = FunctorAux
variable = mu_mixture_var
functor = 'mu_mixture'
[]
[compute_phase_1]
type = ParsedAux
variable = phase_1
coupled_variables = 'phase_2'
expression = '1 - phase_2'
[]
[]
[FunctorMaterials]
[CD]
type = NSFVDispersePhaseDragFunctorMaterial
rho = 'rho_mixture'
mu = mu_mixture
u = 'vel_x'
v = 'vel_y'
particle_diameter = ${dp}
[]
[mixing_material]
type = NSFVMixtureFunctorMaterial
phase_1_names = '${rho_d} ${mu_d}'
phase_2_names = '${rho} ${mu}'
prop_names = 'rho_mixture mu_mixture'
phase_1_fraction = 'phase_2'
[]
[populate_u_slip]
type = WCNSFV2PSlipVelocityFunctorMaterial
slip_velocity_name = 'vel_slip_x'
momentum_component = 'x'
u = 'vel_x'
v = 'vel_y'
rho = ${rho}
mu = 'mu_mixture'
rho_d = ${rho_d}
particle_diameter = ${dp}
linear_coef_name = 'Darcy_coefficient'
[]
[populate_v_slip]
type = WCNSFV2PSlipVelocityFunctorMaterial
slip_velocity_name = 'vel_slip_y'
momentum_component = 'y'
u = 'vel_x'
v = 'vel_y'
rho = ${rho}
mu = 'mu_mixture'
rho_d = ${rho_d}
particle_diameter = ${dp}
linear_coef_name = 'Darcy_coefficient'
[]
[]
[Postprocessors]
[average_void]
type = ElementAverageValue
variable = 'phase_2'
[]
[max_y_velocity]
type = ElementExtremeValue
variable = 'vel_y'
value_type = max
[]
[min_y_velocity]
type = ElementExtremeValue
variable = 'vel_y'
value_type = min
[]
[max_x_velocity]
type = ElementExtremeValue
variable = 'vel_x'
value_type = max
[]
[min_x_velocity]
type = ElementExtremeValue
variable = 'vel_x'
value_type = min
[]
[max_x_slip_velocity]
type = ElementExtremeFunctorValue
functor = 'vel_slip_x'
value_type = max
[]
[max_y_slip_velocity]
type = ElementExtremeFunctorValue
functor = 'vel_slip_y'
value_type = max
[]
[max_drag_coefficient]
type = ElementExtremeFunctorValue
functor = 'drag_coefficient'
value_type = max
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
[TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 10
iteration_window = 2
growth_factor = 2
cutback_factor = 0.5
dt = 1e-3
[]
nl_max_its = 20
nl_rel_tol = 1e-03
nl_abs_tol = 1e-9
l_max_its = 5
end_time = 1e8
[]
[Outputs]
exodus = false
[CSV]
type = CSV
execute_on = 'FINAL'
[]
[]
(modules/navier_stokes/test/tests/finite_volume/physics/restart/2d_channel_scalar_turbulence_init.i)
### Thermophysical Properties ###
rho = 1
cp = 1
Pr_t = 0.9
# large diffusion coefficients to converge without initial conditions (test uses Problem/solve=false)
mu = 100
k = 10
diff_scalar = 10
### Simulation parameters
inlet_velocity = 1
side_length = 1
### k-epsilon Closure Parameters ###
sigma_k = 1.0
sigma_eps = 1.3
C1_eps = 1.44
C2_eps = 1.92
C_mu = 0.09
### Initial Conditions ###
intensity = 0.01
k_init = '${fparse 1.5*(intensity * inlet_velocity)^2}'
eps_init = '${fparse C_mu^0.75 * k_init^1.5 / side_length}'
mu_t_init = '${fparse rho * C_mu * k_init * k_init / eps_init}'
### Modeling parameters ###
bulk_wall_treatment = false
wall_treatment_eps = 'eq_newton' # Options: eq_newton, eq_incremental, eq_linearized, neq
wall_treatment_tem = 'eq_newton' # Options: eq_newton, eq_incremental, eq_linearized, neq
[Mesh]
active = 'gen'
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 10
ymin = 0
ymax = ${side_length}
nx = 100
ny = 20
[]
[fmg_restart]
type = FileMeshGenerator
file = user_ics.e
use_for_exodus_restart = true
[]
[]
[Physics]
[NavierStokes]
[Flow]
[all_flow]
compressibility = 'incompressible'
density = ${rho}
dynamic_viscosity = ${mu}
inlet_boundaries = 'left'
momentum_inlet_types = 'fixed-velocity'
momentum_inlet_functors = '${inlet_velocity} 0'
wall_boundaries = 'top bottom'
momentum_wall_types = 'noslip noslip'
outlet_boundaries = 'right'
momentum_outlet_types = 'fixed-pressure'
pressure_functors = '0'
mass_advection_interpolation = 'average'
momentum_advection_interpolation = 'average'
[]
[]
[FluidHeatTransfer]
[all_energy]
thermal_conductivity = ${k}
specific_heat = ${cp}
energy_inlet_types = 'fixed-temperature'
energy_inlet_functors = '1'
energy_wall_types = 'heatflux heatflux'
energy_wall_functors = '0 0'
energy_advection_interpolation = 'average'
[]
[]
[ScalarTransport]
[all_scalar]
passive_scalar_names = 'scalar1 scalar2'
passive_scalar_diffusivity = '${diff_scalar} ${diff_scalar}'
passive_scalar_source = '0.1 0'
passive_scalar_coupled_source = '1; 0'
passive_scalar_coupled_source_coeff = '0.1; 0'
passive_scalar_inlet_types = 'fixed-value fixed-value'
passive_scalar_inlet_functors = '1; 0.1'
passive_scalar_advection_interpolation = 'average'
[]
[]
[Turbulence]
[keps]
fluid_heat_transfer_physics = 'all_energy'
scalar_transport_physics = 'all_scalar'
turbulence_handling = 'k-epsilon'
tke_name = TKE
tked_name = TKED
# Fluid properties
Pr_t = ${Pr_t}
Sc_t = '0.7'
# Model parameters
C1_eps = ${C1_eps}
C2_eps = ${C2_eps}
C_mu = ${C_mu}
sigma_k = ${sigma_k}
sigma_eps = ${sigma_eps}
# Wall parameters
turbulence_walls = 'top bottom'
bulk_wall_treatment = ${bulk_wall_treatment}
wall_treatment_eps = ${wall_treatment_eps}
wall_treatment_T = ${wall_treatment_tem}
# Numerical parameters
mu_t_as_aux_variable = false
k_t_as_aux_variable = false
[]
[]
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
nl_abs_tol = 1e-3
line_search = 'none'
[]
[Problem]
solve = false
[]
[Outputs]
# Used to set up a restart from checkpoint
checkpoint = true
# Used to set up a restart from exodus file
[exodus]
type = Exodus
execute_on = TIMESTEP_END
[]
# Used to check results
csv = true
execute_on = INITIAL
[]
[Postprocessors]
[min_vel_x]
type = ElementExtremeValue
variable = 'vel_x'
value_type = 'min'
execute_on = 'INITIAL'
[]
[max_vel_x]
type = ElementExtremeValue
variable = 'vel_x'
value_type = 'max'
execute_on = 'INITIAL'
[]
[min_vel_y]
type = ElementExtremeValue
variable = 'vel_y'
value_type = 'min'
execute_on = 'INITIAL'
[]
[max_vel_y]
type = ElementExtremeValue
variable = 'vel_y'
value_type = 'max'
execute_on = 'INITIAL'
[]
[min_pressure]
type = ElementExtremeValue
variable = 'pressure'
value_type = 'min'
execute_on = 'INITIAL'
[]
[max_pressure]
type = ElementExtremeValue
variable = 'pressure'
value_type = 'max'
execute_on = 'INITIAL'
[]
[min_T_fluid]
type = ElementExtremeValue
variable = 'T_fluid'
value_type = 'min'
execute_on = 'INITIAL'
[]
[max_T_fluid]
type = ElementExtremeValue
variable = 'T_fluid'
value_type = 'max'
execute_on = 'INITIAL'
[]
[min_scalar1]
type = ElementExtremeValue
variable = 'scalar1'
value_type = 'min'
execute_on = 'INITIAL'
[]
[max_scalar1]
type = ElementExtremeValue
variable = 'scalar1'
value_type = 'max'
execute_on = 'INITIAL'
[]
[min_scalar2]
type = ElementExtremeValue
variable = 'scalar2'
value_type = 'min'
execute_on = 'INITIAL'
[]
[max_scalar2]
type = ElementExtremeValue
variable = 'scalar2'
value_type = 'max'
execute_on = 'INITIAL'
[]
[min_mu_t]
type = ElementExtremeFunctorValue
functor = 'mu_t'
value_type = 'min'
execute_on = 'INITIAL'
[]
[max_mu_t]
type = ElementExtremeFunctorValue
functor = 'mu_t'
value_type = 'max'
execute_on = 'INITIAL'
[]
[min_tke]
type = ElementExtremeValue
variable = 'TKE'
value_type = 'min'
execute_on = 'INITIAL'
[]
[max_tke]
type = ElementExtremeValue
variable = 'TKE'
value_type = 'max'
execute_on = 'INITIAL'
[]
[min_tked]
type = ElementExtremeValue
variable = 'TKED'
value_type = 'min'
execute_on = 'INITIAL'
[]
[max_tked]
type = ElementExtremeValue
variable = 'TKED'
value_type = 'max'
execute_on = 'INITIAL'
[]
[]
(modules/navier_stokes/test/tests/finite_volume/ins/natural_convection/fuel_cavity.i)
# ========================================================================
# The purpose of this MOOSE scripts is to solve a 2-D axisymmetric
# problem with the following details:
# ------------------------------------------------------------------
# Physics: natural convection through a fluid and heat conduction
# in a solid and there is convective heat transfer from the
# solid to the liquid.
# ------------------------------------------------------------------
# Materials: the fluid is water and the solid is not specified.
# ------------------------------------------------------------------
# BCS: Inlet and outlet pressure with value of 0
# noslip conditions on the walls.
# Heat flux on the left wall with value of 40000 W/m^2
# ========================================================================
# ========================================================================
# Dimensions & Physical properties
# ========================================================================
Domain_length = 121.92e-2 # m
Solid_width = 0.7112e-3 # m
Liquid_width = 0.56261e-2 # m
mu = 0.00053157
rho = 987.27
k = 0.64247
k_solid = 15.0
cp = 4181.8
alpha_b = 210e-6
T_init = 300.0
input_heat_flux = 40000.0
# ========================================================================
# The main body of the script
# ========================================================================
[Mesh]
[cmg]
type = CartesianMeshGenerator
dim = 2
#dx = '0.7032625e-4 0.7112e-5'
dx = '${Liquid_width} ${Solid_width}'
ix = '10 3'
dy = '${fparse 1./5.*Domain_length} ${fparse 4./5.*Domain_length}'
iy = '30 10'
subdomain_id = '0 1
0 1'
[]
[interface]
type = SideSetsBetweenSubdomainsGenerator
input = 'cmg'
primary_block = 0
paired_block = 1
new_boundary = 'interface'
[]
[fluid_side]
type = BreakBoundaryOnSubdomainGenerator
input = 'interface'
boundaries = 'top bottom'
[]
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
advected_interp_method = 'upwind'
velocity_interp_method = 'rc'
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = vel_x
v = vel_y
block = 0
pressure = pressure
[]
[]
[Variables]
[vel_x]
type = INSFVVelocityVariable
block = 0
initial_condition = 1e-6
[]
[vel_y]
type = INSFVVelocityVariable
block = 0
initial_condition = 1e-6
[]
[pressure]
type = INSFVPressureVariable
block = 0
[]
[T]
type = INSFVEnergyVariable
block = 0
initial_condition = ${T_init}
scaling = 1e-5
[]
[Ts]
type = INSFVEnergyVariable
block = 1
initial_condition = ${T_init}
scaling = 1e-3
[]
[]
[FVKernels]
[mass]
type = INSFVMassAdvection
variable = pressure
rho = ${rho}
[]
[u_time]
type = INSFVMomentumTimeDerivative
variable = vel_x
rho = ${rho}
momentum_component = 'x'
[]
[u_advection]
type = INSFVMomentumAdvection
variable = vel_x
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = vel_x
mu = ${mu}
momentum_component = 'x'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = vel_x
momentum_component = 'x'
pressure = pressure
[]
[u_buoyancy]
type = INSFVMomentumBoussinesq
variable = vel_x
T_fluid = T
gravity = '0 -9.81 0'
rho = ${rho}
ref_temperature = ${T_init}
momentum_component = 'x'
#alpha_name = ${alpha_b}
[]
[v_time]
type = INSFVMomentumTimeDerivative
variable = vel_y
rho = ${rho}
momentum_component = 'y'
[]
[v_advection]
type = INSFVMomentumAdvection
variable = vel_y
rho = ${rho}
momentum_component = 'y'
#alpha_name = ${alpha_b}
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = vel_y
mu = ${mu}
momentum_component = 'y'
[]
[v_pressure]
type = INSFVMomentumPressure
variable = vel_y
momentum_component = 'y'
pressure = pressure
[]
[v_buoyancy]
type = INSFVMomentumBoussinesq
variable = vel_y
T_fluid = T
gravity = '0 -9.81 0'
rho = ${rho}
ref_temperature = ${T_init}
momentum_component = 'y'
[]
[temp_time]
type = INSFVEnergyTimeDerivative
variable = T
rho = '${rho}'
dh_dt = dh_dt
[]
[temp_conduction]
type = FVDiffusion
coeff = 'k'
variable = T
[]
[temp_advection]
type = INSFVEnergyAdvection
variable = T
[]
[Ts_time]
type = INSFVEnergyTimeDerivative
variable = Ts
rho = '${rho}'
dh_dt = dh_solid_dt
[]
[solid_temp_conduction]
type = FVDiffusion
coeff = 'k_solid'
variable = Ts
[]
[]
[FVInterfaceKernels]
[convection]
type = FVConvectionCorrelationInterface
variable1 = T
variable2 = Ts
boundary = 'interface'
h = htc
T_solid = Ts
T_fluid = T
subdomain1 = 0
subdomain2 = 1
wall_cell_is_bulk = true
[]
[]
[FVBCs]
[walls_u]
type = INSFVNoSlipWallBC
variable = vel_x
boundary = 'interface left bottom_to_0'
function = 0
[]
[walls_v]
type = INSFVNoSlipWallBC
variable = vel_y
boundary = 'interface left bottom_to_0'
function = 0
[]
[outlet]
type = INSFVOutletPressureBC
variable = pressure
boundary = 'top_to_0'
function = 0.0
[]
[outlet_T]
type = NSFVOutflowTemperatureBC
variable = T
boundary = 'top_to_0'
u = vel_x
v = vel_y
rho = ${rho}
cp = '${cp}'
backflow_T = ${T_init}
[]
[Insulator]
type = FVNeumannBC
variable = 'T'
boundary = 'left'
value = 0.0
[]
[heater]
type = FVNeumannBC
variable = 'Ts'
boundary = 'right'
value = '${fparse input_heat_flux}'
[]
[Insulator_solid]
type = FVNeumannBC
variable = 'Ts'
boundary = 'top_to_1'
value = 0.0
[]
[inlet_T_1]
type = FVDirichletBC
variable = Ts
boundary = 'bottom_to_1'
value = ${T_init}
[]
[]
[AuxVariables]
[Ra]
type = INSFVScalarFieldVariable
initial_condition = 1000.0
[]
[htc]
type = INSFVScalarFieldVariable
initial_condition = 0.0
[]
[]
[AuxKernels]
[compute_Ra]
type = ParsedAux
variable = Ra
coupled_variables = 'T'
constant_names = 'g beta T_init width nu alpha'
constant_expressions = '9.81 ${alpha_b} ${T_init} ${Liquid_width} ${fparse mu/rho} ${fparse k/(rho*cp)}'
expression = 'g * beta * (T - T_init) * pow(width, 3) / (nu*alpha) + 1.0'
block = 0
[]
[htc]
type = ParsedAux
variable = htc
coupled_variables = 'Ra'
constant_names = 'Pr'
constant_expressions = '${fparse cp*mu/k}'
expression = '${k}* (0.68 + 0.67 * pow(Ra, 0.25)/pow(1 + pow(0.437/Pr, 9/16) ,4/9) )/ ${Liquid_width} '
block = 0
[]
[]
[FunctorMaterials]
[functor_constants]
type = ADGenericFunctorMaterial
prop_names = 'cp k k_solid'
prop_values = '${cp} ${k} ${k_solid}'
[]
[ins_fv]
type = INSFVEnthalpyFunctorMaterial
temperature = 'T'
rho = ${rho}
block = 0
[]
[ins_fv_solid]
type = INSFVEnthalpyFunctorMaterial
temperature = 'Ts'
rho = ${rho}
cp = ${cp}
h = h_solid
rho_h = rho_h_solid
block = 1
[]
[const_functor]
type = ADGenericFunctorMaterial
prop_names = 'alpha_b'
prop_values = '${alpha_b}'
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type -sub_pc_factor_shift_type -ksp_gmres_restart'
petsc_options_value = ' lu NONZERO 200'
line_search = 'none'
[TimeStepper]
type = IterationAdaptiveDT
dt = 0.01
optimal_iterations = 20
iteration_window = 2
[]
nl_max_its = 30
nl_abs_tol = 1e-10
steady_state_detection = true
steady_state_tolerance = 1e-09
[]
[Postprocessors]
[max_T]
type = ADElementExtremeFunctorValue
functor = T
block = 0
[]
[max_Ts]
type = ADElementExtremeFunctorValue
functor = Ts
block = 1
[]
[]
[Outputs]
exodus = false
csv = true
[]
(modules/heat_transfer/test/tests/functormaterials/convection_heat_flux/convection_heat_flux.i)
T_solid = 500
T_fluid = 300
htc = 100
# q = htc * (T_solid - T_fluid) = 100 * (500 - 300) = 20000
[Mesh]
type = GeneratedMesh
dim = 1
nx = 1
[]
[FunctorMaterials]
[q_fmat]
type = ADConvectionHeatFluxFunctorMaterial
heat_flux_name = q
T_solid = ${T_solid}
T_fluid = ${T_fluid}
htc = ${htc}
[]
[]
[Postprocessors]
[q_pp]
type = ADElementExtremeFunctorValue
functor = q
execute_on = 'INITIAL'
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[Outputs]
csv = true
execute_on = 'INITIAL'
[]
(modules/navier_stokes/test/tests/finite_volume/two_phase/mixture_model/segregated/rayleigh-bernard-two-phase-physics_heated.i)
mu = 1.0
rho = 1e3
mu_d = 0.3
rho_d = 1.0
dp = 0.01
U_lid = 0.0
g = -9.81
advected_interp_method = 'upwind'
T_fluid_top = 1
# Currently required
k = 1
k_d = 1
cp = 1
cp_d = 1
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = .1
ymin = 0
ymax = .1
nx = 10
ny = 11
[]
[]
[Problem]
linear_sys_names = 'u_system v_system pressure_system energy_system phi_system'
[]
# We are using a Materials block to order the functor creation.
# See #30827
[Materials]
[T_from_p_h]
type = ParsedFunctorMaterial
property_name = 'T_from_p_h_functor'
expression = 'h / cp_mixture'
functor_names = 'h cp_mixture'
[]
[h_from_p_T]
type = ParsedFunctorMaterial
property_name = 'h_from_p_T_functor'
expression = 'cp_mixture * T_fluid'
functor_names = 'T_fluid cp_mixture'
[]
[density_1]
type = ParsedFunctorMaterial
property_name = 'rho'
expression = '${rho} * (1. - 0.9 * T_fluid)'
functor_names = 'T_fluid'
[]
[density_2]
type = ParsedFunctorMaterial
property_name = 'rho_d'
expression = '${rho_d} * (1. - 0.9 * T_fluid)'
functor_names = 'T_fluid'
[]
[]
[Physics]
[NavierStokes]
[FlowSegregated]
[flow]
compressibility = 'weakly-compressible'
density = 'rho_mixture'
dynamic_viscosity = 'mu_mixture'
gravity = '0 ${g} 0'
# Initial conditions
initial_velocity = '1e-12 1e-12 0'
initial_pressure = 0.2
wall_boundaries = 'top left right bottom'
momentum_wall_types = 'noslip noslip noslip noslip'
momentum_wall_functors = '${U_lid} 0; 0 0; 0 0; 0 0'
orthogonality_correction = false
pressure_two_term_bc_expansion = true
momentum_advection_interpolation = ${advected_interp_method}
[]
[]
[FluidHeatTransferSegregated]
[heat]
system_names = 'energy_system'
# allows non-constant cp
solve_for_enthalpy = true
initial_temperature = ${T_fluid_top}
thermal_conductivity = 'k_mixture'
specific_heat = 'cp_mixture'
energy_wall_boundaries = 'top bottom'
energy_wall_types = 'fixed-temperature fixed-temperature'
energy_wall_functors = '0 1'
use_nonorthogonal_correction = false
energy_two_term_bc_expansion = true
energy_advection_interpolation = ${advected_interp_method}
[]
[]
[TwoPhaseMixtureSegregated]
[mixture]
system_names = 'phi_system'
phase_1_fraction_name = 'phase_1'
phase_2_fraction_name = 'phase_2'
# not fully mixed initialization
initial_phase_fraction = 'unstable'
add_phase_transport_equation = true
phase_advection_interpolation = '${advected_interp_method}'
phase_fraction_diffusivity = 1e-3
fluid_heat_transfer_physics = heat
# Base phase material properties
phase_1_density_name = 'rho'
phase_1_viscosity_name = ${mu}
phase_1_specific_heat_name = ${cp}
phase_1_thermal_conductivity_name = ${k}
# Other phase material properties
phase_2_density_name = 'rho_d'
phase_2_viscosity_name = ${mu_d}
phase_2_specific_heat_name = ${cp_d}
phase_2_thermal_conductivity_name = ${k_d}
output_all_properties = true
# Friction model, not actually used!
use_dispersed_phase_drag_model = true
particle_diameter = ${dp}
add_advection_slip_term = false
# To match Rayleigh Bernard nonlinear test setup
add_gravity_term_in_slip_velocity = false
[]
[]
[]
[]
[Functions]
[unstable]
type = ParsedFunction
expression = 'if(y > 0.05, 1, 0)'
[]
[]
[Executioner]
type = PIMPLE
rhie_chow_user_object = 'ins_rhie_chow_interpolator'
end_time = 1e8
[TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 10
iteration_window = 2
growth_factor = 2
cutback_factor = 0.5
dt = 1e-3
[]
# Systems
momentum_systems = 'u_system v_system'
pressure_system = 'pressure_system'
energy_system = 'energy_system'
active_scalar_systems = 'phi_system'
momentum_equation_relaxation = 0.8
active_scalar_equation_relaxation = '0.7'
energy_equation_relaxation = '0.5'
pressure_variable_relaxation = 0.3
# We need to converge the problem to show conservation
num_iterations = 200
pressure_absolute_tolerance = 1e-10
momentum_absolute_tolerance = 1e-10
energy_absolute_tolerance = 1e-10
active_scalar_absolute_tolerance = '1e-10'
momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
momentum_petsc_options_value = 'hypre boomeramg'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
pressure_petsc_options_value = 'hypre boomeramg'
energy_petsc_options_iname = '-pc_type -pc_hypre_type'
energy_petsc_options_value = 'hypre boomeramg'
active_scalar_petsc_options_iname = '-pc_type -pc_factor_shift_type' # -pc_hypre_type'
active_scalar_petsc_options_value = 'lu NONZERO'
momentum_l_abs_tol = 1e-13
pressure_l_abs_tol = 1e-13
energy_l_abs_tol = 1e-13
active_scalar_l_abs_tol = 1e-13
momentum_l_tol = 0
pressure_l_tol = 0
energy_l_tol = 0
active_scalar_l_tol = 0
# print_fields = true
continue_on_max_its = true
pin_pressure = true
pressure_pin_value = 0.0
pressure_pin_point = '0.0 0.0 0.0'
[]
[Outputs]
exodus = false
[out]
type = CSV
execute_on = 'FINAL'
[]
[]
[AuxVariables]
[U]
order = CONSTANT
family = MONOMIAL
fv = true
[]
[]
[Postprocessors]
[average_void]
type = ElementAverageValue
variable = 'phase_2'
[]
[max_y_velocity]
type = ElementExtremeValue
variable = 'vel_y'
value_type = max
[]
[min_y_velocity]
type = ElementExtremeValue
variable = 'vel_y'
value_type = min
[]
[max_x_velocity]
type = ElementExtremeValue
variable = 'vel_x'
value_type = max
[]
[min_x_velocity]
type = ElementExtremeValue
variable = 'vel_x'
value_type = min
[]
[max_x_slip_velocity]
type = ElementExtremeFunctorValue
functor = 'vel_slip_x'
value_type = max
[]
[max_y_slip_velocity]
type = ElementExtremeFunctorValue
functor = 'vel_slip_y'
value_type = max
[]
[max_drag_coefficient_x]
type = ElementExtremeFunctorValue
functor = 'Darcy_coefficient_vec_out_x'
value_type = max
[]
[max_drag_coefficient_y]
type = ElementExtremeFunctorValue
functor = 'Darcy_coefficient_vec_out_y'
value_type = max
[]
[]
(test/tests/functormaterials/functor_change/fp_parent.i)
# Heat conduction with fixed temperature on left and convection BC on right:
#
# d/dx(-k dT/dx) = S'''(T) (0,1)X(0,1)
# T = T_inf x = 0
# -k dT/dx = htc (T - T_inf) x = 1
#
# Source is temperature-dependent and is calculated in the child app:
# S(T) = B - A * (T - T_inf)^2
k = 15.0
htc = 100.0
T_ambient = 300.0
[Mesh]
type = GeneratedMesh
dim = 2
nx = 5
ny = 5
[]
[Variables]
[T_nodal]
[]
[T_elem]
type = MooseVariableFVReal
[]
[]
[AuxVariables]
[S_parent]
[]
[]
[FunctorMaterials]
[heat_flux_mat_nodal]
type = ADParsedFunctorMaterial
expression = 'htc * (T - T_inf)'
functor_symbols = 'T T_inf htc'
functor_names = 'T_nodal ${T_ambient} ${htc}'
property_name = 'heat_flux_nodal'
[]
[heat_flux_mat_elem]
type = ADParsedFunctorMaterial
expression = 'htc * (T - T_inf)'
functor_symbols = 'T T_inf htc'
functor_names = 'T_elem ${T_ambient} ${htc}'
property_name = 'heat_flux_elem'
[]
[]
[Kernels]
[T_nodal_diff]
type = FunctionDiffusion
variable = T_nodal
function = ${k}
[]
[T_nodal_source]
type = CoupledForce
variable = T_nodal
v = S_parent
[]
[]
[FVKernels]
[T_elem_diff]
type = FVDiffusion
variable = T_elem
coeff = ${k}
[]
[T_elem_source]
type = FVCoupledForce
variable = T_elem
v = S_parent
[]
[]
[BCs]
[left_bc_nodal]
type = DirichletBC
variable = T_nodal
boundary = left
value = ${T_ambient}
[]
[right_bc_nodal]
type = FunctorNeumannBC
variable = T_nodal
boundary = right
functor = heat_flux_nodal
flux_is_inward = false
[]
[]
[FVBCs]
[left_bc_elem]
type = FVDirichletBC
variable = T_elem
boundary = left
value = ${T_ambient}
[]
[right_bc_elem]
type = FVFunctorNeumannBC
variable = T_elem
boundary = right
functor = heat_flux_elem
factor = -1
[]
[]
[MultiApps]
[source_app]
type = FullSolveMultiApp
positions = '0 0 0'
input_files = fp_child.i
execute_on = 'TIMESTEP_END'
[]
[]
[Transfers]
[T_to_child]
type = MultiAppCopyTransfer
to_multi_app = source_app
source_variable = T_nodal
variable = T_child
execute_on = 'SAME_AS_MULTIAPP'
[]
[S_from_child]
type = MultiAppCopyTransfer
from_multi_app = source_app
source_variable = S
variable = S_parent
execute_on = 'SAME_AS_MULTIAPP'
[]
[]
[FunctorMaterials]
[nodal_mat]
type = ADFunctorChangeFunctorMaterial
functor = T_nodal
change_over = multiapp_fixed_point
take_absolute_value = false
prop_name = T_nodal_change
[]
[elem_mat]
type = ADFunctorChangeFunctorMaterial
functor = T_elem
change_over = multiapp_fixed_point
take_absolute_value = false
prop_name = T_elem_change
[]
[S_mat]
type = ADFunctorChangeFunctorMaterial
functor = S_parent
change_over = multiapp_fixed_point
take_absolute_value = false
prop_name = S_change
[]
[]
[Postprocessors]
[T_nodal_avg]
type = AverageNodalVariableValue
variable = T_nodal
execute_on = 'INITIAL TIMESTEP_END'
[]
[T_elem_avg]
type = ElementAverageValue
variable = T_elem
execute_on = 'INITIAL TIMESTEP_END'
[]
[S_avg]
type = ElementAverageValue
variable = S_parent
execute_on = 'INITIAL TIMESTEP_END'
[]
[T_nodal_max_change]
type = ElementExtremeFunctorValue
functor = T_nodal_change
value_type = max
execute_on = 'INITIAL TIMESTEP_END'
[]
[T_elem_max_change]
type = ElementExtremeFunctorValue
functor = T_elem_change
value_type = max
execute_on = 'INITIAL TIMESTEP_END'
[]
[S_max_change]
type = ElementExtremeFunctorValue
functor = S_change
value_type = max
execute_on = 'TIMESTEP_BEGIN'
[]
[fp_it]
type = NumFixedPointIterations
get_index_instead_of_count = true
execute_on = 'INITIAL TIMESTEP_END'
[]
[]
[Convergence]
[fp_conv]
type = IterationCountConvergence
max_iterations = 6
converge_at_max_iterations = true
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
multiapp_fixed_point_convergence = fp_conv
[]
[Outputs]
[console]
type = Console
new_row_detection_columns = all
execute_postprocessors_on = 'INITIAL MULTIAPP_FIXED_POINT_ITERATION_END'
[]
[out]
type = CSV
new_row_detection_columns = all
execute_on = 'INITIAL MULTIAPP_FIXED_POINT_ITERATION_END'
[]
[]
(modules/navier_stokes/test/tests/finite_volume/pins/mms/linear-segregated/hydrostatic-jump/hydrostatic-jump.i)
# Fluid at rest under gravity in a closed box split by a pressure baffle across which porosity
# jumps. The interface x - skew * y = interface is a mesh line.
# The superficial momentum balance at rest is 0 = -eps grad(p) + eps rho g, so
# U = 0 and grad(p) = rho g on both sides,
# independent of porosity. With density rho = rho_0 + strat * z linear in the height
# z = -g . x / |g|, the exact pressure is
# p = -|g| (rho_0 z + strat z^2 / 2) + const.
# The body force is the porosity-weighted buoyancy eps rho g, applied either by
# LinearFVMomentumBuoyancy or, with LinearFVKernels/inactive = 'u_buoyancy v_buoyancy', by
# LinearFVMomentumBoussinesq with a temperature chosen so that -alpha rho_ref (T - T_ref) = rho.
rho_0 = 1
strat = -0.1
eps_left = 1
eps_right = 1
mu = 0.01
reaction = 1
gx = 0
gy = -9.81
interface = 0.5
skew = 0
nx = 8
ny = 8
nonorthogonal = false
alpha = 1e-3
T_ref = 300
pressure_gradient_method = reconstructed
[Problem]
linear_sys_names = 'u_system v_system pressure_system'
previous_nl_solution_required = true
[]
[Mesh]
[generated]
type = GeneratedMeshGenerator
dim = 2
nx = ${nx}
ny = ${ny}
[]
[right]
type = ParsedSubdomainMeshGenerator
input = generated
combinatorial_geometry = 'x > ${interface}'
block_id = 2
block_name = right
[]
[left]
type = ParsedSubdomainMeshGenerator
input = right
combinatorial_geometry = 'x < ${interface}'
block_id = 1
block_name = left
[]
[skew]
type = ParsedNodeTransformGenerator
input = left
x_function = 'x + ${skew} * y'
[]
[baffle]
type = SideSetsBetweenSubdomainsGenerator
input = skew
primary_block = left
paired_block = right
new_boundary = baffle
[]
[]
[FVGradientMethods]
[jump_aware]
type = FVPressureJumpGreenGaussGradient
[]
[velocity_jump_aware]
type = FVVelocityJumpGreenGaussGradient
[]
[reconstructed]
type = FVReconstructedPressureGradient
base_gradient_method = jump_aware
gradient_relaxation = 1
[]
[]
[FVInterpolationMethods]
[average]
type = FVGeometricAverage
[]
[]
[UserObjects]
[pressure_jump]
type = BernoulliFormLossPressureJump
boundary = baffle
porosity = porosity
density = density
[]
[rc]
type = PorousRhieChowMassFlux
u = superficial_u
v = superficial_v
pressure = pressure
rho = density
porosity = porosity
p_diffusion_kernel = p_diffusion
pressure_jump_models = pressure_jump
pressure_projection_method = consistent
# The body force enters H/A through face averages, so the 1/A diffusion must be averaged the
# same way for the hydrostatic balance to hold on the face when the viscous A varies.
pressure_diffusion_interpolation = average
[]
[]
[Variables]
[superficial_u]
type = MooseLinearVariableFVReal
solver_sys = u_system
initial_condition = 0
gradient_method = velocity_jump_aware
[]
[superficial_v]
type = MooseLinearVariableFVReal
solver_sys = v_system
initial_condition = 0
gradient_method = velocity_jump_aware
[]
[pressure]
type = MooseLinearVariableFVReal
solver_sys = pressure_system
initial_condition = 0
gradient_method = jump_aware
[]
[]
[LinearFVKernels]
inactive = 'u_boussinesq v_boussinesq'
[u_advection]
type = LinearPWCNSFVMomentumFlux
variable = superficial_u
advected_interp_method_name = average
mu = ${mu}
u = superficial_u
v = superficial_v
momentum_component = x
rhie_chow_user_object = rc
use_nonorthogonal_correction = ${nonorthogonal}
[]
[v_advection]
type = LinearPWCNSFVMomentumFlux
variable = superficial_v
advected_interp_method_name = average
mu = ${mu}
u = superficial_u
v = superficial_v
momentum_component = y
rhie_chow_user_object = rc
use_nonorthogonal_correction = ${nonorthogonal}
[]
[u_pressure]
type = LinearPWCNSFVMomentumPressure
variable = superficial_u
pressure = pressure
porosity = porosity
momentum_component = x
gradient_method = ${pressure_gradient_method}
[]
[v_pressure]
type = LinearPWCNSFVMomentumPressure
variable = superficial_v
pressure = pressure
porosity = porosity
momentum_component = y
gradient_method = ${pressure_gradient_method}
[]
[u_buoyancy]
type = LinearFVMomentumBuoyancy
variable = superficial_u
rho = density
porosity = porosity
reference_rho = 0
gravity = '${gx} ${gy} 0'
momentum_component = x
[]
[v_buoyancy]
type = LinearFVMomentumBuoyancy
variable = superficial_v
rho = density
porosity = porosity
reference_rho = 0
gravity = '${gx} ${gy} 0'
momentum_component = y
[]
[u_boussinesq]
type = LinearFVMomentumBoussinesq
variable = superficial_u
T_fluid = T_fluid
rho = 1
alpha_name = ${alpha}
ref_temperature = ${T_ref}
porosity = porosity
gravity = '${gx} ${gy} 0'
momentum_component = x
[]
[v_boussinesq]
type = LinearFVMomentumBoussinesq
variable = superficial_v
T_fluid = T_fluid
rho = 1
alpha_name = ${alpha}
ref_temperature = ${T_ref}
porosity = porosity
gravity = '${gx} ${gy} 0'
momentum_component = y
[]
[u_reaction]
type = LinearFVReaction
variable = superficial_u
coeff = ${reaction}
[]
[v_reaction]
type = LinearFVReaction
variable = superficial_v
coeff = ${reaction}
[]
[p_diffusion]
type = LinearFVPressureCorrectionDiffusionJump
variable = pressure
rhie_chow_user_object = rc
use_nonorthogonal_correction = ${nonorthogonal}
[]
[HbyA_divergence]
type = LinearFVDivergence
variable = pressure
face_flux = HbyA
force_boundary_execution = true
[]
[]
[LinearFVBCs]
[velocity_x]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left right top bottom'
variable = superficial_u
functor = 0
[]
[velocity_y]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left right top bottom'
variable = superficial_v
functor = 0
[]
[pressure_flux]
type = LinearFVPressureFluxBC
boundary = 'left right top bottom'
variable = pressure
HbyA_flux = HbyA
Ainv = Ainv
rho = density
u = superficial_u
v = superficial_v
[]
[]
[FunctorMaterials]
[density]
type = ParsedFunctorMaterial
property_name = density
functor_names = 'exact_density'
expression = 'exact_density'
[]
[porosity]
type = ParsedFunctorMaterial
property_name = porosity
expression = 'if(x-${skew}*y<${interface},${eps_left},${eps_right})'
[]
[pressure_error]
type = ParsedFunctorMaterial
property_name = pressure_error
functor_names = 'pressure exact_pressure'
expression = 'pressure-exact_pressure'
[]
[speed]
type = ParsedFunctorMaterial
property_name = speed
functor_names = 'superficial_u superficial_v'
expression = 'sqrt(superficial_u^2+superficial_v^2)'
[]
[]
[AuxVariables]
[T_fluid]
type = MooseLinearVariableFVReal
[]
[]
[AuxKernels]
[T_fluid]
type = FunctorAux
variable = T_fluid
functor = boussinesq_temperature
execute_on = INITIAL
[]
[]
[Functions]
[boussinesq_temperature]
type = ParsedFunction
expression = 'T_ref-rho/alpha'
symbol_names = 'T_ref rho alpha'
symbol_values = '${T_ref} exact_density ${alpha}'
[]
[height]
type = ParsedFunction
expression = '-(gx*x+gy*y)/sqrt(gx^2+gy^2)'
symbol_names = 'gx gy'
symbol_values = '${gx} ${gy}'
[]
[exact_density]
type = ParsedFunction
expression = 'rho_0+strat*hz'
symbol_names = 'rho_0 strat hz'
symbol_values = '${rho_0} ${strat} height'
[]
# Hydrostatic pressure with the pin at (0.3, 0.3), inside a cell on 2^n meshes, set to zero.
[exact_pressure]
type = ParsedFunction
expression = '-sqrt(gx^2+gy^2)*(rho_0*(hz-hp)+strat*(hz^2-hp^2)/2)'
symbol_names = 'gx gy rho_0 strat hz hp'
symbol_values = '${gx} ${gy} ${rho_0} ${strat} height '
'${fparse -(gx*(0.3+skew*0.3)+gy*0.3)/sqrt(gx^2+gy^2)}'
[]
[]
[Executioner]
type = SIMPLE
momentum_l_abs_tol = 1e-13
pressure_l_abs_tol = 1e-13
momentum_l_tol = 0
pressure_l_tol = 0
momentum_l_max_its = 100
pressure_l_max_its = 100
rhie_chow_user_object = rc
momentum_systems = 'u_system v_system'
pressure_system = pressure_system
momentum_equation_relaxation = 0.7
pressure_variable_relaxation = 0.5
# At rest the normalized momentum residual has no flow to scale against and stalls near 1e-4,
# so the absolute tolerances below are not reached. The solution is fixed well before 50
# iterations.
num_iterations = 50
continue_on_max_its = true
pressure_absolute_tolerance = 1e-12
momentum_absolute_tolerance = 1e-12
momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
momentum_petsc_options_value = 'hypre boomeramg'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
pressure_petsc_options_value = 'hypre boomeramg'
print_fields = false
pin_pressure = true
pressure_pin_value = 0
pressure_pin_point = '${fparse 0.3 + skew * 0.3} 0.3 0'
[]
[Postprocessors]
[max_speed]
type = ElementExtremeFunctorValue
functor = speed
value_type = max
execute_on = FINAL
[]
# The pin sits at a point, not a cell centroid, so the error is compared up to a constant.
[max_pressure_error]
type = ElementExtremeFunctorValue
functor = pressure_error
value_type = max
execute_on = FINAL
outputs = none
[]
[min_pressure_error]
type = ElementExtremeFunctorValue
functor = pressure_error
value_type = min
execute_on = FINAL
outputs = none
[]
[pressure_error_range]
type = ParsedPostprocessor
pp_names = 'max_pressure_error min_pressure_error'
expression = 'max_pressure_error-min_pressure_error'
execute_on = FINAL
[]
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
[]
[]