- functionThe initial condition function.
C++ Type:FunctionName
Unit:(no unit assumed)
Controllable:No
Description:The initial condition function.
- variableThe variable this initial condition is supposed to provide values for.
C++ Type:VariableName
Unit:(no unit assumed)
Controllable:No
Description:The variable this initial condition is supposed to provide values for.
FVFunctionIC
An initial condition that uses a normal function of x, y, z to produce values (and optionally gradients) for a field variable.
Sets an initial condition via a Function described by parameter "function". It can be restricted to particular blocks using the "block" parameter.
Example input syntax
In this example, we set the initial value of variable u using a ParsedFunction.
[FVICs<<<{"href": "../../syntax/FVICs/index.html"}>>>]
[u_ic]
type = FVFunctionIC<<<{"description": "An initial condition that uses a normal function of x, y, z to produce values (and optionally gradients) for a field variable.", "href": "FVFunctionIC.html"}>>>
variable<<<{"description": "The variable this initial condition is supposed to provide values for."}>>> = 'u'
function<<<{"description": "The initial condition function."}>>> = parsed_function
[]
[]
[Functions<<<{"href": "../../syntax/Functions/index.html"}>>>]
[parsed_function]
type = ParsedFunction<<<{"description": "Function created by parsing a string", "href": "../functions/MooseParsedFunction.html"}>>>
expression<<<{"description": "The user defined function."}>>> = 'sin(x)-cos(y/2)'
[]
[](test/tests/fvics/function_ic/parsed_function.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
- scaling_factor1Scaling factor to apply on the function
Default:1
C++ Type:Real
Unit:(no unit assumed)
Controllable:No
Description:Scaling factor to apply on the function
- stateCURRENTThis parameter is used to set old state solutions at the start of simulation. If specifying multiple states at the start of simulation, use one IC object for each state being specified. The states are CURRENT=0 OLD=1 OLDER=2. States older than 2 are not currently supported. When the user only specifies current state, the solution is copied to the old and older states, as expected. This functionality is mainly used for dynamic simulations with explicit time integration schemes, where old solution states are used in the velocity and acceleration approximations.
Default:CURRENT
C++ Type:MooseEnum
Options:CURRENT, OLD, OLDER
Controllable:No
Description:This parameter is used to set old state solutions at the start of simulation. If specifying multiple states at the start of simulation, use one IC object for each state being specified. The states are CURRENT=0 OLD=1 OLDER=2. States older than 2 are not currently supported. When the user only specifies current state, the solution is copied to the old and older states, as expected. This functionality is mainly used for dynamic simulations with explicit time integration schemes, where old solution states are used in the velocity and acceleration approximations.
Optional Parameters
- control_tagsAdds user-defined labels for accessing object parameters via control logic.
C++ Type:std::vector<std::string>
Controllable:No
Description:Adds user-defined labels for accessing object parameters via control logic.
- enableTrueSet the enabled status of the MooseObject.
Default:True
C++ Type:bool
Controllable:No
Description:Set the enabled status of the MooseObject.
Advanced Parameters
Input Files
- (modules/navier_stokes/test/tests/finite_volume/wcns/materials/enthalpy_computation.i)
- (test/tests/postprocessors/side_average_value/side_average_functor_test.i)
- (test/tests/fvics/function_ic/parsed_function.i)
- (test/tests/materials/piecewise_by_block_material/discontinuous.i)
- (test/tests/vectorpostprocessors/element_value_sampler/mixed_fe_fv_sampler.i)
- (test/tests/postprocessors/element_integral/functors/element_integral_test.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/cht/conjugate_heat_transfer/cht_thermal_resistance.i)
- (modules/porous_flow/test/tests/heat_advection/heat_advection_1d_fv.i)
- (test/tests/postprocessors/side_integral/side_integral_functor.i)
function
C++ Type:FunctionName
Unit:(no unit assumed)
Controllable:No
Description:The initial condition function.
block
C++ Type:std::vector<SubdomainName>
Controllable:No
Description:The list of blocks (ids or names) that this object will be applied
(test/tests/fvics/function_ic/parsed_function.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 3.1416
ymin = 0
ymax = 3.1416
nx = 10
ny = 10
[]
[]
[Variables]
[u]
type = MooseVariableFVReal
[]
[]
[Functions]
[parsed_function]
type = ParsedFunction
expression = 'sin(x)-cos(y/2)'
[]
[]
[FVICs]
[u_ic]
type = FVFunctionIC
variable = 'u'
function = parsed_function
[]
[]
[Executioner]
type = Steady
[]
[Problem]
solve = false
[]
[Outputs]
exodus = true
[]
(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
[]
(test/tests/postprocessors/side_average_value/side_average_functor_test.i)
[Mesh]
inactive = 'refine'
# U-shaped domains to have internal boundaries in
# a variety of directions
[cmg]
type = CartesianMeshGenerator
dim = 2
dx = '1 1 1'
dy = '3 1'
ix = '4 5 3'
iy = '12 4'
subdomain_id = '1 2 1
1 1 1'
[]
[internal_boundary_dir1]
type = SideSetsBetweenSubdomainsGenerator
input = cmg
primary_block = 1
paired_block = 2
new_boundary = 'inside_1'
[]
[internal_boundary_dir2]
type = SideSetsBetweenSubdomainsGenerator
input = internal_boundary_dir1
primary_block = 2
paired_block = 1
new_boundary = 'inside_2'
[]
[refine]
type = RefineBlockGenerator
input = internal_boundary_dir2
block = '1 2'
refinement = '2 1'
[]
[]
[Variables]
[u]
type = MooseVariableFVReal
block = 1
[]
[]
[AuxVariables]
[v1]
type = MooseVariableFVReal
block = 1
[FVInitialCondition]
type = FVFunctionIC
function = 'x + y'
[]
[]
[v2]
type = MooseVariableFVReal
block = 2
[FVInitialCondition]
type = FVFunctionIC
function = '2*x*x - y'
[]
[]
[]
[Functions]
[f1]
type = ParsedFunction
expression = 'exp(x - y)'
[]
[]
[FunctorMaterials]
[m1]
type = ADGenericFunctorMaterial
prop_names = 'm1'
prop_values = 'f1'
[]
[m2]
type = ADPiecewiseByBlockFunctorMaterial
prop_name = 'm2'
subdomain_to_prop_value = '1 12
2 4'
[]
[]
[FVKernels]
[diff]
type = FVDiffusion
variable = u
coeff = '1'
[]
[]
[FVBCs]
[left]
type = FVDirichletBC
variable = u
boundary = 3
value = 0
[]
[right]
type = FVDirichletBC
variable = u
boundary = 1
value = 1
[]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
[]
[Postprocessors]
# Mesh external boundaries integration
[ext_u]
type = SideAverageFunctorPostprocessor
boundary = 'left top right'
functor = u
restrict_to_functors_domain = true
[]
[ext_u_int]
type = ADSideIntegralFunctorPostprocessor
boundary = 'left top right'
functor = u
restrict_to_functors_domain = true
[]
[ext_u_area]
type = AreaPostprocessor
boundary = 'left top right'
[]
[ext_u_diff]
type = ParsedPostprocessor
pp_names = 'ext_u ext_u_int ext_u_area'
expression = 'ext_u - ext_u_int/ext_u_area'
[]
[ext_v1]
type = SideAverageFunctorPostprocessor
boundary = 'left right'
functor = v1
[]
[ext_v2]
type = SideAverageFunctorPostprocessor
boundary = 'top'
functor = v2
restrict_to_functors_domain = true
[]
[ext_f1]
type = SideAverageFunctorPostprocessor
boundary = 'left top right'
functor = f1
prefactor = f1
[]
[ext_m1]
type = SideAverageFunctorPostprocessor
boundary = 'left top right'
functor = m1
restrict_to_functors_domain = true
[]
[ext_m2]
type = SideAverageFunctorPostprocessor
boundary = 'left top right'
functor = m2
restrict_to_functors_domain = true
[]
# Internal to the mesh, but a side to the variables
# With orientation of normal 1->2
[int_s1_u]
type = SideAverageFunctorPostprocessor
boundary = inside_1
functor = u
[]
[int_s1_v1]
type = SideAverageFunctorPostprocessor
boundary = inside_1
functor = v1
[]
[int_s1_f1]
type = SideAverageFunctorPostprocessor
boundary = inside_1
functor = f1
[]
[int_s1_m1]
type = SideAverageFunctorPostprocessor
boundary = inside_1
functor = m1
[]
[int_s1_m2]
type = SideAverageFunctorPostprocessor
boundary = inside_1
functor = m2
[]
# With orientation of normal 2->1
[int_s2_v2]
type = SideAverageFunctorPostprocessor
boundary = inside_2
functor = v2
[]
[int_s2_f1]
type = SideAverageFunctorPostprocessor
boundary = inside_2
functor = f1
[]
[int_s2_m1]
type = SideAverageFunctorPostprocessor
boundary = inside_2
functor = m1
[]
[int_s2_m2]
type = SideAverageFunctorPostprocessor
boundary = inside_2
functor = m2
[]
[]
[Outputs]
csv = true
exodus = true
[]
[Problem]
kernel_coverage_check = false
[]
(test/tests/fvics/function_ic/parsed_function.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 3.1416
ymin = 0
ymax = 3.1416
nx = 10
ny = 10
[]
[]
[Variables]
[u]
type = MooseVariableFVReal
[]
[]
[Functions]
[parsed_function]
type = ParsedFunction
expression = 'sin(x)-cos(y/2)'
[]
[]
[FVICs]
[u_ic]
type = FVFunctionIC
variable = 'u'
function = parsed_function
[]
[]
[Executioner]
type = Steady
[]
[Problem]
solve = false
[]
[Outputs]
exodus = true
[]
(test/tests/materials/piecewise_by_block_material/discontinuous.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 1
nx = 10
xmax = 2
[]
[subdomain1]
input = gen
type = SubdomainBoundingBoxGenerator
bottom_left = '1.0 0 0'
block_id = 1
top_right = '2.0 1.0 0'
[]
[middle]
input = subdomain1
type = SideSetsBetweenSubdomainsGenerator
new_boundary = middle
paired_block = 1
primary_block = 0
[]
[]
[Variables]
[dummy]
type = MooseVariableFVReal
[]
[]
# This is added to have sufficient ghosting layers, see #19534
[FVKernels]
[diff]
type = FVDiffusion
variable = 'dummy'
coeff = 1
[]
[]
[AuxVariables]
[u]
type = MooseVariableFVReal
[]
[v]
type = MooseVariableFVReal
[FVInitialCondition]
type = FVFunctionIC
function = '4 * (x - 7) * (x - 8)'
[]
[]
[]
[AuxKernels]
# to trigger off-boundary element computations
[to_var]
type = ADMaterialRealAux
variable = 'u'
property = coeff
[]
[]
[Materials]
[coeff_mat]
type = ADPiecewiseConstantByBlockMaterial
prop_name = 'coeff'
subdomain_to_prop_value = '0 4
1 2'
[]
[]
[Postprocessors]
# to trigger on boundary element computations
[flux]
type = ADNonFunctorSideDiffusiveFluxIntegral
boundary = left
variable = v
diffusivity = 'coeff'
[]
# to trigger ghost evaluations
[flux_mid]
type = ADInterfaceDiffusiveFluxIntegral
boundary = middle
variable = v
diffusivity = 'coeff'
coeff_interp_method = average
[]
[]
[Executioner]
type = Steady
[]
[Problem]
solve = false
[]
[Outputs]
exodus = true
# To get level of ghosting
[console]
type = Console
system_info = 'framework mesh aux nonlinear execution relationship'
[]
[]
(test/tests/vectorpostprocessors/element_value_sampler/mixed_fe_fv_sampler.i)
[Mesh]
[cmg]
type = CartesianMeshGenerator
dim = 1
dx = 3
ix = 10
[]
[]
[AuxVariables]
[T]
type = MooseVariableFVReal
[FVInitialCondition]
type = FVFunctionIC
function = '10 * x*x'
[]
[]
[T_linear]
type = MooseLinearVariableFVReal
initial_condition = 0.15
[]
[grad_T]
order = CONSTANT
family = MONOMIAL_VEC
[]
[auxGrad_T_x]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxKernels]
[grad_T_aux]
type = FunctorElementalGradientAux
variable = grad_T
functor = T
[]
[grad_T_x_aux]
type = VectorVariableComponentAux
variable = auxGrad_T_x
vector_variable = grad_T
component = 'x'
[]
[]
[VectorPostprocessors]
[element_value_sampler]
type = ElementValueSampler
variable = 'T auxGrad_T_x T_linear'
sort_by = id
[]
[]
[Outputs]
csv = true
[]
[Executioner]
type = Steady
[]
[Problem]
solve = false
[]
(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/conjugate_heat_transfer/cht_thermal_resistance.i)
# One-dimensional conjugate heat-transfer validation with an area-normalized
# interface thermal resistance. The four mms.run_spatial levels refine the
# initial 10 + 10 element mesh to a final 80 + 80 element mesh.
rho_salt = 2000
cp_salt = 2000
k_salt = 0.6
rho_solid = 2000
cp_solid = 900
k_solid = 10
T_hot = 400
T_cold = 300
R_interface = 0.1
L_solid = 0.5
L_salt = 0.5
nx_solid = 10
nx_salt = 10
# Exact 1D steady conduction solution for comparison.
q_exact = ${fparse (T_hot - T_cold) / (L_solid / k_solid + R_interface + L_salt / k_salt)}
T_solid_interface_exact = ${fparse T_cold + q_exact * L_solid / k_solid}
T_salt_interface_exact = ${fparse T_solid_interface_exact + q_exact * R_interface}
[Problem]
kernel_coverage_check = false
material_coverage_check = false
previous_nl_solution_required = true
linear_sys_names = 'energy_system p_system u_system solid_energy_system'
[]
[FVInterpolationMethods]
[harm]
type = FVHarmonicAverage
[]
[]
[Mesh]
[solid_mesh]
type = GeneratedMeshGenerator
dim = 1
nx = ${nx_solid}
xmin = 0.0
xmax = ${L_solid}
subdomain_ids = 0
bias_x = 1.0
[]
[fluid_mesh]
type = GeneratedMeshGenerator
dim = 1
nx = ${nx_salt}
xmin = ${L_solid}
xmax = ${fparse L_solid + L_salt}
subdomain_ids = 1
bias_x = 1.0
[]
[name_solid]
type = RenameBlockGenerator
input = solid_mesh
old_block = 0
new_block = 'solid'
[]
[name_salt]
type = RenameBlockGenerator
input = fluid_mesh
old_block = 1
new_block = 'salt'
[]
[stitch]
type = StitchMeshGenerator
inputs = 'name_solid name_salt'
stitch_boundaries_pairs = 'right left'
[]
[interface]
type = SideSetsBetweenSubdomainsGenerator
input = stitch
primary_block = 'solid'
paired_block = 'salt'
new_boundary = interface
[]
[]
[Functions]
[T_solid_exact]
type = ParsedFunction
expression = '${T_cold} + ${q_exact} * x / ${k_solid}'
[]
[T_salt_exact]
type = ParsedFunction
expression = '${T_salt_interface_exact} + ${q_exact} * (x - ${L_solid}) / ${k_salt}'
[]
[]
[UserObjects]
[rc]
type = RhieChowMassFlux
u = vel_x
v = vel_y
w = vel_z
pressure = pressure
rho = 1
p_diffusion_kernel = p_diffusion
block = salt
[]
[]
[Variables]
[temp_salt]
type = MooseLinearVariableFVReal
solver_sys = energy_system
block = salt
[]
[temp_solid]
type = MooseLinearVariableFVReal
solver_sys = solid_energy_system
block = solid
[]
[vel_x]
type = MooseLinearVariableFVReal
solver_sys = 'u_system'
initial_condition = 0
block = salt
[]
[pressure]
type = MooseLinearVariableFVReal
solver_sys = 'p_system'
initial_condition = 0
block = salt
[]
[]
[FVICs]
[solid_exact_ic]
type = FVFunctionIC
variable = temp_solid
function = T_solid_exact
block = solid
[]
[salt_exact_ic]
type = FVFunctionIC
variable = temp_salt
function = T_salt_exact
block = salt
[]
[]
[LinearFVKernels]
[p_diffusion]
type = LinearFVPressureCorrectionDiffusion
variable = pressure
diffusion_tensor = Ainv
block = salt
use_nonorthogonal_correction = false
[]
[h_time]
type = LinearFVTimeDerivative
variable = temp_salt
factor = ${fparse rho_salt * cp_salt}
block = salt
[]
[h_conduction]
type = LinearFVDiffusion
variable = temp_salt
diffusion_coeff = ${k_salt}
use_nonorthogonal_correction = false
block = salt
coeff_interp_method = harm
[]
[solid_time]
type = LinearFVTimeDerivative
variable = temp_solid
factor = ${fparse rho_solid * cp_solid}
block = solid
[]
[solid_conduction]
type = LinearFVDiffusion
variable = temp_solid
diffusion_coeff = ${k_solid}
use_nonorthogonal_correction = false
block = solid
coeff_interp_method = harm
[]
[]
[FunctorMaterials]
[]
[LinearFVBCs]
[solid_left]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = temp_solid
boundary = left
functor = ${T_cold}
[]
[fluid_right]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = temp_salt
boundary = right
functor = ${T_hot}
[]
# Neumann-Dirichlet CHT pair. The Robin BC emulates a Neumann BC because h = 0.
# This avoids adding an unrelated heat-transfer coefficient to the accuracy test.
[fluid_solid]
type = LinearFVRobinCHTBC
variable = temp_salt
boundary = interface
h = 0
thermal_conductivity = ${k_salt}
incoming_flux = heat_flux_to_fluid_interface
surface_temperature = interface_temperature_to_fluid_interface
[]
[solid_fluid]
type = LinearFVDirichletCHTBC
variable = temp_solid
boundary = interface
functor = interface_temperature_to_solid_interface
[]
[]
[Postprocessors]
[h]
type = AverageElementSize
outputs = csv
[]
# Numerical interface quantities
[q]
type = SideAverageFunctorPostprocessor
boundary = interface
functor = heat_flux_to_solid_interface
functor_argument = face
[]
[t_solid]
type = SideAverageFunctorPostprocessor
boundary = interface
functor = interface_temperature_to_solid_interface
functor_argument = face
[]
[t_fluid]
type = SideAverageFunctorPostprocessor
boundary = interface
functor = interface_temperature_to_fluid_interface
functor_argument = face
[]
# Analytical interface quantities
[q_analytical]
type = ParsedPostprocessor
expression = '${q_exact}'
[]
[t_solid_analytical]
type = ParsedPostprocessor
expression = '${T_solid_interface_exact}'
[]
[t_fluid_analytical]
type = ParsedPostprocessor
expression = '${T_salt_interface_exact}'
[]
[q_relative_error]
type = ParsedPostprocessor
pp_names = 'q q_analytical'
expression = 'abs(q-q_analytical)/abs(q_analytical)'
[]
[t_solid_relative_error]
type = ParsedPostprocessor
pp_names = 't_solid t_solid_analytical'
expression = 'abs(t_solid-t_solid_analytical)/abs(t_solid_analytical)'
[]
[t_fluid_relative_error]
type = ParsedPostprocessor
pp_names = 't_fluid t_fluid_analytical'
expression = 'abs(t_fluid-t_fluid_analytical)/abs(t_fluid_analytical)'
[]
[]
[Executioner]
type = PIMPLE
# Large dt makes this effectively a steady-state conduction test in one step.
dt = 1e6
end_time = 1e6
num_iterations = 2
continue_on_max_its = true
print_fields = false
energy_system = energy_system
solid_energy_system = solid_energy_system
rhie_chow_user_object = 'rc'
momentum_systems = 'u_system'
pressure_system = 'p_system'
should_solve_momentum = false
should_solve_pressure = false
energy_l_abs_tol = 1e-14
energy_l_tol = 1e-14
solid_energy_l_abs_tol = 1e-14
solid_energy_l_tol = 1e-14
energy_absolute_tolerance = 1e-14
solid_energy_absolute_tolerance = 1e-14
energy_equation_relaxation = 1.0
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'
cht_interfaces = interface
thermal_resistance = ${R_interface}
cht_solid_flux_relaxation = 0.3
cht_fluid_flux_relaxation = 0.3
cht_solid_temperature_relaxation = 0.3
cht_fluid_temperature_relaxation = 0.3
cht_heat_flux_tolerance = 1e-10
max_cht_fpi = 500
[]
[Outputs]
execute_on = TIMESTEP_END
csv = true
[]
(modules/porous_flow/test/tests/heat_advection/heat_advection_1d_fv.i)
# 1phase, heat advecting with a moving fluid using FV
[Mesh]
[mesh]
type = GeneratedMeshGenerator
dim = 1
nx = 50
xmin = 0
xmax = 1
[]
[]
[GlobalParams]
PorousFlowDictator = dictator
gravity = '0 0 0'
[]
[Variables]
[temp]
type = MooseVariableFVReal
[]
[pp]
type = MooseVariableFVReal
[]
[]
[FVICs]
[pp]
type = FVFunctionIC
variable = pp
function = '1-x'
[]
[temp]
type = FVFunctionIC
variable = temp
function = 'if(x<0.02, 300, 200)'
[]
[]
[FVBCs]
[pp0]
type = FVDirichletBC
variable = pp
boundary = left
value = 1
[]
[pp1]
type = FVDirichletBC
variable = pp
boundary = right
value = 0
[]
[hot]
type = FVDirichletBC
variable = temp
boundary = left
value = 300
[]
[cold]
type = FVDirichletBC
variable = temp
boundary = right
value = 200
[]
[]
[FVKernels]
[mass_dot]
type = FVPorousFlowMassTimeDerivative
fluid_component = 0
variable = pp
[]
[advection]
type = FVPorousFlowAdvectiveFlux
fluid_component = 0
variable = pp
[]
[energy_dot]
type = FVPorousFlowEnergyTimeDerivative
variable = temp
[]
[heat_advection]
type = FVPorousFlowHeatAdvection
variable = temp
[]
[]
[UserObjects]
[dictator]
type = PorousFlowDictator
porous_flow_vars = 'temp pp'
number_fluid_phases = 1
number_fluid_components = 1
[]
[pc]
type = PorousFlowCapillaryPressureVG
m = 0.6
alpha = 1.3
[]
[]
[FluidProperties]
[simple_fluid]
type = SimpleFluidProperties
bulk_modulus = 100
density0 = 1000
viscosity = 4.4
thermal_expansion = 0
cv = 2
[]
[]
[Materials]
[temperature]
type = ADPorousFlowTemperature
temperature = temp
[]
[porosity]
type = ADPorousFlowPorosityConst
porosity = 0.2
[]
[rock_heat]
type = ADPorousFlowMatrixInternalEnergy
specific_heat_capacity = 1.0
density = 125
[]
[simple_fluid]
type = ADPorousFlowSingleComponentFluid
fp = simple_fluid
phase = 0
[]
[permeability]
type = ADPorousFlowPermeabilityConst
permeability = '1.1 0 0 0 2 0 0 0 3'
[]
[relperm]
type = ADPorousFlowRelativePermeabilityCorey
n = 2
phase = 0
[]
[massfrac]
type = ADPorousFlowMassFraction
[]
[PS]
type = ADPorousFlow1PhaseP
porepressure = pp
capillary_pressure = pc
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = Newton
dt = 0.01
end_time = 0.6
[]
[VectorPostprocessors]
[T]
type = ElementValueSampler
sort_by = x
variable = 'temp'
[]
[]
[Outputs]
[csv]
type = CSV
execute_vector_postprocessors_on = final
[]
[]
(test/tests/postprocessors/side_integral/side_integral_functor.i)
[Mesh]
inactive = 'refine'
# U-shaped domains to have internal boundaries in
# a variety of directions
[cmg]
type = CartesianMeshGenerator
dim = 2
dx = '1 1 1'
dy = '3 1'
ix = '4 5 3'
iy = '12 4'
subdomain_id = '1 2 1
1 1 1'
[]
[internal_boundary_dir1]
type = SideSetsBetweenSubdomainsGenerator
input = cmg
primary_block = 1
paired_block = 2
new_boundary = 'inside_1'
[]
[internal_boundary_dir2]
type = SideSetsBetweenSubdomainsGenerator
input = internal_boundary_dir1
primary_block = 2
paired_block = 1
new_boundary = 'inside_2'
[]
[refine]
type = RefineBlockGenerator
input = internal_boundary_dir2
block = '1 2'
refinement = '2 1'
[]
[]
[Variables]
[u]
type = MooseVariableFVReal
block = 1
[]
[]
[AuxVariables]
[v1]
type = MooseVariableFVReal
block = 1
[FVInitialCondition]
type = FVFunctionIC
function = 'x + y'
[]
[]
[v2]
type = MooseVariableFVReal
block = 2
[FVInitialCondition]
type = FVFunctionIC
function = '2*x*x - y'
[]
[]
[]
[Functions]
[f1]
type = ParsedFunction
expression = 'exp(x - y)'
[]
[]
[Materials]
[m1]
type = ADGenericFunctorMaterial
prop_names = 'm1'
prop_values = 'f1'
[]
[m2]
type = ADPiecewiseByBlockFunctorMaterial
prop_name = 'm2'
subdomain_to_prop_value = '1 12
2 4'
[]
[]
[FVKernels]
[diff]
type = FVDiffusion
variable = u
coeff = '1'
[]
[]
[FVBCs]
[left]
type = FVDirichletBC
variable = u
boundary = 3
value = 0
[]
[right]
type = FVDirichletBC
variable = u
boundary = 1
value = 1
[]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
[]
[Postprocessors]
# Mesh external boundaries integration
[ext_u]
type = ADSideIntegralFunctorPostprocessor
boundary = 'left top right'
functor = u
restrict_to_functors_domain = true
[]
[ext_v1]
type = ADSideIntegralFunctorPostprocessor
boundary = 'left right'
functor = v1
[]
[ext_v2]
type = ADSideIntegralFunctorPostprocessor
boundary = 'top'
functor = v2
restrict_to_functors_domain = true
[]
[ext_f1]
type = ADSideIntegralFunctorPostprocessor
boundary = 'left top right'
functor = f1
prefactor = f1
[]
[ext_m1]
type = ADSideIntegralFunctorPostprocessor
boundary = 'left top right'
functor = m1
restrict_to_functors_domain = true
[]
[ext_m2]
type = ADSideIntegralFunctorPostprocessor
boundary = 'left top right'
functor = m2
restrict_to_functors_domain = true
[]
# Internal to the mesh, but a side to the variables
# With orientation of normal 1->2
[int_s1_u]
type = ADSideIntegralFunctorPostprocessor
boundary = inside_1
functor = u
[]
[int_s1_v1]
type = ADSideIntegralFunctorPostprocessor
boundary = inside_1
functor = v1
[]
[int_s1_f1]
type = ADSideIntegralFunctorPostprocessor
boundary = inside_1
functor = f1
[]
[int_s1_m1]
type = ADSideIntegralFunctorPostprocessor
boundary = inside_1
functor = m1
[]
[int_s1_m2]
type = ADSideIntegralFunctorPostprocessor
boundary = inside_1
functor = m2
[]
# With orientation of normal 2->1
[int_s2_v2]
type = ADSideIntegralFunctorPostprocessor
boundary = inside_2
functor = v2
[]
[int_s2_f1]
type = ADSideIntegralFunctorPostprocessor
boundary = inside_2
functor = f1
[]
[int_s2_m1]
type = ADSideIntegralFunctorPostprocessor
boundary = inside_2
functor = m1
[]
[int_s2_m2]
type = ADSideIntegralFunctorPostprocessor
boundary = inside_2
functor = m2
[]
[]
[Outputs]
csv = true
exodus = true
[]
[Problem]
kernel_coverage_check = false
[]