- variableThe name of the variable whose linear system this object contributes to
C++ Type:LinearVariableName
Unit:(no unit assumed)
Controllable:No
Description:The name of the variable whose linear system this object contributes to
LinearFVSource
Description
This kernel contributes to the right hand side of a system which is solved for a linear finite volume variable MooseVariableLinearFVReal. The contribution for each cell is the numerical integral of the source density function () in the following form:
where and denote the source density at the cell centroid and the cell volume, respectively. This integral is added to the corresponding entry of the right hand side of the linear system. The source density parameter ("source_density") accepts anything that supports functor-based evaluations. For more information on functors in MOOSE, see Functor system.
Example Syntax
The case below demonstrates the use of LinearFVSource where the force term is supplied based upon a function form:
[LinearFVKernels<<<{"href": "../../syntax/LinearFVKernels/index.html"}>>>]
[reaction]
type = LinearFVReaction<<<{"description": "Represents the matrix and right hand side contributions of a reaction term ($c u$) in a partial differential equation.", "href": "LinearFVReaction.html"}>>>
variable<<<{"description": "The name of the variable whose linear system this object contributes to"}>>> = u
coeff<<<{"description": "The reaction coefficient. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number."}>>> = coeff_func
[]
[source]
type = LinearFVSource<<<{"description": "Represents the matrix and right hand side contributions of a solution-independent source term in a partial differential equation.", "href": "LinearFVSource.html"}>>>
variable<<<{"description": "The name of the variable whose linear system this object contributes to"}>>> = u
source_density<<<{"description": "The source density. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number."}>>> = source_func
[]
[](test/tests/linearfvkernels/reaction/reaction-1d.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_factor1Coefficient to multiply the body force term with. 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:Coefficient to multiply the body force term with. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
- source_density1The source density. 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 source density. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
Optional Parameters
- absolute_value_vector_tagsThe tags for the vectors this residual object should fill with the absolute value of the residual contribution
C++ Type:std::vector<TagName>
Controllable:No
Description:The tags for the vectors this residual object should fill with the absolute value of the residual contribution
- extra_matrix_tagsThe extra tags for the matrices this Kernel should fill
C++ Type:std::vector<TagName>
Controllable:No
Description:The extra tags for the matrices this Kernel should fill
- extra_vector_tagsThe extra tags for the vectors this Kernel should fill
C++ Type:std::vector<TagName>
Controllable:No
Description:The extra tags for the vectors this Kernel should fill
- matrix_onlyFalseWhether this object is only doing assembly to matrices (no vectors)
Default:False
C++ Type:bool
Controllable:No
Description:Whether this object is only doing assembly to matrices (no vectors)
- matrix_tagssystemThe tag for the matrices this Kernel should fill
Default:system
C++ Type:MultiMooseEnum
Options:nontime, system
Controllable:No
Description:The tag for the matrices this Kernel should fill
- vector_tagsrhsThe tag for the vectors this Kernel should fill
Default:rhs
C++ Type:MultiMooseEnum
Options:rhs, time
Controllable:No
Description:The tag for the vectors this Kernel should fill
Contribution To Tagged Field Data Parameters
- control_tagsAdds user-defined labels for accessing object parameters via control logic.
C++ Type:std::vector<std::string>
Controllable:No
Description:Adds user-defined labels for accessing object parameters via control logic.
- enableTrueSet the enabled status of the MooseObject.
Default:True
C++ Type:bool
Controllable:Yes
Description:Set the enabled status of the MooseObject.
- implicitTrueDetermines whether this object is calculated using an implicit or explicit form
Default:True
C++ Type:bool
Controllable:No
Description:Determines whether this object is calculated using an implicit or explicit form
- seed0The seed for the master random number generator
Default:0
C++ Type:unsigned int
Controllable:No
Description:The seed for the master random number generator
- 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
- ghost_layers1The number of layers of elements to ghost.
Default:1
C++ Type:unsigned short
Controllable:No
Description:The number of layers of elements to ghost.
- use_point_neighborsFalseWhether to use point neighbors, which introduces additional ghosting to that used for simple face neighbors.
Default:False
C++ Type:bool
Controllable:No
Description:Whether to use point neighbors, which introduces additional ghosting to that used for simple face neighbors.
Parallel Ghosting Parameters
Input Files
- (modules/navier_stokes/test/tests/finite_volume/ins/cht/bulk_heat_transfer/flow-around-square-linear.i)
- (modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/linear-segregated/2d-simple-channel-enthalpy/porous-baffle-2d-enthalpy.i)
- (test/tests/variables/linearfv/gradient-time-states.i)
- (test/tests/kokkos/fe-fv-interplay/multisystem.i)
- (test/tests/multisystem/restore_multiapp/parent.i)
- (test/tests/linearfvkernels/anisotropic-diffusion/anisotropic-diffusion-2d.i)
- (test/tests/linearfvkernels/diffusion/diffusion-2d_neumann.i)
- (test/tests/tag/tag-linearfv.i)
- (test/tests/linearfvkernels/diffusion/diffusion-2d.i)
- (modules/heat_transfer/test/tests/linearfvbcs/linear_fv_functor_radiative_bc/linear_fv_functor_radiative_bc_mms_2d.i)
- (test/tests/linearfvkernels/diffusion/diffusion-2d-rz.i)
- (test/tests/variables/linearfv/shared-gradient-method.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/mms/linear-segregated/2d-vortex/2d-vortex.i)
- (test/tests/outputs/debug/show_execution_linear_fv_flux.i)
- (test/tests/linearfvbcs/scalar_symmetry/diffusion-1d-symmetry.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/mms/linear-segregated/2d-symmetric-vortex/2d-symmetric-vortex.i)
- (test/tests/linearfvkernels/advection/advection-2d.i)
- (test/tests/linearfvbcs/robin/diffusion-1d-robin.i)
- (test/tests/variables/linearfv/diffusion-1d-aux.i)
- (test/tests/transfers/multiapp_copy_transfer/linear_sys_to_aux/linear_sub.i)
- (test/tests/linearfvbcs/scalar_symmetry/advection-2d-symmetry.i)
- (test/tests/time_steppers/iteration_adaptive/adapt_linear_systems.i)
- (test/tests/linearfvbcs/robin/diffusion-2d-robin.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/mms/linear-segregated/porosity-jump-traction/porosity-jump-traction.i)
- (modules/navier_stokes/test/tests/finite_volume/wcns/enthalpy_equation/1d_test_h_fp.i)
- (modules/navier_stokes/test/tests/finite_volume/pins/mms/linear-segregated/interface-reconstruction/interface-reconstruction.i)
- (test/tests/outputs/debug/show_execution_linear_fv_elemental.i)
- (test/tests/linearfvkernels/advection/advection-2d-rz.i)
- (test/tests/variables/linearfv/gradient-aux.i)
- (test/tests/multisystem/restore_multiapp/sub.i)
- (test/tests/linearfvkernels/diffusion/diffusion-1d_neumann.i)
- (test/tests/linearfvkernels/diffusion-reaction-advection/advection-diffusion-reaction-1d.i)
- (test/tests/linearfvbcs/scalar_symmetry/advection-1d-symmetry.i)
- (test/tests/linearfvbcs/robin/advection-2d-robin.i)
- (test/tests/linearfvkernels/diffusion/diffusion-1d.i)
- (modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/linear-segregated/2d-simple-channel-enthalpy/porous-baffle-2d-enthalpy-fluid-only.i)
- (test/tests/time_integrators/bdf2/linearfv.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/mms/linear-segregated/2d-symmetric-vortex-rz/2d-symmetric-vortex-rz.i)
- (modules/navier_stokes/test/tests/finite_volume/wcns/enthalpy_equation/1d_test_h.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/mms/linear-segregated/2d-vortex/spacedependent_mu/sl.i)
- (test/tests/linearfvbcs/scalar_symmetry/diffusion-2d-symmetry.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/mms/linear-segregated/2d-symmetric-vortex-rz/2d-symmetric-vortex-rz-spacedependent.i)
- (test/tests/time_integrators/bdf2/linearfv-varying-factor.i)
- (test/tests/linearfvbcs/robin/advection-1d-robin.i)
- (test/tests/linearfvkernels/advection/advection-1d.i)
- (modules/navier_stokes/test/tests/finite_volume/pins/mms/linear-segregated/smooth-properties/smooth-properties.i)
- (modules/heat_transfer/test/tests/linearfvbcs/linear_fv_functor_radiative_bc/linear_fv_functor_radiative_bc_mms.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/channel-flow/linear-segregated/2d/reconstructed-force-channel.i)
- (test/tests/multisystem/picard/linearfv_nonlinearfv/same_input.i)
- (test/tests/linearfvkernels/block-restriction/block-restricted-diffusion-react.i)
- (test/tests/linearfvkernels/block-restriction/block-restricted-adr.i)
- (modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/linear-segregated/errors/kernel-errors.i)
- (test/tests/linearfvkernels/reaction/reaction-1d.i)
- (test/tests/linearfvkernels/block-restriction/block-restricted-diffusion.i)
- (modules/navier_stokes/test/tests/finite_volume/two_phase/mixture_model/segregated/channel-drift-flux.i)
- (test/tests/linearfvkernels/diffusion-reaction-advection/advection-diffusion-reaction-2d.i)
- (test/tests/linearfvbcs/scalar_symmetry/advection-1d-symmetry-two-gradient-methods.i)
- (test/tests/variables/linearfv/diffusion-1d-pp.i)
- (test/tests/time_integrators/implicit-euler/ie-linearfv.i)
- (test/tests/multiapps/linearfv_nonlinearfv/linearfv.i)
source_density
Default:1
C++ Type:MooseFunctorName
Unit:(no unit assumed)
Controllable:No
Description:The source density. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
(test/tests/linearfvkernels/reaction/reaction-1d.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
nx = 10
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
[]
[]
[LinearFVKernels]
[reaction]
type = LinearFVReaction
variable = u
coeff = coeff_func
[]
[source]
type = LinearFVSource
variable = u
source_density = source_func
[]
[]
[Functions]
[coeff_func]
type = ParsedFunction
expression = '1+sin(x)'
[]
[source_func]
type = ParsedFunction
expression = '(1+sin(x))*(1+cos(x))'
[]
[analytic_solution]
type = ParsedFunction
expression = '1+cos(x)'
[]
[]
[Postprocessors]
[l2error]
type = ElementL2FunctorError
approximate = u
exact = analytic_solution
execute_on = TIMESTEP_END
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-10
[]
[Outputs]
[exodus]
type = Exodus
execute_on = TIMESTEP_END
[]
[]
(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/pins/channel-flow/linear-segregated/2d-simple-channel-enthalpy/porous-baffle-2d-enthalpy.i)
# Steady conjugate heat transfer from a heated solid to fluid in a 0.5-m porous block.
# The solid fraction scales the 20 MW/m^3 source to 10 MW/m^3. Conservation therefore gives
# u_block_2 = 2, T_fluid_out = 300.59523809524, and h_fluid_out = 1262500.
# For 10 upwind cells, T_fluid_block_2 = 300.32738095238. The local balance gives
# T_solid_block_2 - T_fluid_block_2 = 10e6 / 30000 = 333.33333333333,
# hence T_solid_block_2 = 633.66071428571.
mu = 2e-3
rho = 1000
advected_interp_method = 'upwind'
u_in = 2
forchheimer = 0
bf = '0 0'
cp_fluid = 4200
cp_solid = 500
k_fluid = 0.4
k_solid = 0.2
h_vol = 30000
q_solid = 20000000
T_inlet = 300
T_initial = 300
[FVGradientMethods]
[jump_aware]
type = FVPressureJumpGreenGaussGradient
[]
[velocity_jump_aware]
type = FVVelocityJumpGreenGaussGradient
[]
[reconstructed]
type = FVReconstructedPressureGradient
base_gradient_method = jump_aware
gradient_relaxation = 1.0
[]
[]
[Mesh]
[mesh]
type = CartesianMeshGenerator
dim = 2
dx = '0.5 0.5 0.5'
dy = '0.5'
ix = '10 10 10'
iy = '3'
subdomain_id = '1 2 3'
[]
[baffle]
type = SideSetsBetweenSubdomainsGenerator
input = mesh
primary_block = '1'
paired_block = '2'
new_boundary = 'baffle'
[]
[baffle2]
type = SideSetsBetweenSubdomainsGenerator
input = baffle
primary_block = '2'
paired_block = '3'
new_boundary = 'baffle2'
[]
[split_top_bottom]
type = BreakBoundaryOnSubdomainGenerator
input = baffle2
boundaries = 'top bottom'
[]
[delete]
type = BoundaryDeletionGenerator
boundary_names = 'top bottom'
input = split_top_bottom
[]
[]
[FVInterpolationMethods]
[upwind]
type = FVAdvectedUpwind
[]
[]
[Problem]
linear_sys_names = 'u_system v_system pressure_system energy_system solid_energy_system'
previous_nl_solution_required = true
[]
[UserObjects]
[pressure_jump]
type = BernoulliFormLossPressureJump
boundary = 'baffle baffle2'
porosity = porosity
density = ${rho}
form_loss = ${bf}
reference_velocity_side = 'lower_porosity higher_porosity'
[]
[rc]
type = PorousRhieChowMassFlux
u = superficial_u
v = superficial_v
pressure = pressure
rho = ${rho}
porosity = porosity
p_diffusion_kernel = p_diffusion
pressure_jump_models = pressure_jump
pressure_jump_relaxation = 0.1
[]
[]
[Variables]
[superficial_u]
type = MooseLinearVariableFVReal
solver_sys = u_system
initial_condition = ${u_in}
gradient_method = velocity_jump_aware
[]
[superficial_v]
type = MooseLinearVariableFVReal
solver_sys = v_system
initial_condition = 0.0
gradient_method = velocity_jump_aware
[]
[pressure]
type = MooseLinearVariableFVReal
solver_sys = pressure_system
initial_condition = 0.0
gradient_method = jump_aware
[]
[h_fluid]
type = MooseLinearVariableFVReal
solver_sys = energy_system
initial_condition = '${fparse cp_fluid * T_initial}'
[]
[T_solid]
type = MooseLinearVariableFVReal
solver_sys = solid_energy_system
initial_condition = ${T_initial}
block = 2
[]
[]
[LinearFVKernels]
[u_advection]
type = LinearPWCNSFVMomentumFlux
variable = superficial_u
advected_interp_method_name = ${advected_interp_method}
mu = ${mu}
u = superficial_u
v = superficial_v
momentum_component = 'x'
rhie_chow_user_object = rc
use_nonorthogonal_correction = false
[]
[v_advection]
type = LinearPWCNSFVMomentumFlux
variable = superficial_v
advected_interp_method_name = ${advected_interp_method}
mu = ${mu}
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
momentum_component = 'x'
porosity = porosity
pressure = pressure
gradient_method = reconstructed
[]
[v_pressure]
type = LinearPWCNSFVMomentumPressure
variable = superficial_v
momentum_component = 'y'
porosity = porosity
pressure = pressure
gradient_method = reconstructed
[]
[u_friction]
type = LinearFVMomentumFriction
variable = superficial_u
Forchheimer_name = forch
porosity = porosity
rho = ${rho}
u = superficial_u
v = superficial_v
momentum_component = 'x'
block = 2
[]
[v_friction]
type = LinearFVMomentumFriction
variable = superficial_v
Forchheimer_name = forch
porosity = porosity
rho = ${rho}
u = superficial_u
v = superficial_v
momentum_component = 'y'
block = 2
[]
[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
[]
[fluid_advection]
type = LinearFVEnergyAdvection
variable = h_fluid
advected_quantity = enthalpy
advected_interp_method = ${advected_interp_method}
rhie_chow_user_object = rc
[]
[fluid_diffusion]
type = LinearFVDiffusion
variable = h_fluid
diffusion_coeff = kappa_fluid
use_nonorthogonal_correction = false
[]
[fluid_exchange]
type = LinearFVEnthalpyVolumetricHeatTransfer
variable = h_fluid
h_solid_fluid = h_vol
cp = cp_fluid
T_fluid = T_fluid
T_solid = T_solid
is_solid = false
block = 2
[]
[fluid_source]
type = LinearFVSource
variable = h_fluid
source_density = q_fluid_scaled
[]
[solid_diffusion]
type = LinearFVDiffusion
variable = T_solid
diffusion_coeff = ${k_solid}
use_nonorthogonal_correction = false
block = 2
[]
[solid_exchange]
type = LinearFVEnthalpyVolumetricHeatTransfer
variable = T_solid
h_solid_fluid = h_vol
cp = 1.0
T_fluid = T_fluid
T_solid = T_solid
is_solid = true
block = 2
[]
[solid_source]
type = LinearFVSource
variable = T_solid
source_density = q_solid_scaled
block = 2
[]
[]
[LinearFVBCs]
[left_u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = left
variable = superficial_u
functor = ${u_in}
[]
[outlet_u]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = right
variable = superficial_u
use_two_term_expansion = false
[]
[left_v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = left
variable = superficial_v
functor = 0.0
[]
[outlet_v]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = right
variable = superficial_v
use_two_term_expansion = false
[]
[symmetry-u]
type = LinearFVVelocitySymmetryBC
boundary = 'top_to_1 top_to_3 bottom_to_1 bottom_to_3 top_to_2 bottom_to_2'
variable = superficial_u
u = superficial_u
v = superficial_v
momentum_component = x
[]
[symmetry-v]
type = LinearFVVelocitySymmetryBC
boundary = 'top_to_1 top_to_3 bottom_to_1 bottom_to_3 top_to_2 bottom_to_2'
variable = superficial_v
u = superficial_u
v = superficial_v
momentum_component = y
[]
[pressure-extrapolation]
type = LinearFVPressureFluxBC
boundary = 'bottom_to_1 bottom_to_2 bottom_to_3 top_to_1 top_to_2 top_to_3'
variable = pressure
HbyA_flux = HbyA
Ainv = Ainv
rho = ${rho}
u = superficial_u
v = superficial_v
[]
[outlet_p]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = right
variable = pressure
functor = 0.0
[]
[left_T_fluid]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = left
variable = T_fluid
functor = ${T_inlet}
[]
[left_h_fluid]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = left
variable = h_fluid
functor = h_from_p_T
[]
[walls_h_fluid]
type = LinearFVAdvectionDiffusionFunctorNeumannBC
boundary = 'top_to_1 top_to_2 top_to_3 bottom_to_1 bottom_to_2 bottom_to_3'
variable = h_fluid
functor = 0.0
diffusion_coeff = kappa_fluid
[]
[outlet_h_fluid]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = right
variable = h_fluid
use_two_term_expansion = false
[]
[solid_zero_flux]
type = LinearFVAdvectionDiffusionFunctorNeumannBC
boundary = 'baffle baffle2 top_to_2 bottom_to_2'
variable = T_solid
functor = 0.0
diffusion_coeff = kappa_solid
[]
[]
[FunctorMaterials]
[forch]
type = GenericVectorFunctorMaterial
prop_names = forch
prop_values = '${forchheimer} ${forchheimer} ${forchheimer}'
[]
[porosity]
type = PiecewiseByBlockFunctorMaterial
prop_name = porosity
subdomain_to_prop_value = '1 1.0 2 0.5 3 1.0'
[]
[fluid_constants]
type = GenericFunctorMaterial
prop_names = 'cp_fluid kappa_fluid h_vol q_fluid_scaled'
prop_values = '${cp_fluid} ${fparse k_fluid/cp_fluid} ${h_vol} 0'
[]
[solid_constants]
type = GenericFunctorMaterial
prop_names = 'cp_solid kappa_solid'
prop_values = '${cp_solid} ${fparse k_solid/cp_solid}'
[]
[q_solid]
type = GenericFunctorMaterial
prop_names = 'q_solid'
prop_values = ${q_solid}
block = 2
[]
[q_solid_scaled]
type = ParsedFunctorMaterial
property_name = q_solid_scaled
functor_names = 'porosity q_solid'
expression = '(1 - porosity) * q_solid'
block = 2
[]
[fluid_enthalpy_material]
type = LinearFVEnthalpyFunctorMaterial
pressure = pressure
T_fluid = T_fluid
h = h_fluid
h_from_p_T_functor = h_from_p_T_functor
T_from_p_h_functor = T_from_p_h_functor
[]
[h_from_p_T_functor]
type = ParsedFunctorMaterial
property_name = h_from_p_T_functor
functor_names = 'T_fluid'
expression = '${cp_fluid} * T_fluid'
[]
[T_from_p_h_functor]
type = ParsedFunctorMaterial
property_name = T_from_p_h_functor
functor_names = 'h_fluid'
expression = 'h_fluid / ${cp_fluid}'
[]
[]
[Postprocessors]
[u_block_2]
type = ElementAverageValue
variable = superficial_u
block = 2
[]
[T_fluid_out]
type = SideAverageValue
variable = T_fluid
boundary = right
[]
[T_fluid_block_2]
type = ElementAverageValue
variable = T_fluid
block = 2
[]
[T_solid_block_2]
type = ElementAverageValue
variable = T_solid
block = 2
[]
[h_fluid_out]
type = SideAverageValue
variable = h_fluid
boundary = right
[]
[]
[AuxVariables]
[porosity_aux]
type = MooseLinearVariableFVReal
[]
[T_fluid]
type = MooseLinearVariableFVReal
initial_condition = ${T_initial}
[]
[]
[AuxKernels]
[por]
type = FunctorAux
variable = porosity_aux
functor = porosity
execute_on = 'NONLINEAR'
[]
[fluid_temperature]
type = FunctorAux
variable = T_fluid
functor = T_from_p_h
execute_on = 'NONLINEAR'
[]
[]
[VectorPostprocessors]
# Sample each x-cell once at its center.
[centerline]
type = LineValueSampler
variable = 'superficial_u T_fluid T_solid'
start_point = '0.0119047619047619 0.25 0'
end_point = '1.4880952380952381 0.25 0'
num_points = 30
sort_by = x
[]
[]
[Executioner]
type = SIMPLE
momentum_l_abs_tol = 1e-14
pressure_l_abs_tol = 1e-14
energy_l_abs_tol = 1e-14
solid_energy_l_abs_tol = 1e-14
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.2
pressure_variable_relaxation = 0.1
energy_equation_relaxation = 0.8
num_iterations = 1000
# These outer tolerances stop once the velocity and zero-pressure fields have stabilized to
# substantially below the accuracy exercised by the temperature and velocity profile checks.
pressure_absolute_tolerance = 1e-6
momentum_absolute_tolerance = 1e-2
energy_absolute_tolerance = 1e-8
solid_energy_absolute_tolerance = 1e-8
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'
[]
[Outputs]
csv = true
execute_on = FINAL
[]
(test/tests/variables/linearfv/gradient-time-states.i)
[Mesh]
allow_renumbering = false # Keep the sampled element ID independent of MPI partitioning.
[gmg]
type = GeneratedMeshGenerator
dim = 1
# Use enough cells for the sampled element side to be an internal face.
nx = 8
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
[]
[v]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
[]
[]
[AuxVariables]
[aux_u]
type = MooseLinearVariableFVReal
[]
[]
[ICs]
[u]
type = FunctionIC
variable = u
function = initial_solution
[]
[aux_u]
type = FunctionIC
variable = aux_u
function = initial_solution
[]
[v]
type = FunctionIC
variable = v
function = initial_solution
[]
[]
[AuxKernels]
[set_aux_u]
type = FunctionAux
variable = aux_u
function = exact_solution
execute_on = 'INITIAL TIMESTEP_BEGIN'
[]
[]
[LinearFVKernels]
[time]
type = LinearFVTimeDerivative
variable = u
[]
[source]
type = LinearFVSource
variable = u
source_density = source
[]
[time_v]
type = LinearFVTimeDerivative
variable = v
[]
[source_v]
type = LinearFVSource
variable = v
source_density = source
[]
[]
[Functions]
[initial_solution]
type = ParsedFunction
expression = x
[]
[exact_solution]
type = ParsedFunction
expression = '(1+t)*x'
[]
[source]
type = ParsedFunction
expression = x
[]
[]
[Postprocessors]
[u_current]
type = LinearFVGradientStateTest
variable = u
initial_oldest_gradient_state = 0
oldest_gradient_state = 3
state = 0
element_id = 1
execute_on = TIMESTEP_END
[]
[u_old]
type = LinearFVGradientStateTest
variable = u
oldest_gradient_state = 1
state = 1
element_id = 1
execute_on = TIMESTEP_END
[]
[u_older]
type = LinearFVGradientStateTest
variable = u
oldest_gradient_state = 2
state = 2
element_id = 1
execute_on = TIMESTEP_END
[]
[u_oldest]
type = LinearFVGradientStateTest
variable = u
oldest_gradient_state = 3
state = 3
element_id = 1
execute_on = TIMESTEP_END
[]
[u_face_current]
type = LinearFVGradientStateTest
variable = u
oldest_gradient_state = 1
state = 0
face = true
element_id = 1
face_side = 1 # Right side of element 1.
execute_on = TIMESTEP_END
[]
[u_face_old]
type = LinearFVGradientStateTest
variable = u
oldest_gradient_state = 1
state = 1
face = true
element_id = 1
face_side = 1 # Right side of element 1.
execute_on = TIMESTEP_END
[]
[aux_current]
type = LinearFVGradientStateTest
variable = aux_u
oldest_gradient_state = 3
state = 0
element_id = 1
execute_on = TIMESTEP_END
[]
[aux_old]
type = LinearFVGradientStateTest
variable = aux_u
oldest_gradient_state = 3
state = 1
element_id = 1
execute_on = TIMESTEP_END
[]
[aux_older]
type = LinearFVGradientStateTest
variable = aux_u
oldest_gradient_state = 3
state = 2
element_id = 1
execute_on = TIMESTEP_END
[]
[aux_oldest]
type = LinearFVGradientStateTest
variable = aux_u
oldest_gradient_state = 3
state = 3
element_id = 1
execute_on = TIMESTEP_END
[]
[v_shared_oldest]
type = LinearFVGradientStateTest
variable = v
oldest_gradient_state = 0
state = 3
element_id = 1
execute_on = TIMESTEP_END
[]
[]
[Executioner]
type = Transient
system_names = u_sys
scheme = implicit-euler
dt = 1
num_steps = 4
l_tol = 1e-12
[]
[Outputs]
[csv]
type = CSV
execute_on = TIMESTEP_END
[]
[]
(test/tests/kokkos/fe-fv-interplay/multisystem.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
nx = 5
[]
[]
[Problem]
nl_sys_names = 'u_sys'
linear_sys_names = 'v_sys'
[]
[Variables]
[u]
solver_sys = 'u_sys'
[]
[v]
type = MooseLinearVariableFVReal
solver_sys = 'v_sys'
[]
[]
[Kernels]
[diff]
type = KokkosDiffusion
variable = u
[]
[coupled]
type = KokkosCoupledForce
variable = u
v = v
[]
[]
[LinearFVKernels]
[diff]
type = KokkosLinearFVDiffusion
diffusion_coeff = 'unity'
variable = v
[]
[coupled]
type = LinearFVSource
source_density = u
variable = v
[]
[]
[BCs]
[left]
type = KokkosDirichletBC
boundary = 'left'
variable = u
value = 0
[]
[right]
type = KokkosDirichletBC
boundary = 'right'
variable = u
value = 1
[]
[]
[LinearFVBCs]
[left]
type = KokkosLinearFVFunctorDirichletBC
boundary = 'left'
variable = v
functor = 'zero'
[]
[right]
type = KokkosLinearFVFunctorDirichletBC
boundary = 'right'
variable = v
functor = 'unity'
[]
[]
[Functions]
[zero]
type = KokkosParsedFunction
expression = '0'
[]
[unity]
type = KokkosParsedFunction
expression = '1'
[]
[]
[Postprocessors]
[fe_avg]
type = ElementAverageValue
variable = u
execute_on = FINAL
[]
[fv_avg]
type = ElementAverageFunctorPostprocessor
functor = v
execute_on = FINAL
evaluation_type = CELL_AVERAGE
[]
[]
[Convergence]
[fixed_point]
type = IterationCountConvergence
converge_at_max_iterations = true
min_iterations = 10
max_iterations = 10
[]
[]
[Executioner]
type = Steady
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
system_names = 'u_sys v_sys'
multi_system_fixed_point = true
multi_system_fixed_point_convergence = fixed_point
nl_abs_tol = 1e-12
l_tol = 1e-12
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
[]
[console]
type = Console
execute_postprocessors_on = FINAL
[]
[]
(test/tests/multisystem/restore_multiapp/parent.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
nx = 6
[]
[]
[Problem]
nl_sys_names = 'v_sys'
linear_sys_names = 'u_sys'
[]
[Variables]
[v]
type = MooseVariableFVReal
initial_condition = 2.0
solver_sys = v_sys
[]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
[]
[]
[FVKernels]
[diffusion]
type = FVDiffusion
variable = v
coeff = u
[]
[source]
type = FVBodyForce
variable = v
function = 3
[]
[]
[LinearFVKernels]
[diffusion]
type = LinearFVDiffusion
variable = u
diffusion_coeff = v
[]
[source]
type = LinearFVSource
variable = u
source_density = 1
[]
[]
[FVBCs]
[dir]
type = FVFunctorDirichletBC
variable = v
boundary = "left right"
functor = 2
[]
[]
[LinearFVBCs]
[dir]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "left right"
functor = 1
[]
[]
[Convergence]
[linear]
type = IterationCountConvergence
max_iterations = 7
converge_at_max_iterations = true
[]
[]
[MultiApps]
[sub]
type = FullSolveMultiApp
input_files = sub.i
execute_on = TIMESTEP_END
keep_solution_during_restore = true
# The choice does not matter here, but conceptually there is no need to override
# the old solution when the subapp is a Steady solve
update_old_solution_when_keeping_solution_during_restore = false
[]
[]
[Executioner]
type = Steady
system_names = 'v_sys u_sys'
l_abs_tol = 1e-12
l_tol = 1e-10
nl_abs_tol = 1e-10
multi_system_fixed_point=true
multi_system_fixed_point_convergence=linear
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
fixed_point_max_its = 2
fixed_point_min_its = 2
#disable_fixed_point_residual_norm_check = true
accept_on_max_fixed_point_iteration = true
[]
(test/tests/linearfvkernels/anisotropic-diffusion/anisotropic-diffusion-2d.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 2
ny = 1
ymax = 0.5
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
[]
[]
[FVInterpolationMethods]
[harmonic]
type = FVHarmonicAverage
[]
[]
[LinearFVKernels]
[diffusion]
type = LinearFVAnisotropicDiffusion
variable = u
diffusion_tensor = diffusivity_tensor
use_nonorthogonal_correction = false
[]
[source]
type = LinearFVSource
variable = u
source_density = source_func
[]
[]
[LinearFVBCs]
[dir]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "left right top bottom"
functor = analytic_solution
[]
[]
[FunctorMaterials]
[diff_tensor]
type = GenericVectorFunctorMaterial
prop_names = diffusivity_tensor
prop_values = 'coeff_func_x coeff_func_y 0.0'
[]
[]
[Functions]
[coeff_func_x]
type = ParsedFunction
expression = '1+0.5*x*y'
[]
[coeff_func_y]
type = ParsedFunction
expression = '1+x*y'
[]
[source_func]
type = ParsedFunction
expression = '(1.5-y*y)*(2+2*x*y)+(1.5-x*x)*(2+4*x*y)'
[]
[analytic_solution]
type = ParsedFunction
expression = '(1.5-x*x)*(1.5-y*y)'
[]
[]
[Postprocessors]
[h]
type = AverageElementSize
execute_on = FINAL
[]
[error]
type = ElementL2FunctorError
approximate = u
exact = analytic_solution
execute_on = FINAL
[]
[]
[Convergence]
[linear]
type = IterationCountConvergence
max_iterations = 1
converge_at_max_iterations = true
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-10
multi_system_fixed_point=true
multi_system_fixed_point_convergence=linear
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
[]
[]
(test/tests/linearfvkernels/diffusion/diffusion-2d_neumann.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 2
ny = 1
ymax = 0.5
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
[]
[]
[LinearFVKernels]
[diffusion]
type = LinearFVDiffusion
variable = u
diffusion_coeff = coeff_func
use_nonorthogonal_correction = false
[]
[source]
type = LinearFVSource
variable = u
source_density = source_func
[]
[]
[LinearFVBCs]
[dir]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "left right"
functor = analytic_solution
[]
[neu_bottom]
type = LinearFVAdvectionDiffusionFunctorNeumannBC
variable = u
boundary = "bottom"
functor = analytic_solution_neumann_bottom
diffusion_coeff = coeff_func
[]
[neu_top]
type = LinearFVAdvectionDiffusionFunctorNeumannBC
variable = u
boundary = "top"
functor = analytic_solution_neumann_top
diffusion_coeff = coeff_func
[]
[]
[Functions]
[coeff_func]
type = ParsedFunction
expression = '1+0.5*x*y'
[]
[source_func]
type = ParsedFunction
expression = '2*(1.5-y*y)+2*x*y*(1.5-y*y)+2*(1.5-x*x)+2*x*y*(1.5-x*x)'
[]
[analytic_solution]
type = ParsedFunction
expression = '(1.5-x*x)*(1.5-y*y)'
[]
[analytic_solution_neumann_bottom]
type = ParsedFunction
expression = '-(1+0.5*x*y)*(1.5-x*x)*(-2*y)'
[]
[analytic_solution_neumann_top]
type = ParsedFunction
expression = '(1+0.5*x*y)*(1.5-x*x)*(-2*y)'
[]
[]
[Postprocessors]
[h]
type = AverageElementSize
execute_on = FINAL
[]
[error]
type = ElementL2FunctorError
approximate = u
exact = analytic_solution
execute_on = FINAL
[]
[]
[Convergence]
[linear]
type = IterationCountConvergence
max_iterations = 1
converge_at_max_iterations = true
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-10
multi_system_fixed_point=true
multi_system_fixed_point_convergence=linear
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
[]
[]
(test/tests/tag/tag-linearfv.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
nx = 3
[]
[]
[Problem]
linear_sys_names = 'u_sys v_sys'
extra_tag_matrices = 'mat_tag_u; mat_tag_v'
extra_tag_vectors = 'vec_tag_u; vec_tag_v'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
initial_condition = 1.0
solver_sys = u_sys
[]
[v]
type = MooseLinearVariableFVReal
initial_condition = 0.5
solver_sys = v_sys
[]
[]
[LinearFVKernels]
[diffusion]
type = LinearFVDiffusion
variable = u
diffusion_coeff = 2.0
[]
[reaction]
type = LinearFVReaction
variable = u
coeff = 3.0
matrix_tags = 'system mat_tag_u'
[]
[source]
type = LinearFVSource
variable = u
source_density = 60.0
vector_tags = 'rhs vec_tag_u'
[]
[diffusion_v]
type = LinearFVDiffusion
variable = v
diffusion_coeff = 1.0
[]
[reaction_v]
type = LinearFVReaction
variable = v
coeff = 1.5
matrix_tags = 'system mat_tag_v'
[]
[source_v]
type = LinearFVSource
variable = v
source_density = 20.0
vector_tags = 'rhs vec_tag_v'
[]
[]
[LinearFVBCs]
[left_u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = left
functor = 1.0
[]
[right_u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = right
functor = 3.0
[]
[left_v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = v
boundary = left
functor = 1.0
[]
[right_v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = v
boundary = right
functor = 3.0
[]
[]
[AuxVariables]
[soln_u_dof]
type = MooseLinearVariableFVReal
[]
[soln_u]
type = MooseLinearVariableFVReal
[]
[rhs_u_dof]
type = MooseLinearVariableFVReal
[]
[rhs_u]
type = MooseLinearVariableFVReal
[]
[vector_tag_u]
type = MooseLinearVariableFVReal
[]
[matrix_u_diag]
type = MooseLinearVariableFVReal
[]
[soln_v_dof]
type = MooseLinearVariableFVReal
[]
[soln_v]
type = MooseLinearVariableFVReal
[]
[rhs_v_dof]
type = MooseLinearVariableFVReal
[]
[rhs_v]
type = MooseLinearVariableFVReal
[]
[vector_tag_v]
type = MooseLinearVariableFVReal
[]
[matrix_v_diag]
type = MooseLinearVariableFVReal
[]
[]
[AuxKernels]
[soln_u_dof]
type = TagVectorDofValueAux
variable = soln_u_dof
v = u
vector_tag = 'solution'
[]
[soln_u]
type = TagVectorAux
variable = soln_u
v = u
vector_tag = 'solution'
[]
[rhs_u_dof]
type = TagVectorDofValueAux
variable = rhs_u_dof
v = u
vector_tag = 'rhs'
[]
[rhs_u]
type = TagVectorAux
variable = rhs_u
v = u
vector_tag = 'rhs'
[]
[extra_vector_u_dof]
type = TagVectorDofValueAux
variable = vector_tag_u
v = u
vector_tag = 'vec_tag_u'
[]
[extra_vector_u]
type = TagVectorAux
variable = vector_tag_u
v = u
vector_tag = 'vec_tag_u'
[]
[extra_matrix_u]
type = TagMatrixAux
variable = matrix_u_diag
v = u
matrix_tag = 'mat_tag_u'
[]
[soln_v_dof]
type = TagVectorDofValueAux
variable = soln_v_dof
v = v
vector_tag = 'solution'
[]
[soln_v]
type = TagVectorAux
variable = soln_v
v = v
vector_tag = 'solution'
[]
[rhs_v_dof]
type = TagVectorDofValueAux
variable = rhs_v_dof
v = v
vector_tag = 'rhs'
[]
[rhs_v]
type = TagVectorAux
variable = rhs_v
v = v
vector_tag = 'rhs'
[]
[extra_vector_v_dof]
type = TagVectorDofValueAux
variable = vector_tag_v
v = v
vector_tag = 'vec_tag_v'
[]
[extra_vector_v]
type = TagVectorAux
variable = vector_tag_v
v = v
vector_tag = 'vec_tag_v'
[]
[extra_matrix_v]
type = TagMatrixAux
variable = matrix_v_diag
v = v
matrix_tag = 'mat_tag_v'
[]
[]
[Executioner]
type = Steady
solve_type = 'LINEAR'
system_names = 'u_sys v_sys'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true
execute_on = timestep_end
[]
(test/tests/linearfvkernels/diffusion/diffusion-2d.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 2
ny = 1
ymax = 0.5
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
[]
[]
[LinearFVKernels]
[diffusion]
type = LinearFVDiffusion
variable = u
diffusion_coeff = coeff_func
use_nonorthogonal_correction = false
[]
[source]
type = LinearFVSource
variable = u
source_density = source_func
[]
[]
[LinearFVBCs]
[dir]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "left right top bottom"
functor = analytic_solution
[]
[]
[Functions]
[coeff_func]
type = ParsedFunction
expression = '1+0.5*x*y'
[]
[source_func]
type = ParsedFunction
expression = '2*(1.5-y*y)+2*x*y*(1.5-y*y)+2*(1.5-x*x)+2*x*y*(1.5-x*x)'
[]
[analytic_solution]
type = ParsedFunction
expression = '(1.5-x*x)*(1.5-y*y)'
[]
[]
[Postprocessors]
[h]
type = AverageElementSize
execute_on = FINAL
[]
[error]
type = ElementL2FunctorError
approximate = u
exact = analytic_solution
execute_on = FINAL
[]
[]
[Convergence]
[linear]
type = IterationCountConvergence
max_iterations = 1
converge_at_max_iterations = true
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-10
multi_system_fixed_point=true
multi_system_fixed_point_convergence=linear
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
[]
[]
(modules/heat_transfer/test/tests/linearfvbcs/linear_fv_functor_radiative_bc/linear_fv_functor_radiative_bc_mms_2d.i)
# 2D MMS convergence test for LinearFVFunctorRadiativeBC.
#
# Exact solution: T(x,y) = T_L + B_x*(exp(x) - 1) + B_y*x*sin(pi*y)
# where B_x = (T_R_mms - T_L) / (e - 1).
#
# The solution combines a 1D exponential profile with a sinusoidal 2D
# perturbation B_y*x*sin(pi*y). The sinusoidal y-dependence is
# non-polynomial, ensuring the FV scheme has genuine O(h^2) truncation
# error in the y-direction.
#
# At the radiative boundary (x=1):
# T(1,y) = T_R_mms + B_y*sin(pi*y)
# dT/dx(1,y) = B_x*e + B_y*sin(pi*y)
#
# A spatially varying T_inf(y) is computed analytically so the radiative
# BC is satisfied exactly at every boundary face:
# T_inf(y)^4 = T(1,y)^4 + k*dT/dx(1,y)/(sigma*eps)
# At y=0,1 this recovers the 1D far-field temperature T_inf ~ 300 K.
#
# Boundary conditions:
# Left (x=0): Dirichlet T = T_L (constant, since x=0)
# Right (x=1): Radiative Robin with T_inf(y) (spatially varying)
# Bottom (y=0): Dirichlet T = T_L + B_x*(exp(x) - 1) (sin(0)=0)
# Top (y=1): Dirichlet T = T_L + B_x*(exp(x) - 1) (sin(pi)=0)
#
# Source: f(x,y) = -k*(B_x*exp(x) - B_y*pi^2*x*sin(pi*y))
#
# T_R_mms must be supplied via CLI args, as the root of:
# k*(T_L - T_R)*e/(e-1) = sigma*eps*(T_R^4 - T_inf^4)
# (computed in the Python convergence script).
T_L = 1000.0
k = 1.0
eps = 1.0
sigma = 5.670374419e-8
B_y = 200.0
T_R_mms = 0 # set via CLI: T_R_mms=<value>
B_x = '${fparse (T_R_mms - T_L) / (exp(1.0) - 1.0)}'
B_x_e = '${fparse B_x * exp(1.0)}'
flux_scale = '${fparse k / (sigma * eps)}'
pi_val = '${fparse pi}'
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
nx = 10 # overridden by CLI
ny = 10 # overridden by CLI
xmin = 0
xmax = 1
ymin = 0
ymax = 1
[]
[]
[Problem]
linear_sys_names = 'heat_system'
[]
[Variables]
[T]
type = MooseLinearVariableFVReal
solver_sys = 'heat_system'
initial_condition = ${T_L}
[]
[]
[Functions]
[exact_T]
type = ParsedFunction
expression = 'T_L + Bx * (exp(x) - 1.0) + By * x * sin(pv * y)'
symbol_names = 'T_L Bx By pv'
symbol_values = '${T_L} ${B_x} ${B_y} ${pi_val}'
[]
[source_fn]
type = ParsedFunction
expression = '-k * Bx * exp(x) + k * By * pv * pv * x * sin(pv * y)'
symbol_names = 'k Bx By pv'
symbol_values = '${k} ${B_x} ${B_y} ${pi_val}'
[]
[T_inf_fn]
type = ParsedFunction
expression = 'pow(pow(TR + By * sin(pv * y), 4) + fs * (Bxe + By * sin(pv * y)), 0.25)'
symbol_names = 'TR By fs Bxe pv'
symbol_values = '${T_R_mms} ${B_y} ${flux_scale} ${B_x_e} ${pi_val}'
[]
[bottom_top_T]
type = ParsedFunction
expression = 'T_L + Bx * (exp(x) - 1.0)'
symbol_names = 'T_L Bx'
symbol_values = '${T_L} ${B_x}'
[]
[]
[LinearFVKernels]
[time]
type = LinearFVTimeDerivative
variable = T
[]
[diffusion]
type = LinearFVDiffusion
variable = T
diffusion_coeff = ${k}
[]
[source]
type = LinearFVSource
variable = T
source_density = source_fn
[]
[]
[LinearFVBCs]
[left]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = T
boundary = 'left'
functor = ${T_L}
[]
[right]
type = LinearFVFunctorRadiativeBC
variable = T
boundary = 'right'
emissivity = ${eps}
Tinfinity = T_inf_fn
diffusion_coeff = ${k}
[]
[bottom]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = T
boundary = 'bottom'
functor = bottom_top_T
[]
[top]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = 'T'
boundary = 'top'
functor = bottom_top_T
[]
[]
[Postprocessors]
[l2_error]
type = ElementL2FunctorError
approximate = T
exact = exact_T
execute_on = TIMESTEP_END
[]
[]
[Executioner]
type = Transient
system_names = heat_system
scheme = 'implicit-euler'
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
dt = 1e6
num_steps = 100
l_tol = 1e-12
[]
[Outputs]
[out]
type = CSV
execute_on = final
[]
[]
(test/tests/linearfvkernels/diffusion/diffusion-2d-rz.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 2
ny = 1
ymax = 0.5
[]
coord_type = RZ
rz_coord_axis = Y
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
[]
[]
[LinearFVKernels]
[diffusion]
type = LinearFVDiffusion
variable = u
diffusion_coeff = coeff_func
use_nonorthogonal_correction = true
[]
[source]
type = LinearFVSource
variable = u
source_density = source_func
[]
[]
[LinearFVBCs]
[dir]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "right top bottom"
functor = analytic_solution
[]
[symmetry]
type = LinearFVAdvectionDiffusionScalarSymmetryBC
variable = u
boundary = "left"
[]
[]
[Functions]
[coeff_func]
type = ParsedFunction
expression = '1+0.5*x*y'
[]
[source_func]
type = ParsedFunction
expression = '-(-1.0*x^2*y*(1.5 - x^2) + x*(1.5 - x^2)*(-1.0*x*y - 2))/x - (-1.0*x^2*y*(1.5 - y^2) - 4*x*(1.5 - y^2)*(0.5*x*y + 1))/x'
[]
[analytic_solution]
type = ParsedFunction
expression = '(1.5-x*x)*(1.5-y*y)'
[]
[]
[Postprocessors]
[h]
type = AverageElementSize
execute_on = FINAL
[]
[error]
type = ElementL2FunctorError
approximate = u
exact = analytic_solution
execute_on = FINAL
[]
[]
[Convergence]
[linear]
type = IterationCountConvergence
max_iterations = 1
converge_at_max_iterations = true
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-10
multi_system_fixed_point = true
multi_system_fixed_point_convergence = linear
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
[]
[exo]
type = Exodus
execute_on = FINAL
[]
[]
(test/tests/variables/linearfv/shared-gradient-method.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
nx = 4
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
gradient_method = gg
[]
[v]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
gradient_method = gg
[]
[]
[FVGradientMethods]
[gg]
type = FVGreenGaussGradient
[]
[]
[FVInterpolationMethods]
[muscl]
type = FVAdvectedMUSCLDeferredCorrection
gradient_method = gg
deferred_correction_factor = 1.0
[]
[]
[LinearFVKernels]
[advection_u]
type = LinearFVAdvection
variable = u
velocity = "1 0 0"
advected_interp_method_name = muscl
[]
[source_u]
type = LinearFVSource
variable = u
source_density = source_func
[]
[advection_v]
type = LinearFVAdvection
variable = v
velocity = "1 0 0"
advected_interp_method_name = muscl
[]
[source_v]
type = LinearFVSource
variable = v
source_density = source_func
[]
[]
[LinearFVBCs]
[inflow_u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "left"
functor = analytic_solution
[]
[outflow_u]
type = LinearFVAdvectionDiffusionOutflowBC
variable = u
boundary = "right"
use_two_term_expansion = false
[]
[inflow_v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = v
boundary = "left"
functor = analytic_solution
[]
[outflow_v]
type = LinearFVAdvectionDiffusionOutflowBC
variable = v
boundary = "right"
use_two_term_expansion = false
[]
[]
[Functions]
[source_func]
type = ParsedFunction
expression = x
[]
[analytic_solution]
type = ParsedFunction
expression = '0.5+0.5*x*x'
[]
[]
[Postprocessors]
[error_u]
type = ElementL2FunctorError
approximate = u
exact = analytic_solution
execute_on = FINAL
[]
[error_v]
type = ElementL2FunctorError
approximate = v
exact = analytic_solution
execute_on = FINAL
[]
[h]
type = AverageElementSize
execute_on = FINAL
[]
[]
[Convergence]
[linear]
type = IterationCountConvergence
max_iterations = 8
converge_at_max_iterations = true
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-10
multi_system_fixed_point = true
multi_system_fixed_point_convergence = linear
multi_system_fixed_point_relaxation_factor = 1.0
petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_shift_amount -pc_factor_mat_solver_type -mat_mumps_icntl_14'
petsc_options_value = 'lu NONZERO 1e-12 mumps 50'
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
[]
[]
(modules/navier_stokes/test/tests/finite_volume/ins/mms/linear-segregated/2d-vortex/2d-vortex.i)
mu = 1
rho = 1000
advected_interp_method = 'average'
pressure_gradient_method = 'green-gauss'
[Problem]
linear_sys_names = 'u_system v_system pressure_system'
previous_nl_solution_required = true
[]
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 2
ny = 2
[]
[]
[UserObjects]
[rc]
type = RhieChowMassFlux
u = vel_x
v = vel_y
pressure = pressure
rho = ${rho}
p_diffusion_kernel = p_diffusion
pressure_projection_method = CONSISTENT
[]
[]
[Variables]
[vel_x]
type = MooseLinearVariableFVReal
initial_condition = 0.0
solver_sys = u_system
[]
[vel_y]
type = MooseLinearVariableFVReal
solver_sys = v_system
initial_condition = 0.0
[]
[pressure]
type = MooseLinearVariableFVReal
solver_sys = pressure_system
initial_condition = 0
[]
[]
[FVGradientMethods]
[reconstructed]
type = FVReconstructedPressureGradient
base_gradient_method = green-gauss
gradient_relaxation = 0.2
[]
[]
[FVInterpolationMethods]
[average]
type = FVGeometricAverage
[]
[upwind]
type = FVAdvectedUpwind
[]
[min_mod]
type = FVAdvectedMinmodWeightBased
[]
[vanLeer]
type = FVAdvectedVanLeerWeightBased
[]
[venkatakrishnan]
type = FVAdvectedMUSCLDeferredCorrection
[]
[]
[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 = false
[]
[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 = false
[]
[u_pressure]
type = LinearFVMomentumPressure
variable = vel_x
pressure = pressure
momentum_component = 'x'
gradient_method = ${pressure_gradient_method}
[]
[v_pressure]
type = LinearFVMomentumPressure
variable = vel_y
pressure = pressure
momentum_component = 'y'
gradient_method = ${pressure_gradient_method}
[]
[u_forcing]
type = LinearFVSource
variable = vel_x
source_density = forcing_u
[]
[v_forcing]
type = LinearFVSource
variable = vel_y
source_density = forcing_v
[]
[p_diffusion]
type = LinearFVPressureCorrectionDiffusion
variable = pressure
diffusion_tensor = Ainv
use_nonorthogonal_correction = false
use_nonorthogonal_correction_on_boundary = false
[]
[HbyA_divergence]
type = LinearFVDivergence
variable = pressure
face_flux = HbyA
force_boundary_execution = true
[]
[]
[LinearFVBCs]
[no-slip-wall-u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left right top bottom'
variable = vel_x
functor = '0'
[]
[no-slip-wall-v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left right top bottom'
variable = vel_y
functor = '0'
[]
[pressure-extrapolation]
type = LinearFVExtrapolatedPressureBC
boundary = 'left right top bottom'
variable = pressure
use_two_term_expansion = true
[]
[]
[Functions]
[exact_u]
type = ParsedFunction
expression = 'x^2*(1-x)^2*(2*y-6*y^2+4*y^3)'
[]
[exact_v]
type = ParsedFunction
expression = '-y^2*(1-y)^2*(2*x-6*x^2+4*x^3)'
[]
[exact_p]
type = ParsedFunction
expression = 'x*(1-x)'
[]
[forcing_u]
type = ParsedFunction
expression = '-4*mu*(-1+2*y)*(y^2-6*x*y^2+6*x^2*y^2-y+6*x*y-6*x^2*y+3*x^2-6*x^3+3*x^4)+1-2*x+rho*4*x^3*y^2*(2*y^2-2*y+1)*(y-1)^2*(-1+2*x)*(x-1)^3'
symbol_names = 'mu rho'
symbol_values = '${mu} ${rho}'
[]
[forcing_v]
type = ParsedFunction
expression = '4*mu*(-1+2*x)*(x^2-6*y*x^2+6*x^2*y^2-x+6*x*y-6*x*y^2+3*y^2-6*y^3+3*y^4)+rho*4*y^3*x^2*(2*x^2-2*x+1)*(x-1)^2*(-1+2*y)*(y-1)^3'
symbol_names = 'mu rho'
symbol_values = '${mu} ${rho}'
[]
[]
[Executioner]
type = SIMPLE
momentum_l_abs_tol = 1e-8
pressure_l_abs_tol = 1e-8
momentum_l_tol = 0
pressure_l_tol = 0
rhie_chow_user_object = 'rc'
momentum_systems = 'u_system v_system'
pressure_system = 'pressure_system'
momentum_equation_relaxation = 0.7
pressure_variable_relaxation = 1.0
num_iterations = 20000
pressure_absolute_tolerance = 1e-8
momentum_absolute_tolerance = 1e-8
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.25
pressure_pin_point = '0.5 0.5 0.0'
[]
[Outputs]
exodus = true
[csv]
type = CSV
execute_on = FINAL
[]
[]
[Postprocessors]
[h]
type = AverageElementSize
outputs = 'csv'
execute_on = FINAL
[]
[L2u]
type = ElementL2FunctorError
approximate = vel_x
exact = exact_u
outputs = 'csv'
execute_on = FINAL
[]
[L2v]
type = ElementL2FunctorError
approximate = vel_y
exact = exact_v
outputs = 'csv'
execute_on = FINAL
[]
[L2p]
approximate = pressure
exact = exact_p
type = ElementL2FunctorError
outputs = 'csv'
execute_on = FINAL
[]
[]
(test/tests/outputs/debug/show_execution_linear_fv_flux.i)
[Mesh]
[gen_mesh]
type = GeneratedMeshGenerator
dim = 1
xmin = 0
xmax = 10
nx = 50
[]
[left]
type = ParsedSubdomainMeshGenerator
input = 'gen_mesh'
combinatorial_geometry = 'x < 0.5'
block_id = '1'
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
[]
[]
[LinearFVKernels]
[diffusion_1]
type = LinearFVDiffusion
variable = u
diffusion_coeff = 1.5
block = 0
[]
[diffusion_2]
type = LinearFVDiffusion
variable = u
diffusion_coeff = 2.5
block = 1
[]
[source_1]
type = LinearFVSource
variable = u
source_density = 3.5
block = 0
[]
[source_2]
type = LinearFVSource
variable = u
source_density = 4.5
block = 1
[]
[]
[LinearFVBCs]
[left_bc]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = 'left right'
functor = 0
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-10
[]
[Debug]
show_execution_order = 'NONLINEAR'
[]
(test/tests/linearfvbcs/scalar_symmetry/diffusion-1d-symmetry.i)
diff = 0.1
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
nx = 2
xmin = 0
xmax = ${fparse pi}
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
[]
[]
[Functions]
[u_exact]
type = ParsedFunction
expression = 'cos(x)'
[]
[source_fn]
type = ParsedFunction
expression = '${diff}*cos(x)'
[]
[]
[LinearFVKernels]
[advection]
type = LinearFVDiffusion
variable = u
diffusion_coeff = ${diff}
[]
[source]
type = LinearFVSource
variable = u
source_density = source_fn
[]
[]
[LinearFVBCs]
[rob_l]
type = LinearFVAdvectionDiffusionScalarSymmetryBC
variable = u
boundary = "left"
use_two_term_expansion = true
[]
[dirichlet]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "right"
functor = u_exact
[]
[]
[Postprocessors]
[h]
type = AverageElementSize
execute_on = FINAL
[]
[error]
type = ElementL2FunctorError
approximate = u
exact = u_exact
execute_on = FINAL
[]
[]
[Convergence]
[linear]
type = IterationCountConvergence
max_iterations = 4
converge_at_max_iterations = true
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-7
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
linear_convergence = linear
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
[]
[]
(modules/navier_stokes/test/tests/finite_volume/ins/mms/linear-segregated/2d-symmetric-vortex/2d-symmetric-vortex.i)
mu = 1.2
rho = 1.5
advected_interp_method = 'average'
pressure_gradient_method = 'green-gauss'
[Problem]
linear_sys_names = 'u_system v_system pressure_system'
previous_nl_solution_required = true
[]
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 2
ny = 2
[]
[]
[UserObjects]
[rc]
type = RhieChowMassFlux
u = vel_x
v = vel_y
pressure = pressure
rho = ${rho}
p_diffusion_kernel = p_diffusion
[]
[]
[FVInterpolationMethods]
[average]
type = FVGeometricAverage
[]
[]
[Variables]
[vel_x]
type = MooseLinearVariableFVReal
initial_condition = 0.0
solver_sys = u_system
[]
[vel_y]
type = MooseLinearVariableFVReal
solver_sys = v_system
initial_condition = 0.0
[]
[pressure]
type = MooseLinearVariableFVReal
solver_sys = pressure_system
initial_condition = 0.0
[]
[]
[FVGradientMethods]
[reconstructed]
type = FVReconstructedPressureGradient
base_gradient_method = green-gauss
gradient_relaxation = 0.1
[]
[]
[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 = false
[]
[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 = false
[]
[u_pressure]
type = LinearFVMomentumPressure
variable = vel_x
pressure = pressure
momentum_component = 'x'
gradient_method = ${pressure_gradient_method}
[]
[v_pressure]
type = LinearFVMomentumPressure
variable = vel_y
pressure = pressure
momentum_component = 'y'
gradient_method = ${pressure_gradient_method}
[]
[u_forcing]
type = LinearFVSource
variable = vel_x
source_density = forcing_u
[]
[v_forcing]
type = LinearFVSource
variable = vel_y
source_density = forcing_v
[]
[p_diffusion]
type = LinearFVPressureCorrectionDiffusion
variable = pressure
diffusion_tensor = 'Ainv' # Functor created in the RhieChowMassFlux UO
use_nonorthogonal_correction = false
use_nonorthogonal_correction_on_boundary = false
[]
[HbyA_divergence]
type = LinearFVDivergence
variable = pressure
face_flux = 'HbyA' # Functor created in the RhieChowMassFlux UO
force_boundary_execution = true
[]
[]
[LinearFVBCs]
[no-slip-wall-u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left right top'
variable = vel_x
functor = exact_u
[]
[no-slip-wall-v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left right top'
variable = vel_y
functor = exact_v
[]
[symmetry-u]
type = LinearFVVelocitySymmetryBC
boundary = 'bottom'
variable = vel_x
u = vel_x
v = vel_y
momentum_component = x
[]
[symmetry-v]
type = LinearFVVelocitySymmetryBC
boundary = 'bottom'
variable = vel_y
u = vel_x
v = vel_y
momentum_component = y
[]
[pressure-extrapolation]
type = LinearFVPressureFluxBC
boundary = 'top left right'
variable = pressure
HbyA_flux = HbyA
Ainv = Ainv
rho = ${rho}
u = vel_x
v = vel_y
[]
[pressure-symmetry]
type = LinearFVPressureSymmetryBC
boundary = 'bottom'
variable = pressure
HbyA_flux = 'HbyA' # Functor created in the RhieChowMassFlux UO
[]
[]
[Functions]
[exact_u]
type = ParsedFunction
expression = 'x^2*(1-x)^2*(8*y^3 - 9*y^2 + 1)'
[]
[exact_v]
type = ParsedFunction
expression = '-(2*x - 6*x^2 + 4*x^3)*y*(1-y)^2*(2*y+1)'
[]
[exact_p]
type = ParsedFunction
expression = 'y^2'
[]
[forcing_u]
type = ParsedFunction
symbol_names = 'mu rho'
symbol_values = '${mu} ${rho}'
expression = 'rho*( (x^2*(1-x)^2)*(2*x - 6*x^2 + 4*x^3)*
( (8*y^3 - 9*y^2 + 1)^2
- (2*y^4 - 3*y^3 + y)*(24*y^2 - 18*y) ) )
- mu*( (2 - 12*x + 12*x^2)*(8*y^3 - 9*y^2 + 1)
+ (x^2*(1-x)^2)*(48*y - 18) )'
[]
[forcing_v]
type = ParsedFunction
symbol_names = 'mu rho'
symbol_values = '${mu} ${rho}'
expression = 'rho*( (8*y^3 - 9*y^2 + 1)*(2*y^4 - 3*y^3 + y)*
( (2*x - 6*x^2 + 4*x^3)^2
- (x^2*(1-x)^2)*(2 - 12*x + 12*x^2) ) )
+ mu*( (24*x - 12)*(2*y^4 - 3*y^3 + y)
+ (2*x - 6*x^2 + 4*x^3)*(24*y^2 - 18*y) )
+ 2*y'
[]
[]
[Executioner]
type = SIMPLE
momentum_l_abs_tol = 1e-8
pressure_l_abs_tol = 1e-8
momentum_l_tol = 0
pressure_l_tol = 0
rhie_chow_user_object = 'rc'
momentum_systems = 'u_system v_system'
pressure_system = 'pressure_system'
momentum_equation_relaxation = 0.8
pressure_variable_relaxation = 0.3
num_iterations = 10000
pressure_absolute_tolerance = 1e-7
momentum_absolute_tolerance = '1e-7 1e-7'
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
continue_on_max_its = true
pin_pressure = true
pressure_pin_value = 0.25
pressure_pin_point = '0.5 0.5 0.0'
[]
[Outputs]
exodus = true
[csv]
type = CSV
execute_on = TIMESTEP_END
[]
[]
[Postprocessors]
[h]
type = AverageElementSize
execute_on = TIMESTEP_END
[]
[L2u]
type = ElementL2FunctorError
approximate = vel_x
exact = exact_u
execute_on = TIMESTEP_END
[]
[L2v]
type = ElementL2FunctorError
approximate = vel_y
exact = exact_v
execute_on = TIMESTEP_END
[]
[L2p]
approximate = pressure
exact = exact_p
type = ElementL2FunctorError
execute_on = TIMESTEP_END
[]
[]
(test/tests/linearfvkernels/advection/advection-2d.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 2
ny= 1
ymax = 0.5
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
[]
[]
[FVInterpolationMethods]
[upwind]
type = FVAdvectedUpwind
[]
[average]
type = FVGeometricAverage
[]
[muscl]
type = FVAdvectedMUSCLDeferredCorrection
deferred_correction_factor = 1.0
[]
[nvd_vanleer]
type = FVAdvectedVanLeerWeightBased
blending_factor = 1.0
[]
[nvd_minmod]
type = FVAdvectedMinmodWeightBased
blending_factor = 1.0
[]
[]
[LinearFVKernels]
[advection]
type = LinearFVAdvection
variable = u
velocity = "0.5 0 0"
advected_interp_method_name = upwind
[]
[source]
type = LinearFVSource
variable = u
source_density = source_func
[]
[]
[LinearFVBCs]
[inflow]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "left top bottom"
functor = analytic_solution
[]
[outflow]
type = LinearFVAdvectionDiffusionOutflowBC
variable = u
boundary = "right"
use_two_term_expansion = false
[]
[]
[Functions]
[source_func]
type = ParsedFunction
expression = '0.5*pi*sin(2*y*pi)*cos(x*pi)'
[]
[analytic_solution]
type = ParsedFunction
expression = 'sin(x*pi)*sin(2*y*pi) + 1.5'
[]
[]
[Postprocessors]
[error]
type = ElementL2FunctorError
approximate = u
exact = analytic_solution
execute_on = FINAL
[]
[h]
type = AverageElementSize
execute_on = FINAL
[]
[]
[Convergence]
[linear]
type = IterationCountConvergence
max_iterations = 1
converge_at_max_iterations = true
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-10
multi_system_fixed_point=true
multi_system_fixed_point_convergence=linear
petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_shift_amount -pc_factor_mat_solver_type -mat_mumps_icntl_14'
petsc_options_value = 'lu NONZERO 1e-12 mumps 50'
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
[]
[]
(test/tests/linearfvbcs/robin/diffusion-1d-robin.i)
##################################################################
k = 7.0 # diffusion coeff.
amp = 3.6 # sinusoid amplitude, for u_exact
x_l = ${fparse 0.0*pi} # domain bound (left)
x_r = ${fparse 0.9*pi} # domain bound (right)
alpha = 5.000 # robin BC coeff for gradient term
beta = 2.000 # robin BC coeff for variable term
gamma = ${fparse (alpha*amp*cos(x_r) ) + (beta*amp*sin(x_r))} # RHS of Robin BC, applied at right boundary
npts = 2
##################################################################
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
nx = ${npts}
xmin = ${x_l}
xmax = ${x_r}
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 0.0
[]
[]
[Functions]
[u_exact]
type = ParsedFunction
expression = '${amp}*sin(x)'
[]
[source_fn]
type = ParsedFunction
expression = '${fparse k*amp}*sin(x)'
[]
[]
[LinearFVKernels]
[diffusion]
type = LinearFVDiffusion
variable = u
diffusion_coeff = ${k}
use_nonorthogonal_correction = False
[]
[source]
type = LinearFVSource
variable = u
source_density = source_fn
[]
[]
[LinearFVBCs]
[dir_r]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "left"
functor = 0
[]
[rob_l]
type = LinearFVAdvectionDiffusionFunctorRobinBC
variable = u
boundary = "right"
alpha = ${alpha}
beta = ${beta}
gamma = ${gamma}
[]
[]
[Postprocessors]
[h]
type = AverageElementSize
execute_on = FINAL
[]
[error]
type = ElementL2FunctorError
approximate = u
exact = u_exact
execute_on = FINAL
[]
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
[]
[]
[Convergence]
[linear]
type = IterationCountConvergence
max_iterations = 4
converge_at_max_iterations = true
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-7
linear_convergence = linear
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
(test/tests/variables/linearfv/diffusion-1d-aux.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
nx = 10
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
[]
[]
[AuxVariables]
[v_volume]
type = MooseLinearVariableFVReal
initial_condition = 50
[]
[v_functor]
type = MooseLinearVariableFVReal
initial_condition = 25
[]
[v_parsed]
type = MooseLinearVariableFVReal
initial_condition = 12.5
[]
[]
[AuxKernels]
[volume]
type = VolumeAux
variable = v_volume
[]
[functor]
type = FunctorAux
variable = v_functor
functor = u
[]
[parsed]
type = ParsedAux
variable = v_parsed
coupled_variables = 'v_volume v_functor'
expression = '0.5*v_volume+0.5*v_functor'
[]
[]
[LinearFVKernels]
[diffusion]
type = LinearFVDiffusion
variable = u
diffusion_coeff = coeff_func
[]
[source]
type = LinearFVSource
variable = u
source_density = source_func
[]
[]
[LinearFVBCs]
[dir]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "left right"
functor = analytic_solution
[]
[]
[Functions]
[coeff_func]
type = ParsedFunction
expression = '0.5*x'
[]
[source_func]
type = ParsedFunction
expression = '2*x'
[]
[analytic_solution]
type = ParsedFunction
expression = '1-x*x'
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-10
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true
execute_on = TIMESTEP_END
[]
(test/tests/transfers/multiapp_copy_transfer/linear_sys_to_aux/linear_sub.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
nx = 10
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
[]
[]
[LinearFVKernels]
[diffusion]
type = LinearFVDiffusion
variable = u
diffusion_coeff = coeff_func
[]
[source]
type = LinearFVSource
variable = u
source_density = source_func
[]
[]
[LinearFVBCs]
[dir]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "left right"
functor = analytic_solution
[]
[]
[Functions]
[coeff_func]
type = ParsedFunction
expression = '0.5*x'
[]
[source_func]
type = ParsedFunction
expression = '2*x'
[]
[analytic_solution]
type = ParsedFunction
expression = '1-x*x'
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-10
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true
execute_on = TIMESTEP_END
[]
(test/tests/linearfvbcs/scalar_symmetry/advection-2d-symmetry.i)
vel_x = -0.1
two_term_bc=true
gradient_method = 'green-gauss'
advected_interp_method = 'average'
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 2
ny = 2
xmin = 0
xmax = ${fparse pi/3}
ymin = 0
ymax = ${fparse pi/3}
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 0.02
gradient_method = ${gradient_method}
[]
[]
[FVGradientMethods]
[gg]
type = FVGreenGaussGradient
[]
[gg_custom]
type = FVGreenGaussGradient
[]
[]
[FVInterpolationMethods]
[average]
type = FVGeometricAverage
[]
[muscl]
type = FVAdvectedMUSCLDeferredCorrection
gradient_method = gg_custom
[]
[]
[Functions]
[u_exact]
type = ParsedFunction
expression = 'cos(x)*cos(y)'
[]
[source_fn]
type = ParsedFunction
expression = '-${vel_x}*sin(x)*cos(y)'
[]
[]
[LinearFVKernels]
[advection]
type = LinearFVAdvection
variable = u
velocity = "${vel_x} 0 0"
advected_interp_method_name = ${advected_interp_method}
[]
[source]
type = LinearFVSource
variable = u
source_density = source_fn
[]
[]
[LinearFVBCs]
[symm]
type = LinearFVAdvectionDiffusionScalarSymmetryBC
variable = u
boundary = "bottom"
use_two_term_expansion = ${two_term_bc}
[]
[outflow]
type = LinearFVAdvectionDiffusionOutflowBC
variable = u
boundary = "left"
use_two_term_expansion = ${two_term_bc}
[]
[dir]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "right top"
functor = u_exact
[]
[]
[Postprocessors]
[h]
type = AverageElementSize
execute_on = 'TIMESTEP_END'
[]
[error]
type = ElementL2FunctorError
approximate = u
exact = u_exact
execute_on = 'TIMESTEP_END'
[]
[]
[Convergence]
[linear]
type = IterationCountConvergence
max_iterations = 1
converge_at_max_iterations = true
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-9
petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_shift_amount'
petsc_options_value = 'lu NONZERO 1e-10'
multi_system_fixed_point = true
multi_system_fixed_point_convergence = linear
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
[]
exodus = true
[]
(test/tests/time_steppers/iteration_adaptive/adapt_linear_systems.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 50
ny = 2
xmax = 5
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
[]
[]
[LinearFVKernels]
[time]
type = LinearFVTimeDerivative
variable = 'u'
[]
[diffusion]
type = LinearFVDiffusion
variable = u
diffusion_coeff = 5
[]
[source]
type = LinearFVSource
variable = u
source_density = 2
[]
[]
[LinearFVBCs]
[dir]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "left right"
functor = 12
[]
[]
[Executioner]
type = Transient
system_names = u_sys
start_time = 0.0
end_time = 19
n_startup_steps = 2
dtmax = 6.0
[TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 8
dt = 1.0
[]
verbose = true
linear_convergence = much_logic
[]
[Convergence]
[force_grow]
type = IterationCountConvergence
min_iterations = 0
max_iterations = 4
converge_at_max_iterations = true
[]
[force_shrink]
type = IterationCountConvergence
min_iterations = 12
max_iterations = 13
converge_at_max_iterations = true
[]
[much_logic]
type = ParsedConvergence
convergence_expression = 'if(time < 5, force_grow, force_shrink)'
symbol_names = 'time force_grow force_shrink'
symbol_values = 'time force_grow force_shrink'
[]
[]
[Postprocessors]
[_dt]
type = TimestepSize
[]
[time]
type = TimePostprocessor
[]
[]
[Outputs]
csv = true
[]
(test/tests/linearfvbcs/robin/diffusion-2d-robin.i)
#################################################################
k = 7.0 # diffusion coeff.
amp = 3.6 # sinusoid amplitude, for u_exact
x1 = ${fparse 0.1*pi}
x2 = ${fparse 1.0*pi}
y1 = ${fparse 0.0*pi}
y2 = ${fparse 1.0*pi}
alpha = 2.000 # robin BC coeff for gradient term
beta = 5.000 # robin BC coeff for variable term
nx = 2
ny = 2
##################################################################
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = ${nx}
ny = ${ny}
xmin = ${x1}
xmax = ${x2}
ymin = ${y1}
ymax = ${y2}
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 0.0
[]
[]
[Functions]
[u_exact]
type = ParsedFunction
expression = '(${amp}*sin(x)*sin(y))'
[]
[source_fn]
type = ParsedFunction
expression = '${fparse k*amp}*2.0*sin(x)*sin(y)'
[]
[gamma_fn]
type = ParsedFunction
expression = '${fparse -amp*alpha}*cos(x)*sin(y) + ${beta} * u_e'
symbol_names = 'u_e'
symbol_values = 'u_exact'
[]
[]
[LinearFVKernels]
[diffusion]
type = LinearFVDiffusion
variable = u
diffusion_coeff = ${k}
use_nonorthogonal_correction = true
[]
[source]
type = LinearFVSource
variable = u
source_density = source_fn
[]
[]
[LinearFVBCs]
[right]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "right"
functor = u_exact
[]
[top]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "top"
functor = u_exact
[]
[bottom]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "bottom"
functor = u_exact
[]
[robin_left]
type = LinearFVAdvectionDiffusionFunctorRobinBC
variable = u
boundary = "left"
alpha = ${alpha}
beta = ${beta}
gamma = gamma_fn
[]
[]
[Postprocessors]
[h]
type = AverageElementSize
execute_on = FINAL
[]
[error]
type = ElementL2FunctorError
approximate = u
exact = u_exact
execute_on = FINAL
[]
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
[]
[]
[Convergence]
[linear]
type = IterationCountConvergence
max_iterations = 4
converge_at_max_iterations = true
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-7
multi_system_fixed_point = true
multi_system_fixed_point_convergence = linear
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
linear_convergence = linear
[]
(modules/navier_stokes/test/tests/finite_volume/ins/mms/linear-segregated/porosity-jump-traction/porosity-jump-traction.i)
rho = 1
mu = 1
eps_left = 0.4
eps_right = 0.8
interface = 0.5
skew = 0.35
normal_velocity = 0
tangential_velocity = 1
tangential_gradient = 0
tangential_curvature = 0.5
shear_traction = 2
# In interface-normal coordinates (r,t), the manufactured velocity is
# v_n = normal_velocity + tangential_gradient*t and
# v_t = tangential_velocity + (shear_traction/mu - tangential_gradient)*r
# + tangential_curvature*r^2. It is divergence-free and
# mu*(d(v_t)/dr + d(v_n)/dt) = shear_traction on both sides of the porosity interface.
[Problem]
linear_sys_names = 'u_system v_system pressure_system'
previous_nl_solution_required = true
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
nx = 4
ny = 4
[]
[right]
type = ParsedSubdomainMeshGenerator
input = gen
combinatorial_geometry = 'x > ${interface}'
block_id = 1
block_name = right
[]
[left]
type = ParsedSubdomainMeshGenerator
input = right
combinatorial_geometry = 'x < ${interface}'
block_id = 2
block_name = left
[]
[skew]
type = ParsedNodeTransformGenerator
input = left
x_function = 'x + ${skew} * y'
[]
[]
[UserObjects]
[rc]
type = PorousRhieChowMassFlux
u = vel_x
v = vel_y
pressure = pressure
rho = ${rho}
porosity = porosity
p_diffusion_kernel = p_diffusion
pressure_projection_method = consistent
[]
[]
[Variables]
[vel_x]
type = MooseLinearVariableFVReal
solver_sys = u_system
initial_condition = 0
[]
[vel_y]
type = MooseLinearVariableFVReal
solver_sys = v_system
initial_condition = 0
[]
[pressure]
type = MooseLinearVariableFVReal
solver_sys = pressure_system
initial_condition = 0
[]
[]
[FVInterpolationMethods]
[average]
type = FVGeometricAverage
[]
[]
[LinearFVKernels]
[u_advection_stress]
type = LinearPWCNSFVMomentumFlux
variable = vel_x
advected_interp_method_name = average
mu = dynamic_viscosity
u = vel_x
v = vel_y
momentum_component = x
rhie_chow_user_object = rc
use_nonorthogonal_correction = true
use_deviatoric_terms = true
[]
[v_advection_stress]
type = LinearPWCNSFVMomentumFlux
variable = vel_y
advected_interp_method_name = average
mu = dynamic_viscosity
u = vel_x
v = vel_y
momentum_component = y
rhie_chow_user_object = rc
use_nonorthogonal_correction = true
use_deviatoric_terms = true
[]
[u_pressure]
type = LinearPWCNSFVMomentumPressure
variable = vel_x
pressure = pressure
porosity = porosity
momentum_component = x
[]
[v_pressure]
type = LinearPWCNSFVMomentumPressure
variable = vel_y
pressure = pressure
porosity = porosity
momentum_component = y
[]
[u_forcing]
type = LinearFVSource
variable = vel_x
source_density = forcing_u
[]
[v_forcing]
type = LinearFVSource
variable = vel_y
source_density = forcing_v
[]
[p_diffusion]
type = LinearFVPressureCorrectionDiffusion
variable = pressure
diffusion_tensor = Ainv
use_nonorthogonal_correction = true
use_nonorthogonal_correction_on_boundary = 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 = vel_x
functor = exact_u
[]
[velocity_y]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left right top bottom'
variable = vel_y
functor = exact_v
[]
[pressure-extrapoaltion]
type = LinearFVPressureFluxBC
boundary = 'left right top bottom'
variable = pressure
HbyA_flux = HbyA
Ainv = Ainv
rho = ${rho}
u = vel_x
v = vel_y
# The two-term boundary pressure expansion leaves an O(1) pressure error in the boundary
# cells on this nonorthogonal mesh, which limits the L2 pressure slope to about 0.5.
use_two_term_expansion = false
[]
[]
[FunctorMaterials]
[viscosity]
type = GenericFunctorMaterial
prop_names = dynamic_viscosity
prop_values = ${mu}
[]
[porosity_left]
type = GenericFunctorMaterial
block = left
prop_names = porosity
prop_values = ${eps_left}
[]
[porosity_right]
type = GenericFunctorMaterial
block = right
prop_names = porosity
prop_values = ${eps_right}
[]
[]
[Functions]
[exact_u]
type = ParsedFunction
expression = '(vn+skew*vt)/sqrt(1+skew^2)'
symbol_names = 'skew vn vt'
symbol_values = '${skew} exact_normal_velocity exact_tangential_velocity'
[]
[exact_v]
type = ParsedFunction
expression = '(-skew*vn+vt)/sqrt(1+skew^2)'
symbol_names = 'skew vn vt'
symbol_values = '${skew} exact_normal_velocity exact_tangential_velocity'
[]
[exact_normal_velocity]
type = ParsedFunction
expression = 'U+b*(skew*x+y)/sqrt(1+skew^2)'
symbol_names = 'skew U b'
symbol_values = '${skew} ${normal_velocity} ${tangential_gradient}'
[]
[exact_tangential_velocity]
type = ParsedFunction
expression = 'Vt+(q/mu-b)*(x-skew*y-interface)/sqrt(1+skew^2)'
'+c*((x-skew*y-interface)/sqrt(1+skew^2))^2'
symbol_names = 'interface skew mu q b Vt c'
symbol_values = '${interface} ${skew} ${mu} ${shear_traction} ${tangential_gradient} ${tangential_velocity} ${tangential_curvature}'
[]
[tangential_velocity_derivative]
type = ParsedFunction
expression = 'q/mu-b+2*c*(x-skew*y-interface)/sqrt(1+skew^2)'
symbol_names = 'interface skew mu q b c'
symbol_values = '${interface} ${skew} ${mu} ${shear_traction} ${tangential_gradient} ${tangential_curvature}'
[]
[forcing_u]
type = ParsedFunction
expression = '(b*vt+skew*(dvtdr*vn-2*mu*c))/sqrt(1+skew^2)'
symbol_names = 'skew mu vn vt dvtdr b c'
symbol_values = '${skew} ${mu} exact_normal_velocity exact_tangential_velocity tangential_velocity_derivative ${tangential_gradient} ${tangential_curvature}'
[]
[forcing_v]
type = ParsedFunction
expression = '(-skew*b*vt+dvtdr*vn-2*mu*c)/sqrt(1+skew^2)'
symbol_names = 'skew mu vn vt dvtdr b c'
symbol_values = '${skew} ${mu} exact_normal_velocity exact_tangential_velocity tangential_velocity_derivative ${tangential_gradient} ${tangential_curvature}'
[]
[]
[Executioner]
type = SIMPLE
momentum_l_abs_tol = 1e-11
pressure_l_abs_tol = 1e-11
momentum_l_max_its = 50
pressure_l_max_its = 50
momentum_l_tol = 0
pressure_l_tol = 0
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
num_iterations = 5000
pressure_absolute_tolerance = 1e-10
momentum_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'
print_fields = false
pin_pressure = true
pressure_pin_value = 0
pressure_pin_point = '0.425 0.5 0'
[]
[Outputs]
exodus = false
[csv]
type = CSV
execute_on = FINAL
[]
[]
[Postprocessors]
[h]
type = AverageElementSize
outputs = csv
execute_on = FINAL
[]
[L2u]
type = ElementL2FunctorError
approximate = vel_x
exact = exact_u
outputs = csv
execute_on = FINAL
[]
[L2v]
type = ElementL2FunctorError
approximate = vel_y
exact = exact_v
outputs = csv
execute_on = FINAL
[]
[L2p]
type = ElementL2FunctorError
approximate = pressure
exact = 0
outputs = csv
execute_on = FINAL
[]
[]
(modules/navier_stokes/test/tests/finite_volume/wcns/enthalpy_equation/1d_test_h_fp.i)
L = 30
nx = 600
bulk_u = 0.01
p_ref = 101325.0
T_in = 860.
q_source = 20000.
advected_interp_method = 'upwind'
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
xmin = 0
xmax = ${L}
nx = ${nx}
[]
allow_renumbering = false
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
advected_interp_method = ${advected_interp_method}
u = vel_x
[]
[Problem]
linear_sys_names = 'u_system pressure_system energy_system'
previous_nl_solution_required = true
[]
[UserObjects]
[rc]
type = RhieChowMassFlux
u = vel_x
pressure = pressure
rho = 'rho'
p_diffusion_kernel = p_diffusion
[]
[]
[Variables]
[vel_x]
type = MooseLinearVariableFVReal
solver_sys = u_system
initial_condition = ${bulk_u}
[]
[pressure]
type = MooseLinearVariableFVReal
solver_sys = pressure_system
initial_condition = ${p_ref}
[]
[h]
type = MooseLinearVariableFVReal
solver_sys = energy_system
initial_condition = ${fparse 860.*240.}
[]
[]
[AuxVariables]
[rho_var]
type = MooseLinearVariableFVReal
[]
[cp_var]
type = MooseLinearVariableFVReal
[]
[mu_var]
type = MooseLinearVariableFVReal
[]
[k_var]
type = MooseLinearVariableFVReal
[]
[T]
type = MooseLinearVariableFVReal
initial_condition = ${T_in}
[]
[h_aux]
type = MooseLinearVariableFVReal
[]
[]
[FVInterpolationMethods]
[upwind]
type = FVAdvectedUpwind
[]
[]
[LinearFVKernels]
[u_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_x
advected_interp_method_name = ${advected_interp_method}
mu = 'mu'
momentum_component = 'x'
use_nonorthogonal_correction = false
[]
[u_pressure]
type = LinearFVMomentumPressure
variable = vel_x
pressure = pressure
momentum_component = 'x'
[]
[p_diffusion]
type = LinearFVPressureCorrectionDiffusion
variable = pressure
diffusion_tensor = Ainv
use_nonorthogonal_correction = false
[]
[HbyA_divergence]
type = LinearFVDivergence
variable = pressure
face_flux = HbyA
force_boundary_execution = true
[]
[temp_advection]
type = LinearFVEnergyAdvection
variable = h
[]
[source]
type = LinearFVSource
variable = h
source_density = source_func
[]
[]
[LinearFVBCs]
[inlet_u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left'
variable = vel_x
functor = ${bulk_u}
[]
[inlet_h]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = h
boundary = 'left'
functor = 'h_from_p_T'
[]
[inlet_T]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = T
boundary = 'left'
functor = ${T_in}
[]
[outlet_p]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'right'
variable = pressure
functor = ${p_ref}
[]
[outlet_h]
type = LinearFVAdvectionDiffusionOutflowBC
variable = h
use_two_term_expansion = false
boundary = 'right'
[]
[outlet_u]
type = LinearFVAdvectionDiffusionOutflowBC
variable = vel_x
use_two_term_expansion = false
boundary = 'right'
[]
[]
[FluidProperties]
[lead]
type = LeadFluidProperties
[]
[]
[FunctorMaterials]
[enthalpy_material]
type = LinearFVEnthalpyFunctorMaterial
pressure = ${p_ref}
T_fluid = T
h = h
fp = lead
[]
[fluid_props_to_mat_props]
type = GeneralFunctorFluidProps
fp = lead
pressure = ${p_ref}
T_fluid = 'T'
speed = 1
porosity = 1
characteristic_length = 1
[]
[source_func]
type = ADParsedFunctorMaterial
property_name = source_func
functor_names = 'rho'
expression = ${q_source}
[]
[]
[AuxKernels]
[rho_out]
type = FunctorAux
functor = 'rho'
variable = 'rho_var'
execute_on = 'NONLINEAR'
[]
[cp_out]
type = FunctorAux
functor = 'cp'
variable = 'cp_var'
execute_on = 'NONLINEAR'
[]
[mu_out]
type = FunctorAux
functor = 'mu'
variable = 'mu_var'
execute_on = 'NONLINEAR'
[]
[k_out]
type = FunctorAux
functor = 'k'
variable = 'k_var'
execute_on = 'NONLINEAR'
[]
[T_from_h_functor_aux]
type = FunctorAux
functor = 'T_from_p_h'
variable = 'T'
execute_on = 'NONLINEAR'
[]
[h_from_T_functor_aux]
type = FunctorAux
functor = 'h_from_p_T'
variable = 'h_aux'
execute_on = 'NONLINEAR'
[]
[]
[Postprocessors]
[T_out_sim]
type = ElementalVariableValue
variable = T
elementid = ${fparse nx-1}
[]
[]
[Executioner]
type = SIMPLE
momentum_l_abs_tol = 1e-12
pressure_l_abs_tol = 1e-12
energy_l_abs_tol = 1e-12
momentum_l_tol = 0
pressure_l_tol = 0
energy_l_tol = 0
rhie_chow_user_object = 'rc'
momentum_systems = 'u_system'
pressure_system = 'pressure_system'
energy_system = 'energy_system'
momentum_equation_relaxation = 0.7
pressure_variable_relaxation = 0.3
energy_equation_relaxation = 0.95
num_iterations = 100
pressure_absolute_tolerance = 1e-8
momentum_absolute_tolerance = 1e-8
energy_absolute_tolerance = 1e-6
print_fields = false
momentum_l_max_its = 200
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'
continue_on_max_its = true
[]
[Outputs]
[out]
type = CSV
[]
[]
(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
[]
[]
(test/tests/outputs/debug/show_execution_linear_fv_elemental.i)
[Mesh]
[gen_mesh]
type = GeneratedMeshGenerator
dim = 1
xmin = 0
xmax = 10
nx = 50
[]
[left]
type = ParsedSubdomainMeshGenerator
input = 'gen_mesh'
combinatorial_geometry = 'x < 0.5'
block_id = '1'
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
[]
[]
[LinearFVKernels]
[reaction_1]
type = LinearFVReaction
variable = u
coeff = 1.5
block = 0
[]
[reaction_2]
type = LinearFVReaction
variable = u
coeff = 2.5
block = 1
[]
[source_1]
type = LinearFVSource
variable = u
source_density = 3.5
block = 0
[]
[source_2]
type = LinearFVSource
variable = u
source_density = 4.5
block = 1
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-10
[]
[Debug]
show_execution_order = 'NONLINEAR'
[]
(test/tests/linearfvkernels/advection/advection-2d-rz.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 2
ny= 1
ymax = 0.5
[]
coord_type = RZ
rz_coord_axis = Y
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
[]
[]
[FVInterpolationMethods]
[upwind]
type = FVAdvectedUpwind
[]
[average]
type = FVGeometricAverage
[]
[]
[LinearFVKernels]
[advection]
type = LinearFVAdvection
variable = u
velocity = "0.0 0.5 0"
advected_interp_method_name = average
[]
[source]
type = LinearFVSource
variable = u
source_density = source_func
[]
[]
[LinearFVBCs]
[inflow]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "left right bottom"
functor = analytic_solution
[]
[outflow]
type = LinearFVAdvectionDiffusionOutflowBC
variable = u
boundary = "top"
use_two_term_expansion = true
[]
[]
[Functions]
[source_func]
type = ParsedFunction
expression = '1.0*pi*sin(x*pi)*cos(2*y*pi)'
[]
[analytic_solution]
type = ParsedFunction
expression = 'sin(x*pi)*sin(2*y*pi) + 1.5'
[]
[]
[Postprocessors]
[error]
type = ElementL2FunctorError
approximate = u
exact = analytic_solution
execute_on = FINAL
[]
[h]
type = AverageElementSize
execute_on = FINAL
[]
[]
[Convergence]
[linear]
type = IterationCountConvergence
max_iterations = 10
converge_at_max_iterations = true
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-10
multi_system_fixed_point=true
multi_system_fixed_point_convergence=linear
petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_shift_amount'
petsc_options_value = 'lu NONZERO 1e-10'
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
[]
[]
(test/tests/variables/linearfv/gradient-aux.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 4
ny = 4
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
[]
[]
[AuxVariables]
[grad_u_default]
family = MONOMIAL_VEC
order = CONSTANT
[]
[grad_u_limited]
family = MONOMIAL_VEC
order = CONSTANT
[]
[]
[FVGradientMethods]
[limited]
type = FVGreenGaussGradient
limiter = venkatakrishnan
[]
[]
[LinearFVKernels]
[diffusion]
type = LinearFVDiffusion
variable = u
diffusion_coeff = 1
use_nonorthogonal_correction = false
[]
[source]
type = LinearFVSource
variable = u
source_density = source_func
[]
[]
[LinearFVBCs]
[dir]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = 'left right top bottom'
functor = analytic_solution
[]
[]
[AuxKernels]
[grad_u_default]
type = LinearFVGradientAux
variable = grad_u_default
linear_fv_variable = u
[]
[grad_u_limited]
type = LinearFVGradientAux
variable = grad_u_limited
linear_fv_variable = u
gradient_method = limited
[]
[]
[Functions]
[source_func]
type = ParsedFunction
expression = '2*(1.5-y*y)+2*(1.5-x*x)'
[]
[analytic_solution]
type = ParsedFunction
expression = '(1.5-x*x)*(1.5-y*y)'
[]
[analytic_gradient]
type = ParsedVectorFunction
expression_x = '-2*x*(1.5-y*y)'
expression_y = '-2*y*(1.5-x*x)'
[]
[]
[Postprocessors]
[default_gradient_error]
type = ElementVectorL2Error
variable = grad_u_default
function = analytic_gradient
execute_on = FINAL
[]
[limited_gradient_error]
type = ElementVectorL2Error
variable = grad_u_limited
function = analytic_gradient
execute_on = FINAL
[]
[]
[Convergence]
[linear]
type = IterationCountConvergence
max_iterations = 1
converge_at_max_iterations = true
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-10
multi_system_fixed_point = true
multi_system_fixed_point_convergence = linear
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
[]
[]
(test/tests/multisystem/restore_multiapp/sub.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
nx = 6
[]
[]
[Problem]
nl_sys_names = 'v_sys'
linear_sys_names = 'u_sys'
[]
[Variables]
[v]
type = MooseVariableFVReal
initial_condition = 2.0
solver_sys = v_sys
[]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
[]
[]
[FVKernels]
[diffusion]
type = FVDiffusion
variable = v
coeff = u
[]
[source]
type = FVBodyForce
variable = v
function = 3
[]
[]
[LinearFVKernels]
[diffusion]
type = LinearFVDiffusion
variable = u
diffusion_coeff = v
[]
[source]
type = LinearFVSource
variable = u
source_density = 1
[]
[]
[FVBCs]
[dir]
type = FVFunctorDirichletBC
variable = v
boundary = "left right"
functor = 2
[]
[]
[LinearFVBCs]
[dir]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "left right"
functor = 1
[]
[]
[Convergence]
[linear]
type = IterationCountConvergence
max_iterations = 7
converge_at_max_iterations = true
[]
[]
[Executioner]
type = Steady
#type = Transient
#steady_state_detection = true
system_names = 'v_sys u_sys'
l_abs_tol = 1e-12
l_tol = 1e-10
nl_abs_tol = 1e-10
multi_system_fixed_point=true
multi_system_fixed_point_convergence=linear
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true
#execute_on = timestep_end
[]
(test/tests/linearfvkernels/diffusion/diffusion-1d_neumann.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
nx = 2
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
[]
[]
[LinearFVKernels]
[diffusion]
type = LinearFVDiffusion
variable = u
diffusion_coeff = coeff_func
[]
[source]
type = LinearFVSource
variable = u
source_density = source_func
[]
[]
[LinearFVBCs]
[dir]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "right"
functor = analytic_solution
[]
[neu]
type = LinearFVAdvectionDiffusionFunctorNeumannBC
variable = u
boundary = "left"
functor = analytic_solution_neumann
[]
[]
[Functions]
[coeff_func]
type = ParsedFunction
expression = '0.5*x'
[]
[source_func]
type = ParsedFunction
expression = '2*x'
[]
[analytic_solution]
type = ParsedFunction
expression = '1-x*x'
[]
[analytic_solution_neumann]
type = ParsedFunction
expression = '-(0.5*x)*(-2*x)'
[]
[]
[Postprocessors]
[h]
type = AverageElementSize
execute_on = FINAL
[]
[error]
type = ElementL2FunctorError
approximate = u
exact = analytic_solution
execute_on = FINAL
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-10
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
[]
[]
(test/tests/linearfvkernels/diffusion-reaction-advection/advection-diffusion-reaction-1d.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
nx = 2
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
[]
[]
[FVInterpolationMethods]
[average]
type = FVGeometricAverage
[]
[]
[LinearFVKernels]
[diffusion]
type = LinearFVDiffusion
variable = u
diffusion_coeff = diff_coeff_func
use_nonorthogonal_correction = false
[]
[advection]
type = LinearFVAdvection
variable = u
velocity = "0.5 0 0"
advected_interp_method_name = average
[]
[reaction]
type = LinearFVReaction
variable = u
coeff = coeff_func
[]
[source]
type = LinearFVSource
variable = u
source_density = source_func
[]
[]
[LinearFVBCs]
inactive = "outflow neumann"
[dir]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "left right"
functor = analytic_solution
[]
[outflow]
type = LinearFVAdvectionDiffusionOutflowBC
variable = u
boundary = "right"
use_two_term_expansion = true
[]
[neumann]
type = LinearFVAdvectionDiffusionFunctorNeumannBC
variable = u
boundary = "left"
functor = analytic_solution_neumann_left
diffusion_coeff = diff_coeff_func
[]
[]
[Functions]
[diff_coeff_func]
type = ParsedFunction
expression = '1+0.5*x'
[]
[coeff_func]
type = ParsedFunction
expression = '1+1/(1+x)'
[]
[source_func]
type = ParsedFunction
expression = '(1+1/(x+1))*(sin(pi/2*x)+1.5)+0.25*pi*pi*(0.5*x+1)*sin(pi/2*x)'
[]
[analytic_solution]
type = ParsedFunction
expression = 'sin(pi/2*x)+1.5'
[]
[analytic_solution_neumann_left]
type = ParsedFunction
expression = '-(1+0.5*x)*cos(pi/2*x)*pi/2'
[]
[]
[Postprocessors]
[h]
type = AverageElementSize
execute_on = FINAL
[]
[error]
type = ElementL2FunctorError
approximate = u
exact = analytic_solution
execute_on = FINAL
[]
[]
[Convergence]
[linear]
type = IterationCountConvergence
max_iterations = 1
converge_at_max_iterations = true
[]
[]
[Executioner]
type = Steady
system_names = u_sys
multi_system_fixed_point=true
multi_system_fixed_point_convergence=linear
petsc_options_iname = '-pc_type -pc_hypre_type -ksp_rtol'
petsc_options_value = 'hypre boomeramg 1e-10'
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
[]
[]
(test/tests/linearfvbcs/scalar_symmetry/advection-1d-symmetry.i)
vel = 0.1
gradient_method = 'green-gauss'
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
nx = 2
xmin = 0
xmax = ${fparse pi}
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
gradient_method = ${gradient_method}
[]
[]
[FVGradientMethods]
[gg]
type = FVGreenGaussGradient
[]
[gg_limited]
type = FVGreenGaussGradient
limiter = venkatakrishnan
[]
[]
[FVInterpolationMethods]
[average]
type = FVGeometricAverage
[]
[]
[Functions]
[u_exact]
type = ParsedFunction
expression = 'cos(x)'
[]
[source_fn]
type = ParsedFunction
expression = '-${vel}*sin(x)'
[]
[]
[LinearFVKernels]
[advection]
type = LinearFVAdvection
variable = u
velocity = "${vel} 0 0"
advected_interp_method_name = average
[]
[source]
type = LinearFVSource
variable = u
source_density = source_fn
[]
[]
[LinearFVBCs]
[rob_l]
type = LinearFVAdvectionDiffusionScalarSymmetryBC
variable = u
boundary = "left"
use_two_term_expansion = true
[]
[dirichlet]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "right"
functor = u_exact
[]
[]
[Postprocessors]
[h]
type = AverageElementSize
execute_on = FINAL
[]
[error]
type = ElementL2FunctorError
approximate = u
exact = u_exact
execute_on = FINAL
[]
[]
[Convergence]
[linear]
type = IterationCountConvergence
max_iterations = 4
converge_at_max_iterations = true
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-7
petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_shift_amount'
petsc_options_value = 'lu NONZERO 1e-10'
linear_convergence = linear
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
[]
[]
(test/tests/linearfvbcs/robin/advection-2d-robin.i)
##################################################################
c = 0.01 # advection velocity (+x direction)
amp = 1.0 # sinusoid amplitude, for u_exact
u0 = 1.2 # any positive constant > 1.0
x_l = ${fparse 0.0*pi}
x_r = ${fparse pi}
y_l = ${fparse 0.0*pi}
y_r = ${fparse 1.0*pi}
alpha = 5.000 # robin BC coeff for gradient term
beta = 2.000 # robin BC coeff for variable term
nx = 2
ny = 2
##################################################################
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = ${nx}
ny = ${ny}
xmin = ${x_l}
xmax = ${x_r}
ymin = ${y_l}
ymax = ${y_r}
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 0.01
[]
[]
[FVInterpolationMethods]
[average]
type = FVGeometricAverage
[]
[]
[Functions]
[u_exact]
type = ParsedFunction
expression = '${amp} * (${u0} - cos(x)) * sin(y)'
[]
[source_fn]
type = ParsedFunction
expression = '${fparse c*amp} * sin(x) * sin(y)'
[]
[gamma_fn]
type = ParsedFunction
expression = '(${fparse -amp*alpha}*sin(x)*sin(y)) + (${beta} * u_e)'
symbol_names = 'u_e'
symbol_values = 'u_exact'
[]
[]
[LinearFVKernels]
[advection]
type = LinearFVAdvection
variable = u
velocity = "${c} 0 0"
advected_interp_method_name = average
[]
[source]
type = LinearFVSource
variable = u
source_density = source_fn
[]
[]
[LinearFVBCs]
[rob_l]
type = LinearFVAdvectionDiffusionFunctorRobinBC
variable = u
boundary = "left"
alpha = ${alpha}
beta = ${beta}
gamma = gamma_fn
[]
[outflow]
type = LinearFVAdvectionDiffusionOutflowBC
variable = u
boundary = "right"
use_two_term_expansion = true
[]
[top]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "top"
functor = 0.0
[]
[bottom]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "bottom"
functor = 0.0
[]
[]
[Postprocessors]
[h]
type = AverageElementSize
execute_on = FINAL
[]
[error]
type = ElementL2FunctorError
approximate = u
exact = u_exact
execute_on = FINAL
[]
[]
[Convergence]
[linear]
type = IterationCountConvergence
max_iterations = 4
converge_at_max_iterations = true
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-7
petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_shift_amount'
petsc_options_value = 'lu NONZERO 1e-10'
linear_convergence = linear
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
[]
[]
(test/tests/linearfvkernels/diffusion/diffusion-1d.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
nx = 2
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
[]
[]
[FVInterpolationMethods]
[geom]
type = FVGeometricAverage
[]
[harm]
type = FVHarmonicAverage
[]
[]
[LinearFVKernels]
[diffusion]
type = LinearFVDiffusion
variable = u
diffusion_coeff = coeff_func
[]
[source]
type = LinearFVSource
variable = u
source_density = source_func
[]
[]
[LinearFVBCs]
[dir]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "left right"
functor = analytic_solution
[]
[]
[Functions]
[coeff_func]
type = ParsedFunction
expression = '0.5*x'
[]
[coeff_pos_func]
type = ParsedFunction
expression = '1+0.5*x'
[]
[source_func]
type = ParsedFunction
expression = '2*x'
[]
[analytic_solution]
type = ParsedFunction
expression = '1-x*x'
[]
[]
[Postprocessors]
[h]
type = AverageElementSize
execute_on = FINAL
[]
[error]
type = ElementL2FunctorError
approximate = u
exact = analytic_solution
execute_on = FINAL
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-10
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
[]
[]
(modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/linear-segregated/2d-simple-channel-enthalpy/porous-baffle-2d-enthalpy-fluid-only.i)
# Steady fluid-only enthalpy transport through a 0.5-m heated porous block.
# With rho = 1000, u = 2, cp = 4200, and q = 20 MW/m^3, conservation gives
# u_block_2 = 2, T_fluid_out = 301.19047619048, and h_fluid_out = 1265000.
# For 10 upwind cells in the heated block, T_fluid_block_2 = 300.65476190476.
mu = 2e-3
rho = 1000
advected_interp_method = 'upwind'
u_in = 2
forchheimer = 0
bf = '0 0'
cp_fluid = 4200
k_fluid = 0.4
h_vol = 300
T_inlet = 300
T_initial = 300
q = 20000000
[FVGradientMethods]
[jump_aware]
type = FVPressureJumpGreenGaussGradient
[]
[velocity_jump_aware]
type = FVVelocityJumpGreenGaussGradient
[]
[reconstructed]
type = FVReconstructedPressureGradient
base_gradient_method = jump_aware
gradient_relaxation = 1.0
[]
[]
[Mesh]
[mesh]
type = CartesianMeshGenerator
dim = 2
dx = '0.5 0.5 0.5'
dy = '0.5'
ix = '10 10 10'
iy = '3'
subdomain_id = '1 2 3'
[]
[baffle]
type = SideSetsBetweenSubdomainsGenerator
input = mesh
primary_block = '1'
paired_block = '2'
new_boundary = 'baffle'
[]
[baffle2]
type = SideSetsBetweenSubdomainsGenerator
input = baffle
primary_block = '2'
paired_block = '3'
new_boundary = 'baffle2'
[]
[split_top_bottom]
type = BreakBoundaryOnSubdomainGenerator
input = baffle2
boundaries = 'top bottom'
[]
[delete]
type = BoundaryDeletionGenerator
boundary_names = 'top bottom'
input = split_top_bottom
[]
[]
[FVInterpolationMethods]
[upwind]
type = FVAdvectedUpwind
[]
[]
[Problem]
linear_sys_names = 'u_system v_system pressure_system energy_system'
previous_nl_solution_required = true
[]
[UserObjects]
[pressure_jump]
type = BernoulliFormLossPressureJump
boundary = 'baffle baffle2'
porosity = porosity
density = ${rho}
form_loss = ${bf}
reference_velocity_side = 'lower_porosity higher_porosity'
[]
[rc]
type = PorousRhieChowMassFlux
u = superficial_u
v = superficial_v
pressure = pressure
rho = ${rho}
porosity = porosity
p_diffusion_kernel = p_diffusion
pressure_jump_models = pressure_jump
pressure_jump_relaxation = 0.1
[]
[]
[Variables]
[superficial_u]
type = MooseLinearVariableFVReal
solver_sys = u_system
initial_condition = ${u_in}
gradient_method = velocity_jump_aware
[]
[superficial_v]
type = MooseLinearVariableFVReal
solver_sys = v_system
initial_condition = 0.0
gradient_method = velocity_jump_aware
[]
[pressure]
type = MooseLinearVariableFVReal
solver_sys = pressure_system
initial_condition = 0.0
gradient_method = jump_aware
[]
[h_fluid]
type = MooseLinearVariableFVReal
solver_sys = energy_system
initial_condition = '${fparse cp_fluid * T_initial}'
[]
[]
[LinearFVKernels]
[u_advection]
type = LinearPWCNSFVMomentumFlux
variable = superficial_u
advected_interp_method_name = ${advected_interp_method}
mu = ${mu}
u = superficial_u
v = superficial_v
momentum_component = 'x'
rhie_chow_user_object = rc
use_nonorthogonal_correction = false
[]
[v_advection]
type = LinearPWCNSFVMomentumFlux
variable = superficial_v
advected_interp_method_name = ${advected_interp_method}
mu = ${mu}
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
momentum_component = 'x'
porosity = porosity
pressure = pressure
gradient_method = reconstructed
[]
[v_pressure]
type = LinearPWCNSFVMomentumPressure
variable = superficial_v
momentum_component = 'y'
porosity = porosity
pressure = pressure
gradient_method = reconstructed
[]
[u_friction]
type = LinearFVMomentumFriction
variable = superficial_u
Forchheimer_name = forch
porosity = porosity
rho = ${rho}
u = superficial_u
v = superficial_v
momentum_component = 'x'
block = 2
[]
[v_friction]
type = LinearFVMomentumFriction
variable = superficial_v
Forchheimer_name = forch
porosity = porosity
rho = ${rho}
u = superficial_u
v = superficial_v
momentum_component = 'y'
block = 2
[]
[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
[]
[fluid_advection]
type = LinearFVEnergyAdvection
variable = h_fluid
advected_quantity = enthalpy
advected_interp_method = ${advected_interp_method}
rhie_chow_user_object = rc
[]
[fluid_diffusion]
type = LinearFVDiffusion
variable = h_fluid
diffusion_coeff = kappa_fluid
use_nonorthogonal_correction = false
[]
[fluid_source]
type = LinearFVSource
variable = h_fluid
source_density = q_fluid_scaled
block = 2
[]
[]
[LinearFVBCs]
[left_u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = left
variable = superficial_u
functor = ${u_in}
[]
[outlet_u]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = right
variable = superficial_u
use_two_term_expansion = false
[]
[left_v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = left
variable = superficial_v
functor = 0.0
[]
[outlet_v]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = right
variable = superficial_v
use_two_term_expansion = false
[]
[symmetry-u]
type = LinearFVVelocitySymmetryBC
boundary = 'top_to_2 bottom_to_2 top_to_1 top_to_3 bottom_to_1 bottom_to_3'
variable = superficial_u
u = superficial_u
v = superficial_v
momentum_component = x
[]
[symmetry-v]
type = LinearFVVelocitySymmetryBC
boundary = 'top_to_2 bottom_to_2 top_to_1 top_to_3 bottom_to_1 bottom_to_3'
variable = superficial_v
u = superficial_u
v = superficial_v
momentum_component = y
[]
[outlet_p]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = right
variable = pressure
functor = 0.0
[]
[pressure-extrapolation]
type = LinearFVPressureFluxBC
boundary = 'bottom_to_1 bottom_to_2 bottom_to_3 top_to_1 top_to_2 top_to_3'
variable = pressure
HbyA_flux = HbyA
Ainv = Ainv
rho = ${rho}
u = superficial_u
v = superficial_v
[]
[left_T_fluid]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = left
variable = T_fluid
functor = ${T_inlet}
[]
[left_h_fluid]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = left
variable = h_fluid
functor = h_from_p_T
[]
[walls_h_fluid]
type = LinearFVAdvectionDiffusionFunctorNeumannBC
boundary = 'top_to_1 top_to_2 top_to_3 bottom_to_1 bottom_to_2 bottom_to_3'
variable = h_fluid
functor = 0.0
diffusion_coeff = kappa_fluid
[]
[outlet_h_fluid]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = right
variable = h_fluid
use_two_term_expansion = false
[]
[]
[FunctorMaterials]
[forch]
type = GenericVectorFunctorMaterial
prop_names = forch
prop_values = '${forchheimer} ${forchheimer} ${forchheimer}'
[]
[porosity]
type = PiecewiseByBlockFunctorMaterial
prop_name = porosity
subdomain_to_prop_value = '1 1.0 2 0.5 3 1.0'
[]
[fluid_constants]
type = GenericFunctorMaterial
prop_names = 'cp_fluid kappa_fluid h_vol q_fluid_scaled'
prop_values = '${cp_fluid} ${fparse k_fluid/cp_fluid} ${h_vol} ${q}'
[]
[fluid_enthalpy_material]
type = LinearFVEnthalpyFunctorMaterial
pressure = pressure
T_fluid = T_fluid
h = h_fluid
h_from_p_T_functor = h_from_p_T_functor
T_from_p_h_functor = T_from_p_h_functor
[]
[h_from_p_T_functor]
type = ParsedFunctorMaterial
property_name = h_from_p_T_functor
functor_names = 'T_fluid'
expression = '${cp_fluid} * T_fluid'
[]
[T_from_p_h_functor]
type = ParsedFunctorMaterial
property_name = T_from_p_h_functor
functor_names = 'h_fluid'
expression = 'h_fluid / ${cp_fluid}'
[]
[]
[Postprocessors]
[u_block_2]
type = ElementAverageValue
variable = superficial_u
block = 2
[]
[T_fluid_out]
type = SideAverageValue
variable = T_fluid
boundary = right
[]
[T_fluid_block_2]
type = ElementAverageValue
variable = T_fluid
block = 2
[]
[h_fluid_out]
type = SideAverageValue
variable = h_fluid
boundary = right
[]
[]
[AuxVariables]
[porosity_aux]
type = MooseLinearVariableFVReal
[]
[T_fluid]
type = MooseLinearVariableFVReal
initial_condition = ${T_initial}
[]
[]
[AuxKernels]
[por]
type = FunctorAux
variable = porosity_aux
functor = porosity
execute_on = 'NONLINEAR'
[]
[fluid_temperature]
type = FunctorAux
variable = T_fluid
functor = T_from_p_h
execute_on = 'NONLINEAR'
[]
[]
[VectorPostprocessors]
# Sample each x-cell once at its center.
[centerline]
type = LineValueSampler
variable = 'superficial_u T_fluid'
start_point = '0.0119047619047619 0.25 0'
end_point = '1.4880952380952381 0.25 0'
num_points = 30
sort_by = x
[]
[]
[Executioner]
type = SIMPLE
momentum_l_abs_tol = 1e-14
pressure_l_abs_tol = 1e-14
energy_l_abs_tol = 1e-14
momentum_l_tol = 0
pressure_l_tol = 0
energy_l_tol = 0
rhie_chow_user_object = rc
momentum_systems = 'u_system v_system'
pressure_system = pressure_system
energy_system = energy_system
momentum_equation_relaxation = 0.2
pressure_variable_relaxation = 0.2
energy_equation_relaxation = 0.7
num_iterations = 1000
# These outer tolerances stop once the velocity and zero-pressure fields have stabilized to
# substantially below the accuracy exercised by the temperature and velocity profile checks.
pressure_absolute_tolerance = 1e-6
momentum_absolute_tolerance = 1e-2
energy_absolute_tolerance = 1e-8
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'
[]
[Outputs]
csv = true
execute_on = FINAL
[]
(test/tests/time_integrators/bdf2/linearfv.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 4
ny = 4
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
[]
[]
[LinearFVKernels]
[timeu]
type = LinearFVTimeDerivative
variable = u
[]
[diffu]
type = LinearFVDiffusion
variable = u
[]
[forceu]
type = LinearFVSource
variable = u
source_density = force
[]
[]
[Functions]
[exact]
type = ParsedFunction
expression = 't^3*x*y'
[]
[force]
type = ParsedFunction
expression = '3*x*y*t^2'
[]
[]
[LinearFVBCs]
[allu]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
functor = exact
variable = u
boundary = 'left right top bottom'
[]
[]
[Executioner]
type = Transient
system_names = u_sys
l_tol = 1e-10
petsc_options_iname = '-pc_type'
petsc_options_value = 'hypre'
dt = 1
end_time = 3
scheme = 'bdf2'
[]
[Postprocessors]
[L2u]
type = ElementL2Error
function = exact
variable = u
[]
[]
[Outputs]
csv = true
[]
(modules/navier_stokes/test/tests/finite_volume/ins/mms/linear-segregated/2d-symmetric-vortex-rz/2d-symmetric-vortex-rz.i)
mu = 1.2
rho = 1.5
advected_interp_method = 'average'
pressure_gradient_method = 'green-gauss'
[Problem]
linear_sys_names = 'u_system v_system pressure_system'
previous_nl_solution_required = true
[]
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 2
ny = 2
[]
coord_type = 'RZ'
rz_coord_axis = x
[]
[UserObjects]
[rc]
type = RhieChowMassFlux
u = vel_x
v = vel_y
pressure = pressure
rho = ${rho}
p_diffusion_kernel = p_diffusion
pressure_projection_method = consistent
[]
[]
[Variables]
[vel_x]
type = MooseLinearVariableFVReal
initial_condition = 0.0
solver_sys = u_system
[]
[vel_y]
type = MooseLinearVariableFVReal
solver_sys = v_system
initial_condition = 0.0
[]
[pressure]
type = MooseLinearVariableFVReal
solver_sys = pressure_system
initial_condition = 0.0
[]
[]
[FVInterpolationMethods]
[average]
type = FVGeometricAverage
[]
[]
[FVGradientMethods]
[reconstructed]
type = FVReconstructedPressureGradient
base_gradient_method = green-gauss
gradient_relaxation = 0.1
[]
[]
[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 = false
[]
[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 = false
[]
[u_pressure]
type = LinearFVMomentumPressure
variable = vel_x
pressure = pressure
momentum_component = 'x'
gradient_method = ${pressure_gradient_method}
[]
[v_pressure]
type = LinearFVMomentumPressure
variable = vel_y
pressure = pressure
momentum_component = 'y'
gradient_method = ${pressure_gradient_method}
[]
[u_forcing]
type = LinearFVSource
variable = vel_x
source_density = forcing_u
[]
[v_forcing]
type = LinearFVSource
variable = vel_y
source_density = forcing_v
[]
[v_viscous_forcing]
type = LinearFVRZViscousSource
variable = vel_y
mu = ${mu}
momentum_component = 'y'
[]
[p_diffusion]
type = LinearFVPressureCorrectionDiffusion
variable = pressure
diffusion_tensor = 'Ainv'
use_nonorthogonal_correction = false
use_nonorthogonal_correction_on_boundary = false
[]
[HbyA_divergence]
type = LinearFVDivergence
variable = pressure
face_flux = 'HbyA'
force_boundary_execution = true
[]
[]
[LinearFVBCs]
[no-slip-wall-u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left right top'
variable = vel_x
functor = exact_u
[]
[no-slip-wall-v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left right top'
variable = vel_y
functor = exact_v
[]
[symmetry-u]
type = LinearFVVelocitySymmetryBC
boundary = 'bottom'
variable = vel_x
u = vel_x
v = vel_y
momentum_component = x
[]
[symmetry-v]
type = LinearFVVelocitySymmetryBC
boundary = 'bottom'
variable = vel_y
u = vel_x
v = vel_y
momentum_component = y
[]
[pressure-extrapolation]
type = LinearFVExtrapolatedPressureBC
boundary = 'top left right'
variable = pressure
use_two_term_expansion = true
[]
[pressure-symmetry]
type = LinearFVPressureSymmetryBC
boundary = 'bottom'
variable = pressure
HbyA_flux = 'HbyA'
[]
[]
[AuxVariables]
[vel_x_aux]
type = MooseLinearVariableFVReal
initial_condition = 0.0
[]
[vel_y_aux]
type = MooseLinearVariableFVReal
initial_condition = 0.0
[]
[pressure_aux]
type = MooseLinearVariableFVReal
initial_condition = 0.0
[]
[]
[AuxKernels]
[vel_x_function_aux]
type = FunctionAux
variable = vel_x_aux
function = exact_u
execute_on = TIMESTEP_END
[]
[vel_y_function_aux]
type = FunctionAux
variable = vel_y_aux
function = exact_v
execute_on = TIMESTEP_END
[]
[pressure_function_aux]
type = FunctionAux
variable = pressure_aux
function = exact_p
execute_on = TIMESTEP_END
[]
[]
[Functions]
[exact_u]
type = ParsedFunction
expression = '4*x^2*y^2 - 20*x^2*y^3 - 8*x^3*y^2 + 36*x^2*y^4 + 40*x^3*y^3 + 4*x^4*y^2 - 28*x^2*y^5 - 72*x^3*y^4 - 20*x^4*y^3 + 8*x^2*y^6 + 56*x^3*y^5 + 36*x^4*y^4 - 16*x^3*y^6 - 28*x^4*y^5 + 8*x^4*y^6'
[]
[exact_v]
type = ParsedFunction
expression = '-2*x*y^3*(x-1)*(2*x-1)*(y-1)^4'
[]
[exact_p]
type = ParsedFunction
expression = 'x*y^2'
[]
[forcing_u]
type = ParsedFunction
symbol_names = 'mu rho'
symbol_values = '${mu} ${rho}'
expression = 'rho*(8*x^3*y^4*(x-1)^3*(2*x-1)*(y-1)^6*(4*y^2 - 5*y + 2)) - mu*(4*(y-1)*(72*x^4*y^3 - 103*x^4*y^2 + 41*x^4*y - 4*x^4 - 144*x^3*y^3 + 206*x^3*y^2 - 82*x^3*y + 8*x^3 + 24*x^2*y^5 - 60*x^2*y^4 + 120*x^2*y^3 - 115*x^2*y^2 + 41*x^2*y - 4*x^2 - 24*x*y^5 + 60*x*y^4 - 48*x*y^3 + 12*x*y^2 + 4*y^5 - 10*y^4 + 8*y^3 - 2*y^2)) + y^2'
[]
[forcing_v]
type = ParsedFunction
symbol_names = 'mu rho'
symbol_values = '${mu} ${rho}'
expression = 'rho*4*x^2*y^5*(x-1)^2*(y-1)^7*(2*(2*x^2 - 2*x + y) + (2*x - 1)^2*(y - 1)) + mu * (4*y*(2*x-1)*(y-1)^2*(24*x^2*y^2 - 22*x^2*y + 4*x^2 - 24*x*y^2 + 22*x*y - 4*x + 3*y^4 - 6*y^3 + 3*y^2)) + 2*x*y'
[]
[]
[Executioner]
type = SIMPLE
momentum_l_abs_tol = 1e-10
pressure_l_abs_tol = 1e-10
momentum_l_tol = 0
pressure_l_tol = 0
momentum_l_max_its = 500
pressure_l_max_its = 500
rhie_chow_user_object = 'rc'
momentum_systems = 'u_system v_system'
pressure_system = 'pressure_system'
momentum_equation_relaxation = 0.85
pressure_variable_relaxation = 1.0
num_iterations = 10000
pressure_absolute_tolerance = 1e-8
momentum_absolute_tolerance = 1e-8
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
continue_on_max_its = true
pin_pressure = true
pressure_pin_value = 0.125
pressure_pin_point = '0.5 0.5 0.0'
[]
[Outputs]
[csv]
type = CSV
execute_on = TIMESTEP_END
[]
[]
[Postprocessors]
[h]
type = AverageElementSize
execute_on = TIMESTEP_END
[]
[L2u]
type = ElementL2FunctorError
approximate = vel_x
exact = exact_u
execute_on = TIMESTEP_END
[]
[L2v]
type = ElementL2FunctorError
approximate = vel_y
exact = exact_v
execute_on = TIMESTEP_END
[]
[L2p]
approximate = pressure
exact = exact_p
type = ElementL2FunctorError
execute_on = TIMESTEP_END
[]
[]
(modules/navier_stokes/test/tests/finite_volume/wcns/enthalpy_equation/1d_test_h.i)
L = 30
nx = 600
bulk_u = 0.01
q_source = 50000.
A_cp = 976.78
B_cp = 1.0634
T_in = 860.
p_ref = 101325.0
rho = 2000.
advected_interp_method = 'upwind'
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
xmin = 0
xmax = ${L}
nx = ${nx}
[]
allow_renumbering = false
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
advected_interp_method = ${advected_interp_method}
u = vel_x
[]
[Problem]
linear_sys_names = 'u_system pressure_system energy_system'
previous_nl_solution_required = true
[]
[UserObjects]
[rc]
type = RhieChowMassFlux
u = vel_x
pressure = pressure
rho = 'rho'
p_diffusion_kernel = p_diffusion
[]
[]
[Variables]
[vel_x]
type = MooseLinearVariableFVReal
solver_sys = u_system
initial_condition = ${bulk_u}
[]
[pressure]
type = MooseLinearVariableFVReal
solver_sys = pressure_system
initial_condition = ${p_ref}
[]
[h]
type = MooseLinearVariableFVReal
solver_sys = energy_system
initial_condition = ${fparse 860.*1900.}
[]
[]
[AuxVariables]
[rho_var]
type = MooseLinearVariableFVReal
[]
[cp_var]
type = MooseLinearVariableFVReal
[]
[mu_var]
type = MooseLinearVariableFVReal
[]
[k_var]
type = MooseLinearVariableFVReal
[]
[T]
type = MooseLinearVariableFVReal
initial_condition = 860.
[]
[h_aux]
type = MooseLinearVariableFVReal
[]
[]
[FVInterpolationMethods]
[upwind]
type = FVAdvectedUpwind
[]
[]
[LinearFVKernels]
[u_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_x
advected_interp_method_name = ${advected_interp_method}
mu = 'mu'
momentum_component = 'x'
use_nonorthogonal_correction = false
[]
[u_pressure]
type = LinearFVMomentumPressure
variable = vel_x
pressure = pressure
momentum_component = 'x'
[]
[p_diffusion]
type = LinearFVPressureCorrectionDiffusion
variable = pressure
diffusion_tensor = Ainv
use_nonorthogonal_correction = false
[]
[HbyA_divergence]
type = LinearFVDivergence
variable = pressure
face_flux = HbyA
force_boundary_execution = true
[]
[temp_advection]
type = LinearFVEnergyAdvection
variable = h
[]
[source]
type = LinearFVSource
variable = h
source_density = source_func
[]
[]
[LinearFVBCs]
[inlet_u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left'
variable = vel_x
functor = ${bulk_u} #${bulk_u} #'fully_developed_velocity'
[]
[inlet_h]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = h
boundary = 'left'
functor = 'h_from_p_T'
[]
[inlet_T]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = T
boundary = 'left'
functor = ${T_in}
[]
[outlet_p]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'right'
variable = pressure
functor = ${p_ref}
[]
[outlet_h]
type = LinearFVAdvectionDiffusionOutflowBC
variable = h
use_two_term_expansion = false
boundary = 'right'
[]
[outlet_u]
type = LinearFVAdvectionDiffusionOutflowBC
variable = vel_x
use_two_term_expansion = false
boundary = 'right'
[]
[]
[Functions]
[source_func]
type = ParsedFunction
expression = ${q_source}
[]
[T_analytical]
type = ParsedFunction
expression = ${fparse (-A_cp+sqrt(A_cp^2-2*B_cp*(-q_source/rho/bulk_u*L-A_cp*T_in-B_cp/2*T_in*T_in)))/B_cp}
[]
[]
[FunctorMaterials]
[enthalpy_material]
type = LinearFVEnthalpyFunctorMaterial
pressure = ${p_ref}
T_fluid = T
h = h
h_from_p_T_functor = h_from_p_T_functor
T_from_p_h_functor = T_from_p_h_functor
[]
[h_from_p_T_functor]
type = ParsedFunctorMaterial
property_name = 'h_from_p_T_functor'
functor_names = 'T'
expression = '${A_cp}*T+${B_cp}/2*(T^2)'
[]
[T_from_p_h_functor]
type = ParsedFunctorMaterial
property_name = 'T_from_p_h_functor'
functor_names = 'h'
expression = '(-${A_cp}+sqrt(${A_cp}^2+2*h*${B_cp}))/${B_cp}'
[]
[rho]
type = ADParsedFunctorMaterial
property_name = 'rho'
functor_names = 'T'
expression = ${rho}
[]
[cp]
type = ADParsedFunctorMaterial
property_name = 'cp'
functor_names = 'T'
expression = '${A_cp}+${B_cp}*T'
[]
[mu]
type = ADParsedFunctorMaterial
property_name = 'mu'
functor_names = 'T'
expression = '4.5e-3'
[]
[k]
type = ADParsedFunctorMaterial
property_name = 'k'
functor_names = 'T'
expression = 0.7
[]
[]
[AuxKernels]
[rho_out]
type = FunctorAux
functor = 'rho'
variable = 'rho_var'
execute_on = 'NONLINEAR'
[]
[cp_out]
type = FunctorAux
functor = 'cp'
variable = 'cp_var'
execute_on = 'NONLINEAR'
[]
[mu_out]
type = FunctorAux
functor = 'mu'
variable = 'mu_var'
execute_on = 'NONLINEAR'
[]
[k_out]
type = FunctorAux
functor = 'k'
variable = 'k_var'
execute_on = 'NONLINEAR'
[]
[T_from_h_functor_aux]
type = FunctorAux
functor = 'T_from_p_h'
variable = 'T'
execute_on = 'NONLINEAR'
[]
[h_from_T_functor_aux]
type = FunctorAux
functor = 'h_from_p_T'
variable = 'h_aux'
execute_on = 'NONLINEAR'
[]
[]
[Postprocessors]
[T_out_sim]
type = ElementalVariableValue
variable = T
elementid = ${fparse nx-1}
[]
[T_out_analytic]
type = FunctionValuePostprocessor
function = T_analytical
[]
[]
[Executioner]
type = SIMPLE
momentum_l_abs_tol = 1e-12
pressure_l_abs_tol = 1e-12
energy_l_abs_tol = 1e-12
momentum_l_tol = 0
pressure_l_tol = 0
energy_l_tol = 0
rhie_chow_user_object = 'rc'
momentum_systems = 'u_system'
pressure_system = 'pressure_system'
energy_system = 'energy_system'
momentum_equation_relaxation = 0.7
pressure_variable_relaxation = 0.3
energy_equation_relaxation = 0.95
num_iterations = 100
pressure_absolute_tolerance = 1e-8
momentum_absolute_tolerance = 1e-8
energy_absolute_tolerance = 1e-6
print_fields = false
momentum_l_max_its = 200
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'
continue_on_max_its = true
[]
[Outputs]
[out]
type = CSV
[]
[]
(modules/navier_stokes/test/tests/finite_volume/ins/mms/linear-segregated/2d-vortex/spacedependent_mu/sl.i)
rho = 1
advected_interp_method = 'average'
[Problem]
linear_sys_names = 'u_system v_system pressure_system'
previous_nl_solution_required = true
[]
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 2
ny = 2
[]
[]
[UserObjects]
[rc]
type = RhieChowMassFlux
u = vel_x
v = vel_y
pressure = pressure
rho = ${rho}
p_diffusion_kernel = p_diffusion
[]
[]
[Variables]
[vel_x]
type = MooseLinearVariableFVReal
initial_condition = 0.0
solver_sys = u_system
[]
[vel_y]
type = MooseLinearVariableFVReal
solver_sys = v_system
initial_condition = 0.0
[]
[pressure]
type = MooseLinearVariableFVReal
solver_sys = pressure_system
initial_condition = 0
[]
[]
[FVInterpolationMethods]
[average]
type = FVGeometricAverage
[]
[]
[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 = false
use_deviatoric_terms = false
[]
[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 = false
use_deviatoric_terms = false
[]
[u_pressure]
type = LinearFVMomentumPressure
variable = vel_x
pressure = pressure
momentum_component = 'x'
[]
[v_pressure]
type = LinearFVMomentumPressure
variable = vel_y
pressure = pressure
momentum_component = 'y'
[]
[u_forcing]
type = LinearFVSource
variable = vel_x
source_density = forcing_u
[]
[v_forcing]
type = LinearFVSource
variable = vel_y
source_density = forcing_v
[]
[p_diffusion]
type = LinearFVPressureCorrectionDiffusion
variable = pressure
diffusion_tensor = Ainv
use_nonorthogonal_correction = false
use_nonorthogonal_correction_on_boundary = false
[]
[HbyA_divergence]
type = LinearFVDivergence
variable = pressure
face_flux = HbyA
force_boundary_execution = true
[]
[]
[LinearFVBCs]
[no-slip-wall-u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left right top bottom'
variable = vel_x
functor = '0'
[]
[no-slip-wall-v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left right top bottom'
variable = vel_y
functor = '0'
[]
[pressure-extrapolation]
type = LinearFVExtrapolatedPressureBC
boundary = 'left right top bottom'
variable = pressure
use_two_term_expansion = true
[]
[]
[Functions]
[exact_u]
type = ParsedFunction
expression = 'x^2*(1-x)^2*(2*y-6*y^2+4*y^3)'
[]
[exact_v]
type = ParsedFunction
expression = '-y^2*(1-y)^2*(2*x-6*x^2+4*x^3)'
[]
[exact_p]
type = ParsedFunction
expression = 'x*(1-x)'
[]
[mu]
type = ParsedFunction
expression = '1+(x-1)*x*(y-1)*y'
[]
[forcing_u]
type = ParsedFunction
expression = '-(2*x-1)*y*(y-1)*(2*x-6*x^2+4*x^3)*(2*y-6*y^2+4*y^3)'
'-(1+x*(x-1)*y*(y-1))*(2*y-6*y^2+4*y^3)*(2-12*x+12*x^2)'
'-(2*y-1)*x*(x-1)*(x^2*(1-x)^2*(2-12*y+12*y^2))'
'-(1+x*(x-1)*y*(y-1))*(x^2*(1-x)^2*(-12+24*y))'
'+1-2*x+rho*4*x^3*y^2*(2*y^2-2*y+1)*(y-1)^2*(-1+2*x)*(x-1)^3'
symbol_names = 'rho'
symbol_values = '${rho}'
[]
[forcing_v]
type = ParsedFunction
expression = '(2*y-1)*x*(x-1)*(2*y-6*y^2+4*y^3)*(2*x-6*x^2+4*x^3)'
'+(1+x*(x-1)*y*(y-1))*(2-12*y+12*y^2)*(2*x-6*x^2+4*x^3)'
'+(2*x-1)*y*(y-1)*(y^2*(1-y)^2*(2-12*x+12*x^2))'
'+(1+x*(x-1)*y*(y-1))*(y^2*(1-y)^2*(-12+24*x))'
'+rho*4*y^3*x^2*(2*x^2-2*x+1)*(x-1)^2*(-1+2*y)*(y-1)^3'
symbol_names = 'rho'
symbol_values = '${rho}'
[]
[forcing_u_deviatoric]
type = ParsedFunction
expression = '-2*(2*x-1)*y*(y-1)*(2*x-6*x^2+4*x^3)*(2*y-6*y^2+4*y^3)'
'-2*(1+x*(x-1)*y*(y-1))*(2*y-6*y^2+4*y^3)*(2-12*x+12*x^2)'
'-(2*y-1)*x*(x-1)*(x^2*(1-x)^2*(2-12*y+12*y^2)-y^2*(1-y)^2*(2-12*x+12*x^2))'
'-(1+x*(x-1)*y*(y-1))*(x^2*(1-x)^2*(-12+24*y)-(2*y-6*y^2+4*y^3)*(2-12*x+12*x^2))'
'+1-2*x+rho*4*x^3*y^2*(2*y^2-2*y+1)*(y-1)^2*(-1+2*x)*(x-1)^3'
symbol_names = 'rho'
symbol_values = '${rho}'
[]
[forcing_v_deviatoric]
type = ParsedFunction
expression = '2*(2*y-1)*x*(x-1)*(2*y-6*y^2+4*y^3)*(2*x-6*x^2+4*x^3)'
'+2*(1+x*(x-1)*y*(y-1))*(2-12*y+12*y^2)*(2*x-6*x^2+4*x^3)'
'-(2*x-1)*y*(y-1)*(x^2*(1-x)^2*(2-12*y+12*y^2)-y^2*(1-y)^2*(2-12*x+12*x^2))'
'-(1+x*(x-1)*y*(y-1))*(-y^2*(1-y)^2*(-12+24*x)+(2*x-6*x^2+4*x^3)*(2-12*y+12*y^2))'
'+rho*4*y^3*x^2*(2*x^2-2*x+1)*(x-1)^2*(-1+2*y)*(y-1)^3'
symbol_names = 'rho'
symbol_values = '${rho}'
[]
[]
[Executioner]
type = SIMPLE
momentum_l_abs_tol = 1e-10
pressure_l_abs_tol = 1e-10
momentum_l_max_its = 30
pressure_l_max_its = 30
momentum_l_tol = 0.0
pressure_l_tol = 0.0
rhie_chow_user_object = 'rc'
momentum_systems = 'u_system v_system'
pressure_system = 'pressure_system'
momentum_equation_relaxation = 0.8
pressure_variable_relaxation = 0.3
num_iterations = 2000
pressure_absolute_tolerance = 1e-8
momentum_absolute_tolerance = 1e-8
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.25
pressure_pin_point = '0.5 0.5 0.0'
[]
[Outputs]
exodus = true
[csv]
type = CSV
execute_on = FINAL
[]
[]
[Postprocessors]
[h]
type = AverageElementSize
outputs = 'csv'
execute_on = FINAL
[]
[L2u]
type = ElementL2FunctorError
approximate = vel_x
exact = exact_u
outputs = 'csv'
execute_on = FINAL
[]
[L2v]
type = ElementL2FunctorError
approximate = vel_y
exact = exact_v
outputs = 'csv'
execute_on = FINAL
[]
[L2p]
approximate = pressure
exact = exact_p
type = ElementL2FunctorError
outputs = 'csv'
execute_on = FINAL
[]
[]
(test/tests/linearfvbcs/scalar_symmetry/diffusion-2d-symmetry.i)
diff = 0.1 # diffusion coeff.
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 2
ny = 2
xmin = 0
xmax = ${fparse pi/3}
ymin = 0
ymax = ${fparse pi/3}
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 0.0
[]
[]
[Functions]
[u_exact]
type = ParsedFunction
expression = 'cos(x)*cos(y)'
[]
[source_fn]
type = ParsedFunction
expression = '2*${diff}*cos(x)*cos(y)'
[]
[]
[LinearFVKernels]
[diffusion]
type = LinearFVDiffusion
variable = u
diffusion_coeff = ${diff}
use_nonorthogonal_correction = true
[]
[source]
type = LinearFVSource
variable = u
source_density = source_fn
[]
[]
[LinearFVBCs]
[dir]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "right top"
functor = u_exact
[]
[symm]
type = LinearFVAdvectionDiffusionScalarSymmetryBC
variable = u
boundary = "bottom left"
use_two_term_expansion = true
[]
[]
[Postprocessors]
[h]
type = AverageElementSize
execute_on = FINAL
[]
[error]
type = ElementL2FunctorError
approximate = u
exact = u_exact
execute_on = FINAL
[]
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
[]
[]
[Convergence]
[linear]
type = IterationCountConvergence
max_iterations = 10
converge_at_max_iterations = true
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-7
multi_system_fixed_point = true
multi_system_fixed_point_convergence = linear
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
linear_convergence = linear
[]
(modules/navier_stokes/test/tests/finite_volume/ins/mms/linear-segregated/2d-symmetric-vortex-rz/2d-symmetric-vortex-rz-spacedependent.i)
mu_ref = 1.2
mu_r = 0.1
mu_x = 0.2
rho_ref = 1.4
rho_r = 0.15
rho_x = 0.25
use_dev = true
advected_interp_method = 'average'
[Problem]
linear_sys_names = 'u_system v_system pressure_system'
previous_nl_solution_required = true
[]
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 2
ny = 2
[]
coord_type = 'RZ'
rz_coord_axis = x
[]
[UserObjects]
[rc]
type = RhieChowMassFlux
u = vel_x
v = vel_y
pressure = pressure
rho = rho_fun
p_diffusion_kernel = p_diffusion
pressure_projection_method = consistent
[]
[]
[Variables]
[vel_x]
type = MooseLinearVariableFVReal
initial_condition = 0.0
solver_sys = u_system
[]
[vel_y]
type = MooseLinearVariableFVReal
solver_sys = v_system
initial_condition = 0.0
[]
[pressure]
type = MooseLinearVariableFVReal
solver_sys = pressure_system
initial_condition = 0.0
[]
[]
[FVInterpolationMethods]
[average]
type = FVGeometricAverage
[]
[]
[LinearFVKernels]
[u_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_x
advected_interp_method_name = ${advected_interp_method}
mu = mu_fun
u = vel_x
v = vel_y
momentum_component = 'x'
rhie_chow_user_object = 'rc'
use_nonorthogonal_correction = false
use_deviatoric_terms = ${use_dev}
[]
[v_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_y
advected_interp_method_name = ${advected_interp_method}
mu = mu_fun
u = vel_x
v = vel_y
momentum_component = 'y'
rhie_chow_user_object = 'rc'
use_nonorthogonal_correction = false
use_deviatoric_terms = ${use_dev}
[]
[u_pressure]
type = LinearFVMomentumPressure
variable = vel_x
pressure = pressure
momentum_component = 'x'
[]
[v_pressure]
type = LinearFVMomentumPressure
variable = vel_y
pressure = pressure
momentum_component = 'y'
[]
[u_forcing]
type = LinearFVSource
variable = vel_x
source_density = forcing_u
[]
[v_forcing]
type = LinearFVSource
variable = vel_y
source_density = forcing_v
[]
[v_viscous_forcing]
type = LinearFVRZViscousSource
variable = vel_y
mu = mu_fun
momentum_component = 'y'
u = vel_x
v = vel_y
use_deviatoric_terms = ${use_dev}
[]
[p_diffusion]
type = LinearFVPressureCorrectionDiffusion
variable = pressure
diffusion_tensor = 'Ainv'
use_nonorthogonal_correction = false
use_nonorthogonal_correction_on_boundary = false
[]
[HbyA_divergence]
type = LinearFVDivergence
variable = pressure
face_flux = 'HbyA'
force_boundary_execution = true
[]
[]
[LinearFVBCs]
[no-slip-wall-u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left right top'
variable = vel_x
functor = exact_u
[]
[no-slip-wall-v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left right top'
variable = vel_y
functor = exact_v
[]
[symmetry-u]
type = LinearFVVelocitySymmetryBC
boundary = 'bottom'
variable = vel_x
u = vel_x
v = vel_y
momentum_component = x
[]
[symmetry-v]
type = LinearFVVelocitySymmetryBC
boundary = 'bottom'
variable = vel_y
u = vel_x
v = vel_y
momentum_component = y
[]
[pressure-extrapolation]
type = LinearFVExtrapolatedPressureBC
boundary = 'top left right'
variable = pressure
use_two_term_expansion = true
[]
[pressure-symmetry]
type = LinearFVPressureSymmetryBC
boundary = 'bottom'
variable = pressure
HbyA_flux = 'HbyA'
[]
[]
[AuxVariables]
[vel_x_aux]
type = MooseLinearVariableFVReal
initial_condition = 0.0
[]
[vel_y_aux]
type = MooseLinearVariableFVReal
initial_condition = 0.0
[]
[pressure_aux]
type = MooseLinearVariableFVReal
initial_condition = 0.0
[]
[]
[AuxKernels]
[vel_x_function_aux]
type = FunctionAux
variable = vel_x_aux
function = exact_u
execute_on = TIMESTEP_END
[]
[vel_y_function_aux]
type = FunctionAux
variable = vel_y_aux
function = exact_v
execute_on = TIMESTEP_END
[]
[pressure_function_aux]
type = FunctionAux
variable = pressure_aux
function = exact_p
execute_on = TIMESTEP_END
[]
[]
[Functions]
# --------------------------------------------------
# Material property functions
# --------------------------------------------------
[rho_fun]
type = ParsedFunction
symbol_names = 'rho_ref rho_r rho_x'
symbol_values = '${rho_ref} ${rho_r} ${rho_x}'
expression = 'rho_ref + rho_x*x + rho_r*y'
[]
[mu_fun]
type = ParsedFunction
symbol_names = 'mu_ref mu_r mu_x'
symbol_values = '${mu_ref} ${mu_r} ${mu_x}'
expression = 'mu_ref + mu_x*x + mu_r*y'
[]
# --------------------------------------------------
# Convenience reciprocals
# --------------------------------------------------
[S]
type=ParsedFunction
symbol_names = 'rho_fun'
symbol_values = 'rho_fun'
expression='1.0/rho_fun'
[]
[S2]
type=ParsedFunction
symbol_names = 'rho_fun'
symbol_values = 'rho_fun'
expression='(1.0/rho_fun)^2'
[]
[S3]
type=ParsedFunction
symbol_names = 'rho_fun'
symbol_values = 'rho_fun'
expression='(1.0/rho_fun)^3'
[]
# --------------------------------------------------
# Building blocks
# --------------------------------------------------
[A]
type=ParsedFunction
expression='x^2*(1-x)^2'
[]
[Ap]
type=ParsedFunction
expression='2*x - 6*x^2 + 4*x^3'
[]
[App]
type=ParsedFunction
expression='2 - 12*x + 12*x^2'
[]
[Appp]
type=ParsedFunction
expression='-12 + 24*x'
[]
[Q]
type=ParsedFunction
expression='4*y^2 - 10*y^3 + 6*y^4'
[]
[Qp]
type=ParsedFunction
expression='8*y - 30*y^2 + 24*y^3'
[]
[Qpp]
type=ParsedFunction
expression='8 - 60*y + 72*y^2'
[]
[R]
type=ParsedFunction
expression='y^3 - 2*y^4 + y^5'
[]
[Rp]
type=ParsedFunction
expression='3*y^2 - 8*y^3 + 5*y^4'
[]
[Rpp]
type=ParsedFunction
expression='6*y - 24*y^2 + 20*y^3'
[]
# --------------------------------------------------
# Exact solutions
# --------------------------------------------------
[exact_u]
type=ParsedFunction
symbol_names = 'A Q rho_fun'
symbol_values = 'A Q rho_fun'
expression='A*Q / rho_fun'
[]
[exact_v]
type=ParsedFunction
symbol_names = 'Ap R rho_fun'
symbol_values = 'Ap R rho_fun'
expression='-Ap*R / rho_fun'
[]
[exact_p]
type=ParsedFunction
expression='x*y^2'
[]
# --------------------------------------------------
# First derivatives
# --------------------------------------------------
[ux]
type=ParsedFunction
symbol_names = 'A Ap Q rho_fun rho_x'
symbol_values = 'A Ap Q rho_fun ${rho_x}'
expression='(Ap*Q)/rho_fun - (A*Q*rho_x)/rho_fun^2'
[]
[ur]
type=ParsedFunction
symbol_names = 'A Q Qp rho_fun rho_r'
symbol_values = 'A Q Qp rho_fun ${rho_r}'
expression='(A*Qp)/rho_fun - (A*Q*rho_r)/rho_fun^2'
[]
[vx]
type=ParsedFunction
symbol_names = 'App Ap R rho_fun rho_x'
symbol_values = 'App Ap R rho_fun ${rho_x}'
expression='-(App*R)/rho_fun + (Ap*R*rho_x)/rho_fun^2'
[]
[vr]
type=ParsedFunction
symbol_names = 'Ap Rp R rho_fun rho_r'
symbol_values = 'Ap Rp R rho_fun ${rho_r}'
expression='-(Ap*Rp)/rho_fun + (Ap*R*rho_r)/rho_fun^2'
[]
# --------------------------------------------------
# Second derivatives
# --------------------------------------------------
[uxx]
type = ParsedFunction
symbol_names = 'rho_x App Q S Ap S2 A S3'
symbol_values = '${rho_x} App Q S Ap S2 A S3'
expression = 'App*Q*S - 2*Ap*Q*rho_x*S2 + 2*A*Q*(rho_x^2)*S3'
[]
[uxr]
type = ParsedFunction
symbol_names = 'rho_x rho_r Ap Qp S Q S2 A S3'
symbol_values = '${rho_x} ${rho_r} Ap Qp S Q S2 A S3'
expression = 'Ap*Qp*S - Ap*Q*rho_r*S2 - A*Qp*rho_x*S2 + 2*A*Q*(rho_x*rho_r)*S3'
[]
[urr]
type = ParsedFunction
symbol_names = 'rho_r A Qpp S Qp S2 Q S3'
symbol_values = '${rho_r} A Qpp S Qp S2 Q S3'
expression = 'A*Qpp*S - 2*A*Qp*rho_r*S2 + 2*A*Q*(rho_r^2)*S3'
[]
[vxx]
type = ParsedFunction
symbol_names = 'rho_x Appp R S App S2 Ap S3'
symbol_values = '${rho_x} Appp R S App S2 Ap S3'
expression = '-Appp*R*S + 2*App*R*rho_x*S2 - 2*Ap*R*(rho_x^2)*S3'
[]
[vxr]
type = ParsedFunction
symbol_names = 'rho_x rho_r App Rp S R Ap S2 S3'
symbol_values = '${rho_x} ${rho_r} App Rp S R Ap S2 S3'
expression = '-App*Rp*S + (App*R*rho_r + Ap*Rp*rho_x)*S2 - 2*Ap*R*(rho_x*rho_r)*S3'
[]
[vrr]
type = ParsedFunction
symbol_names = 'rho_r Ap Rpp S Rp S2 R S3'
symbol_values = '${rho_r} Ap Rpp S Rp S2 R S3'
expression = '-Ap*Rpp*S + 2*Ap*Rp*rho_r*S2 - 2*Ap*R*(rho_r^2)*S3'
[]
# --------------------------------------------------
# Derivatives of theta
# --------------------------------------------------
[theta]
type = ParsedFunction
symbol_names = 'ux vr exact_v'
symbol_values = 'ux vr exact_v'
expression = 'ux + vr + (exact_v/y)'
[]
[thetax]
type = ParsedFunction
symbol_names = 'uxx vxr vx'
symbol_values = 'uxx vxr vx'
expression = 'uxx + vxr + (vx/y)'
[]
[thetar]
type = ParsedFunction
symbol_names = 'uxr vrr vr exact_v'
symbol_values = 'uxr vrr vr exact_v'
expression = 'uxr + vrr + (vr/y) - (exact_v/(y^2))'
[]
# --------------------------------------------------
# Stress components
# --------------------------------------------------
[tau_xx]
type=ParsedFunction
symbol_names = 'ux theta mu_fun'
symbol_values = 'ux theta mu_fun'
expression='2*mu_fun*ux - (2.0/3.0)*mu_fun*theta'
[]
[tau_rr]
type=ParsedFunction
symbol_names = 'vr theta mu_fun'
symbol_values = 'vr theta mu_fun'
expression='2*mu_fun*vr - (2.0/3.0)*mu_fun*theta'
[]
[tau_xr]
type=ParsedFunction
symbol_names = 'ur vx mu_fun'
symbol_values = 'ur vx mu_fun'
expression='mu_fun*(ur + vx)'
[]
[tau_tt]
type=ParsedFunction
symbol_names = 'exact_v theta mu_fun'
symbol_values = 'exact_v theta mu_fun'
expression='2*mu_fun*(exact_v/y) - (2.0/3.0)*mu_fun*theta'
[]
# --------------------------------------------------
# Convective fluxes
# --------------------------------------------------
[Fxx]
type=ParsedFunction
symbol_names = 'exact_u rho_fun'
symbol_values = 'exact_u rho_fun'
expression='rho_fun*exact_u*exact_u'
[]
[Fxr]
type=ParsedFunction
symbol_names = 'exact_u exact_v rho_fun'
symbol_values = 'exact_u exact_v rho_fun'
expression='rho_fun*exact_u*exact_v'
[]
[Frx]
type=ParsedFunction
symbol_names = 'exact_u exact_v rho_fun'
symbol_values = 'exact_u exact_v rho_fun'
expression='rho_fun*exact_v*exact_u'
[]
[Frr]
type=ParsedFunction
symbol_names = 'exact_v rho_fun'
symbol_values = 'exact_v rho_fun'
expression='rho_fun*exact_v*exact_v'
[]
# --------------------------------------------------
# Stress derivatives
# --------------------------------------------------
[tau_xx_x]
type = ParsedFunction
symbol_names = 'mu_x ux mu_fun uxx theta thetax'
symbol_values = '${mu_x} ux mu_fun uxx theta thetax'
expression = '2*mu_x*ux + 2*mu_fun*uxx - (2.0/3.0)*(mu_x*theta + mu_fun*thetax)'
[]
[tau_xr_x]
type = ParsedFunction
symbol_names = 'mu_x ur vx mu_fun uxr vxx'
symbol_values = '${mu_x} ur vx mu_fun uxr vxx'
expression = 'mu_x*(ur + vx) + mu_fun*(uxr + vxx)'
[]
[tau_xr_r]
type = ParsedFunction
symbol_names = 'mu_r ur vx mu_fun urr vxr'
symbol_values = '${mu_r} ur vx mu_fun urr vxr'
expression = 'mu_r*(ur + vx) + mu_fun*(urr + vxr)'
[]
[tau_rr_r]
type = ParsedFunction
symbol_names = 'mu_r vr mu_fun vrr theta thetar'
symbol_values = '${mu_r} vr mu_fun vrr theta thetar'
expression = '2*mu_r*vr + 2*mu_fun*vrr - (2.0/3.0)*(mu_r*theta + mu_fun*thetar)'
[]
# --------------------------------------------------
# Conservative flux derivatives
# --------------------------------------------------
[Fxx_x]
type = ParsedFunction
symbol_names = 'rho_x A Ap Q S S2'
symbol_values = '${rho_x} A Ap Q S S2'
expression = '2*A*Ap*Q^2*S - A^2*Q^2*rho_x*S2'
[]
[Frx_r]
type = ParsedFunction
symbol_names = 'rho_r A Ap Qp R Q Rp S S2'
symbol_values = '${rho_r} A Ap Qp R Q Rp S S2'
expression = '-A*Ap*((Qp*R + Q*Rp)*S - Q*R*rho_r*S2)'
[]
[Fxr_x]
type = ParsedFunction
symbol_names = 'rho_x Ap A App Q R S S2'
symbol_values = '${rho_x} Ap A App Q R S S2'
expression = '-((Ap^2 + A*App)*Q*R*S - A*Ap*Q*R*rho_x*S2)'
[]
[Frr_r]
type = ParsedFunction
symbol_names = 'rho_r Ap R Rp S S2'
symbol_values = '${rho_r} Ap R Rp S S2'
expression = 'Ap^2*(2*R*Rp*S - R^2*rho_r*S2)'
[]
# --------------------------------------------------
# Pressure gradients
# --------------------------------------------------
[px]
type=ParsedFunction
expression='y^2'
[]
[pr]
type=ParsedFunction
expression='2*x*y'
[]
# --------------------------------------------------
# Forcing terms
# --------------------------------------------------
[forcing_u]
type = ParsedFunction
symbol_names = 'Fxx_x Frx Frx_r px tau_xx_x tau_xr tau_xr_r'
symbol_values = 'Fxx_x Frx Frx_r px tau_xx_x tau_xr tau_xr_r'
expression = 'Fxx_x + (Frx/y) + Frx_r + px - ( tau_xx_x + (tau_xr/y) + tau_xr_r )'
[]
[forcing_v]
type = ParsedFunction
symbol_names = 'Fxr_x Frr Frr_r pr tau_xr_x tau_rr tau_rr_r tau_tt'
symbol_values = 'Fxr_x Frr Frr_r pr tau_xr_x tau_rr tau_rr_r tau_tt'
expression = 'Fxr_x + (Frr/y) + Frr_r + pr - ( tau_xr_x + (tau_rr/y) + tau_rr_r - (tau_tt)/y )'
[]
[]
[Executioner]
type = SIMPLE
momentum_l_abs_tol = 1e-10
pressure_l_abs_tol = 1e-10
momentum_l_tol = 0
pressure_l_tol = 0
momentum_l_max_its = 500
pressure_l_max_its = 500
rhie_chow_user_object = 'rc'
momentum_systems = 'u_system v_system'
pressure_system = 'pressure_system'
momentum_equation_relaxation = 0.85
pressure_variable_relaxation = 1.0
num_iterations = 10000
pressure_absolute_tolerance = 1e-8
momentum_absolute_tolerance = 1e-8
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
continue_on_max_its = true
pin_pressure = true
pressure_pin_value = 0.125
pressure_pin_point = '0.5 0.5 0.0'
[]
[Outputs]
[csv]
type = CSV
execute_on = TIMESTEP_END
[]
[]
[Postprocessors]
[h]
type = AverageElementSize
execute_on = TIMESTEP_END
[]
[L2u]
type = ElementL2FunctorError
approximate = vel_x
exact = exact_u
execute_on = TIMESTEP_END
[]
[L2v]
type = ElementL2FunctorError
approximate = vel_y
exact = exact_v
execute_on = TIMESTEP_END
[]
[L2p]
approximate = pressure
exact = exact_p
type = ElementL2FunctorError
execute_on = TIMESTEP_END
[]
[]
(test/tests/time_integrators/bdf2/linearfv-varying-factor.i)
# Temporal convergence of LinearFVTimeDerivative when its multiplier varies in time.
#
# The companion linearfv.i holds the multiplier at its default of one, which cannot distinguish
# d(cu)/dt from c du/dt: where c does not move, every state of it is the same number and the two
# operators are identical. This input moves it.
#
# u = t^3 x y c = 1 + t/2
#
# u is bilinear so lap(u) = 0 and the diffusion term contributes nothing to the balance; the
# transient is the only operator the measured order can be attributed to. The forcing is the
# conservative form of the transient,
#
# d(c u)/dt = c' u + c u' = x y ( 2 t^3 + 3 t^2 ) ,
#
# so the manufactured solution is recovered only if that is what the kernel assembles.
[Mesh]
type = GeneratedMesh
dim = 2
nx = 32
ny = 32
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
[]
[]
[LinearFVKernels]
[time]
type = LinearFVTimeDerivative
variable = u
factor = c
[]
[diff]
type = LinearFVDiffusion
variable = u
[]
[force]
type = LinearFVSource
variable = u
source_density = force
[]
[]
[Functions]
[exact]
type = ParsedFunction
expression = 't^3*x*y'
[]
[c]
type = ParsedFunction
expression = '1 + t/2'
[]
[force]
type = ParsedFunction
expression = 'x*y*(2*t^3 + 3*t^2)'
[]
[]
[LinearFVBCs]
[all]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
functor = exact
variable = u
boundary = 'left right top bottom'
[]
[]
[Executioner]
type = Transient
system_names = u_sys
l_tol = 1e-12
petsc_options_iname = '-pc_type'
petsc_options_value = 'hypre'
dt = 0.25
end_time = 4.0
scheme = 'bdf2'
[]
[Postprocessors]
[L2u]
type = ElementL2Error
function = exact
variable = u
execute_on = 'TIMESTEP_END'
[]
[]
[Outputs]
csv = true
[]
(test/tests/linearfvbcs/robin/advection-1d-robin.i)
##################################################################
c = 0.1 # advection velocity (+x direction)
amp = 7.0 # sinusoid amplitude, for u_exact
x_l = ${fparse 0.0*pi} # domain bound (left)
x_r = ${fparse pi} # domain bound (right)
alpha = 5.000 # robin BC coeff for gradient term
beta = 2.000 # robin BC coeff for variable term
u0 = 3 # some positive constant for the solution, > 1
gamma = ${fparse (-alpha*amp*sin(x_l)) + beta*amp*(u0 - cos(x_l))} # RHS of Robin BC, applied at left boundary
npts = 2
##################################################################
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
nx = ${npts}
xmin = ${x_l}
xmax = ${x_r}
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 0.0
[]
[]
[FVInterpolationMethods]
[average]
type = FVGeometricAverage
[]
[]
[Functions]
[u_exact]
type = ParsedFunction
expression = '${amp}*(${u0} - cos(x))'
[]
[source_fn]
type = ParsedFunction
expression = '${fparse c*amp}*sin(x)'
[]
[]
[LinearFVKernels]
[advection]
type = LinearFVAdvection
variable = u
velocity = "${c} 0 0"
advected_interp_method_name = average
[]
[source]
type = LinearFVSource
variable = u
source_density = source_fn
[]
[]
[LinearFVBCs]
[rob_l]
type = LinearFVAdvectionDiffusionFunctorRobinBC
variable = u
boundary = "left"
alpha = ${alpha}
beta = ${beta}
gamma = ${gamma}
[]
[outflow]
type = LinearFVAdvectionDiffusionOutflowBC
variable = u
boundary = "right"
use_two_term_expansion = true
[]
[]
[Postprocessors]
[h]
type = AverageElementSize
execute_on = FINAL
[]
[error]
type = ElementL2FunctorError
approximate = u
exact = u_exact
execute_on = FINAL
[]
[]
[Convergence]
[linear]
type = IterationCountConvergence
max_iterations = 4
converge_at_max_iterations = true
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-7
petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_shift_amount'
petsc_options_value = 'lu NONZERO 1e-10'
linear_convergence = linear
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
[]
[]
(test/tests/linearfvkernels/advection/advection-1d.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
nx = 2
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
[]
[]
[FVInterpolationMethods]
[upwind]
type = FVAdvectedUpwind
[]
[average]
type = FVGeometricAverage
[]
[muscl]
type = FVAdvectedMUSCLDeferredCorrection
deferred_correction_factor = 1.0
[]
[nvd_vanleer]
type = FVAdvectedVanLeerWeightBased
blending_factor = 1.0
[]
[nvd_minmod]
type = FVAdvectedMinmodWeightBased
blending_factor = 1.0
[]
[]
[LinearFVKernels]
[advection]
type = LinearFVAdvection
variable = u
velocity = "0.5 0 0"
advected_interp_method_name = upwind
[]
[source]
type = LinearFVSource
variable = u
source_density = source_func
[]
[]
[LinearFVBCs]
[inflow]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "left"
functor = analytic_solution
[]
[outflow]
type = LinearFVAdvectionDiffusionOutflowBC
variable = u
boundary = "right"
use_two_term_expansion = false
[]
[]
[Functions]
[source_func]
type = ParsedFunction
expression = '0.5*x'
[]
[analytic_solution]
type = ParsedFunction
expression = '0.5+0.5*x*x'
[]
[]
[Postprocessors]
[error]
type = ElementL2FunctorError
approximate = u
exact = analytic_solution
execute_on = FINAL
[]
[h]
type = AverageElementSize
execute_on = FINAL
[]
[]
[Convergence]
[linear]
type = IterationCountConvergence
max_iterations = 1
converge_at_max_iterations = true
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-10
multi_system_fixed_point=true
multi_system_fixed_point_convergence=linear
multi_system_fixed_point_relaxation_factor = 1.0
petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_shift_amount -pc_factor_mat_solver_type -mat_mumps_icntl_14'
petsc_options_value = 'lu NONZERO 1e-12 mumps 50'
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
[]
[]
(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/linearfvbcs/linear_fv_functor_radiative_bc/linear_fv_functor_radiative_bc_mms.i)
# MMS convergence test for LinearFVFunctorRadiativeBC.
#
# Exact solution: T_exact(x) = T_L + B * (exp(x) - 1)
# where B = (T_R_mms - T_L) / (e - 1).
#
# This satisfies:
# Left BC: T(0) = T_L (Dirichlet)
# Right BC: -k * T'(1) = sigma*eps*(T_R_mms^4 - T_inf^4) (radiative)
# with T'(1) = B*e = (T_R_mms - T_L)*e/(e-1)
# i.e. k*(T_L - T_R_mms)*e/(e-1) = sigma*eps*(T_R_mms^4 - T_inf^4)
# Source: f(x) = -k * T_exact'' = -k * B * exp(x) (spatially varying)
#
# The exponential profile produces non-trivial interior discretization error,
# ensuring the convergence test exercises both the FV interior scheme and the
# Robin boundary condition simultaneously.
#
# T_R_mms must be supplied via CLI args, as the root of:
# k*(T_L - T_R)*e/(e-1) = sigma*eps*(T_R^4 - T_inf^4)
# (computed in the Python convergence script).
T_L = 1000.0
T_inf = 300.0
k = 1.0
eps = 1.0
T_R_mms = 0 # set via CLI: T_R_mms=<value>
B_mms = '${fparse (T_R_mms - T_L) / (exp(1.0) - 1.0)}'
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 1
nx = 10 # overridden by CLI: Mesh/gen/nx=<N>
xmin = 0
xmax = 1
[]
[]
[Problem]
linear_sys_names = 'heat_system'
[]
[Variables]
[T]
type = MooseLinearVariableFVReal
solver_sys = 'heat_system'
initial_condition = ${T_L}
[]
[]
[Functions]
[exact_T]
type = ParsedFunction
expression = 'T_L + B_mms * (exp(x) - 1.0)'
symbol_names = 'T_L B_mms'
symbol_values = '${T_L} ${B_mms}'
[]
[source_fn]
type = ParsedFunction
expression = '-k * B_mms * exp(x)'
symbol_names = 'k B_mms'
symbol_values = '${k} ${B_mms}'
[]
[]
[LinearFVKernels]
[time]
type = LinearFVTimeDerivative
variable = T
[]
[diffusion]
type = LinearFVDiffusion
variable = T
diffusion_coeff = ${k}
[]
[source]
type = LinearFVSource
variable = T
source_density = source_fn
[]
[]
[LinearFVBCs]
[left]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = T
boundary = 'left'
functor = ${T_L}
[]
[right]
type = LinearFVFunctorRadiativeBC
variable = T
boundary = 'right'
emissivity = ${eps}
Tinfinity = ${T_inf}
diffusion_coeff = ${k}
[]
[]
[Postprocessors]
[l2_error]
type = ElementL2FunctorError
approximate = T
exact = exact_T
execute_on = TIMESTEP_END
[]
[]
[Executioner]
type = Transient
system_names = heat_system
scheme = 'implicit-euler'
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
dt = 1e6
num_steps = 100
l_tol = 1e-12
[]
[Outputs]
[out]
type = CSV
execute_on = final
[]
[]
(modules/navier_stokes/test/tests/finite_volume/ins/channel-flow/linear-segregated/2d/reconstructed-force-channel.i)
mu = 1
rho = 1
pressure_gradient_method = reconstructed
[Mesh]
[channel]
type = CartesianMeshGenerator
dim = 2
# Twenty cells per section resolve the interface-localized oscillation without making this
# two-solve comparison unnecessarily expensive.
dx = '1 1 1'
ix = '20 20 20'
dy = 1
iy = 3
subdomain_id = '0 1 2'
[]
[blocks]
type = RenameBlockGenerator
input = channel
old_block = '0 1 2'
new_block = 'upstream forced downstream'
[]
[]
[Problem]
linear_sys_names = 'u_system v_system pressure_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
[]
[]
[Variables]
[vel_x]
type = MooseLinearVariableFVReal
initial_condition = 1
solver_sys = u_system
[]
[vel_y]
type = MooseLinearVariableFVReal
initial_condition = 0
solver_sys = v_system
[]
[pressure]
type = MooseLinearVariableFVReal
initial_condition = 0
solver_sys = pressure_system
gradient_method = ${pressure_gradient_method}
[]
[]
[FVGradientMethods]
[reconstructed]
type = FVReconstructedPressureGradient
base_gradient_method = green-gauss
# This is the relaxation used by the reconstructed-gradient channel regression tests.
gradient_relaxation = 0.1
[]
[]
[FVInterpolationMethods]
[upwind]
type = FVAdvectedUpwind
[]
[]
[LinearFVKernels]
[u_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_x
advected_interp_method_name = upwind
mu = ${mu}
u = vel_x
v = vel_y
momentum_component = x
rhie_chow_user_object = rc
use_nonorthogonal_correction = false
[]
[v_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_y
advected_interp_method_name = upwind
mu = ${mu}
u = vel_x
v = vel_y
momentum_component = y
rhie_chow_user_object = rc
use_nonorthogonal_correction = false
[]
[u_pressure]
type = LinearFVMomentumPressure
variable = vel_x
pressure = pressure
momentum_component = x
[]
[v_pressure]
type = LinearFVMomentumPressure
variable = vel_y
pressure = pressure
momentum_component = y
[]
[middle_force]
type = LinearFVSource
variable = vel_x
# The large source makes the pressure-gradient jump dominate truncation error and visibly
# excites the unsupported cell-velocity mode when reconstruction is disabled.
source_density = 1e4
block = forced
[]
[p_diffusion]
type = LinearFVPressureCorrectionDiffusion
variable = pressure
diffusion_tensor = Ainv
use_nonorthogonal_correction = false
[]
[HbyA_divergence]
type = LinearFVDivergence
variable = pressure
face_flux = HbyA
force_boundary_execution = true
[]
[]
[LinearFVBCs]
[inlet_u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = left
variable = vel_x
functor = 1
[]
[inlet_v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = left
variable = vel_y
functor = 0
[]
[symmetry_u]
type = LinearFVVelocitySymmetryBC
boundary = 'top bottom'
variable = vel_x
momentum_component = x
u = vel_x
v = vel_y
[]
[symmetry_v]
type = LinearFVVelocitySymmetryBC
boundary = 'top bottom'
variable = vel_y
momentum_component = y
u = vel_x
v = vel_y
[]
[pressure_flux]
type = LinearFVPressureFluxBC
boundary = left
variable = pressure
HbyA_flux = HbyA
Ainv = Ainv
u = vel_x
v = vel_y
rho = ${rho}
[]
[pressure_symmetry]
type = LinearFVPressureSymmetryBC
boundary = 'top bottom'
variable = pressure
HbyA_flux = HbyA
[]
[outlet_u]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = right
variable = vel_x
use_two_term_expansion = false
[]
[outlet_v]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = right
variable = vel_y
use_two_term_expansion = false
[]
[outlet_p]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = right
variable = pressure
functor = 0
[]
[]
[Postprocessors]
[upstream_vel_x]
type = ElementAverageValue
variable = vel_x
block = upstream
execute_on = FINAL
[]
[forced_vel_x]
type = ElementAverageValue
variable = vel_x
block = forced
execute_on = FINAL
[]
[downstream_vel_x]
type = ElementAverageValue
variable = vel_x
block = downstream
execute_on = FINAL
[]
[]
[Executioner]
type = SIMPLE
momentum_l_abs_tol = 1e-10
pressure_l_abs_tol = 1e-10
momentum_l_tol = 0
pressure_l_tol = 0
rhie_chow_user_object = rc
momentum_systems = 'u_system v_system'
pressure_system = pressure_system
momentum_equation_relaxation = 0.8
pressure_variable_relaxation = 0.3
# Five hundred iterations allow the reconstructed coupling pressure gradient to relax to the same
# uniform steady field as the standard gradient. The reconstructed momentum residual is
# cancellation-dominated at the source jumps and does not satisfy the generic normalized monitor.
num_iterations = 500
continue_on_max_its = true
# Relative to the 1e4 source, this requires the ordinary outer residuals to fall by eleven orders
# of magnitude while remaining above platform-level roundoff stagnation.
pressure_absolute_tolerance = 1e-7
momentum_absolute_tolerance = 1e-7
momentum_petsc_options_iname = '-pc_type'
momentum_petsc_options_value = lu
pressure_petsc_options_iname = '-pc_type'
pressure_petsc_options_value = lu
print_fields = false
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
[]
exodus = true
[]
(test/tests/multisystem/picard/linearfv_nonlinearfv/same_input.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
nx = 6
[]
[]
[Problem]
nl_sys_names = 'v_sys'
linear_sys_names = 'u_sys'
[]
[Variables]
[v]
type = MooseVariableFVReal
initial_condition = 2.0
solver_sys = v_sys
[]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
[]
[]
[FVKernels]
[diffusion]
type = FVDiffusion
variable = v
coeff = u
[]
[source]
type = FVBodyForce
variable = v
function = 3
[]
[]
[LinearFVKernels]
[diffusion]
type = LinearFVDiffusion
variable = u
diffusion_coeff = v
[]
[source]
type = LinearFVSource
variable = u
source_density = 1
[]
[]
[FVBCs]
[dir]
type = FVFunctorDirichletBC
variable = v
boundary = "left right"
functor = 2
[]
[]
[LinearFVBCs]
[dir]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "left right"
functor = 1
[]
[]
[Convergence]
[linear]
type = IterationCountConvergence
max_iterations = 6
converge_at_max_iterations = true
[]
[]
[Executioner]
type = Steady
system_names = 'v_sys u_sys'
l_abs_tol = 1e-12
l_tol = 1e-10
nl_abs_tol = 1e-10
multi_system_fixed_point=true
multi_system_fixed_point_convergence=linear
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true
execute_on = timestep_end
[]
(test/tests/linearfvkernels/block-restriction/block-restricted-diffusion-react.i)
source=1
diff_coeff=2
reac_coeff=3
[Mesh]
[cmg]
type = CartesianMeshGenerator
dim = 1
dx = '0.5 0.5'
ix = '20 20'
subdomain_id = '1 2'
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
[]
[]
[LinearFVKernels]
[diffusion]
type = LinearFVDiffusion
variable = u
diffusion_coeff = ${diff_coeff}
use_nonorthogonal_correction = false
block = 1
[]
[reaction]
type = LinearFVReaction
variable = u
coeff = ${reac_coeff}
block = 2
[]
[source]
type = LinearFVSource
variable = u
source_density = ${source}
[]
[]
[LinearFVBCs]
[dir]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "left"
functor = 0
[]
[]
[Functions]
[analytic_solution]
type = ParsedFunction
expression = 'if(x<0.5, -x*x*S/2/D+(S/C+0.5*0.5/2/D*S)/0.5*x, S/C)'
symbol_names = 'S D C'
symbol_values = '${source} ${diff_coeff} ${reac_coeff}'
[]
[]
[Postprocessors]
[h]
type = AverageElementSize
execute_on = TIMESTEP_END
block = 2
[]
[error]
type = ElementL2FunctorError
approximate = u
exact = analytic_solution
execute_on = TIMESTEP_END
block = 2
[]
[]
[Convergence]
[linear]
type = IterationCountConvergence
max_iterations = 1
converge_at_max_iterations = true
[]
[]
[Executioner]
type = Steady
system_names = u_sys
multi_system_fixed_point=true
multi_system_fixed_point_convergence=linear
petsc_options_iname = '-pc_type -pc_hypre_type -ksp_rtol'
petsc_options_value = 'hypre boomeramg 1e-10'
[]
[Outputs]
[csv]
type = CSV
execute_on = TIMESTEP_END
[]
[]
(test/tests/linearfvkernels/block-restriction/block-restricted-adr.i)
[Mesh]
[cmg]
type = CartesianMeshGenerator
dim = 2
dx = '0.1 1 0.1'
dy = '0.1 0.5 0.1'
ix = '1 2 1'
iy = '1 1 1'
subdomain_id = '1 1 1 1 2 3 1 1 1'
[]
[transform]
type = TransformGenerator
input = cmg
transform = TRANSLATE
vector_value = '-0.1 -0.1 0.0'
[]
[create_sides]
type = SideSetsBetweenSubdomainsGenerator
input = transform
new_boundary = sides
primary_block = 2
paired_block = 1
[]
[create_outlet]
type = SideSetsBetweenSubdomainsGenerator
input = create_sides
new_boundary = outlet
primary_block = 2
paired_block = 3
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
block = 2
[]
[]
[FVInterpolationMethods]
[average]
type = FVGeometricAverage
[]
[]
[LinearFVKernels]
[diffusion]
type = LinearFVDiffusion
variable = u
diffusion_coeff = diff_coeff_func
use_nonorthogonal_correction = false
[]
[advection]
type = LinearFVAdvection
variable = u
velocity = "0.5 0 0"
advected_interp_method_name = average
[]
[reaction]
type = LinearFVReaction
variable = u
coeff = coeff_func
[]
[source]
type = LinearFVSource
variable = u
source_density = source_func
[]
[]
[LinearFVBCs]
inactive = "outflow"
[dir]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "sides outlet"
functor = analytic_solution
[]
[outflow]
type = LinearFVAdvectionDiffusionOutflowBC
variable = u
boundary = "right"
use_two_term_expansion = true
[]
[]
[Functions]
[diff_coeff_func]
type = ParsedFunction
expression = '1.0+0.5*x*y'
[]
[coeff_func]
type = ParsedFunction
expression = '1.0+1.0/(1+x*y)'
[]
[source_func]
type = ParsedFunction
expression = '-1.0*x*pi*sin((1/2)*x*pi)*cos(2*y*pi) - 0.25*y*pi*sin(2*y*pi)*cos((1/2)*x*pi) + (1.0 + 1.0/(x*y + 1))*(sin((1/2)*x*pi)*sin(2*y*pi) + 1.5) + (17/4)*pi^2*(0.5*x*y + 1.0)*sin((1/2)*x*pi)*sin(2*y*pi) + 0.25*pi*sin(2*y*pi)*cos((1/2)*x*pi)'
[]
[analytic_solution]
type = ParsedFunction
expression = 'sin((1/2)*x*pi)*sin(2*y*pi) + 1.5'
[]
[]
[Postprocessors]
[h]
type = AverageElementSize
execute_on = FINAL
block = 2
[]
[error]
type = ElementL2FunctorError
approximate = u
exact = analytic_solution
execute_on = FINAL
block = 2
[]
[]
[Convergence]
[linear]
type = IterationCountConvergence
max_iterations = 1
converge_at_max_iterations = true
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-10
multi_system_fixed_point=true
multi_system_fixed_point_convergence=linear
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
[]
[]
(modules/navier_stokes/test/tests/finite_volume/pins/channel-flow/linear-segregated/errors/kernel-errors.i)
# Isolated LinearFVMomentumFriction constructor and assembly errors.
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 3
nx = 1
ny = 1
nz = 1
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = u_sys
initial_condition = 1.0
[]
[]
[FunctorMaterials]
[darcy]
type = GenericVectorFunctorMaterial
prop_names = darcy
prop_values = '1 1 1'
[]
[forch]
type = GenericVectorFunctorMaterial
prop_names = forch
prop_values = '1 1 1'
[]
[]
[LinearFVKernels]
active = 'no_model'
[no_model]
type = LinearFVMomentumFriction
variable = u
momentum_component = x
[]
[darcy_no_mu]
type = LinearFVMomentumFriction
variable = u
momentum_component = x
Darcy_name = darcy
[]
[forch_no_rho]
type = LinearFVMomentumFriction
variable = u
momentum_component = x
Forchheimer_name = forch
u = 1
v = 0
w = 0
[]
[forch_no_u]
type = LinearFVMomentumFriction
variable = u
momentum_component = x
Forchheimer_name = forch
rho = 1
v = 0
w = 0
[]
[forch_no_v]
type = LinearFVMomentumFriction
variable = u
momentum_component = x
Forchheimer_name = forch
rho = 1
u = 1
w = 0
[]
[forch_no_w]
type = LinearFVMomentumFriction
variable = u
momentum_component = x
Forchheimer_name = forch
rho = 1
u = 1
v = 0
[]
[forch_zero_porosity]
type = LinearFVMomentumFriction
variable = u
momentum_component = x
Forchheimer_name = forch
rho = 1
u = 1
v = 0
w = 0
porosity = 0
[]
[source]
type = LinearFVSource
variable = u
source_density = 1
[]
[]
[Executioner]
type = Steady
system_names = u_sys
[]
[Outputs]
csv = false
exodus = false
[]
(test/tests/linearfvkernels/reaction/reaction-1d.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
nx = 10
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
[]
[]
[LinearFVKernels]
[reaction]
type = LinearFVReaction
variable = u
coeff = coeff_func
[]
[source]
type = LinearFVSource
variable = u
source_density = source_func
[]
[]
[Functions]
[coeff_func]
type = ParsedFunction
expression = '1+sin(x)'
[]
[source_func]
type = ParsedFunction
expression = '(1+sin(x))*(1+cos(x))'
[]
[analytic_solution]
type = ParsedFunction
expression = '1+cos(x)'
[]
[]
[Postprocessors]
[l2error]
type = ElementL2FunctorError
approximate = u
exact = analytic_solution
execute_on = TIMESTEP_END
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-10
[]
[Outputs]
[exodus]
type = Exodus
execute_on = TIMESTEP_END
[]
[]
(test/tests/linearfvkernels/block-restriction/block-restricted-diffusion.i)
[Mesh]
[cmg]
type = CartesianMeshGenerator
dim = 2
dx = '0.1 1 0.1'
dy = '0.1 0.5 0.1'
ix = '1 2 1'
iy = '1 1 1'
subdomain_id = '1 1 1 1 2 3 1 1 1'
[]
[transform]
type = TransformGenerator
input = cmg
transform = TRANSLATE
vector_value = '-0.1 -0.1 0.0'
[]
[create_sides]
type = SideSetsBetweenSubdomainsGenerator
input = transform
new_boundary = sides
primary_block = 2
paired_block = 1
[]
[create_outlet]
type = SideSetsBetweenSubdomainsGenerator
input = create_sides
new_boundary = outlet
primary_block = 2
paired_block = 3
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
block = 2
[]
[]
[LinearFVKernels]
[diffusion]
type = LinearFVDiffusion
variable = u
diffusion_coeff = diff_coeff_func
use_nonorthogonal_correction = false
[]
[source]
type = LinearFVSource
variable = u
source_density = source_func
[]
[]
[LinearFVBCs]
[dir]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "sides outlet"
functor = analytic_solution
[]
[]
[Functions]
[diff_coeff_func]
type = ParsedFunction
expression = '1.0+0.5*x*y'
[]
[source_func]
type = ParsedFunction
expression = '-1.0*x*pi*sin(x*pi)*cos(2*y*pi) - 0.5*y*pi*sin(2*y*pi)*cos(x*pi) + 5*pi^2*(0.5*x*y + 1.0)*sin(x*pi)*sin(2*y*pi)'
[]
[analytic_solution]
type = ParsedFunction
expression = 'sin(x*pi)*sin(2*y*pi) + 1.5'
[]
[]
[Postprocessors]
[h]
type = AverageElementSize
execute_on = FINAL
block = 2
[]
[error]
type = ElementL2FunctorError
approximate = u
exact = analytic_solution
execute_on = FINAL
block = 2
[]
[]
[Convergence]
[linear]
type = IterationCountConvergence
max_iterations = 1
converge_at_max_iterations = true
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-10
multi_system_fixed_point=true
multi_system_fixed_point_convergence=linear
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
[]
[]
(modules/navier_stokes/test/tests/finite_volume/two_phase/mixture_model/segregated/channel-drift-flux.i)
mu = 1.0
rho = 10.0
mu_d = 0.1
rho_d = 1.0
l = 2
# 'average' leads to slight oscillations, upwind may be preferred
# This method is selected for consistency with the original nonlinear input
advected_interp_method = 'average'
# TODO remove need for those
cp = 1
k = 1
cp_d = 1
k_d = 1
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = '${fparse l * 5}'
ymin = '${fparse -l / 2}'
ymax = '${fparse l / 2}'
nx = 10
ny = 4
[]
uniform_refine = 0
[]
[Problem]
linear_sys_names = 'u_system v_system pressure_system phi_system'
previous_nl_solution_required = true
[]
[Variables]
[vel_x]
type = MooseLinearVariableFVReal
solver_sys = u_system
initial_condition = 1
[]
[vel_y]
type = MooseLinearVariableFVReal
solver_sys = v_system
[]
[pressure]
type = MooseLinearVariableFVReal
solver_sys = pressure_system
[]
[phase_2]
type = MooseLinearVariableFVReal
solver_sys = phi_system
[]
[]
[FVInterpolationMethods]
[average]
type = FVGeometricAverage
[]
[upwind]
type = FVAdvectedUpwind
[]
[]
[LinearFVKernels]
[flow_p_diffusion]
type = LinearFVPressureCorrectionDiffusion
diffusion_tensor = Ainv
use_nonorthogonal_correction = false
variable = pressure
[]
[flow_HbyA_divergence]
type = LinearFVDivergence
face_flux = HbyA
force_boundary_execution = true
variable = pressure
[]
[flow_ins_momentum_flux_x]
type = LinearWCNSFVMomentumFlux
advected_interp_method_name = ${advected_interp_method}
momentum_component = x
mu = mu_mixture
rhie_chow_user_object = ins_rhie_chow_interpolator
u = vel_x
use_deviatoric_terms = false
use_nonorthogonal_correction = false
v = vel_y
variable = vel_x
[]
[flow_ins_momentum_flux_y]
type = LinearWCNSFVMomentumFlux
advected_interp_method_name = ${advected_interp_method}
momentum_component = y
mu = mu_mixture
rhie_chow_user_object = ins_rhie_chow_interpolator
u = vel_x
use_deviatoric_terms = false
use_nonorthogonal_correction = false
v = vel_y
variable = vel_y
[]
[mixture_drift_flux_x]
type = LinearWCNSFV2PMomentumDriftFlux
density_interp_method = average
fraction_dispersed = phase_2
momentum_component = x
rhie_chow_user_object = ins_rhie_chow_interpolator
rho_d = ${rho_d}
u_slip = vel_slip_x
v_slip = vel_slip_y
variable = vel_x
[]
[mixture_drift_flux_y]
type = LinearWCNSFV2PMomentumDriftFlux
density_interp_method = average
fraction_dispersed = phase_2
momentum_component = y
rhie_chow_user_object = ins_rhie_chow_interpolator
rho_d = ${rho_d}
u_slip = vel_slip_x
v_slip = vel_slip_y
variable = vel_y
[]
[flow_ins_momentum_pressure_x]
type = LinearFVMomentumPressure
momentum_component = x
pressure = pressure
variable = vel_x
[]
[flow_ins_momentum_pressure_y]
type = LinearFVMomentumPressure
momentum_component = y
pressure = pressure
variable = vel_y
[]
[flow_momentum_friction_0_x]
type = LinearFVMomentumFriction
Darcy_name = Darcy_coefficient_vec
momentum_component = x
mu = mu_mixture
variable = vel_x
[]
[flow_momentum_friction_0_y]
type = LinearFVMomentumFriction
Darcy_name = Darcy_coefficient_vec
momentum_component = y
mu = mu_mixture
variable = vel_y
[]
# Mixture phase equation
[mixture_ins_phase_2_advection]
type = LinearFVScalarAdvection
advected_interp_method_name = upwind
rhie_chow_user_object = ins_rhie_chow_interpolator
u_slip = vel_slip_x
v_slip = vel_slip_y
variable = phase_2
[]
[mixture_phase_interface_reaction]
type = LinearFVReaction
coeff = 0.1
variable = phase_2
[]
[mixture_phase_interface_source]
type = LinearFVSource
scaling_factor = 0.1
source_density = phase_1
variable = phase_2
[]
[]
[LinearFVBCs]
[vel_x_left]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = left
functor = 1
variable = vel_x
[]
[vel_y_left]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = left
functor = 0
variable = vel_y
[]
[pressure_extrapolation_inlet_left]
type = LinearFVExtrapolatedPressureBC
boundary = left
use_two_term_expansion = true
variable = pressure
[]
[vel_x_right]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = right
use_two_term_expansion = true
variable = vel_x
[]
[vel_y_right]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = right
use_two_term_expansion = true
variable = vel_y
[]
[pressure_right]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = right
functor = 0
variable = pressure
[]
[vel_x_bottom]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = bottom
functor = 0
variable = vel_x
[]
[vel_y_bottom]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = bottom
functor = 0
variable = vel_y
[]
[vel_x_top]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = top
functor = 0
variable = vel_x
[]
[vel_y_top]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = top
functor = 0
variable = vel_y
[]
[pressure_extrapolation_top_bottom]
type = LinearFVExtrapolatedPressureBC
boundary = 'top bottom'
use_two_term_expansion = true
variable = pressure
[]
[phase_2_left]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = left
functor = 0.1
variable = phase_2
[]
[phase_2_right]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = right
use_two_term_expansion = true
variable = phase_2
[]
[]
[FunctorMaterials]
[flow_ins_speed_material]
type = ADVectorMagnitudeFunctorMaterial
execute_on = ALWAYS
outputs = none
vector_magnitude_name = speed
x_functor = vel_x
y_functor = vel_y
[]
[mixture_phase_1_fraction]
type = ParsedFunctorMaterial
execute_on = ALWAYS
expression = '1 - phase_2'
functor_names = phase_2
output_properties = phase_1
outputs = all
property_name = phase_1
[]
[mixture_mixture_material]
type = WCNSLinearFVMixtureFunctorMaterial
execute_on = ALWAYS
limit_phase_fraction = true
outputs = all
phase_1_fraction = phase_2
phase_1_names = '${rho_d} ${mu_d} ${cp_d} ${k_d}'
phase_2_names = '${rho} ${mu} ${cp} ${k}'
prop_names = 'rho_mixture mu_mixture cp_mixture k_mixture'
[]
[mixture_slip_x]
type = WCNSFV2PSlipVelocityFunctorMaterial
execute_on = ALWAYS
gravity = '0 0 0'
linear_coef_name = Darcy_coefficient
momentum_component = x
mu = mu_mixture
outputs = all
particle_diameter = 0.01
rho = ${rho}
rho_d = ${rho_d}
slip_velocity_name = vel_slip_x
u = vel_x
v = vel_y
[]
[mixture_slip_y]
type = WCNSFV2PSlipVelocityFunctorMaterial
execute_on = ALWAYS
gravity = '0 0 0'
linear_coef_name = Darcy_coefficient
momentum_component = y
mu = mu_mixture
outputs = all
particle_diameter = 0.01
rho = ${rho}
rho_d = ${rho_d}
slip_velocity_name = vel_slip_y
u = vel_x
v = vel_y
[]
[mixture_dispersed_drag]
type = NSFVDispersePhaseDragFunctorMaterial
drag_coef_name = Darcy_coefficient
execute_on = ALWAYS
mu = mu_mixture
outputs = all
particle_diameter = 0.01
rho = rho_mixture
u = vel_x
v = vel_y
[]
[]
[UserObjects]
[ins_rhie_chow_interpolator]
type = RhieChowMassFlux
p_diffusion_kernel = flow_p_diffusion
pressure = pressure
rho = rho_mixture
u = vel_x
v = vel_y
[]
[]
[Executioner]
type = SIMPLE
rhie_chow_user_object = 'ins_rhie_chow_interpolator'
# 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_hypre_type'
active_scalar_petsc_options_value = 'hypre boomeramg'
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
[]
[Outputs]
csv = true
[]
[Postprocessors]
[Re]
type = ParsedPostprocessor
expression = '10.0 * 2 * 1'
[]
[average_phase2]
type = ElementAverageValue
variable = phase_2
[]
[dp]
type = PressureDrop
boundary = 'left right'
downstream_boundary = right
pressure = pressure
upstream_boundary = left
[]
[max_phase2]
type = ElementExtremeValue
variable = phase_2
[]
[]
(test/tests/linearfvkernels/diffusion-reaction-advection/advection-diffusion-reaction-2d.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 2
ny = 1
ymax = 0.5
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
[]
[]
[FVInterpolationMethods]
[average]
type = FVGeometricAverage
[]
[]
[LinearFVKernels]
[diffusion]
type = LinearFVDiffusion
variable = u
diffusion_coeff = diff_coeff_func
use_nonorthogonal_correction = false
[]
[advection]
type = LinearFVAdvection
variable = u
velocity = "0.5 0 0"
advected_interp_method_name = average
[]
[reaction]
type = LinearFVReaction
variable = u
coeff = coeff_func
[]
[source]
type = LinearFVSource
variable = u
source_density = source_func
[]
[]
[LinearFVBCs]
inactive = "outflow neumann"
[dir]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "left right top bottom"
functor = analytic_solution
[]
[outflow]
type = LinearFVAdvectionDiffusionOutflowBC
variable = u
boundary = "right"
use_two_term_expansion = true
[]
[neumann]
type = LinearFVAdvectionDiffusionFunctorNeumannBC
variable = u
boundary = "top"
functor = analytic_solution_neumann_top
diffusion_coeff = diff_coeff_func
[]
[]
[Functions]
[diff_coeff_func]
type = ParsedFunction
expression = '1.0+0.5*x*y'
[]
[coeff_func]
type = ParsedFunction
expression = '1.0+1.0/(1+x*y)'
[]
[source_func]
type = ParsedFunction
expression = '-1.0*x*pi*sin((1/2)*x*pi)*cos(2*y*pi) - 0.25*y*pi*sin(2*y*pi)*cos((1/2)*x*pi) + (1.0 + 1.0/(x*y + 1))*(sin((1/2)*x*pi)*sin(2*y*pi) + 1.5) + (17/4)*pi^2*(0.5*x*y + 1.0)*sin((1/2)*x*pi)*sin(2*y*pi) + 0.25*pi*sin(2*y*pi)*cos((1/2)*x*pi)'
[]
[analytic_solution]
type = ParsedFunction
expression = 'sin((1/2)*x*pi)*sin(2*y*pi) + 1.5'
[]
[analytic_solution_neumann_top]
type = ParsedFunction
expression = '(1.0+0.5*x*y)*sin((1/2)*x*pi)*cos(2*y*pi)*2*pi'
[]
[]
[Postprocessors]
[h]
type = AverageElementSize
execute_on = FINAL
[]
[error]
type = ElementL2FunctorError
approximate = u
exact = analytic_solution
execute_on = FINAL
[]
[]
[Convergence]
[linear]
type = IterationCountConvergence
max_iterations = 1
converge_at_max_iterations = true
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-10
multi_system_fixed_point=true
multi_system_fixed_point_convergence=linear
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
[]
[]
(test/tests/linearfvbcs/scalar_symmetry/advection-1d-symmetry-two-gradient-methods.i)
vel = 0.1
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
nx = 2
xmin = 0
xmax = ${fparse pi}
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
gradient_method = gg
[]
[v]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
gradient_method = gg_limited
[]
[]
[FVGradientMethods]
[gg]
type = FVGreenGaussGradient
[]
[gg_limited]
type = FVGreenGaussGradient
limiter = venkatakrishnan
[]
[]
[FVInterpolationMethods]
[average]
type = FVGeometricAverage
[]
[]
[Functions]
[u_exact]
type = ParsedFunction
expression = 'cos(x)'
[]
[source_fn]
type = ParsedFunction
expression = '-${vel}*sin(x)'
[]
[]
[LinearFVKernels]
[advection_u]
type = LinearFVAdvection
variable = u
velocity = "${vel} 0 0"
advected_interp_method_name = average
[]
[source_u]
type = LinearFVSource
variable = u
source_density = source_fn
[]
[advection_v]
type = LinearFVAdvection
variable = v
velocity = "${vel} 0 0"
advected_interp_method_name = average
[]
[source_v]
type = LinearFVSource
variable = v
source_density = source_fn
[]
[]
[LinearFVBCs]
[rob_l_u]
type = LinearFVAdvectionDiffusionScalarSymmetryBC
variable = u
boundary = "left"
use_two_term_expansion = true
[]
[dirichlet_u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "right"
functor = u_exact
[]
[rob_l_v]
type = LinearFVAdvectionDiffusionScalarSymmetryBC
variable = v
boundary = "left"
use_two_term_expansion = true
[]
[dirichlet_v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = v
boundary = "right"
functor = u_exact
[]
[]
[Postprocessors]
[h]
type = AverageElementSize
execute_on = FINAL
[]
[error_u]
type = ElementL2FunctorError
approximate = u
exact = u_exact
execute_on = FINAL
[]
[error_v]
type = ElementL2FunctorError
approximate = v
exact = u_exact
execute_on = FINAL
[]
[]
[Convergence]
[linear]
type = IterationCountConvergence
max_iterations = 4
converge_at_max_iterations = true
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-7
petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_shift_amount'
petsc_options_value = 'lu NONZERO 1e-10'
linear_convergence = linear
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
[]
[]
(test/tests/variables/linearfv/diffusion-1d-pp.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
nx = 50
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
[]
[]
[LinearFVKernels]
[diffusion]
type = LinearFVDiffusion
variable = u
diffusion_coeff = coeff_func
[]
[source]
type = LinearFVSource
variable = u
source_density = source_func
[]
[]
[LinearFVBCs]
[dir]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "left right"
functor = analytic_solution
[]
[]
[Functions]
[coeff_func]
type = ParsedFunction
expression = '0.5*x'
[]
[source_func]
type = ParsedFunction
expression = '2*x'
[]
[analytic_solution]
type = ParsedFunction
expression = '1-x*x'
[]
[]
[Postprocessors]
[average]
type = ElementAverageValue
variable = u
execute_on = TIMESTEP_END
outputs = csv
[]
[min]
type = ElementExtremeValue
variable = u
value_type = min
execute_on = TIMESTEP_END
outputs = csv
[]
[max]
type = ElementExtremeValue
variable = u
value_type = max
execute_on = TIMESTEP_END
outputs = csv
[]
[num_dofs]
type = NumDOFs
execute_on = TIMESTEP_END
outputs = csv
[]
[elem_value]
type = ElementalVariableValue
variable = u
elementid = 10
execute_on = TIMESTEP_END
outputs = csv
[]
[point_value]
type = PointValue
variable = u
point = '0.33333 0 0'
execute_on = TIMESTEP_END
outputs = csv
[]
[]
[VectorPostprocessors]
[line-sample]
type = LineValueSampler
variable = u
start_point = '0.13333 0 0'
end_point = '0.766666 0 0'
num_points = 9
sort_by = x
execute_on = TIMESTEP_END
outputs = vpp_csv
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-10
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
[csv]
type = CSV
execute_on = TIMESTEP_END
[]
[vpp_csv]
type = CSV
execute_on = TIMESTEP_END
[]
[]
(test/tests/time_integrators/implicit-euler/ie-linearfv.i)
###########################################################
# This is a simple test with a time-dependent problem
# demonstrating the use of the TimeIntegrator system.
#
# Testing a solution that is second order in space
# and first order in time
#
# @Requirement F1.30
###########################################################
[Mesh]
type = GeneratedMesh
dim = 2
xmin = -1
xmax = 1
ymin = -1
ymax = 1
nx = 10
ny = 10
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 0.0
[]
[]
[Functions]
[forcing_fn]
type = ParsedFunction
expression = ((x*x)+(y*y))-(4*t)
[]
[exact_fn]
type = ParsedFunction
expression = t*((x*x)+(y*y))
[]
[]
[LinearFVKernels]
[ie]
type = LinearFVTimeDerivative
variable = u
[]
[diff]
type = LinearFVDiffusion
variable = u
[]
[source]
type = LinearFVSource
variable = u
source_density = forcing_fn
[]
[]
[LinearFVBCs]
[all]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = '0 1 2 3'
functor = exact_fn
[]
[]
[Postprocessors]
[l2_err]
type = ElementL2Error
variable = u
function = exact_fn
[]
[]
[Executioner]
type = Transient
system_names = u_sys
l_tol = 1e-10
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
# Test of the TimeIntegrator System
scheme = 'implicit-euler'
start_time = 0.0
num_steps = 5
dt = 0.25
[]
[Outputs]
exodus = true
[]
(test/tests/multiapps/linearfv_nonlinearfv/linearfv.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
nx = 6
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
[]
[]
[AuxVariables]
[diff_var]
type = MooseVariableFVReal
initial_condition = 2.0
[]
[]
[LinearFVKernels]
[diffusion]
type = LinearFVDiffusion
variable = u
diffusion_coeff = diff_var
[]
[source]
type = LinearFVSource
variable = u
source_density = 1
[]
[]
[LinearFVBCs]
[dir]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "left right"
functor = 1
[]
[]
[MultiApps]
inactive = 'nonlinear'
[nonlinear]
type = FullSolveMultiApp
input_files = nonlinearfv.i
execute_on = timestep_begin
no_restore = true
[]
[]
[Transfers]
inactive = 'from_nonlinear to_nonlinear'
[from_nonlinear]
type = MultiAppCopyTransfer
from_multi_app = nonlinear
source_variable = 'v'
variable = 'diff_var'
execute_on = timestep_begin
[]
[to_nonlinear]
type = MultiAppCopyTransfer
to_multi_app = nonlinear
source_variable = 'u'
variable = 'diff_var'
execute_on = timestep_begin
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-10
petsc_options_iname = '-pc_type -pc_factor_mat_solver_type'
petsc_options_value = 'lu mumps'
fixed_point_rel_tol = 1e-10
[]
[Outputs]
exodus = true
execute_on = timestep_end
[]