- functorThe name of the functor that this object operates on. 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 that this object operates on. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
ElementIntegralFunctorPostprocessor
Computes a volume integral of the specified functor
The ElementIntegralFunctorPostprocessor is also an intermediate base class that should be derived from for any calculation involving a volume integral of a functor quantity.
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
- evaluation_typeQUADRATURE_POINTHow the functor should be evaluated.
Default:QUADRATURE_POINT
C++ Type:MooseEnum
Options:CELL_AVERAGE, QUADRATURE_POINT
Controllable:No
Description:How the functor should be evaluated.
- prefactor1The name of a pre-factor inside the integrand. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
Default:1
C++ Type:MooseFunctorName
Unit:(no unit assumed)
Controllable:No
Description:The name of a pre-factor inside the integrand. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
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
- (test/tests/materials/piecewise_by_block_material/named_subdomain_error.i)
- (modules/heat_transfer/test/tests/radiation_participating_media/rad_T_coupled_medium_1d_G.i)
- (test/tests/interfacekernels/nonconforming/fine_primary.i)
- (modules/combined/test/tests/subchannel_thermo_mech/one_pin_problem_sub.i)
- (test/tests/postprocessors/element_integral/functors/element_integral_test.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/cht/bulk_heat_transfer/flow-around-square-linear.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/variables/scalar-with-fv-reaction/test.i)
- (modules/heat_transfer/test/tests/fvbcs/fv_marshak_bc/rad_istothermal_medium_2d.i)
- (test/tests/functors/get_functor/get_functor.i)
- (modules/heat_transfer/test/tests/fvbcs/fv_marshak_bc/rad_istothermal_medium_1d.i)
- (modules/heat_transfer/test/tests/fvkernels/radiation_istothermal_medium_1d.i)
- (modules/heat_transfer/test/tests/radiation_participating_media/rad_T_coupled_medium_1d.i)
- (modules/heat_transfer/test/tests/radiation_participating_media/rad_T_coupled_medium_1d_T.i)
- (test/tests/problems/external_problem/functors.i)
- (test/tests/interfacekernels/nonconforming/coarse_primary.i)
- (modules/heat_transfer/test/tests/radiation_participating_media/rad_isothermal_medium_1d.i)
Child Objects
(test/tests/materials/piecewise_by_block_material/named_subdomain_error.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 1
nx = 2
subdomain_name = left
[]
[right_block]
type = ParsedSubdomainMeshGenerator
input = gen
combinatorial_geometry = 'x > 0.5'
block_id = 1
block_name = right
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[Materials]
[coeff_mat]
type = ADPiecewiseByBlockFunctorMaterial
prop_name = coeff
subdomain_to_prop_value = 'left 1'
[]
[]
[Postprocessors]
[integral]
type = ADElementIntegralFunctorPostprocessor
block = right
functor = coeff
execute_on = INITIAL
[]
[]
(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
[]
(test/tests/interfacekernels/nonconforming/fine_primary.i)
# Same mesh and physics as coarse_primary.i, but primary_block (the side that carries the
# 'interface' boundary tag) is the finer 'gas' side instead. This direction already worked before
# the coarse-primary fix; it is kept as a regression guard and should give identical inventories
# to coarse_primary.i, since swapping which side is "primary" is purely a bookkeeping choice.
[Mesh]
[base]
type = CartesianMeshGenerator
dim = 3
dx = '1 1'
ix = '1 1'
dy = 1
iy = 2
dz = 1
iz = 2
subdomain_id = '0 1'
[]
[refine]
input = base
type = RefineBlockGenerator
block = 1
refinement = 1
[]
[interface]
type = SideSetsBetweenSubdomainsGenerator
input = refine
new_boundary = interface
primary_block = 1
paired_block = 0
[]
[rename]
input = interface
type = RenameBlockGenerator
old_block = '0 1'
new_block = 'sol gas'
[]
[]
[Variables]
[c_H2]
family = LAGRANGE
block = gas
[]
[c_2H]
family = LAGRANGE
block = sol
[]
[]
[AuxVariables]
[w]
block = sol
[]
[]
[AuxKernels]
[w]
type = FunctionAux
variable = w
function = '1 + y + 2 * z'
execute_on = INITIAL
[]
[]
[Kernels]
[diff_gas]
type = ADMatDiffusion
variable = c_H2
diffusivity = diffusivity
block = gas
[]
[diff_solid]
type = ADMatDiffusion
variable = c_2H
diffusivity = diffusivity
block = sol
[]
[]
[Materials]
[gas_diff]
type = ADGenericConstantMaterial
prop_names = 'diffusivity'
prop_values = 1
block = gas
[]
[solid_diff]
type = ADGenericConstantMaterial
prop_names = 'diffusivity'
prop_values = 0.25
block = sol
[]
# The solid-side interface rate depends on an auxiliary variable, which must be evaluated at the
# same physical points as the nonlinear variables on each face
[solid_rate]
type = ADParsedMaterial
property_name = k_sol
coupled_variables = w
expression = 'w'
block = sol
[]
[gas_rate]
type = ADGenericConstantMaterial
prop_names = 'k_gas'
prop_values = 2
block = gas
[]
[]
[InterfaceKernels]
[reaction]
type = ADMatInterfaceReaction
variable = c_H2
neighbor_var = c_2H
forward_rate = k_gas
backward_rate = k_sol
boundary = interface
[]
[]
[BCs]
[left]
type = ADDirichletBC
variable = c_2H
boundary = left
value = 0
[]
[right]
type = ADDirichletBC
variable = c_H2
boundary = right
value = 1
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
nl_abs_tol = 1e-12
[]
[Postprocessors]
[steel_inventory]
type = ADElementIntegralFunctorPostprocessor
functor = c_2H
block = sol
[]
[gas_inventory]
type = ADElementIntegralFunctorPostprocessor
functor = c_H2
block = gas
[]
[total_inventory]
type = LinearCombinationPostprocessor
pp_coefs = '1 1'
pp_names = 'steel_inventory gas_inventory'
[]
[]
[Outputs]
csv = true
[]
(modules/combined/test/tests/subchannel_thermo_mech/one_pin_problem_sub.i)
pin_diameter = 0.00950
heated_length = 1.0
T_in = 359.15
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Problem]
# Residual of the heat conduction and heat source kernels. At the nodes of the Dirichlet
# boundary, it is the heat flowing through that boundary
extra_tag_vectors = 'heat_residual'
[]
[Mesh]
second_order = true
[PinMesh]
type = GeneratedMeshGenerator
dim = 2
xmax = '${fparse pin_diameter / 2.0}'
bias_x = 1.0
nx = 20
ymax = ${heated_length}
ny = 100 # number of axial cells
[]
coord_type = RZ
rz_coord_axis = Y
beta_rotation = 90
[]
[Functions]
[Tpin_fn] # linear interpolation of the SCM pin surface temperature along the pin axis
type = PiecewiseLinearFromVectorPostprocessor
vectorpostprocessor_name = Tpin_profile
argument_column = z
value_column = Tpin
component = y
[]
[volumetric_heat_rate] # Defined such as to be consistent with the IC in SCM
type = ParsedFunction
expression = '(4.0 * 100000.0 / (pi * D * D * L)) * (pi/2)*sin(pi*y/L)'
symbol_names = 'L D'
symbol_values = '${heated_length} ${pin_diameter}'
[]
[]
[Variables]
[temperature]
order = SECOND
family = LAGRANGE
[]
[]
[AuxVariables]
[Pin_surface_temperature]
# Same order as temperature, so the MatchedValueBC has a value at every boundary node
order = SECOND
[]
[pin_diameter_deformed]
# order = CONSTANT
# family = MONOMIAL
[]
[q_prime]
order = CONSTANT
family = MONOMIAL
[]
# q_prime on the nodes, so that the transfer to the subchannel nodes is not ambiguous
[q_prime_nodal]
[]
[heat_residual]
# Same order as temperature, to hold the residual at every temperature node
order = SECOND
[]
[]
[Physics]
[SolidMechanics]
[QuasiStatic]
add_variables = true
strain = SMALL
incremental = true
generate_output = 'stress_xx stress_yy stress_xy'
temperature = temperature
[block0]
eigenstrain_names = eigenstrain
block = 0
[]
[]
[]
[]
[AuxKernels]
[QPrime]
type = SCMRZPinQPrimeAux # This kernel calculates linear heat rate for the 2D-RZ pin model
diffusivity = 'thermal_conductivity'
variable = q_prime
diffusion_variable = temperature
component = normal
boundary = 'right'
execute_on = 'TIMESTEP_END'
use_displaced_mesh = true
[]
[QPrimeNodal]
type = ProjectionAux
variable = q_prime_nodal
v = q_prime
execute_on = 'TIMESTEP_END'
[]
[HeatResidual]
type = TagVectorAux
variable = heat_residual
v = temperature
vector_tag = 'heat_residual'
[]
[Deformation]
type = ParsedAux
variable = pin_diameter_deformed
coupled_variables = 'disp_x'
expression = '2.0 * disp_x + ${pin_diameter}'
execute_on = 'timestep_end'
[]
[]
[Kernels]
[heat_conduction]
type = HeatConduction
variable = temperature
use_displaced_mesh = true
extra_vector_tags = 'heat_residual'
[]
[heat_source]
type = HeatSource
variable = temperature
function = volumetric_heat_rate
use_displaced_mesh = false
extra_vector_tags = 'heat_residual'
[]
[]
[Materials]
[elasticity_tensor]
type = ComputeIsotropicElasticityTensor
block = 0
bulk_modulus = 0.333333333333e6
poissons_ratio = 0.0
[]
[thermal_strain]
type = ComputeThermalExpansionEigenstrain
block = 0
temperature = temperature
stress_free_temperature = 117.56
thermal_expansion_coeff = 1e-5
eigenstrain_name = eigenstrain
[]
[stress]
type = ComputeStrainIncrementBasedStress
block = 0
[]
[heat_conductor]
type = HeatConductionMaterial
thermal_conductivity = 1.0
block = 0
[]
[]
[BCs]
# right_interpolated replaces right when SCM sends Tpin with the Tpin_interpolated transfer
inactive = right_interpolated
[left]
type = NeumannBC
variable = temperature
boundary = 'left'
[]
[right]
type = MatchedValueBC
variable = temperature
boundary = 'right'
v = Pin_surface_temperature
[]
[right_interpolated]
type = FunctionDirichletBC
variable = temperature
boundary = 'right'
function = Tpin_fn
[]
[no_x]
type = DirichletBC
variable = disp_x
boundary = 'left'
value = 0.0
[]
[no_y]
type = DirichletBC
variable = disp_y
boundary = 'bottom top'
value = 0.0
[]
[]
[ICs]
[temperature_ic]
type = ConstantIC
variable = temperature
value = ${T_in}
[]
[q_prime_ic]
type = ConstantIC
variable = q_prime
value = 0.0
[]
[RD_IC]
type = ConstantIC
variable = pin_diameter_deformed
value = ${pin_diameter}
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
nl_abs_tol = 1e-7
l_max_its = 20
start_time = 0.0
dt = 0.5
num_steps = 2
end_time = 1.0
petsc_options_iname = '-pc_type -mat_fd_coloring_err -mat_fd_type'
petsc_options_value = 'lu 1e-6 ds'
[Quadrature]
order = FIFTH
side_order = SEVENTH
[]
[]
[Postprocessors]
# Heat rate through the pin surface from the residual at the pin surface nodes, preserved by the
# q_prime transfer to SCM. The weak form balances it with the heat source, so it equals the pin
# power up to the nonlinear tolerance on any mesh
[pin_surface_residual]
type = NodalSum
variable = heat_residual
boundary = right
outputs = none
[]
[pin_surface_heat_rate]
# The residual is negative for heat leaving the pin
type = ParsedPostprocessor
expression = '-pin_surface_residual'
pp_names = 'pin_surface_residual'
[]
# Heat rate through the pin surface from the temperature gradient, which exceeds the heat source
# by the discretization error of the gradient
[pin_surface_heat_rate_gradient]
type = SideDiffusiveFluxIntegral
variable = temperature
boundary = right
diffusivity = thermal_conductivity
use_displaced_mesh = true
[]
[total_power]
type = ElementIntegralFunctorPostprocessor
functor = volumetric_heat_rate
use_displaced_mesh = false
[]
[total_power_disp]
type = ElementIntegralFunctorPostprocessor
functor = volumetric_heat_rate
use_displaced_mesh = true
[]
[volume]
type = VolumePostprocessor
[]
[volume_disp]
type = VolumePostprocessor
use_displaced_mesh = true
[]
[]
[VectorPostprocessors]
# Filled by the Tpin_interpolated transfer from SCM: pin surface temperature at the SCM axial nodes
[Tpin_profile]
type = ConstantVectorPostprocessor
vector_names = 'z Tpin'
value = '0 ${heated_length}; ${T_in} ${T_in}'
[]
[]
[Outputs]
exodus = true
[csv]
type = CSV
show = 'pin_surface_heat_rate pin_surface_heat_rate_gradient total_power'
[]
[]
(test/tests/postprocessors/element_integral/functors/element_integral_test.i)
[Mesh]
second_order = true
[square]
type = GeneratedMeshGenerator
nx = 2
ny = 2
dim = 2
[]
[block]
type = ParsedSubdomainMeshGenerator
input = square
block_id = 1
combinatorial_geometry = 'x > 0.5'
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Steady
[]
[AuxVariables]
[nodal]
[InitialCondition]
type = FunctionIC
function = '1 + x*x + y*y*y'
[]
[]
[fe_higher_order]
order = SECOND
[InitialCondition]
type = FunctionIC
function = '1 + x*x + y*y*y'
[]
[]
[fe_elemental]
family = MONOMIAL
order = SECOND
[InitialCondition]
type = FunctionIC
function = '1 + x*x + y*y*y'
[]
[]
[fv_var]
type = MooseVariableFVReal
[FVInitialCondition]
type = FVFunctionIC
function = '1 + x*x + y*y*y'
[]
[]
[]
[Functions]
[f]
type = ParsedFunction
expression = '1 + x*x + y*y*y'
[]
[]
[Materials]
[two_piece]
type = ADPiecewiseByBlockFunctorMaterial
prop_name = 'mat'
subdomain_to_prop_value = '0 nodal 1 fv_var'
[]
[]
[Postprocessors]
[fe]
type = ADElementIntegralFunctorPostprocessor
functor = nodal
[]
[fe_higher_order]
type = ADElementIntegralFunctorPostprocessor
functor = fe_higher_order
[]
[fe_elemental]
type = ADElementIntegralFunctorPostprocessor
functor = fe_elemental
[]
[fv]
type = ADElementIntegralFunctorPostprocessor
functor = fv_var
[]
[function]
type = ElementIntegralFunctorPostprocessor
functor = f
prefactor = f
[]
[functor_matprop]
type = ADElementIntegralFunctorPostprocessor
functor = mat
[]
[]
[Outputs]
file_base = out
exodus = false
csv = true
[]
(modules/navier_stokes/test/tests/finite_volume/ins/cht/bulk_heat_transfer/flow-around-square-linear.i)
mu = 0.01
rho = 1.1
k = 0.0005
cp = 10
k_s = 3.0
h_conv = 5
power_density = 10000
advected_interp_method = 'upwind'
[Mesh]
[generated_mesh]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 10
xmin = 0
ymin = 0
ymax = 0.1
xmax = 0.1
[]
[subdomain1]
type = SubdomainBoundingBoxGenerator
input = generated_mesh
block_name = subdomain1
bottom_left = '0.04 0.04 0'
block_id = 1
top_right = '0.06 0.06 0'
[]
[interface]
type = SideSetsBetweenSubdomainsGenerator
input = subdomain1
primary_block = 0
paired_block = 1
new_boundary = interface
[]
[]
[Problem]
linear_sys_names = 'u_system v_system pressure_system energy_system solid_energy_system'
previous_nl_solution_required = true
[]
[UserObjects]
[rc]
type = RhieChowMassFlux
u = vel_x
v = vel_y
pressure = pressure
rho = ${rho}
p_diffusion_kernel = p_diffusion
block = 0
[]
[]
[Variables]
[vel_x]
type = MooseLinearVariableFVReal
initial_condition = 0.1
solver_sys = u_system
block = 0
[]
[vel_y]
type = MooseLinearVariableFVReal
solver_sys = v_system
initial_condition = 0.01
block = 0
[]
[pressure]
type = MooseLinearVariableFVReal
solver_sys = pressure_system
initial_condition = 0.2
block = 0
[]
[T_fluid]
type = MooseLinearVariableFVReal
solver_sys = energy_system
initial_condition = 300
block = 0
[]
[T_solid]
type = MooseLinearVariableFVReal
solver_sys = solid_energy_system
initial_condition = 500
block = 1
[]
[]
[FVInterpolationMethods]
[upwind]
type = FVAdvectedUpwind
[]
[]
[LinearFVKernels]
[u_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_x
advected_interp_method_name = ${advected_interp_method}
mu = ${mu}
u = vel_x
v = vel_y
momentum_component = 'x'
rhie_chow_user_object = 'rc'
use_nonorthogonal_correction = true
[]
[v_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_y
advected_interp_method_name = ${advected_interp_method}
mu = ${mu}
u = vel_x
v = vel_y
momentum_component = 'y'
rhie_chow_user_object = 'rc'
use_nonorthogonal_correction = true
[]
[u_pressure]
type = LinearFVMomentumPressure
variable = vel_x
pressure = pressure
momentum_component = 'x'
[]
[v_pressure]
type = LinearFVMomentumPressure
variable = vel_y
pressure = pressure
momentum_component = 'y'
[]
[p_diffusion]
type = LinearFVPressureCorrectionDiffusion
variable = pressure
diffusion_tensor = Ainv
use_nonorthogonal_correction = true
[]
[HbyA_divergence]
type = LinearFVDivergence
variable = pressure
face_flux = HbyA
force_boundary_execution = true
[]
[h_advection]
type = LinearFVEnergyAdvection
variable = T_fluid
advected_quantity = temperature
cp = ${cp}
advected_interp_method = ${advected_interp_method}
rhie_chow_user_object = 'rc'
[]
[conduction]
type = LinearFVDiffusion
variable = T_fluid
diffusion_coeff = ${k}
use_nonorthogonal_correction = true
[]
[solid-conduction]
type = LinearFVDiffusion
variable = T_solid
diffusion_coeff = ${k_s}
use_nonorthogonal_correction = true
[]
[solid-source]
type = LinearFVSource
variable = T_solid
source_density = ${power_density}
[]
[]
[LinearFVBCs]
[inlet-u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left'
variable = vel_x
functor = '0.1'
[]
[inlet-v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left'
variable = vel_y
functor = '0.0'
[]
[walls-u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'top bottom interface'
variable = vel_x
functor = 0.0
[]
[walls-v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'top bottom interface'
variable = vel_y
functor = 0.0
[]
[outlet_p]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'right'
variable = pressure
functor = 1.4
[]
[outlet_u]
type = LinearFVAdvectionDiffusionOutflowBC
variable = vel_x
use_two_term_expansion = false
boundary = right
[]
[outlet_v]
type = LinearFVAdvectionDiffusionOutflowBC
variable = vel_y
use_two_term_expansion = false
boundary = right
[]
[inlet_T]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = T_fluid
functor = 300
boundary = 'left'
[]
[walls_T]
type = LinearFVAdvectionDiffusionFunctorNeumannBC
variable = T_fluid
functor = 0.0
boundary = 'top bottom'
[]
[outlet_T]
type = LinearFVAdvectionDiffusionOutflowBC
variable = T_fluid
use_two_term_expansion = false
boundary = right
[]
[fluid_solid]
type = LinearFVConvectiveHeatTransferBC
variable = T_fluid
T_solid = T_solid
T_fluid = T_fluid
boundary = interface
h = ${h_conv}
[]
[solid_fluid]
type = LinearFVConvectiveHeatTransferBC
variable = T_solid
T_solid = T_solid
T_fluid = T_fluid
boundary = interface
h = ${h_conv}
[]
[]
[FunctorMaterials]
[rhocpT]
property_name = 'rhocpT'
type = ParsedFunctorMaterial
functor_names = 'T_fluid'
expression = '${rho}*${cp}*T_fluid'
[]
[]
[Postprocessors]
[h_in]
type = VolumetricFlowRate
boundary = left
vel_x = vel_x
vel_y = vel_y
rhie_chow_user_object = rc
advected_quantity = 'rhocpT'
subtract_mesh_velocity = false
[]
[h_out]
type = VolumetricFlowRate
boundary = right
vel_x = vel_x
vel_y = vel_y
rhie_chow_user_object = rc
advected_quantity = 'rhocpT'
advected_interp_method = upwind
subtract_mesh_velocity = false
[]
[power]
type = ElementIntegralFunctorPostprocessor
functor = ${power_density}
block = 1
[]
[]
[Executioner]
type = SIMPLE
momentum_l_abs_tol = 1e-13
pressure_l_abs_tol = 1e-13
energy_l_abs_tol = 1e-13
solid_energy_l_abs_tol = 1e-13
momentum_l_tol = 0
pressure_l_tol = 0
energy_l_tol = 0
solid_energy_l_tol = 0
rhie_chow_user_object = 'rc'
momentum_systems = 'u_system v_system'
pressure_system = 'pressure_system'
energy_system = 'energy_system'
solid_energy_system = 'solid_energy_system'
momentum_equation_relaxation = 0.8
energy_equation_relaxation = 1.0
pressure_variable_relaxation = 0.3
num_iterations = 1000
pressure_absolute_tolerance = 1e-10
momentum_absolute_tolerance = 1e-10
energy_absolute_tolerance = 1e-10
solid_energy_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'
solid_energy_petsc_options_iname = '-pc_type -pc_hypre_type'
solid_energy_petsc_options_value = 'hypre boomeramg'
print_fields = false
continue_on_max_its = true
[]
[Outputs]
exodus = true
execute_on = timestep_end
[]
(modules/navier_stokes/test/tests/finite_volume/ins/variables/scalar-with-fv-reaction/test.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 1
nx = 20
[]
[]
[Variables]
[u]
type = INSFVScalarFieldVariable
[]
[]
[FVKernels]
[time]
type = FVDiffusion
coeff = 1
variable = u
[]
[rxn]
type = FVReaction
variable = u
[]
[]
[FVBCs]
[left]
type = FVDirichletBC
boundary = 'left'
value = 1
variable = u
[]
[right]
type = FVDirichletBC
boundary = 'right'
value = 0
variable = u
[]
[]
[Executioner]
type = Steady
solve_type = Newton
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[Postprocessors]
[avg]
type = ElementIntegralFunctorPostprocessor
functor = u
[]
[]
[Outputs]
csv = true
[]
(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
[]
(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
[]
(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
[]
(modules/heat_transfer/test/tests/fvkernels/radiation_istothermal_medium_1d.i)
diffusion_coef = 1.0
opacity = 1.0
temperature_radiation = 100.0
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 = FVDirichletBC
boundary = 'right'
variable = G
value = ${G_bc}
[]
[]
[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]
[value_solution]
type = ElementIntegralFunctorPostprocessor
functor = G
[]
[value_analytic]
type = ElementIntegralFunctorPostprocessor
functor = analytical_sol
[]
[relative_difference]
type = RelativeDifferencePostprocessor
value1 = value_solution
value2 = 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]
exodus = false
csv = true
[]
(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/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'
[]
[]
(test/tests/problems/external_problem/functors.i)
[Mesh]
[m]
type = CartesianMeshGenerator
dim = 1
dx = '10.0'
ix = 2
[]
[]
[AuxVariables]
[test]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[test]
type = ParsedAux
variable = test
expression = 'x'
use_xyzt = true
[]
[]
[Postprocessors]
[no_functor]
type = ElementIntegralVariablePostprocessor
variable = test
[]
[functor]
type = ADElementIntegralFunctorPostprocessor
functor = test
[]
[]
[Problem]
type = DummyExternalProblem
[]
[Executioner]
type = Transient
num_steps = 2
[]
[Outputs]
csv = true
[]
(test/tests/interfacekernels/nonconforming/coarse_primary.i)
# The 'gas' block is initially refined one level beyond 'sol', so each 'sol' element's face on
# the interface borders four active 'gas' children instead of one. primary_block (the side that
# carries the 'interface' boundary tag, and thus the side InterfaceKernels are evaluated on) is
# the coarser 'sol' side here, exercising the one-coarse-primary-to-many-fine-neighbors case.
[Mesh]
[base]
type = CartesianMeshGenerator
dim = 3
dx = '1 1'
ix = '1 1'
dy = 1
iy = 2
dz = 1
iz = 2
subdomain_id = '0 1'
[]
[refine]
input = base
type = RefineBlockGenerator
block = 1
refinement = 1
[]
[interface]
type = SideSetsBetweenSubdomainsGenerator
input = refine
new_boundary = interface
primary_block = 0
paired_block = 1
[]
[rename]
input = interface
type = RenameBlockGenerator
old_block = '0 1'
new_block = 'sol gas'
[]
[]
[Variables]
[c_H2]
family = LAGRANGE
block = gas
[]
[c_2H]
family = LAGRANGE
block = sol
[]
[]
[AuxVariables]
[w]
block = sol
[]
[]
[AuxKernels]
[w]
type = FunctionAux
variable = w
function = '1 + y + 2 * z'
execute_on = INITIAL
[]
[]
[Kernels]
[diff_gas]
type = ADMatDiffusion
variable = c_H2
diffusivity = diffusivity
block = gas
[]
[diff_solid]
type = ADMatDiffusion
variable = c_2H
diffusivity = diffusivity
block = sol
[]
[]
[Materials]
[gas_diff]
type = ADGenericConstantMaterial
prop_names = 'diffusivity'
prop_values = 1
block = gas
[]
[solid_diff]
type = ADGenericConstantMaterial
prop_names = 'diffusivity'
prop_values = 0.25
block = sol
[]
# The solid-side interface rate depends on an auxiliary variable, which must be evaluated at the
# same physical points as the nonlinear variables on each face
[solid_rate]
type = ADParsedMaterial
property_name = k_sol
coupled_variables = w
expression = 'w'
block = sol
[]
[gas_rate]
type = ADGenericConstantMaterial
prop_names = 'k_gas'
prop_values = 2
block = gas
[]
[]
[InterfaceKernels]
[reaction]
type = ADMatInterfaceReaction
variable = c_2H
neighbor_var = c_H2
forward_rate = k_sol
backward_rate = k_gas
boundary = interface
[]
[]
[BCs]
[left]
type = ADDirichletBC
variable = c_2H
boundary = left
value = 0
[]
[right]
type = ADDirichletBC
variable = c_H2
boundary = right
value = 1
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
nl_abs_tol = 1e-12
[]
[Postprocessors]
[steel_inventory]
type = ADElementIntegralFunctorPostprocessor
functor = c_2H
block = sol
[]
[gas_inventory]
type = ADElementIntegralFunctorPostprocessor
functor = c_H2
block = gas
[]
[total_inventory]
type = LinearCombinationPostprocessor
pp_coefs = '1 1'
pp_names = 'steel_inventory gas_inventory'
[]
[]
[Outputs]
csv = true
[]
(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
[]
(framework/include/postprocessors/ElementAverageFunctorPostprocessor.h)
// This file is part of the MOOSE framework
// https://mooseframework.inl.gov
//
// All rights reserved, see COPYRIGHT for full restrictions
// https://github.com/idaholab/moose/blob/master/COPYRIGHT
//
// Licensed under LGPL 2.1, please see LICENSE for details
// https://www.gnu.org/licenses/lgpl-2.1.html
#pragma once
#include "ElementIntegralFunctorPostprocessor.h"
/**
* This postprocessor computes an element average of the specified functor
*/
class ElementAverageFunctorPostprocessor : public ElementIntegralFunctorPostprocessor
{
public:
static InputParameters validParams();
ElementAverageFunctorPostprocessor(const InputParameters & parameters);
protected:
virtual void initialize() override;
virtual void execute() override;
virtual void threadJoin(const UserObject & y) override;
virtual void finalize() override;
virtual Real getValue() const override;
private:
Real _volume = 0;
};