- gravityGravitational acceleration vector.
C++ Type:libMesh::VectorValue<Real>
Unit:(no unit assumed)
Controllable:No
Description:Gravitational acceleration vector.
- momentum_componentThe component of the momentum equation that this kernel applies to.
C++ Type:MooseEnum
Controllable:No
Description:The component of the momentum equation that this kernel applies to.
- ref_temperatureThe value for the reference temperature.
C++ Type:Real
Unit:(no unit assumed)
Controllable:No
Description:The value for the reference temperature.
- rhoThe value for the density. 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 value for the density. 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 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
LinearFVMomentumBoussinesq
This kernel adds the contributions of the Boussinesq buoyancy treatment for density through a force/source term to the right hand side of the momentum equation system for the finite volume SIMPLE segregated solver SIMPLE. The Boussinesq buoyancy treatment is applicable for low changes in density, and assumes constant density value in all other equation terms.
This term is described by present in the momentum equation conservation when describing an incompressible fluid, where is the reference density, is the thermal expansion coefficient, is the gravity vector, is the temperature, and is a reference temperature. The Boussinesq buoyancy model assumes the changes in density as a function of temperature are linear and relevant only in the buoyant force term of the equation system. The Boussinesq kernel allows for modeling natural convection.
This term deals only with the force due to the variation in density , with the fluid density being . Thus, with no extra added terms to the conventional incompressible Navier Stokes equations, the system will solve for the total pressure minus the hydrostatic pressure. For natural convection simulations, it is advisable to compute relevant dimensionless numbers such as the Rayleigh number or the Richardson number to decide on the need for turbulence models, mesh refinement and stability considerations.
Input Parameters
- T_fluidThe fluid temperature variable.
C++ Type:VariableName
Unit:(no unit assumed)
Controllable:No
Description:The fluid temperature variable.
- alpha_namealpha_bThe name of the thermal expansion coefficientthis is of the form rho = rho_ref*(1-alpha (T-T_ref)). A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
Default:alpha_b
C++ Type:MooseFunctorName
Unit:(no unit assumed)
Controllable:No
Description:The name of the thermal expansion coefficientthis is of the form rho = rho_ref*(1-alpha (T-T_ref)). A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
- 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
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/channel-flow/linear-segregated/2d/2d-boussinesq.i)
- (modules/navier_stokes/examples/solidification/gallium_melting_linear.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/natural_convection/linear_segregated/2d/diff_heated_cavity_linear_segregated.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/channel-flow/linear-segregated/steady-transient-compare/common-blocks.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/channel-flow/linear-segregated/2d/2d-boussinesq-transient.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/channel-flow/linear-segregated/2d/2d-boussinesq.i)
mu = 2.6
rho = 1.0
advected_interp_method = 'average'
cp = 300
k = 20
alpha_b = 1e-4
[Mesh]
[mesh]
type = CartesianMeshGenerator
dim = 2
dx = '1.'
dy = '0.2'
ix = '10'
iy = '5'
[]
[]
[Problem]
linear_sys_names = 'u_system v_system pressure_system 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
[]
[]
[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
[]
[T]
type = MooseLinearVariableFVReal
solver_sys = energy_system
initial_condition = 300
[]
[]
[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'
[]
[u_boussinesq]
type = LinearFVMomentumBoussinesq
variable = vel_x
rho = ${rho}
gravity = '0 -9.81 0'
alpha_name = ${alpha_b}
ref_temperature = 300.0
T_fluid = T
momentum_component = 'x'
[]
[v_boussinesq]
type = LinearFVMomentumBoussinesq
variable = vel_y
rho = ${rho}
gravity = '0 -9.81 0'
alpha_name = ${alpha_b}
ref_temperature = 300.0
T_fluid = T
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
[]
[h_advection]
type = LinearFVEnergyAdvection
variable = T
advected_quantity = temperature
cp = ${cp}
advected_interp_method = ${advected_interp_method}
rhie_chow_user_object = 'rc'
[]
[conduction]
type = LinearFVDiffusion
variable = T
diffusion_coeff = ${k}
use_nonorthogonal_correction = false
[]
[]
[FunctorMaterials]
[constant_functors]
type = GenericFunctorMaterial
prop_names = 'cp alpha_b'
prop_values = '${cp} ${alpha_b}'
[]
[]
[LinearFVBCs]
[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
[]
[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_top_T]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = T
functor = ${fparse 300.0}
boundary = 'left top'
[]
[bottom_T]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = T
functor = ${fparse 350.0}
boundary = bottom
[]
[outlet_T]
type = LinearFVAdvectionDiffusionOutflowBC
variable = T
use_two_term_expansion = false
boundary = right
[]
[]
[Executioner]
type = SIMPLE
momentum_l_abs_tol = 1e-10
pressure_l_abs_tol = 1e-10
energy_l_abs_tol = 1e-10
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.8
energy_equation_relaxation = 0.9
pressure_variable_relaxation = 0.3
num_iterations = 200
pressure_absolute_tolerance = 1e-10
momentum_absolute_tolerance = 1e-10
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'
print_fields = false
[]
[Outputs]
exodus = true
[]
(modules/navier_stokes/examples/solidification/gallium_melting_linear.i)
##########################################################
# Simulation of Gallium Melting Experiment
# Ref: Gau, C., & Viskanta, R. (1986). Melting and solidification of a pure metal on a vertical wall.
# Key physics: melting/solidification, convective heat transfer, natural convection
##########################################################
mu = 1.81e-3
rho_solid = 6093
rho_liquid = 6093
k_solid = 32
k_liquid = 32
cp_solid = 381.5
cp_liquid = 381.5
L = 80160
alpha_b = 1.2e-4
T_solidus = 302.93
T_liquidus = '${fparse T_solidus + 0.1}'
T_cold = 301.15
T_hot = 311.15
Nx = 200
Ny = 120
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 88.9e-3
ymin = 0
ymax = 63.5e-3
nx = ${Nx}
ny = ${Ny}
bias_x = 1.005
[]
[]
[UserObjects]
[rc]
type = RhieChowMassFlux
u = vel_x
v = vel_y
pressure = pressure
rho = ${rho_liquid}
p_diffusion_kernel = p_diffusion
[]
[]
[Problem]
linear_sys_names = 'u_system v_system pressure_system energy_system'
previous_nl_solution_required = true
[]
[AuxVariables]
[U]
type = MooseVariableFVReal
[]
[fl]
type = MooseVariableFVReal
initial_condition = 0.0
[]
[density]
type = MooseVariableFVReal
[]
[th_cond]
type = MooseVariableFVReal
[]
[cp_var]
type = MooseVariableFVReal
[]
[darcy_coef]
type = MooseVariableFVReal
[]
[fch_coef]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[mag]
type = VectorMagnitudeAux
variable = U
x = vel_x
y = vel_y
[]
[compute_fl]
type = NSLiquidFractionAux
variable = fl
temperature = T
T_liquidus = '${T_liquidus}'
T_solidus = '${T_solidus}'
execute_on = 'TIMESTEP_END'
[]
[rho_out]
type = FunctorAux
functor = 'rho_mixture'
variable = 'density'
[]
[th_cond_out]
type = FunctorAux
functor = 'k_mixture'
variable = 'th_cond'
[]
[cp_out]
type = FunctorAux
functor = 'cp_mixture'
variable = 'cp_var'
[]
[darcy_out]
type = FunctorAux
functor = 'Darcy_coefficient'
variable = 'darcy_coef'
[]
[fch_out]
type = FunctorAux
functor = 'Forchheimer_coefficient'
variable = 'fch_coef'
[]
[]
[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.2
[]
[T]
type = MooseLinearVariableFVReal
solver_sys = energy_system
initial_condition = ${T_cold}
[]
[]
[FVInterpolationMethods]
[upwind]
type = FVAdvectedUpwind
[]
[]
[LinearFVKernels]
[u_time]
type = LinearFVTimeDerivative
variable = vel_x
factor = 'rho_mixture'
[]
[v_time]
type = LinearFVTimeDerivative
variable = vel_y
factor = 'rho_mixture'
[]
[u_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_x
mu = ${mu}
u = vel_x
v = vel_y
momentum_component = 'x'
rhie_chow_user_object = 'rc'
use_nonorthogonal_correction = false
advected_interp_method_name = upwind
[]
[v_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_y
mu = ${mu}
u = vel_x
v = vel_y
momentum_component = 'y'
rhie_chow_user_object = 'rc'
use_nonorthogonal_correction = false
advected_interp_method_name = upwind
[]
[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_boussinesq]
type = LinearFVMomentumBoussinesq
variable = vel_x
rho = '${rho_liquid}'
gravity = '0 -9.81 0'
alpha_name = ${alpha_b}
ref_temperature = ${T_solidus}
T_fluid = T
momentum_component = 'x'
[]
[v_boussinesq]
type = LinearFVMomentumBoussinesq
variable = vel_y
rho = '${rho_liquid}'
gravity = '0 -9.81 0'
alpha_name = ${alpha_b}
ref_temperature = ${T_solidus}
T_fluid = T
momentum_component = 'y'
[]
[u_friction_darcy]
type = LinearFVReaction
variable = vel_x
coeff = 'darcy_coef_friction'
[]
[v_friction_darcy]
type = LinearFVReaction
variable = vel_y
coeff = 'darcy_coef_friction'
[]
[u_friction_forch]
type = LinearFVReaction
variable = vel_x
coeff = 'forch_coef_friction'
[]
[v_friction_forch]
type = LinearFVReaction
variable = vel_y
coeff = 'forch_coef_friction'
[]
[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
[]
[h_time]
type = LinearFVTimeDerivative
variable = T
# factor should be mixture. For simplicity and
# because the properties are the same for liquid and solid
# the factor is defined as below.
factor = ${fparse rho_liquid*cp_liquid}
[]
[h_advection]
type = LinearFVEnergyAdvection
variable = T
advected_quantity = temperature
cp = ${cp_liquid}
rhie_chow_user_object = 'rc'
[]
[conduction]
type = LinearFVDiffusion
variable = T
diffusion_coeff = k_mixture
use_nonorthogonal_correction = false
[]
[energy_source]
type = LinearFVPhaseChangeSource
variable = T
L = ${L}
T_liquidus = ${T_liquidus}
T_solidus = ${T_solidus}
rho = 'rho_mixture'
[]
[]
[LinearFVBCs]
[walls-u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left right top bottom'
variable = vel_x
functor = 0.0
[]
[walls-v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left right top bottom'
variable = vel_y
functor = 0.0
[]
[hot_wall]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = T
functor = '${T_hot}'
boundary = 'left'
[]
[cold_wall]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = T
functor = '${T_cold}'
boundary = 'right'
[]
[]
[FunctorMaterials]
[eff_cp]
type = NSFVMixtureFunctorMaterial
phase_2_names = '${cp_solid} ${k_solid} ${rho_solid}'
phase_1_names = '${cp_liquid} ${k_liquid} ${rho_liquid}'
prop_names = 'cp_mixture k_mixture rho_mixture'
phase_1_fraction = fl
[]
[mushy_zone_resistance]
type = INSFVMushyPorousFrictionFunctorMaterial
liquid_fraction = 'fl'
mu = '${mu}'
rho_l = '${rho_liquid}'
dendrite_spacing_scaling = 1e-3
[]
[darcy_coeff_friction]
type = ParsedFunctorMaterial
property_name = 'darcy_coef_friction'
functor_names = 'darcy_coef'
functor_symbols = 'darcy_coef'
expression = 'darcy_coef'
[]
[forch_coeff_friction]
type = ParsedFunctorMaterial
property_name = 'forch_coef_friction'
functor_names = 'U fch_coef'
functor_symbols = 'U fch_coef'
expression = 'fch_coef * U'
[]
[]
[Executioner]
type = PIMPLE
momentum_l_abs_tol = 1e-12
pressure_l_abs_tol = 1e-12
energy_l_abs_tol = 1e-12
momentum_l_tol = 1e-12
pressure_l_tol = 1e-12
energy_l_tol = 1e-12
rhie_chow_user_object = 'rc'
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 = 8
pressure_absolute_tolerance = 1e-11
momentum_absolute_tolerance = 1e-11
energy_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'
energy_petsc_options_iname = '-pc_type -pc_hypre_type'
energy_petsc_options_value = 'hypre boomeramg'
print_fields = false
continue_on_max_its = true
dt = 0.005
start_time = 0.0
end_time = 60.0
num_piso_iterations = 0
pin_pressure = true
pressure_pin_value = 0.0
pressure_pin_point = '0.05 0.05 0.0'
[]
[Postprocessors]
[ave_p]
type = ElementAverageValue
variable = 'pressure'
execute_on = 'INITIAL TIMESTEP_END'
[]
[ave_fl]
type = ElementAverageValue
variable = 'fl'
execute_on = 'INITIAL TIMESTEP_END'
[]
[ave_T]
type = ElementAverageValue
variable = 'T'
execute_on = 'INITIAL TIMESTEP_END'
[]
[]
[Outputs]
[out_avg]
type = Exodus
time_step_interval = 2000
[]
csv = false
[]
(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/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/channel-flow/linear-segregated/steady-transient-compare/common-blocks.i)
mu = 2.6
rho = 1.0
advected_interp_method = 'average'
cp = 300
k = 20
alpha_b = 1e-4
[Mesh]
[mesh]
type = CartesianMeshGenerator
dim = 2
dx = '1.'
dy = '0.2'
ix = '10'
iy = '5'
[]
[]
[Problem]
linear_sys_names = 'u_system v_system pressure_system 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
[]
[]
[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
[]
[T]
type = MooseLinearVariableFVReal
solver_sys = energy_system
initial_condition = 300
[]
[]
[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'
[]
[u_boussinesq]
type = LinearFVMomentumBoussinesq
variable = vel_x
rho = ${rho}
gravity = '0 -9.81 0'
alpha_name = ${alpha_b}
ref_temperature = 300.0
T_fluid = T
momentum_component = 'x'
[]
[v_boussinesq]
type = LinearFVMomentumBoussinesq
variable = vel_y
rho = ${rho}
gravity = '0 -9.81 0'
alpha_name = ${alpha_b}
ref_temperature = 300.0
T_fluid = T
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
[]
[h_advection]
type = LinearFVEnergyAdvection
variable = T
advected_quantity = temperature
cp = ${cp}
advected_interp_method = ${advected_interp_method}
rhie_chow_user_object = 'rc'
[]
[conduction]
type = LinearFVDiffusion
variable = T
diffusion_coeff = ${k}
use_nonorthogonal_correction = false
[]
[]
[FunctorMaterials]
[constant_functors]
type = GenericFunctorMaterial
prop_names = 'cp alpha_b'
prop_values = '${cp} ${alpha_b}'
[]
[]
[LinearFVBCs]
[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
[]
[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_top_T]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = T
functor = ${fparse 300.0}
boundary = 'left top'
[]
[bottom_T]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = T
functor = ${fparse 350.0}
boundary = bottom
[]
[outlet_T]
type = LinearFVAdvectionDiffusionOutflowBC
variable = T
use_two_term_expansion = false
boundary = right
[]
[]
[Outputs]
exodus = true
execute_on = FINAL
[]
(modules/navier_stokes/test/tests/finite_volume/ins/channel-flow/linear-segregated/2d/2d-boussinesq-transient.i)
mu = 2.6
rho = 1.0
advected_interp_method = 'average'
cp = 300
k = 10
alpha_b = 1e-4
pressure_gradient_method = 'green-gauss'
[Mesh]
[mesh]
type = CartesianMeshGenerator
dim = 2
dx = '1.'
dy = '0.2'
ix = '10'
iy = '5'
[]
[]
[Problem]
linear_sys_names = 'u_system v_system pressure_system 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
[]
[]
[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}
[]
[T]
type = MooseLinearVariableFVReal
solver_sys = energy_system
initial_condition = 300
[]
[]
[FVGradientMethods]
[gg]
type = FVGreenGaussGradient
[]
[reconstructed]
type = FVReconstructedPressureGradient
base_gradient_method = green-gauss
gradient_relaxation = 0.1
[]
[]
[FVInterpolationMethods]
[average]
type = FVGeometricAverage
[]
[]
[LinearFVKernels]
[u_time]
type = LinearFVTimeDerivative
variable = vel_x
factor = ${rho}
[]
[v_time]
type = LinearFVTimeDerivative
variable = vel_y
factor = ${rho}
[]
[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'
[]
[u_boussinesq]
type = LinearFVMomentumBoussinesq
variable = vel_x
rho = ${rho}
gravity = '0 -9.81 0'
alpha_name = ${alpha_b}
ref_temperature = 300.0
T_fluid = T
momentum_component = 'x'
[]
[v_boussinesq]
type = LinearFVMomentumBoussinesq
variable = vel_y
rho = ${rho}
gravity = '0 -9.81 0'
alpha_name = ${alpha_b}
ref_temperature = 300.0
T_fluid = T
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
[]
[h_time]
type = LinearFVTimeDerivative
variable = T
factor = ${fparse rho*cp}
[]
[h_advection]
type = LinearFVEnergyAdvection
variable = T
advected_quantity = temperature
cp = ${cp}
advected_interp_method = ${advected_interp_method}
rhie_chow_user_object = 'rc'
[]
[conduction]
type = LinearFVDiffusion
variable = T
diffusion_coeff = ${k}
use_nonorthogonal_correction = false
[]
[]
[FunctorMaterials]
[constant_functors]
type = GenericFunctorMaterial
prop_names = 'cp alpha_b'
prop_values = '${cp} ${alpha_b}'
[]
[]
[LinearFVBCs]
[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
[]
[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_top_T]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = T
functor = 300.0
boundary = 'left top'
[]
[bottom_T]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = T
functor = wall-temperature
boundary = bottom
[]
[outlet_T]
type = LinearFVAdvectionDiffusionOutflowBC
variable = T
use_two_term_expansion = false
boundary = right
[]
[]
[Functions]
[wall-temperature]
type = ParsedFunction
expression = '350 + 50 * sin(6.28*t)'
[]
[]
[VectorPostprocessors]
[line_sample]
type = LineValueSampler
# Sampled at the cell-center x-locations of the row of cells at mid-channel height (dx=1/ix=10
# -> 0.1-wide cells; dy=0.2/iy=5 -> 0.04-tall cells, so y=0.1 is a cell-center row) to avoid
# sampling a piecewise-constant FV variable exactly on a face.
start_point = '0.05 0.1 0'
end_point = '0.95 0.1 0'
num_points = 10
sort_by = x
variable = 'vel_x vel_y pressure T'
execute_on = FINAL
[]
[]
[Executioner]
type = PIMPLE
momentum_l_abs_tol = 1e-12
pressure_l_abs_tol = 1e-12
energy_l_abs_tol = 1e-12
momentum_l_tol = 1e-12
pressure_l_tol = 1e-12
energy_l_tol = 1e-12
rhie_chow_user_object = 'rc'
momentum_systems = 'u_system v_system'
pressure_system = 'pressure_system'
energy_system = 'energy_system'
momentum_equation_relaxation = 0.8
pressure_variable_relaxation = 0.3
energy_equation_relaxation = 0.9
num_iterations = 100
pressure_absolute_tolerance = 1e-11
momentum_absolute_tolerance = 1e-11
energy_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'
energy_petsc_options_iname = '-pc_type -pc_hypre_type'
energy_petsc_options_value = 'hypre boomeramg'
print_fields = false
continue_on_max_its = true
dt = 0.01
num_steps = 6
num_piso_iterations = 0
[]
[Outputs]
exodus = true
[csv]
type = CSV
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
[]