- AinvThe 1/A where A is the momentum system diagonal vector. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
C++ Type:MooseFunctorName
Unit:(no unit assumed)
Controllable:No
Description:The 1/A where A is the momentum system diagonal vector. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
- HbyA_fluxThe total HbyA face flux value. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
C++ Type:MooseFunctorName
Unit:(no unit assumed)
Controllable:No
Description:The total HbyA face flux value. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
- boundaryThe list of boundary IDs from the mesh where this object applies
C++ Type:std::vector<BoundaryName>
Controllable:No
Description:The list of boundary IDs from the mesh where this object applies
- rhoThe density functor used together with the prescribed boundary velocity. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
C++ Type:MooseFunctorName
Unit:(no unit assumed)
Controllable:No
Description:The density functor used together with the prescribed boundary velocity. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
- uThe x-velocity functor on the boundary. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
C++ Type:MooseFunctorName
Unit:(no unit assumed)
Controllable:No
Description:The x-velocity functor on the boundary. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
- variableThe name of the variable that this boundary condition applies to
C++ Type:LinearVariableName
Unit:(no unit assumed)
Controllable:No
Description:The name of the variable that this boundary condition applies to
LinearFVPressureFluxBC
Description
This pressure boundary condition is meant to be used with a LinearFVAdvectionDiffusionFunctorDirichletBC applied to the velocity field. It makes the boundary pressure flux consistent with the pressure Poisson equation and the prescribed boundary velocity. The flux supplied by RhieChowMassFlux includes the off-diagonal momentum contributions and every assembled non-pressure momentum source.
The boundary velocity functors "u", "v", and "w", together with the density functor "rho", define the prescribed normal mass flux that this boundary condition enforces:
Anisotropic boundary reconstruction
The boundary condition supplies the complete signed pressure-diffusion flux to the diffusion kernel:
Let denote the diagonal pressure-diffusion tensor supplied through "Ainv", and let . The normal points outward from the cell on which the boundary condition acts. The complete tensor-weighted flux can be decomposed into normal and tangential pressure-gradient contributions:
The boundary condition therefore reconstructs the boundary-normal pressure gradient as
The bracketed vector is orthogonal to , so its dot product contains only the tangential pressure-gradient contribution. This contribution is used only to recover the normal gradient; the kernel does not add it to because the prescribed flux is already the complete tensor-weighted flux.
For the boundary value, let point from the boundary-cell centroid to the boundary face centroid and let . The reconstructed pressure is
The last term provides the geometric tangential correction on a nonorthogonal boundary cell. At startup, before momentum assembly has populated , is exactly zero. The boundary condition then uses the cell pressure as the boundary pressure and a zero normal gradient until a valid inverse momentum diagonal is available.
The reconstruction can be disabled explicitly by setting "use_two_term_expansion" to false. In that case, the boundary pressure is approximated by the adjacent cell pressure and the boundary-normal gradient used for reconstruction is zero. The complete pressure-diffusion flux imposed on the pressure equation is unchanged. This one-term option avoids division by for configurations in which the boundary-normal inverse momentum coefficient may remain zero.
Input Parameters
- use_two_term_expansionTrueWhether to reconstruct the boundary pressure using the pressure flux and cell gradient. If false, the boundary pressure is approximated by the adjacent cell pressure.
Default:True
C++ Type:bool
Controllable:No
Description:Whether to reconstruct the boundary pressure using the pressure flux and cell gradient. If false, the boundary pressure is approximated by the adjacent cell pressure.
- vThe y-velocity functor on the boundary. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
C++ Type:MooseFunctorName
Unit:(no unit assumed)
Controllable:No
Description:The y-velocity functor on the boundary. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
- wThe z-velocity functor on the boundary. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
C++ Type:MooseFunctorName
Unit:(no unit assumed)
Controllable:No
Description:The z-velocity functor on the boundary. 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
- search_methodnearest_node_connected_sidesChoice of search algorithm. All options begin by finding the nearest node in the primary boundary to a query point in the secondary boundary. In the default nearest_node_connected_sides algorithm, primary boundary elements are searched iff that nearest node is one of their nodes. This is fast to determine via a pregenerated node-to-elem map and is robust on conforming meshes. In the optional all_proximate_sides algorithm, primary boundary elements are searched iff they touch that nearest node, even if they are not topologically connected to it. This is more CPU-intensive but is necessary for robustness on any boundary surfaces which has disconnections (such as Flex IGA meshes) or non-conformity (such as hanging nodes in adaptively h-refined meshes).
Default:nearest_node_connected_sides
C++ Type:MooseEnum
Options:nearest_node_connected_sides, all_proximate_sides
Controllable:No
Description:Choice of search algorithm. All options begin by finding the nearest node in the primary boundary to a query point in the secondary boundary. In the default nearest_node_connected_sides algorithm, primary boundary elements are searched iff that nearest node is one of their nodes. This is fast to determine via a pregenerated node-to-elem map and is robust on conforming meshes. In the optional all_proximate_sides algorithm, primary boundary elements are searched iff they touch that nearest node, even if they are not topologically connected to it. This is more CPU-intensive but is necessary for robustness on any boundary surfaces which has disconnections (such as Flex IGA meshes) or non-conformity (such as hanging nodes in adaptively h-refined meshes).
Advanced Parameters
Input Files
- (modules/navier_stokes/test/tests/finite_volume/ins/linear_fv_pressure_flux_bc/internal-neighbor.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/radiation_s2s/diff_heated_cavity_slabs_cht.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/channel-flow/linear-segregated/2d/reconstructed-force-channel.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/natural_convection/linear_segregated/2d/diff_heated_cavity_linear_segregated.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/block_restriction/linear-segregated/reconstructed-gradient.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/natural_convection/linear_segregated/2d/diff_heated_cavity_s2s_rad.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/mms/linear-segregated/2d-symmetric-vortex/2d-symmetric-vortex.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/channel-flow/linear-segregated/2d/2d-velocity-pressure.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/natural_convection/linear_segregated/2d/diff_heated_cavity_linear_buoyancy.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/linear_fv_pressure_flux_bc/errors.i)
u
C++ Type:MooseFunctorName
Unit:(no unit assumed)
Controllable:No
Description:The x-velocity functor on the boundary. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
v
C++ Type:MooseFunctorName
Unit:(no unit assumed)
Controllable:No
Description:The y-velocity functor on the boundary. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
w
C++ Type:MooseFunctorName
Unit:(no unit assumed)
Controllable:No
Description:The z-velocity functor on the boundary. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
rho
C++ Type:MooseFunctorName
Unit:(no unit assumed)
Controllable:No
Description:The density functor used together with the prescribed boundary velocity. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
Ainv
C++ Type:MooseFunctorName
Unit:(no unit assumed)
Controllable:No
Description:The 1/A where A is the momentum system diagonal vector. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
use_two_term_expansion
Default:True
C++ Type:bool
Controllable:No
Description:Whether to reconstruct the boundary pressure using the pressure flux and cell gradient. If false, the boundary pressure is approximated by the adjacent cell pressure.
(modules/navier_stokes/test/tests/finite_volume/ins/linear_fv_pressure_flux_bc/internal-neighbor.i)
# Unit properties and speed give the exact constant plug-flow solution used by the CSV comparisons.
mu = 1
rho = 1
flow_block = 2
inlet_speed = 1
[Mesh]
[blocks]
type = CartesianMeshGenerator
dim = 2
dx = '1 1'
dy = '1'
ix = '1 2'
iy = '1'
subdomain_id = '1 ${flow_block}'
[]
[internal_inlet]
type = SideSetsBetweenSubdomainsGenerator
input = blocks
primary_block = ${flow_block}
paired_block = 1
new_boundary = internal_inlet
[]
[delete_inlet_block]
type = BlockDeletionGenerator
input = internal_inlet
block = 1
[]
[]
[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
block = ${flow_block}
[]
[]
[Variables]
[vel_x]
type = MooseLinearVariableFVReal
initial_condition = ${inlet_speed}
solver_sys = u_system
block = ${flow_block}
[]
[vel_y]
type = MooseLinearVariableFVReal
solver_sys = v_system
block = ${flow_block}
[]
[pressure]
type = MooseLinearVariableFVReal
solver_sys = pressure_system
block = ${flow_block}
[]
[]
[FVInterpolationMethods]
[average]
type = FVGeometricAverage
[]
[]
[LinearFVKernels]
[u_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_x
advected_interp_method_name = average
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 = average
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
[]
[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]
[prescribed-u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'internal_inlet top bottom'
variable = vel_x
functor = ${inlet_speed}
[]
[prescribed-v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'internal_inlet top bottom'
variable = vel_y
functor = 0
[]
[pressure-flux]
type = LinearFVPressureFluxBC
boundary = 'internal_inlet top bottom'
variable = pressure
HbyA_flux = HbyA
Ainv = Ainv
u = vel_x
v = vel_y
rho = ${rho}
[]
[outlet-pressure]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = right
variable = pressure
functor = 0
[]
[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
[]
[]
[Functions]
[exact-u]
type = ParsedFunction
expression = ${inlet_speed}
[]
[exact-zero]
type = ParsedFunction
expression = 0
[]
[]
[Postprocessors]
[inlet-mass-flow]
type = VolumetricFlowRate
boundary = internal_inlet
vel_x = vel_x
vel_y = vel_y
advected_quantity = ${rho}
rhie_chow_user_object = rc
[]
[u-error]
type = ElementL2FunctorError
approximate = vel_x
exact = exact-u
block = ${flow_block}
[]
[v-error]
type = ElementL2FunctorError
approximate = vel_y
exact = exact-zero
block = ${flow_block}
[]
[pressure-error]
type = ElementL2FunctorError
approximate = pressure
exact = exact-zero
block = ${flow_block}
[]
[]
[Executioner]
type = SIMPLE
# Tight algebraic tolerances make the reported errors sensitive to the internal-boundary sign.
momentum_l_abs_tol = 1e-12
pressure_l_abs_tol = 1e-12
momentum_l_tol = 0
pressure_l_tol = 0
rhie_chow_user_object = rc
momentum_systems = 'u_system v_system'
pressure_system = pressure_system
# These standard SIMPLE relaxation factors provide stable convergence for the tiny test mesh.
momentum_equation_relaxation = 0.8
pressure_variable_relaxation = 0.3
# Fifty iterations is a conservative cap; the exact initialized solution converges much sooner.
num_iterations = 50
# These nonlinear tolerances keep the final CSV errors below the comparison threshold.
pressure_absolute_tolerance = 1e-10
momentum_absolute_tolerance = 1e-10
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 = true
execute_on = FINAL
[]
(modules/navier_stokes/test/tests/finite_volume/ins/radiation_s2s/diff_heated_cavity_slabs_cht.i)
# Differentially heated cavity with conducting slabs on the left and right.
#
# Domain layout:
#
# T = 880 K fluid cavity T = 870 K
# | left slab | 0 < x < 1 | right slab |
# | -d < x < 0 | | 1 < x < 1+d |
#
# The prescribed temperatures are applied only to the OUTER slab faces.
# The left/right cavity surfaces use linear-FV CHT, and the top/bottom cavity
# walls are externally adiabatic.
#
# As written, this input solves the case without radiation. The radiation case
# activates the inactive objects below and sets
# Executioner/surface_radiation_object_name = gray_lambert, which passes the
# surface-to-surface radiation into CHTHandler. The conductive heat flux on the
# top/bottom walls is then balanced by LinearFVGrayLambertBC.
################################################################################
# MATERIAL PROPERTIES AND GEOMETRY
################################################################################
rho = 3279.0
T_0 = 875.0
T_hot = 880.0
T_cold = 870.0
mu = 1.0
k_fluid = 38.0
k_solid = 38.0
cp = 640.0
alpha = 3.26e-5
eps = 1.0
slab_thickness = 0.10
# Coarsest mesh on which SIMPLE converges for this problem; a 10x10 fluid mesh
# stalls with momentum residuals near 0.5.
n_slab_x = 4
n_fluid_x = 20
n_y = 20
rad_left = 'left_0 left_1 left_2 left_3 left_4'
rad_right = 'right_0 right_1 right_2 right_3 right_4'
rad_top = 'top_0 top_1 top_2 top_3 top_4'
rad_bottom = 'bottom_0 bottom_1 bottom_2 bottom_3 bottom_4'
rad_cht = '${rad_left} ${rad_right}'
rad_noncht = '${rad_top} ${rad_bottom}'
rad_all = '${rad_left} ${rad_right} ${rad_top} ${rad_bottom}'
walls = ${rad_all}
[GlobalParams]
rhie_chow_user_object = ins_rhie_chow_interpolator
advected_interp_method = upwind
u = vel_x
v = vel_y
[]
[Problem]
linear_sys_names = 'u_system v_system pressure_system energy_system solid_energy_system'
previous_nl_solution_required = true
[]
################################################################################
# GEOMETRY
################################################################################
[Mesh]
type = MeshGeneratorMesh
parallel_type = replicated
# A single generator gives a conforming mesh across both CHT interfaces.
[base]
type = CartesianMeshGenerator
dim = 2
dx = '${slab_thickness} 1.0 ${slab_thickness}'
ix = '${n_slab_x} ${n_fluid_x} ${n_slab_x}'
dy = '1.0'
iy = '${n_y}'
subdomain_id = '1 0 2'
[]
# Keep the fluid cavity at 0 <= x <= 1.
[shift]
type = TransformGenerator
input = base
transform = TRANSLATE
vector_value = '${fparse -slab_thickness} 0 0'
[]
[rename_blocks]
type = RenameBlockGenerator
input = shift
old_block = '0 1 2'
new_block = 'fluid left_solid right_solid'
[]
# Reserve left/right/top/bottom for the four surfaces of the cavity.
[rename_exterior]
type = RenameBoundaryGenerator
input = rename_blocks
old_boundary = 'left right bottom top'
new_boundary = 'left_outer right_outer whole_bottom whole_top'
[]
# Put the internal sidesets on fluid elements so gray_lambert can sample
# T_fluid on every surface in its boundary list.
[left_interface]
type = SideSetsBetweenSubdomainsGenerator
input = rename_exterior
primary_block = fluid
paired_block = left_solid
new_boundary = left
[]
[right_interface]
type = SideSetsBetweenSubdomainsGenerator
input = left_interface
primary_block = fluid
paired_block = right_solid
new_boundary = right
[]
# Re-create separate exterior horizontal sidesets for each block.
[cavity_horizontal]
type = SideSetsFromNormalsGenerator
input = right_interface
normals = '0 -1 0
0 1 0'
fixed_normal = true
included_subdomains = fluid
new_boundary = 'bottom top'
[]
[left_slab_horizontal]
type = SideSetsFromNormalsGenerator
input = cavity_horizontal
normals = '0 -1 0
0 1 0'
fixed_normal = true
included_subdomains = left_solid
new_boundary = 'left_solid_bottom left_solid_top'
[]
[right_slab_horizontal]
type = SideSetsFromNormalsGenerator
input = left_slab_horizontal
normals = '0 -1 0
0 1 0'
fixed_normal = true
included_subdomains = right_solid
new_boundary = 'right_solid_bottom right_solid_top'
[]
# Patch every radiating surface. This allows the wall temperature and
# radiative heat flux to vary along each side of the cavity.
[patch_left]
type = PatchSidesetGenerator
input = right_slab_horizontal
boundary = left
n_patches = 5
partitioner = centroid
centroid_partitioner_direction = y
[]
[patch_right]
type = PatchSidesetGenerator
input = patch_left
boundary = right
n_patches = 5
partitioner = centroid
centroid_partitioner_direction = y
[]
[patch_top]
type = PatchSidesetGenerator
input = patch_right
boundary = top
n_patches = 5
partitioner = centroid
centroid_partitioner_direction = x
[]
[patch_bottom]
type = PatchSidesetGenerator
input = patch_top
boundary = bottom
n_patches = 5
partitioner = centroid
centroid_partitioner_direction = x
[]
# PatchSidesetGenerator retains its parent sideset. Remove the parents so
# each face has only its patch boundary for radiation and CHT bookkeeping.
[delete_unpatched_parents]
type = BoundaryDeletionGenerator
input = patch_bottom
boundary_names = 'left right top bottom whole_top whole_bottom'
[]
final_generator = delete_unpatched_parents
[]
################################################################################
# USER OBJECTS: RHIE-CHOW AND SURFACE-TO-SURFACE RADIATION
################################################################################
[UserObjects]
# Activated for the radiation case
inactive = 'view_factor gray_lambert'
[ins_rhie_chow_interpolator]
type = RhieChowMassFlux
u = vel_x
v = vel_y
pressure = pressure
rho = ${rho}
p_diffusion_kernel = p_diffusion
block = fluid
[]
# The enclosure is convex and unobstructed. This deterministic view-factor
# object also avoids ray-orientation ambiguity on the internal CHT sidesets.
[view_factor]
type = UnobstructedPlanarViewFactor
boundary = ${rad_all}
normalize_view_factor = true
execute_on = INITIAL
[]
[gray_lambert]
type = ViewFactorObjectSurfaceRadiation
boundary = ${rad_all}
# There are no fixed-temperature or radiatively adiabatic surfaces here.
# All 20 surfaces obtain their current temperature from T_fluid.
emissivity = '${eps} ${eps} ${eps} ${eps} ${eps}
${eps} ${eps} ${eps} ${eps} ${eps}
${eps} ${eps} ${eps} ${eps} ${eps}
${eps} ${eps} ${eps} ${eps} ${eps}'
temperature = T_fluid
view_factor_object_name = view_factor
# Refreshes radiation during the SIMPLE/CHT Picard loop. The handler uses
# the most recently assembled radiation state (one fluid-energy solve lag).
execute_on = 'NONLINEAR TIMESTEP_END'
[]
[]
################################################################################
# VARIABLES
################################################################################
[Variables]
[vel_x]
type = MooseLinearVariableFVReal
solver_sys = u_system
block = fluid
[]
[vel_y]
type = MooseLinearVariableFVReal
solver_sys = v_system
block = fluid
[]
[pressure]
type = MooseLinearVariableFVReal
initial_condition = 0
solver_sys = pressure_system
block = fluid
[]
[T_fluid]
type = MooseLinearVariableFVReal
solver_sys = energy_system
initial_condition = ${T_0}
block = fluid
[]
# A single solid system/variable is used on the two disconnected slabs,
# as required by the current linear-FV CHTHandler.
[T_solid]
type = MooseLinearVariableFVReal
solver_sys = solid_energy_system
initial_condition = ${T_0}
block = 'left_solid right_solid'
[]
[]
[FVInterpolationMethods]
[upwind]
type = FVAdvectedUpwind
[]
[]
################################################################################
# LINEAR-FV EQUATIONS
################################################################################
[LinearFVKernels]
[u_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_x
advected_interp_method_name = upwind
mu = ${mu}
momentum_component = x
use_nonorthogonal_correction = false
[]
[u_pressure]
type = LinearFVMomentumPressure
variable = vel_x
pressure = pressure
momentum_component = x
[]
[u_buoyancy]
type = LinearFVMomentumBoussinesq
variable = vel_x
T_fluid = T_fluid
gravity = '0 -9.81 0'
rho = ${rho}
ref_temperature = ${T_0}
alpha_name = alpha_b
momentum_component = x
[]
[v_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_y
advected_interp_method_name = upwind
mu = ${mu}
momentum_component = y
use_nonorthogonal_correction = false
[]
[v_pressure]
type = LinearFVMomentumPressure
variable = vel_y
pressure = pressure
momentum_component = y
[]
[v_buoyancy]
type = LinearFVMomentumBoussinesq
variable = vel_y
T_fluid = T_fluid
gravity = '0 -9.81 0'
rho = ${rho}
ref_temperature = ${T_0}
alpha_name = alpha_b
momentum_component = y
[]
[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 = false
[]
[fluid_heat_advection]
type = LinearFVEnergyAdvection
variable = T_fluid
advected_quantity = temperature
cp = ${cp}
[]
[fluid_conduction]
type = LinearFVDiffusion
variable = T_fluid
diffusion_coeff = ${k_fluid}
use_nonorthogonal_correction = false
[]
# CHTHandler expects exactly one solid conduction kernel in the solid
# energy system, so this one kernel covers both slabs.
[solid_conduction]
type = LinearFVDiffusion
variable = T_solid
diffusion_coeff = ${k_solid}
use_nonorthogonal_correction = false
[]
[]
################################################################################
# LINEAR-FV BOUNDARY CONDITIONS
################################################################################
[LinearFVBCs]
# Activated for the radiation case
inactive = 'radiation_top_bottom'
[no_slip_u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = vel_x
boundary = ${walls}
functor = 0
[]
[no_slip_v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = vel_y
boundary = ${walls}
functor = 0
[]
[pressure_walls]
type = LinearFVPressureFluxBC
boundary = ${walls}
variable = pressure
HbyA_flux = HbyA
Ainv = Ainv
u = vel_x
v = vel_y
rho = ${rho}
[]
# Prescribe temperature only on the exterior faces of the slabs.
[left_outer_temperature]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = T_solid
boundary = left_outer
functor = ${T_hot}
[]
[right_outer_temperature]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = T_solid
boundary = right_outer
functor = ${T_cold}
[]
[insulated_slab_horizontal_faces]
type = LinearFVAdvectionDiffusionFunctorNeumannBC
variable = T_solid
boundary = 'left_solid_bottom left_solid_top right_solid_bottom right_solid_top'
functor = 0
[]
# Without radiation, the top/bottom cavity walls are adiabatic. The radiation
# case replaces this BC with radiation_top_bottom.
[adiabatic_top_bottom]
type = LinearFVAdvectionDiffusionFunctorNeumannBC
variable = T_fluid
boundary = ${rad_noncht}
functor = 0
[]
# Radiation is imposed directly only on the non-CHT top/bottom walls.
# Do not add these boundaries to adiabatic_boundary in gray_lambert:
# this BC makes their conductive flux balance their radiative flux.
[radiation_top_bottom]
type = LinearFVGrayLambertBC
variable = T_fluid
temperature_radiation = T_fluid
coeff_diffusion = ${k_fluid}
surface_radiation_object_name = gray_lambert
boundary = ${rad_noncht}
[]
# Neumann-Dirichlet CHT. Each patch needs its own pair because CHTHandler
# creates boundary-specific temperature and heat-flux functors.
# ---- left slab / fluid interface -----------------------------------------
[fluid_left_0]
type = LinearFVDirichletCHTBC
variable = T_fluid
boundary = left_0
functor = interface_temperature_to_fluid_left_0
[]
[solid_left_0]
type = LinearFVRobinCHTBC
variable = T_solid
boundary = left_0
h = 0
thermal_conductivity = ${k_solid}
incoming_flux = heat_flux_to_solid_left_0
surface_temperature = interface_temperature_to_solid_left_0
[]
[fluid_left_1]
type = LinearFVDirichletCHTBC
variable = T_fluid
boundary = left_1
functor = interface_temperature_to_fluid_left_1
[]
[solid_left_1]
type = LinearFVRobinCHTBC
variable = T_solid
boundary = left_1
h = 0
thermal_conductivity = ${k_solid}
incoming_flux = heat_flux_to_solid_left_1
surface_temperature = interface_temperature_to_solid_left_1
[]
[fluid_left_2]
type = LinearFVDirichletCHTBC
variable = T_fluid
boundary = left_2
functor = interface_temperature_to_fluid_left_2
[]
[solid_left_2]
type = LinearFVRobinCHTBC
variable = T_solid
boundary = left_2
h = 0
thermal_conductivity = ${k_solid}
incoming_flux = heat_flux_to_solid_left_2
surface_temperature = interface_temperature_to_solid_left_2
[]
[fluid_left_3]
type = LinearFVDirichletCHTBC
variable = T_fluid
boundary = left_3
functor = interface_temperature_to_fluid_left_3
[]
[solid_left_3]
type = LinearFVRobinCHTBC
variable = T_solid
boundary = left_3
h = 0
thermal_conductivity = ${k_solid}
incoming_flux = heat_flux_to_solid_left_3
surface_temperature = interface_temperature_to_solid_left_3
[]
[fluid_left_4]
type = LinearFVDirichletCHTBC
variable = T_fluid
boundary = left_4
functor = interface_temperature_to_fluid_left_4
[]
[solid_left_4]
type = LinearFVRobinCHTBC
variable = T_solid
boundary = left_4
h = 0
thermal_conductivity = ${k_solid}
incoming_flux = heat_flux_to_solid_left_4
surface_temperature = interface_temperature_to_solid_left_4
[]
# ---- right slab / fluid interface ----------------------------------------
[fluid_right_0]
type = LinearFVDirichletCHTBC
variable = T_fluid
boundary = right_0
functor = interface_temperature_to_fluid_right_0
[]
[solid_right_0]
type = LinearFVRobinCHTBC
variable = T_solid
boundary = right_0
h = 0
thermal_conductivity = ${k_solid}
incoming_flux = heat_flux_to_solid_right_0
surface_temperature = interface_temperature_to_solid_right_0
[]
[fluid_right_1]
type = LinearFVDirichletCHTBC
variable = T_fluid
boundary = right_1
functor = interface_temperature_to_fluid_right_1
[]
[solid_right_1]
type = LinearFVRobinCHTBC
variable = T_solid
boundary = right_1
h = 0
thermal_conductivity = ${k_solid}
incoming_flux = heat_flux_to_solid_right_1
surface_temperature = interface_temperature_to_solid_right_1
[]
[fluid_right_2]
type = LinearFVDirichletCHTBC
variable = T_fluid
boundary = right_2
functor = interface_temperature_to_fluid_right_2
[]
[solid_right_2]
type = LinearFVRobinCHTBC
variable = T_solid
boundary = right_2
h = 0
thermal_conductivity = ${k_solid}
incoming_flux = heat_flux_to_solid_right_2
surface_temperature = interface_temperature_to_solid_right_2
[]
[fluid_right_3]
type = LinearFVDirichletCHTBC
variable = T_fluid
boundary = right_3
functor = interface_temperature_to_fluid_right_3
[]
[solid_right_3]
type = LinearFVRobinCHTBC
variable = T_solid
boundary = right_3
h = 0
thermal_conductivity = ${k_solid}
incoming_flux = heat_flux_to_solid_right_3
surface_temperature = interface_temperature_to_solid_right_3
[]
[fluid_right_4]
type = LinearFVDirichletCHTBC
variable = T_fluid
boundary = right_4
functor = interface_temperature_to_fluid_right_4
[]
[solid_right_4]
type = LinearFVRobinCHTBC
variable = T_solid
boundary = right_4
h = 0
thermal_conductivity = ${k_solid}
incoming_flux = heat_flux_to_solid_right_4
surface_temperature = interface_temperature_to_solid_right_4
[]
[]
[FunctorMaterials]
[constant_fluid_functors]
type = GenericFunctorMaterial
# block = fluid
prop_names = 'cp alpha_b'
prop_values = '${cp} ${alpha}'
[]
[]
################################################################################
# DIAGNOSTICS
################################################################################
[VectorPostprocessors]
# Activated for the radiation case
inactive = 'surface_radiation'
[surface_radiation]
type = SurfaceRadiationVectorPostprocessor
surface_radiation_object_name = gray_lambert
information = 'temperature emissivity radiosity heat_flux_density'
execute_on = TIMESTEP_END
[]
[]
################################################################################
# EXECUTION / SOLVE
################################################################################
# CHTHandler requires one value per entry in rad_cht (10 entries here).
cht_relaxation = '0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3'
[Executioner]
type = SIMPLE
rhie_chow_user_object = ins_rhie_chow_interpolator
momentum_systems = 'u_system v_system'
pressure_system = pressure_system
energy_system = energy_system
solid_energy_system = solid_energy_system
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
momentum_equation_relaxation = 0.7
pressure_variable_relaxation = 0.3
energy_equation_relaxation = 0.9
num_iterations = 5000
# Tight enough that the gold files do not depend on the number of MPI ranks.
pressure_absolute_tolerance = 1e-11
momentum_absolute_tolerance = 1e-11
energy_absolute_tolerance = 1e-11
solid_energy_absolute_tolerance = 1e-11
# Activate CHT on every patched slab/cavity interface.
cht_interfaces = ${rad_cht}
cht_solid_flux_relaxation = ${cht_relaxation}
cht_fluid_flux_relaxation = ${cht_relaxation}
cht_solid_temperature_relaxation = ${cht_relaxation}
cht_fluid_temperature_relaxation = ${cht_relaxation}
cht_heat_flux_tolerance = 1e-4
max_cht_fpi = 10
print_fields = false
momentum_l_max_its = 300
pin_pressure = true
pressure_pin_value = 0.0
pressure_pin_point = '0.5 0.5 0.0'
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'
continue_on_max_its = true
# Improves the numerical integration used by UnobstructedPlanarViewFactor.
[Quadrature]
order = SECOND
[]
[]
################################################################################
# OUTPUTS
################################################################################
[Outputs]
exodus = true
csv = true
execute_on = TIMESTEP_END
[]
(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
[]
(modules/navier_stokes/test/tests/finite_volume/ins/natural_convection/linear_segregated/2d/diff_heated_cavity_linear_segregated.i)
################################################################################
# MATERIAL PROPERTIES
################################################################################
rho = 3279.
T_0 = 875.0
mu = 1.
k_cond = 38.0
cp = 640.
alpha = 3.26e-5
walls = 'right left top bottom'
[GlobalParams]
rhie_chow_user_object = 'ins_rhie_chow_interpolator'
advected_interp_method = 'upwind'
u = vel_x
v = vel_y
[]
[Problem]
linear_sys_names = 'u_system v_system pressure_system energy_system'
previous_nl_solution_required = true
[]
################################################################################
# GEOMETRY
################################################################################
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 1
ymin = 0
ymax = 1
nx = 15
ny = 15
[]
[]
################################################################################
# EQUATIONS: VARIABLES, KERNELS & BCS
################################################################################
[UserObjects]
[ins_rhie_chow_interpolator]
type = RhieChowMassFlux
u = vel_x
v = vel_y
pressure = pressure
rho = ${rho}
p_diffusion_kernel = p_diffusion
[]
[]
[Variables]
[vel_x]
type = MooseLinearVariableFVReal
solver_sys = u_system
[]
[vel_y]
type = MooseLinearVariableFVReal
solver_sys = v_system
[]
[pressure]
type = MooseLinearVariableFVReal
initial_condition = 0
solver_sys = pressure_system
[]
[T_fluid]
type = MooseLinearVariableFVReal
solver_sys = energy_system
initial_condition = 875
[]
[]
[FVInterpolationMethods]
[upwind]
type = FVAdvectedUpwind
[]
[]
[LinearFVKernels]
[u_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_x
advected_interp_method_name = upwind
mu = ${mu}
momentum_component = 'x'
use_nonorthogonal_correction = false
[]
[u_pressure]
type = LinearFVMomentumPressure
variable = vel_x
pressure = pressure
momentum_component = 'x'
[]
[u_buoyancy]
type = LinearFVMomentumBoussinesq
variable = vel_x
T_fluid = T_fluid
gravity = '0 -9.8 0'
rho = ${rho}
ref_temperature = ${T_0}
alpha_name = ${alpha}
momentum_component = 'x'
[]
[v_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_y
advected_interp_method_name = upwind
mu = ${mu}
momentum_component = 'y'
use_nonorthogonal_correction = false
[]
[v_pressure]
type = LinearFVMomentumPressure
variable = vel_y
pressure = pressure
momentum_component = 'y'
[]
[v_buoyancy]
type = LinearFVMomentumBoussinesq
variable = vel_y
T_fluid = T_fluid
gravity = '0 -9.81 0'
rho = ${rho}
ref_temperature = ${T_0}
alpha_name = ${alpha}
momentum_component = 'y'
[]
[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 = false
[]
####### FUEL ENERGY EQUATION #######
[heat_advection]
type = LinearFVEnergyAdvection
variable = T_fluid
advected_quantity = temperature
cp = ${cp}
[]
[conduction]
type = LinearFVDiffusion
variable = T_fluid
diffusion_coeff = ${fparse k_cond}
[]
[]
[LinearFVBCs]
[no-slip-u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = vel_x
boundary = ${walls}
functor = 0
[]
[no-slip-v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = vel_y
boundary = ${walls}
functor = 0
[]
[T_cold]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = T_fluid
boundary = 'right'
functor = 870.0
[]
[T_hot]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = T_fluid
boundary = 'left'
functor = 880.0
[]
[T_all]
type = LinearFVAdvectionDiffusionExtrapolatedBC
variable = T_fluid
boundary = 'top bottom'
use_two_term_expansion = false
[]
[pressure]
type = LinearFVPressureFluxBC
boundary = 'top bottom left right'
variable = pressure
HbyA_flux = HbyA
Ainv = Ainv
u = vel_x
v = vel_y
rho = ${rho}
[]
[]
[FunctorMaterials]
[constant_functors]
type = GenericFunctorMaterial
prop_names = 'cp alpha_b'
prop_values = '${cp} ${alpha}'
[]
[]
################################################################################
# EXECUTION / SOLVE
################################################################################
[Executioner]
type = SIMPLE
momentum_l_abs_tol = 1e-11
pressure_l_abs_tol = 1e-11
energy_l_abs_tol = 1e-11
momentum_l_tol = 0
pressure_l_tol = 0
energy_l_tol = 0
rhie_chow_user_object = 'ins_rhie_chow_interpolator'
momentum_systems = 'u_system v_system'
pressure_system = 'pressure_system'
energy_system = 'energy_system'
momentum_equation_relaxation = 0.7
pressure_variable_relaxation = 0.3
energy_equation_relaxation = 0.9
num_iterations = 1500
pressure_absolute_tolerance = 1e-8
momentum_absolute_tolerance = 1e-8
energy_absolute_tolerance = 1e-8
print_fields = false
momentum_l_max_its = 300
pin_pressure = true
pressure_pin_value = 0.0
pressure_pin_point = '0.5 0.0 0.0'
# momentum_petsc_options = '-ksp_monitor'
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
[]
################################################################################
# SIMULATION OUTPUTS
################################################################################
[Outputs]
#exodus = true
[out]
type = Exodus
file_base = 'diff_heated_cavity_linear_segregated_out'
[]
[]
(modules/navier_stokes/test/tests/finite_volume/ins/block_restriction/linear-segregated/reconstructed-gradient.i)
mu = 1
rho = 1
flow_block = 2
restricted_blocks = '${flow_block}'
inlet_speed = 1
[Mesh]
[blocks]
type = CartesianMeshGenerator
dim = 2
dx = '1 1 1'
dy = '1'
ix = '1 2 1'
iy = '1'
subdomain_id = '1 ${flow_block} 3'
[]
[internal_inlet]
type = SideSetsBetweenSubdomainsGenerator
input = blocks
primary_block = ${flow_block}
paired_block = 1
new_boundary = internal_inlet
[]
[internal_outlet]
type = SideSetsBetweenSubdomainsGenerator
input = internal_inlet
primary_block = ${flow_block}
paired_block = 3
new_boundary = internal_outlet
[]
[delete_outside_blocks]
type = BlockDeletionGenerator
input = internal_outlet
block = '1 3'
[]
[]
[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
block = ${restricted_blocks}
[]
[]
[Variables]
[vel_x]
type = MooseLinearVariableFVReal
initial_condition = 0
solver_sys = u_system
block = ${restricted_blocks}
[]
[vel_y]
type = MooseLinearVariableFVReal
solver_sys = v_system
block = ${restricted_blocks}
[]
[pressure]
type = MooseLinearVariableFVReal
solver_sys = pressure_system
block = ${restricted_blocks}
gradient_method = reconstructed
[]
[]
[FVGradientMethods]
[reconstructed]
type = FVReconstructedPressureGradient
base_gradient_method = green-gauss
# This moderate relaxation exposes the orientation feedback within the short regression.
gradient_relaxation = 0.5
[]
[]
[FVInterpolationMethods]
[average]
type = FVGeometricAverage
[]
[]
[LinearFVKernels]
[u_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_x
advected_interp_method_name = average
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 = average
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
[]
[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]
[prescribed-u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'internal_inlet top bottom'
variable = vel_x
functor = ${inlet_speed}
[]
[prescribed-v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'internal_inlet top bottom'
variable = vel_y
functor = 0
[]
[pressure-flux]
type = LinearFVPressureFluxBC
boundary = 'internal_inlet top bottom'
variable = pressure
HbyA_flux = HbyA
Ainv = Ainv
u = vel_x
v = vel_y
rho = ${rho}
[]
[outlet-pressure]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = internal_outlet
variable = pressure
functor = 0
[]
[outlet-u]
type = LinearFVAdvectionDiffusionOutflowBC
variable = vel_x
use_two_term_expansion = false
boundary = internal_outlet
[]
[outlet-v]
type = LinearFVAdvectionDiffusionOutflowBC
variable = vel_y
use_two_term_expansion = false
boundary = internal_outlet
[]
[]
[Functions]
[exact-u]
type = ParsedFunction
expression = ${inlet_speed}
[]
[exact-zero]
type = ParsedFunction
expression = 0
[]
[]
[Postprocessors]
[inlet-mass-flow]
type = VolumetricFlowRate
boundary = internal_inlet
vel_x = vel_x
vel_y = vel_y
advected_quantity = ${rho}
rhie_chow_user_object = rc
[]
[u-error]
type = ElementL2FunctorError
approximate = vel_x
exact = exact-u
block = ${flow_block}
[]
[v-error]
type = ElementL2FunctorError
approximate = vel_y
exact = exact-zero
block = ${flow_block}
[]
[pressure-error]
type = ElementL2FunctorError
approximate = pressure
exact = exact-zero
block = ${flow_block}
[]
[]
[Executioner]
type = SIMPLE
momentum_l_abs_tol = 1e-12
pressure_l_abs_tol = 1e-12
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
# Three iterations let the first reconstructed candidate feed a subsequent momentum predictor.
num_iterations = 3
continue_on_max_its = true
pressure_absolute_tolerance = 1e-10
momentum_absolute_tolerance = 1e-10
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 = true
execute_on = FINAL
[]
(modules/navier_stokes/test/tests/finite_volume/ins/natural_convection/linear_segregated/2d/diff_heated_cavity_s2s_rad.i)
################################################################################
# MATERIAL PROPERTIES
################################################################################
rho = 3279.
T_0 = 875.0
mu = 1.
k_cond = 38.0
cp = 640.
alpha = 3.26e-5
eps = 1.0
rad_left = 'left_0 left_1 left_2 left_3 left_4'
rad_right = 'right_0 right_1 right_2 right_3 right_4'
rad_top = 'top_0 top_1 top_2 top_3 top_4'
rad_bottom = 'bottom_0 bottom_1 bottom_2 bottom_3 bottom_4'
rad_fixed = '${rad_left} ${rad_right}'
rad_variable = '${rad_top} ${rad_bottom}'
rad_all = '${rad_left} ${rad_right} ${rad_top} ${rad_bottom}'
walls = ${rad_all}
[GlobalParams]
rhie_chow_user_object = 'ins_rhie_chow_interpolator'
advected_interp_method = 'upwind'
u = vel_x
v = vel_y
[]
[Problem]
linear_sys_names = 'u_system v_system pressure_system energy_system'
previous_nl_solution_required = true
[]
################################################################################
# GEOMETRY
################################################################################
[Mesh]
type = MeshGeneratorMesh
parallel_type = replicated
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 1
ymin = 0
ymax = 1
nx = 20
ny = 20
[]
[patch_left]
type = PatchSidesetGenerator
input = gen
boundary = left
n_patches = 5
partitioner = centroid
centroid_partitioner_direction = y
[]
[patch_right]
type = PatchSidesetGenerator
input = patch_left
boundary = right
n_patches = 5
partitioner = centroid
centroid_partitioner_direction = y
[]
[patch_top]
type = PatchSidesetGenerator
input = patch_right
boundary = top
n_patches = 5
partitioner = centroid
centroid_partitioner_direction = x
[]
[patch_bottom]
type = PatchSidesetGenerator
input = patch_top
boundary = bottom
n_patches = 5
partitioner = centroid
centroid_partitioner_direction = x
[]
[delete_original_sidesets]
type = BoundaryDeletionGenerator
input = patch_bottom
boundary_names = 'left right top bottom'
[]
[]
################################################################################
# EQUATIONS: VARIABLES, KERNELS & BCS
################################################################################
[UserObjects]
[ins_rhie_chow_interpolator]
type = RhieChowMassFlux
u = vel_x
v = vel_y
pressure = pressure
rho = ${rho}
p_diffusion_kernel = p_diffusion
[]
[view_factor_study]
type = ViewFactorRayStudy
boundary = ${rad_all}
execute_on = INITIAL
face_order = FOURTH
polar_quad_order = 12
azimuthal_quad_order = 4
warn_subdomain_hmax = false
[]
[view_factor]
type = RayTracingViewFactor
boundary = ${rad_all}
ray_study_name = view_factor_study
normalize_view_factor = true
execute_on = INITIAL
[]
[gray_lambert]
type = ViewFactorObjectSurfaceRadiation
boundary = ${rad_all}
fixed_temperature_boundary = ${rad_fixed}
fixed_boundary_temperatures = '880 880 880 880 880
870 870 870 870 870'
# Top and bottom are variable-temperature radiating surfaces.
adiabatic_boundary = ''
emissivity = '${eps} ${eps} ${eps} ${eps} ${eps}
${eps} ${eps} ${eps} ${eps} ${eps}
${eps} ${eps} ${eps} ${eps} ${eps}
${eps} ${eps} ${eps} ${eps} ${eps}'
temperature = T_fluid
view_factor_object_name = view_factor
# NONLINEAR updates the radiation solution between SIMPLE iterations.
execute_on = 'NONLINEAR'
[]
[]
[RayBCs]
[view_factor]
type = ViewFactorRayBC
boundary = ${rad_all}
[]
[]
[Variables]
[vel_x]
type = MooseLinearVariableFVReal
solver_sys = u_system
[]
[vel_y]
type = MooseLinearVariableFVReal
solver_sys = v_system
[]
[pressure]
type = MooseLinearVariableFVReal
initial_condition = 0
solver_sys = pressure_system
[]
[T_fluid]
type = MooseLinearVariableFVReal
solver_sys = energy_system
initial_condition = 875
[]
[]
[FVInterpolationMethods]
[upwind]
type = FVAdvectedUpwind
[]
[]
[LinearFVKernels]
[u_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_x
advected_interp_method_name = upwind
mu = ${mu}
momentum_component = 'x'
use_nonorthogonal_correction = false
[]
[u_pressure]
type = LinearFVMomentumPressure
variable = vel_x
pressure = pressure
momentum_component = 'x'
[]
[u_buoyancy]
type = LinearFVMomentumBoussinesq
variable = vel_x
T_fluid = T_fluid
gravity = '0 -9.8 0'
rho = ${rho}
ref_temperature = ${T_0}
alpha_name = ${alpha}
momentum_component = 'x'
[]
[v_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_y
advected_interp_method_name = upwind
mu = ${mu}
momentum_component = 'y'
use_nonorthogonal_correction = false
[]
[v_pressure]
type = LinearFVMomentumPressure
variable = vel_y
pressure = pressure
momentum_component = 'y'
[]
[v_buoyancy]
type = LinearFVMomentumBoussinesq
variable = vel_y
T_fluid = T_fluid
gravity = '0 -9.81 0'
rho = ${rho}
ref_temperature = ${T_0}
alpha_name = ${alpha}
momentum_component = 'y'
[]
[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 = false
[]
####### FLUID ENERGY EQUATION #######
[heat_advection]
type = LinearFVEnergyAdvection
variable = T_fluid
advected_quantity = temperature
cp = ${cp}
[]
[conduction]
type = LinearFVDiffusion
variable = T_fluid
diffusion_coeff = ${fparse k_cond}
[]
[]
[LinearFVBCs]
[no-slip-u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = vel_x
boundary = ${walls}
functor = 0
[]
[no-slip-v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = vel_y
boundary = ${walls}
functor = 0
[]
[T_cold]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = T_fluid
boundary = ${rad_right}
functor = 870.0
[]
[T_hot]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = T_fluid
boundary = ${rad_left}
functor = 880.0
[]
[radiation_top_bottom]
type = LinearFVGrayLambertBC
variable = T_fluid
temperature_radiation = T_fluid
coeff_diffusion = ${k_cond}
surface_radiation_object_name = gray_lambert
boundary = ${rad_variable}
[]
[pressure]
type = LinearFVPressureFluxBC
boundary = ${walls}
variable = pressure
HbyA_flux = HbyA
Ainv = Ainv
u = vel_x
v = vel_y
rho = ${rho}
[]
[]
[FunctorMaterials]
[constant_functors]
type = GenericFunctorMaterial
prop_names = 'cp alpha_b'
prop_values = '${cp} ${alpha}'
[]
[]
################################################################################
# EXECUTION / SOLVE
################################################################################
[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 = 'ins_rhie_chow_interpolator'
momentum_systems = 'u_system v_system'
pressure_system = 'pressure_system'
energy_system = 'energy_system'
momentum_equation_relaxation = 0.7
pressure_variable_relaxation = 0.3
energy_equation_relaxation = 0.9
num_iterations = 1500
# Tight enough that the gold file does not depend on the number of MPI ranks.
pressure_absolute_tolerance = 1e-11
momentum_absolute_tolerance = 1e-11
energy_absolute_tolerance = 1e-11
print_fields = false
momentum_l_max_its = 300
pin_pressure = true
pressure_pin_value = 0.0
pressure_pin_point = '0.5 0.0 0.0'
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
[]
################################################################################
# SIMULATION OUTPUTS
################################################################################
[Outputs]
exodus = true
[]
(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
[]
[]
(modules/navier_stokes/test/tests/finite_volume/ins/channel-flow/linear-segregated/2d/2d-velocity-pressure.i)
mu = 2.6
rho = 1.0
advected_interp_method = 'average'
pressure_gradient_method = 'green-gauss'
[Mesh]
allow_renumbering = false # Keep IDs stable for the ID-sorted ElementValueSampler output.
[mesh]
type = CartesianMeshGenerator
dim = 2
dx = '0.3'
dy = '0.3'
ix = '3'
iy = '3'
[]
[]
[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 = 0.5
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.2
gradient_method = ${pressure_gradient_method}
[]
[]
[FVGradientMethods]
[gg]
type = FVGreenGaussGradient
[]
[reconstructed]
type = FVReconstructedPressureGradient
base_gradient_method = green-gauss
gradient_relaxation = 0.1
[]
[]
[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
[]
[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'
[]
[v_pressure]
type = LinearFVMomentumPressure
variable = vel_y
pressure = pressure
momentum_component = 'y'
[]
[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]
inactive = 'inlet_and_wall_pressure_flux'
[inlet-u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left'
variable = vel_x
functor = '1.1'
[]
[inlet-v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left'
variable = vel_y
functor = '0.0'
[]
[walls-u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'top bottom'
variable = vel_x
functor = 0.0
[]
[walls-v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'top bottom'
variable = vel_y
functor = 0.0
[]
[outlet_p]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'right'
variable = pressure
functor = 1.4
[]
[inlet_and_wall_pressure_flux]
type = LinearFVPressureFluxBC
boundary = 'left top bottom'
variable = pressure
HbyA_flux = HbyA
Ainv = Ainv
u = vel_x
v = vel_y
rho = ${rho}
[]
[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
[]
[]
[VectorPostprocessors]
[solution]
type = ElementValueSampler
variable = 'vel_x vel_y pressure'
sort_by = id
execute_on = TIMESTEP_END
[]
[]
[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
num_iterations = 100
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
[]
[Outputs]
exodus = true
[]
(modules/navier_stokes/test/tests/finite_volume/ins/natural_convection/linear_segregated/2d/diff_heated_cavity_linear_buoyancy.i)
################################################################################
# MATERIAL PROPERTIES
################################################################################
rho_0 = 3279.
mu = 1.0
k_cond = 38.0
cp = ${fparse 640}
alpha_b = 3.26e-5
T_0 = 875.0
walls = 'right left top bottom'
[GlobalParams]
rhie_chow_user_object = 'ins_rhie_chow_interpolator'
advected_interp_method = 'upwind'
u = vel_x
v = vel_y
[]
[Problem]
linear_sys_names = 'u_system v_system pressure_system energy_system'
previous_nl_solution_required = true
[]
################################################################################
# GEOMETRY
################################################################################
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 1
xmax = 2.0
ymin = 1.0
ymax = 2.0
nx = 15
ny = 15
[]
[]
################################################################################
# EQUATIONS: VARIABLES, KERNELS & BCS
################################################################################
[UserObjects]
[ins_rhie_chow_interpolator]
type = RhieChowMassFlux
u = vel_x
v = vel_y
pressure = pressure
rho = 'rho'
p_diffusion_kernel = p_diffusion
[]
[]
[Variables]
[vel_x]
type = MooseLinearVariableFVReal
solver_sys = u_system
[]
[vel_y]
type = MooseLinearVariableFVReal
solver_sys = v_system
[]
[pressure]
type = MooseLinearVariableFVReal
initial_condition = 0
solver_sys = pressure_system
[]
[T_fluid]
type = MooseLinearVariableFVReal
solver_sys = energy_system
initial_condition = 875
[]
[]
[FVInterpolationMethods]
[upwind]
type = FVAdvectedUpwind
[]
[]
[LinearFVKernels]
[u_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_x
advected_interp_method_name = upwind
mu = ${mu}
momentum_component = 'x'
use_nonorthogonal_correction = false
[]
[u_pressure]
type = LinearFVMomentumPressure
variable = vel_x
pressure = pressure
momentum_component = 'x'
[]
[u_buoyancy]
type = LinearFVMomentumBuoyancy
variable = vel_x
rho = 'rho'
reference_rho = ${rho_0}
gravity = '0 -9.81 0'
momentum_component = 'x'
[]
[v_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_y
advected_interp_method_name = upwind
mu = ${mu}
momentum_component = 'y'
use_nonorthogonal_correction = false
[]
[v_pressure]
type = LinearFVMomentumPressure
variable = vel_y
pressure = pressure
momentum_component = 'y'
[]
[v_buoyancy]
type = LinearFVMomentumBuoyancy
variable = vel_y
rho = 'rho'
reference_rho = ${rho_0}
gravity = '0 -9.81 0'
momentum_component = 'y'
[]
[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 = false
[]
####### FUEL ENERGY EQUATION #######
[heat_advection]
type = LinearFVEnergyAdvection
variable = T_fluid
advected_quantity = temperature
cp = ${cp}
[]
[conduction]
type = LinearFVDiffusion
variable = T_fluid
diffusion_coeff = ${k_cond}
[]
[]
[LinearFVBCs]
[no-slip-u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = vel_x
boundary = ${walls}
functor = 0
[]
[no-slip-v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = vel_y
boundary = ${walls}
functor = 0
[]
[T_cold]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = T_fluid
boundary = 'right'
functor = 870.0
[]
[T_hot]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = T_fluid
boundary = 'left'
functor = 880.0
[]
[T_all]
type = LinearFVAdvectionDiffusionFunctorNeumannBC
variable = T_fluid
boundary = 'top bottom'
functor = 0.0
[]
[pressure]
type = LinearFVPressureFluxBC
boundary = 'top bottom left right'
variable = pressure
HbyA_flux = HbyA
Ainv = Ainv
u = vel_x
v = vel_y
rho = 'rho'
[]
[]
[FunctorMaterials]
[rho_function]
type = ParsedFunctorMaterial
property_name = 'rho'
functor_names = 'T_fluid'
expression = '${rho_0}*(1-${alpha_b}*(T_fluid-${T_0})) '
[]
[]
################################################################################
# EXECUTION / SOLVE
################################################################################
[Executioner]
type = SIMPLE
momentum_l_abs_tol = 1e-11
pressure_l_abs_tol = 1e-11
energy_l_abs_tol = 1e-11
momentum_l_tol = 0
pressure_l_tol = 0
energy_l_tol = 0
rhie_chow_user_object = 'ins_rhie_chow_interpolator'
momentum_systems = 'u_system v_system'
pressure_system = 'pressure_system'
energy_system = 'energy_system'
momentum_equation_relaxation = 0.7
pressure_variable_relaxation = 0.3
energy_equation_relaxation = 0.9
num_iterations = 1500
pressure_absolute_tolerance = 1e-8
momentum_absolute_tolerance = 1e-8
energy_absolute_tolerance = 1e-8
print_fields = false
momentum_l_max_its = 300
pin_pressure = true
pressure_pin_value = 0.0
pressure_pin_point = '1.5 1.5 0.0'
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
[]
################################################################################
# SIMULATION OUTPUTS
################################################################################
[Outputs]
exodus = true
[]
(modules/navier_stokes/test/tests/finite_volume/ins/linear_fv_pressure_flux_bc/errors.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
nx = 1
ny = 1
[]
[]
[Problem]
linear_sys_names = pressure_system
[]
[Variables]
[pressure]
type = MooseLinearVariableFVReal
solver_sys = pressure_system
[]
[]
[LinearFVKernels]
[diffusion]
type = LinearFVAnisotropicDiffusion
variable = pressure
diffusion_tensor = Ainv
[]
[]
[LinearFVBCs]
active = pressure_flux
[pressure_flux]
type = LinearFVPressureFluxBC
variable = pressure
boundary = left
HbyA_flux = 0
Ainv = Ainv
u = 0
rho = 1
[]
[]
[FunctorMaterials]
[inverse_diagonal]
type = GenericVectorFunctorMaterial
prop_names = Ainv
prop_values = '1 1 1'
[]
[]
[Executioner]
type = Steady
system_names = pressure_system
[]