- 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
- 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
LinearFVExtrapolatedPressureBC
Description
This boundary condition is created for pressure variables in the pressure Poisson equation. It behaves just like a LinearFVAdvectionDiffusionExtrapolatedBC but its response depends on the usage:
- When it is used for the computation of gradients, the user can prescribe two-term extrapolation to the boundary faces to increase accuracy. - When it is used for building the pressure Poisson equation, it assumes a one-term expansion. The reason behind this is that for cases when the pressure needs to be pinned, adding boundary-related terms to the right hand side of the system will emulate a boundary source which yields unphysical results.
Input Parameters
- use_two_term_expansionFalseIf an approximate linear expansion should be used to compute the face value.
Default:False
C++ Type:bool
Controllable:No
Description:If an approximate linear expansion should be used to compute the face value.
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/mms/linear-segregated/2d-symmetric-vortex-rz/2d-symmetric-vortex-rz.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/lid-driven/linear-segregated/lid-driven-segregated.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/mms/linear-segregated/2d-vortex/2d-vortex.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/turbulence/lid-driven/linear-segregated/lid-driven-turb-std-wall.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/turbulence/lid-driven/linear-segregated/lid-driven-turb-non-eq-wall.i)
- (modules/navier_stokes/test/tests/finite_volume/two_phase/mixture_model/segregated/channel-drift-flux.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/mms/linear-segregated/2d-symmetric-vortex-rz/2d-symmetric-vortex-rz-spacedependent.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/mms/linear-segregated/2d-vortex/spacedependent_mu/sl.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/channel-flow/linear-segregated/2d-symmetric/channel.i)
- (modules/navier_stokes/test/tests/finite_volume/wcns/enthalpy_equation/enthalpy_equation.i)
(modules/navier_stokes/test/tests/finite_volume/ins/mms/linear-segregated/2d-symmetric-vortex-rz/2d-symmetric-vortex-rz.i)
mu = 1.2
rho = 1.5
advected_interp_method = 'average'
[Problem]
linear_sys_names = 'u_system v_system pressure_system'
previous_nl_solution_required = true
[]
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 2
ny = 2
[]
coord_type = 'RZ'
rz_coord_axis = x
[]
[UserObjects]
[rc]
type = RhieChowMassFlux
u = vel_x
v = vel_y
pressure = pressure
rho = ${rho}
p_diffusion_kernel = p_diffusion
pressure_projection_method = consistent
[]
[]
[Variables]
[vel_x]
type = MooseLinearVariableFVReal
initial_condition = 0.0
solver_sys = u_system
[]
[vel_y]
type = MooseLinearVariableFVReal
solver_sys = v_system
initial_condition = 0.0
[]
[pressure]
type = MooseLinearVariableFVReal
solver_sys = pressure_system
initial_condition = 0.0
[]
[]
[LinearFVKernels]
[u_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_x
advected_interp_method = ${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 = ${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_forcing]
type = LinearFVSource
variable = vel_x
source_density = forcing_u
[]
[v_forcing]
type = LinearFVSource
variable = vel_y
source_density = forcing_v
[]
[v_viscous_forcing]
type = LinearFVRZViscousSource
variable = vel_y
mu = ${mu}
momentum_component = 'y'
[]
[p_diffusion]
type = LinearFVAnisotropicDiffusion
variable = pressure
diffusion_tensor = 'Ainv'
use_nonorthogonal_correction = false
use_nonorthogonal_correction_on_boundary = false
[]
[HbyA_divergence]
type = LinearFVDivergence
variable = pressure
face_flux = 'HbyA'
force_boundary_execution = true
[]
[]
[LinearFVBCs]
[no-slip-wall-u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left right top'
variable = vel_x
functor = exact_u
[]
[no-slip-wall-v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left right top'
variable = vel_y
functor = exact_v
[]
[symmetry-u]
type = LinearFVVelocitySymmetryBC
boundary = 'bottom'
variable = vel_x
u = vel_x
v = vel_y
momentum_component = x
[]
[symmetry-v]
type = LinearFVVelocitySymmetryBC
boundary = 'bottom'
variable = vel_y
u = vel_x
v = vel_y
momentum_component = y
[]
[pressure-extrapolation]
type = LinearFVExtrapolatedPressureBC
boundary = 'top left right'
variable = pressure
use_two_term_expansion = true
[]
[pressure-symmetry]
type = LinearFVPressureSymmetryBC
boundary = 'bottom'
variable = pressure
HbyA_flux = 'HbyA'
[]
[]
[AuxVariables]
[vel_x_aux]
type = MooseLinearVariableFVReal
initial_condition = 0.0
[]
[vel_y_aux]
type = MooseLinearVariableFVReal
initial_condition = 0.0
[]
[pressure_aux]
type = MooseLinearVariableFVReal
initial_condition = 0.0
[]
[]
[AuxKernels]
[vel_x_function_aux]
type = FunctionAux
variable = vel_x_aux
function = exact_u
execute_on = TIMESTEP_END
[]
[vel_y_function_aux]
type = FunctionAux
variable = vel_y_aux
function = exact_v
execute_on = TIMESTEP_END
[]
[pressure_function_aux]
type = FunctionAux
variable = pressure_aux
function = exact_p
execute_on = TIMESTEP_END
[]
[]
[Functions]
[exact_u]
type = ParsedFunction
expression = '4*x^2*y^2 - 20*x^2*y^3 - 8*x^3*y^2 + 36*x^2*y^4 + 40*x^3*y^3 + 4*x^4*y^2 - 28*x^2*y^5 - 72*x^3*y^4 - 20*x^4*y^3 + 8*x^2*y^6 + 56*x^3*y^5 + 36*x^4*y^4 - 16*x^3*y^6 - 28*x^4*y^5 + 8*x^4*y^6'
[]
[exact_v]
type = ParsedFunction
expression = '-2*x*y^3*(x-1)*(2*x-1)*(y-1)^4'
[]
[exact_p]
type = ParsedFunction
expression = 'x*y^2'
[]
[forcing_u]
type = ParsedFunction
symbol_names = 'mu rho'
symbol_values = '${mu} ${rho}'
expression = 'rho*(8*x^3*y^4*(x-1)^3*(2*x-1)*(y-1)^6*(4*y^2 - 5*y + 2)) - mu*(4*(y-1)*(72*x^4*y^3 - 103*x^4*y^2 + 41*x^4*y - 4*x^4 - 144*x^3*y^3 + 206*x^3*y^2 - 82*x^3*y + 8*x^3 + 24*x^2*y^5 - 60*x^2*y^4 + 120*x^2*y^3 - 115*x^2*y^2 + 41*x^2*y - 4*x^2 - 24*x*y^5 + 60*x*y^4 - 48*x*y^3 + 12*x*y^2 + 4*y^5 - 10*y^4 + 8*y^3 - 2*y^2)) + y^2'
[]
[forcing_v]
type = ParsedFunction
symbol_names = 'mu rho'
symbol_values = '${mu} ${rho}'
expression = 'rho*4*x^2*y^5*(x-1)^2*(y-1)^7*(2*(2*x^2 - 2*x + y) + (2*x - 1)^2*(y - 1)) + mu * (4*y*(2*x-1)*(y-1)^2*(24*x^2*y^2 - 22*x^2*y + 4*x^2 - 24*x*y^2 + 22*x*y - 4*x + 3*y^4 - 6*y^3 + 3*y^2)) + 2*x*y'
[]
[]
[Executioner]
type = SIMPLE
momentum_l_abs_tol = 1e-10
pressure_l_abs_tol = 1e-10
momentum_l_tol = 0
pressure_l_tol = 0
momentum_l_max_its = 500
pressure_l_max_its = 500
rhie_chow_user_object = 'rc'
momentum_systems = 'u_system v_system'
pressure_system = 'pressure_system'
momentum_equation_relaxation = 0.85
pressure_variable_relaxation = 1.0
num_iterations = 10000
pressure_absolute_tolerance = 1e-8
momentum_absolute_tolerance = 1e-8
momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
momentum_petsc_options_value = 'hypre boomeramg'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
pressure_petsc_options_value = 'hypre boomeramg'
print_fields = false
continue_on_max_its = true
pin_pressure = true
pressure_pin_value = 0.125
pressure_pin_point = '0.5 0.5 0.0'
[]
[Outputs]
[csv]
type = CSV
execute_on = TIMESTEP_END
[]
[]
[Postprocessors]
[h]
type = AverageElementSize
execute_on = TIMESTEP_END
[]
[L2u]
type = ElementL2FunctorError
approximate = vel_x
exact = exact_u
execute_on = TIMESTEP_END
[]
[L2v]
type = ElementL2FunctorError
approximate = vel_y
exact = exact_v
execute_on = TIMESTEP_END
[]
[L2p]
approximate = pressure
exact = exact_p
type = ElementL2FunctorError
execute_on = TIMESTEP_END
[]
[]
(modules/navier_stokes/test/tests/finite_volume/ins/lid-driven/linear-segregated/lid-driven-segregated.i)
mu = .01
rho = 1
advected_interp_method = 'average'
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = .1
ymin = 0
ymax = .1
nx = 3
ny = 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.0
solver_sys = u_system
[]
[vel_y]
type = MooseLinearVariableFVReal
initial_condition = 0.0
solver_sys = v_system
[]
[pressure]
type = MooseLinearVariableFVReal
solver_sys = pressure_system
initial_condition = 0.2
[]
[]
[LinearFVKernels]
[u_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_x
advected_interp_method = ${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 = ${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 = LinearFVAnisotropicDiffusion
variable = pressure
diffusion_tensor = Ainv
use_nonorthogonal_correction = false
[]
[HbyA_divergence]
type = LinearFVDivergence
variable = pressure
face_flux = HbyA
force_boundary_execution = true
[]
[]
[LinearFVBCs]
[top_x]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = vel_x
boundary = 'top'
functor = 1
[]
[no_slip_x]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = vel_x
boundary = 'left right bottom'
functor = 0
[]
[no_slip_y]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = vel_y
boundary = 'left right top bottom'
functor = 0
[]
[pressure-extrapolation]
type = LinearFVExtrapolatedPressureBC
boundary = 'left right top bottom'
variable = pressure
use_two_term_expansion = true
[]
[]
[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 = 500
pressure_absolute_tolerance = 1e-10
momentum_absolute_tolerance = 1e-10
momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
momentum_petsc_options_value = 'hypre boomeramg'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
pressure_petsc_options_value = 'hypre boomeramg'
print_fields = false
pin_pressure = true
pressure_pin_value = 0.0
pressure_pin_point = '0.05 0.05 0.0'
[]
[Outputs]
exodus = true
csv = false
perf_graph = false
print_nonlinear_residuals = false
print_linear_residuals = true
[]
(modules/navier_stokes/test/tests/finite_volume/ins/mms/linear-segregated/2d-vortex/2d-vortex.i)
mu = 1
rho = 1
advected_interp_method = 'average'
[Problem]
linear_sys_names = 'u_system v_system pressure_system'
previous_nl_solution_required = true
[]
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 2
ny = 2
[]
[]
[UserObjects]
[rc]
type = RhieChowMassFlux
u = vel_x
v = vel_y
pressure = pressure
rho = ${rho}
p_diffusion_kernel = p_diffusion
[]
[]
[Variables]
[vel_x]
type = MooseLinearVariableFVReal
initial_condition = 0.0
solver_sys = u_system
[]
[vel_y]
type = MooseLinearVariableFVReal
solver_sys = v_system
initial_condition = 0.0
[]
[pressure]
type = MooseLinearVariableFVReal
solver_sys = pressure_system
initial_condition = 0
[]
[]
[LinearFVKernels]
[u_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_x
advected_interp_method = ${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 = ${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_forcing]
type = LinearFVSource
variable = vel_x
source_density = forcing_u
[]
[v_forcing]
type = LinearFVSource
variable = vel_y
source_density = forcing_v
[]
[p_diffusion]
type = LinearFVAnisotropicDiffusion
variable = pressure
diffusion_tensor = Ainv
use_nonorthogonal_correction = false
use_nonorthogonal_correction_on_boundary = false
[]
[HbyA_divergence]
type = LinearFVDivergence
variable = pressure
face_flux = HbyA
force_boundary_execution = true
[]
[]
[LinearFVBCs]
[no-slip-wall-u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left right top bottom'
variable = vel_x
functor = '0'
[]
[no-slip-wall-v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left right top bottom'
variable = vel_y
functor = '0'
[]
[pressure-extrapolation]
type = LinearFVExtrapolatedPressureBC
boundary = 'left right top bottom'
variable = pressure
use_two_term_expansion = true
[]
[]
[Functions]
[exact_u]
type = ParsedFunction
expression = 'x^2*(1-x)^2*(2*y-6*y^2+4*y^3)'
[]
[exact_v]
type = ParsedFunction
expression = '-y^2*(1-y)^2*(2*x-6*x^2+4*x^3)'
[]
[exact_p]
type = ParsedFunction
expression = 'x*(1-x)'
[]
[forcing_u]
type = ParsedFunction
expression = '-4*mu*(-1+2*y)*(y^2-6*x*y^2+6*x^2*y^2-y+6*x*y-6*x^2*y+3*x^2-6*x^3+3*x^4)+1-2*x+rho*4*x^3'
'*y^2*(2*y^2-2*y+1)*(y-1)^2*(-1+2*x)*(x-1)^3'
symbol_names = 'mu rho'
symbol_values = '${mu} ${rho}'
[]
[forcing_v]
type = ParsedFunction
expression = '4*mu*(-1+2*x)*(x^2-6*y*x^2+6*x^2*y^2-x+6*x*y-6*x*y^2+3*y^2-6*y^3+3*y^4)+rho*4*y^3*x^2*(2'
'*x^2-2*x+1)*(x-1)^2*(-1+2*y)*(y-1)^3'
symbol_names = 'mu rho'
symbol_values = '${mu} ${rho}'
[]
[]
[Executioner]
type = SIMPLE
momentum_l_abs_tol = 1e-8
pressure_l_abs_tol = 1e-8
momentum_l_tol = 0
pressure_l_tol = 0
rhie_chow_user_object = 'rc'
momentum_systems = 'u_system v_system'
pressure_system = 'pressure_system'
momentum_equation_relaxation = 0.8
pressure_variable_relaxation = 0.3
num_iterations = 2000
pressure_absolute_tolerance = 1e-8
momentum_absolute_tolerance = 1e-8
momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
momentum_petsc_options_value = 'hypre boomeramg'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
pressure_petsc_options_value = 'hypre boomeramg'
print_fields = false
pin_pressure = true
pressure_pin_value = 0.25
pressure_pin_point = '0.5 0.5 0.0'
[]
[Outputs]
exodus = true
[csv]
type = CSV
execute_on = FINAL
[]
[]
[Postprocessors]
[h]
type = AverageElementSize
outputs = 'csv'
execute_on = FINAL
[]
[L2u]
type = ElementL2FunctorError
approximate = vel_x
exact = exact_u
outputs = 'csv'
execute_on = FINAL
[]
[L2v]
type = ElementL2FunctorError
approximate = vel_y
exact = exact_v
outputs = 'csv'
execute_on = FINAL
[]
[L2p]
approximate = pressure
exact = exact_p
type = ElementL2FunctorError
outputs = 'csv'
execute_on = FINAL
[]
[]
(modules/navier_stokes/test/tests/finite_volume/ins/turbulence/lid-driven/linear-segregated/lid-driven-turb-std-wall.i)
### Thermophysical Properties ###
mu = 1e-3
rho = 1.0
### Operation Conditions ###
lid_velocity = 1.0
side_length = 0.1
### Initial Conditions ###
intensity = 0.01
k_init = '${fparse 1.5*(intensity * lid_velocity)^2}'
eps_init = '${fparse C_mu^0.75 * k_init^1.5 / side_length}'
### k-epsilon Closure Parameters ###
sigma_k = 1.0
sigma_eps = 1.3
C1_eps = 1.44
C2_eps = 1.92
C_mu = 0.09
### Modeling parameters ###
bulk_wall_treatment = false
walls = 'left top right bottom'
wall_treatment = 'eq_newton' # Options: eq_newton, eq_incremental, eq_linearized, neq
[GlobalParams]
rhie_chow_user_object = 'rc'
advected_interp_method = 'upwind'
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${side_length}
ymin = 0
ymax = ${side_length}
nx = 12
ny = 12
[]
# Prevent test diffing on distributed parallel element numbering
allow_renumbering = false
[]
[Problem]
linear_sys_names = 'u_system v_system pressure_system TKE_system TKED_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 = ${lid_velocity}
solver_sys = u_system
[]
[vel_y]
type = MooseLinearVariableFVReal
initial_condition = 0
solver_sys = v_system
[]
[pressure]
type = MooseLinearVariableFVReal
initial_condition = 1e-8
solver_sys = pressure_system
[]
[TKE]
type = MooseLinearVariableFVReal
solver_sys = TKE_system
initial_condition = ${k_init}
[]
[TKED]
type = MooseLinearVariableFVReal
solver_sys = TKED_system
initial_condition = ${eps_init}
[]
[]
[LinearFVKernels]
[u_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_x
mu = 'mu_t'
u = vel_x
v = vel_y
momentum_component = 'x'
rhie_chow_user_object = 'rc'
use_nonorthogonal_correction = true
use_deviatoric_terms = yes
[]
[u_diffusion]
type = LinearFVDiffusion
variable = vel_x
diffusion_coeff = ${mu}
use_nonorthogonal_correction = true
[]
[u_pressure]
type = LinearFVMomentumPressure
variable = vel_x
pressure = pressure
momentum_component = 'x'
[]
[v_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_y
mu = 'mu_t'
u = vel_x
v = vel_y
momentum_component = 'y'
rhie_chow_user_object = 'rc'
use_nonorthogonal_correction = true
use_deviatoric_terms = yes
[]
[v_diffusion]
type = LinearFVDiffusion
variable = vel_y
diffusion_coeff = ${mu}
use_nonorthogonal_correction = true
[]
[v_pressure]
type = LinearFVMomentumPressure
variable = vel_y
pressure = pressure
momentum_component = 'y'
[]
[p_diffusion]
type = LinearFVAnisotropicDiffusion
variable = pressure
diffusion_tensor = Ainv
use_nonorthogonal_correction = true
[]
[HbyA_divergence]
type = LinearFVDivergence
variable = pressure
face_flux = HbyA
force_boundary_execution = true
[]
[TKE_advection]
type = LinearFVTurbulentAdvection
variable = TKE
[]
[TKE_diffusion]
type = LinearFVTurbulentDiffusion
variable = TKE
diffusion_coeff = ${mu}
use_nonorthogonal_correction = true
[]
[TKE_turb_diffusion]
type = LinearFVTurbulentDiffusion
variable = TKE
diffusion_coeff = 'mu_t'
scaling_coeff = ${sigma_k}
use_nonorthogonal_correction = true
[]
[TKE_source_sink]
type = LinearFVTKESourceSink
variable = TKE
u = vel_x
v = vel_y
epsilon = TKED
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
walls = ${walls}
wall_treatment = ${wall_treatment}
C_pl = 1e10
[]
[TKED_advection]
type = LinearFVTurbulentAdvection
variable = TKED
walls = ${walls}
[]
[TKED_diffusion]
type = LinearFVTurbulentDiffusion
variable = TKED
diffusion_coeff = ${mu}
use_nonorthogonal_correction = true
walls = ${walls}
[]
[TKED_turb_diffusion]
type = LinearFVTurbulentDiffusion
variable = TKED
diffusion_coeff = 'mu_t'
scaling_coeff = ${sigma_eps}
use_nonorthogonal_correction = true
walls = ${walls}
[]
[TKED_source_sink]
type = LinearFVTKEDSourceSink
variable = TKED
u = vel_x
v = vel_y
tke = TKE
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
C1_eps = ${C1_eps}
C2_eps = ${C2_eps}
walls = ${walls}
wall_treatment = ${wall_treatment}
C_pl = 1e10
[]
[]
[LinearFVBCs]
[top_x]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = vel_x
boundary = 'top'
functor = 1
[]
[no_slip_x]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = vel_x
boundary = 'left right bottom'
functor = 0
[]
[no_slip_y]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = vel_y
boundary = 'left right top bottom'
functor = 0
[]
[pressure-extrapolation]
type = LinearFVExtrapolatedPressureBC
boundary = 'left right top bottom'
variable = pressure
use_two_term_expansion = true
[]
[walls_mu_t]
type = LinearFVTurbulentViscosityWallFunctionBC
boundary = ${walls}
variable = 'mu_t'
u = vel_x
v = vel_y
rho = ${rho}
mu = ${mu}
tke = TKE
wall_treatment = ${wall_treatment}
[]
[]
[AuxVariables]
[mu_t]
type = MooseLinearVariableFVReal
initial_condition = '${fparse rho * C_mu * ${k_init}^2 / eps_init}'
[]
[yplus]
type = MooseLinearVariableFVReal
[]
[mu_eff]
type = MooseLinearVariableFVReal
initial_condition = '${fparse rho * C_mu * ${k_init}^2 / eps_init}'
[]
[]
[AuxKernels]
[compute_mu_t]
type = kEpsilonViscosityAux
variable = mu_t
C_mu = ${C_mu}
tke = TKE
epsilon = TKED
mu = ${mu}
rho = ${rho}
u = vel_x
v = vel_y
bulk_wall_treatment = ${bulk_wall_treatment}
walls = ${walls}
wall_treatment = ${wall_treatment}
execute_on = 'NONLINEAR'
mu_t_ratio_max = 1e20
[]
[compute_y_plus]
type = RANSYPlusAux
variable = yplus
tke = TKE
mu = ${mu}
rho = ${rho}
u = vel_x
v = vel_y
walls = ${walls}
wall_treatment = ${wall_treatment}
execute_on = 'NONLINEAR'
[]
[compute_mu_eff]
type = ParsedAux
variable = 'mu_eff'
coupled_variables = 'mu_t'
expression = 'mu_t + ${mu}'
execute_on = 'NONLINEAR'
[]
[]
[Executioner]
type = SIMPLE
rhie_chow_user_object = 'rc'
momentum_systems = 'u_system v_system'
pressure_system = 'pressure_system'
turbulence_systems = 'TKE_system TKED_system'
momentum_l_abs_tol = 1e-14
pressure_l_abs_tol = 1e-14
turbulence_l_abs_tol = 1e-14
momentum_l_tol = 1e-14
pressure_l_tol = 1e-14
turbulence_l_tol = 1e-14
momentum_equation_relaxation = 0.7
pressure_variable_relaxation = 0.3
turbulence_equation_relaxation = '0.5 0.5'
num_iterations = 1000
pressure_absolute_tolerance = 1e-12
momentum_absolute_tolerance = 1e-12
turbulence_absolute_tolerance = '1e-12 1e-12'
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'
turbulence_petsc_options_iname = '-pc_type -pc_hypre_type'
turbulence_petsc_options_value = 'hypre boomeramg'
print_fields = false
continue_on_max_its = true
pin_pressure = true
pressure_pin_value = 0.0
pressure_pin_point = '0.01 0.099 0.0'
[]
[Outputs]
csv = true
perf_graph = false
print_nonlinear_residuals = false
print_linear_residuals = true
[]
[VectorPostprocessors]
[side_bottom]
type = SideValueSampler
boundary = 'bottom'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[side_top]
type = SideValueSampler
boundary = 'top'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[side_left]
type = SideValueSampler
boundary = 'left'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'y'
execute_on = 'timestep_end'
[]
[side_right]
type = SideValueSampler
boundary = 'right'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'y'
execute_on = 'timestep_end'
[]
[horizontal_center]
type = LineValueSampler
start_point = '${fparse 0.01 * side_length} ${fparse 0.499 * side_length} 0'
end_point = '${fparse 0.99 * side_length} ${fparse 0.499 * side_length} 0'
num_points = ${Mesh/gen/nx}
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[vertical_center]
type = LineValueSampler
start_point = '${fparse 0.499 * side_length} ${fparse 0.01 * side_length} 0'
end_point = '${fparse 0.499 * side_length} ${fparse 0.99 * side_length} 0'
num_points = ${Mesh/gen/ny}
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'y'
execute_on = 'timestep_end'
[]
[]
(modules/navier_stokes/test/tests/finite_volume/ins/turbulence/lid-driven/linear-segregated/lid-driven-turb-non-eq-wall.i)
### Thermophysical Properties ###
mu = 1e-3
rho = 1.0
### Operation Conditions ###
lid_velocity = 1.0
side_length = 0.1
### Initial Conditions ###
intensity = 0.01
k_init = '${fparse 1.5*(intensity * lid_velocity)^2}'
eps_init = '${fparse C_mu^0.75 * k_init^1.5 / side_length}'
### k-epsilon Closure Parameters ###
sigma_k = 1.0
sigma_eps = 1.3
C1_eps = 1.44
C2_eps = 1.92
C_mu = 0.09
### Modeling parameters ###
bulk_wall_treatment = false
walls = 'left top right bottom'
wall_treatment = 'neq' # Options: eq_newton, eq_incremental, eq_linearized, neq
[GlobalParams]
rhie_chow_user_object = 'rc'
advected_interp_method = 'upwind'
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${side_length}
ymin = 0
ymax = ${side_length}
nx = 12
ny = 12
[]
# Prevent test diffing on distributed parallel element numbering
allow_renumbering = false
[]
[Problem]
linear_sys_names = 'u_system v_system pressure_system TKE_system TKED_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 = ${lid_velocity}
solver_sys = u_system
[]
[vel_y]
type = MooseLinearVariableFVReal
initial_condition = 0
solver_sys = v_system
[]
[pressure]
type = MooseLinearVariableFVReal
initial_condition = 1e-8
solver_sys = pressure_system
[]
[TKE]
type = MooseLinearVariableFVReal
solver_sys = TKE_system
initial_condition = ${k_init}
[]
[TKED]
type = MooseLinearVariableFVReal
solver_sys = TKED_system
initial_condition = ${eps_init}
[]
[]
[LinearFVKernels]
[u_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_x
mu = 'mu_t'
u = vel_x
v = vel_y
momentum_component = 'x'
rhie_chow_user_object = 'rc'
use_nonorthogonal_correction = false
use_deviatoric_terms = yes
[]
[u_diffusion]
type = LinearFVDiffusion
variable = vel_x
diffusion_coeff = ${mu}
use_nonorthogonal_correction = false
[]
[u_pressure]
type = LinearFVMomentumPressure
variable = vel_x
pressure = pressure
momentum_component = 'x'
[]
[v_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_y
mu = 'mu_t'
u = vel_x
v = vel_y
momentum_component = 'y'
rhie_chow_user_object = 'rc'
use_nonorthogonal_correction = false
use_deviatoric_terms = yes
[]
[v_diffusion]
type = LinearFVDiffusion
variable = vel_y
diffusion_coeff = ${mu}
use_nonorthogonal_correction = false
[]
[v_pressure]
type = LinearFVMomentumPressure
variable = vel_y
pressure = pressure
momentum_component = 'y'
[]
[p_diffusion]
type = LinearFVAnisotropicDiffusion
variable = pressure
diffusion_tensor = Ainv
use_nonorthogonal_correction = false
[]
[HbyA_divergence]
type = LinearFVDivergence
variable = pressure
face_flux = HbyA
force_boundary_execution = true
[]
[TKE_advection]
type = LinearFVTurbulentAdvection
variable = TKE
[]
[TKE_diffusion]
type = LinearFVTurbulentDiffusion
variable = TKE
diffusion_coeff = ${mu}
use_nonorthogonal_correction = false
[]
[TKE_turb_diffusion]
type = LinearFVTurbulentDiffusion
variable = TKE
diffusion_coeff = 'mu_t'
scaling_coeff = ${sigma_k}
use_nonorthogonal_correction = false
[]
[TKE_source_sink]
type = LinearFVTKESourceSink
variable = TKE
u = vel_x
v = vel_y
epsilon = TKED
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
walls = ${walls}
wall_treatment = ${wall_treatment}
C_pl = 1e10
[]
[TKED_advection]
type = LinearFVTurbulentAdvection
variable = TKED
walls = ${walls}
[]
[TKED_diffusion]
type = LinearFVTurbulentDiffusion
variable = TKED
diffusion_coeff = ${mu}
use_nonorthogonal_correction = false
walls = ${walls}
[]
[TKED_turb_diffusion]
type = LinearFVTurbulentDiffusion
variable = TKED
diffusion_coeff = 'mu_t'
scaling_coeff = ${sigma_eps}
use_nonorthogonal_correction = false
walls = ${walls}
[]
[TKED_source_sink]
type = LinearFVTKEDSourceSink
variable = TKED
u = vel_x
v = vel_y
tke = TKE
rho = ${rho}
mu = ${mu}
mu_t = 'mu_t'
C1_eps = ${C1_eps}
C2_eps = ${C2_eps}
walls = ${walls}
wall_treatment = ${wall_treatment}
C_pl = 1e10
[]
[]
[LinearFVBCs]
[top_x]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = vel_x
boundary = 'top'
functor = 1
[]
[no_slip_x]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = vel_x
boundary = 'left right bottom'
functor = 0
[]
[no_slip_y]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = vel_y
boundary = 'left right top bottom'
functor = 0
[]
[pressure-extrapolation]
type = LinearFVExtrapolatedPressureBC
boundary = 'left right top bottom'
variable = pressure
use_two_term_expansion = true
[]
[walls_mu_t]
type = LinearFVTurbulentViscosityWallFunctionBC
boundary = 'bottom top'
variable = 'mu_t'
u = vel_x
v = vel_y
rho = ${rho}
mu = ${mu}
tke = TKE
wall_treatment = ${wall_treatment}
[]
[]
[AuxVariables]
[mu_t]
type = MooseLinearVariableFVReal
initial_condition = '${fparse rho * C_mu * ${k_init}^2 / eps_init}'
[]
[yplus]
type = MooseLinearVariableFVReal
[]
[mu_eff]
type = MooseLinearVariableFVReal
initial_condition = '${fparse rho * C_mu * ${k_init}^2 / eps_init}'
[]
[]
[AuxKernels]
[compute_mu_t]
type = kEpsilonViscosityAux
variable = mu_t
C_mu = ${C_mu}
tke = TKE
epsilon = TKED
mu = ${mu}
rho = ${rho}
u = vel_x
v = vel_y
bulk_wall_treatment = ${bulk_wall_treatment}
walls = ${walls}
wall_treatment = ${wall_treatment}
execute_on = 'NONLINEAR'
mu_t_ratio_max = 1e20
[]
[compute_y_plus]
type = RANSYPlusAux
variable = yplus
tke = TKE
mu = ${mu}
rho = ${rho}
u = vel_x
v = vel_y
walls = ${walls}
wall_treatment = ${wall_treatment}
execute_on = 'NONLINEAR'
[]
[compute_mu_eff]
type = ParsedAux
variable = 'mu_eff'
coupled_variables = 'mu_t'
expression = 'mu_t + ${mu}'
execute_on = 'NONLINEAR'
[]
[]
[Executioner]
type = SIMPLE
rhie_chow_user_object = 'rc'
momentum_systems = 'u_system v_system'
pressure_system = 'pressure_system'
turbulence_systems = 'TKE_system TKED_system'
momentum_l_abs_tol = 1e-14
pressure_l_abs_tol = 1e-14
turbulence_l_abs_tol = 1e-14
momentum_l_tol = 1e-14
pressure_l_tol = 1e-14
turbulence_l_tol = 1e-14
momentum_equation_relaxation = 0.7
pressure_variable_relaxation = 0.3
turbulence_equation_relaxation = '0.5 0.5'
num_iterations = 1000
pressure_absolute_tolerance = 1e-12
momentum_absolute_tolerance = 1e-12
turbulence_absolute_tolerance = '1e-12 1e-12'
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'
turbulence_petsc_options_iname = '-pc_type -pc_hypre_type'
turbulence_petsc_options_value = 'hypre boomeramg'
print_fields = false
continue_on_max_its = true
pin_pressure = true
pressure_pin_value = 0.0
pressure_pin_point = '0.01 0.099 0.0'
[]
[Outputs]
csv = true
perf_graph = false
print_nonlinear_residuals = false
print_linear_residuals = true
[]
[VectorPostprocessors]
[side_bottom]
type = SideValueSampler
boundary = 'bottom'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[side_top]
type = SideValueSampler
boundary = 'top'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[side_left]
type = SideValueSampler
boundary = 'left'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'y'
execute_on = 'timestep_end'
[]
[side_right]
type = SideValueSampler
boundary = 'right'
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'y'
execute_on = 'timestep_end'
[]
[horizontal_center]
type = LineValueSampler
start_point = '${fparse 0.01 * side_length} ${fparse 0.499 * side_length} 0'
end_point = '${fparse 0.99 * side_length} ${fparse 0.499 * side_length} 0'
num_points = ${Mesh/gen/nx}
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[vertical_center]
type = LineValueSampler
start_point = '${fparse 0.499 * side_length} ${fparse 0.01 * side_length} 0'
end_point = '${fparse 0.499 * side_length} ${fparse 0.99 * side_length} 0'
num_points = ${Mesh/gen/ny}
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'y'
execute_on = 'timestep_end'
[]
[]
(modules/navier_stokes/test/tests/finite_volume/two_phase/mixture_model/segregated/channel-drift-flux.i)
mu = 1.0
rho = 10.0
mu_d = 0.1
rho_d = 1.0
l = 2
# 'average' leads to slight oscillations, upwind may be preferred
# This method is selected for consistency with the original nonlinear input
advected_interp_method = 'average'
# TODO remove need for those
cp = 1
k = 1
cp_d = 1
k_d = 1
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = '${fparse l * 5}'
ymin = '${fparse -l / 2}'
ymax = '${fparse l / 2}'
nx = 10
ny = 4
[]
uniform_refine = 0
[]
[Problem]
linear_sys_names = 'u_system v_system pressure_system phi_system'
previous_nl_solution_required = true
[]
[Variables]
[vel_x]
type = MooseLinearVariableFVReal
solver_sys = u_system
initial_condition = 1
[]
[vel_y]
type = MooseLinearVariableFVReal
solver_sys = v_system
[]
[pressure]
type = MooseLinearVariableFVReal
solver_sys = pressure_system
[]
[phase_2]
type = MooseLinearVariableFVReal
solver_sys = phi_system
[]
[]
[LinearFVKernels]
[flow_p_diffusion]
type = LinearFVAnisotropicDiffusion
diffusion_tensor = Ainv
use_nonorthogonal_correction = false
variable = pressure
[]
[flow_HbyA_divergence]
type = LinearFVDivergence
face_flux = HbyA
force_boundary_execution = true
variable = pressure
[]
[flow_ins_momentum_flux_x]
type = LinearWCNSFVMomentumFlux
advected_interp_method = ${advected_interp_method}
momentum_component = x
mu = mu_mixture
rhie_chow_user_object = ins_rhie_chow_interpolator
u = vel_x
use_deviatoric_terms = false
use_nonorthogonal_correction = false
v = vel_y
variable = vel_x
[]
[flow_ins_momentum_flux_y]
type = LinearWCNSFVMomentumFlux
advected_interp_method = ${advected_interp_method}
momentum_component = y
mu = mu_mixture
rhie_chow_user_object = ins_rhie_chow_interpolator
u = vel_x
use_deviatoric_terms = false
use_nonorthogonal_correction = false
v = vel_y
variable = vel_y
[]
[mixture_drift_flux_x]
type = LinearWCNSFV2PMomentumDriftFlux
density_interp_method = average
fraction_dispersed = phase_2
momentum_component = x
rhie_chow_user_object = ins_rhie_chow_interpolator
rho_d = ${rho_d}
u_slip = vel_slip_x
v_slip = vel_slip_y
variable = vel_x
[]
[mixture_drift_flux_y]
type = LinearWCNSFV2PMomentumDriftFlux
density_interp_method = average
fraction_dispersed = phase_2
momentum_component = y
rhie_chow_user_object = ins_rhie_chow_interpolator
rho_d = ${rho_d}
u_slip = vel_slip_x
v_slip = vel_slip_y
variable = vel_y
[]
[flow_ins_momentum_pressure_x]
type = LinearFVMomentumPressure
momentum_component = x
pressure = pressure
variable = vel_x
[]
[flow_ins_momentum_pressure_y]
type = LinearFVMomentumPressure
momentum_component = y
pressure = pressure
variable = vel_y
[]
[flow_momentum_friction_0_x]
type = LinearFVMomentumFriction
Darcy_name = Darcy_coefficient_vec
momentum_component = x
mu = mu_mixture
variable = vel_x
[]
[flow_momentum_friction_0_y]
type = LinearFVMomentumFriction
Darcy_name = Darcy_coefficient_vec
momentum_component = y
mu = mu_mixture
variable = vel_y
[]
# Mixture phase equation
[mixture_ins_phase_2_advection]
type = LinearFVScalarAdvection
advected_interp_method = upwind
rhie_chow_user_object = ins_rhie_chow_interpolator
u_slip = vel_slip_x
v_slip = vel_slip_y
variable = phase_2
[]
[mixture_phase_interface_reaction]
type = LinearFVReaction
coeff = 0.1
variable = phase_2
[]
[mixture_phase_interface_source]
type = LinearFVSource
scaling_factor = 0.1
source_density = phase_1
variable = phase_2
[]
[]
[LinearFVBCs]
[vel_x_left]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = left
functor = 1
variable = vel_x
[]
[vel_y_left]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = left
functor = 0
variable = vel_y
[]
[pressure_extrapolation_inlet_left]
type = LinearFVExtrapolatedPressureBC
boundary = left
use_two_term_expansion = true
variable = pressure
[]
[vel_x_right]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = right
use_two_term_expansion = true
variable = vel_x
[]
[vel_y_right]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = right
use_two_term_expansion = true
variable = vel_y
[]
[pressure_right]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = right
functor = 0
variable = pressure
[]
[vel_x_bottom]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = bottom
functor = 0
variable = vel_x
[]
[vel_y_bottom]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = bottom
functor = 0
variable = vel_y
[]
[vel_x_top]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = top
functor = 0
variable = vel_x
[]
[vel_y_top]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = top
functor = 0
variable = vel_y
[]
[pressure_extrapolation_top_bottom]
type = LinearFVExtrapolatedPressureBC
boundary = 'top bottom'
use_two_term_expansion = true
variable = pressure
[]
[phase_2_left]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = left
functor = 0.1
variable = phase_2
[]
[phase_2_right]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = right
use_two_term_expansion = true
variable = phase_2
[]
[]
[FunctorMaterials]
[flow_ins_speed_material]
type = ADVectorMagnitudeFunctorMaterial
execute_on = ALWAYS
outputs = none
vector_magnitude_name = speed
x_functor = vel_x
y_functor = vel_y
[]
[mixture_phase_1_fraction]
type = ParsedFunctorMaterial
execute_on = ALWAYS
expression = '1 - phase_2'
functor_names = phase_2
output_properties = phase_1
outputs = all
property_name = phase_1
[]
[mixture_mixture_material]
type = WCNSLinearFVMixtureFunctorMaterial
execute_on = ALWAYS
limit_phase_fraction = true
outputs = all
phase_1_fraction = phase_2
phase_1_names = '${rho_d} ${mu_d} ${cp_d} ${k_d}'
phase_2_names = '${rho} ${mu} ${cp} ${k}'
prop_names = 'rho_mixture mu_mixture cp_mixture k_mixture'
[]
[mixture_slip_x]
type = WCNSFV2PSlipVelocityFunctorMaterial
execute_on = ALWAYS
gravity = '0 0 0'
linear_coef_name = Darcy_coefficient
momentum_component = x
mu = mu_mixture
outputs = all
particle_diameter = 0.01
rho = ${rho}
rho_d = ${rho_d}
slip_velocity_name = vel_slip_x
u = vel_x
v = vel_y
[]
[mixture_slip_y]
type = WCNSFV2PSlipVelocityFunctorMaterial
execute_on = ALWAYS
gravity = '0 0 0'
linear_coef_name = Darcy_coefficient
momentum_component = y
mu = mu_mixture
outputs = all
particle_diameter = 0.01
rho = ${rho}
rho_d = ${rho_d}
slip_velocity_name = vel_slip_y
u = vel_x
v = vel_y
[]
[mixture_dispersed_drag]
type = NSFVDispersePhaseDragFunctorMaterial
drag_coef_name = Darcy_coefficient
execute_on = ALWAYS
mu = mu_mixture
outputs = all
particle_diameter = 0.01
rho = rho_mixture
u = vel_x
v = vel_y
[]
[]
[UserObjects]
[ins_rhie_chow_interpolator]
type = RhieChowMassFlux
p_diffusion_kernel = flow_p_diffusion
pressure = pressure
rho = rho_mixture
u = vel_x
v = vel_y
[]
[]
[Executioner]
type = SIMPLE
rhie_chow_user_object = 'ins_rhie_chow_interpolator'
# Systems
momentum_systems = 'u_system v_system'
pressure_system = 'pressure_system'
active_scalar_systems = 'phi_system'
momentum_equation_relaxation = 0.8
active_scalar_equation_relaxation = '0.7'
pressure_variable_relaxation = 0.3
# We need to converge the problem to show conservation
num_iterations = 200
pressure_absolute_tolerance = 1e-10
momentum_absolute_tolerance = 1e-10
active_scalar_absolute_tolerance = '1e-10'
momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
momentum_petsc_options_value = 'hypre boomeramg'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
pressure_petsc_options_value = 'hypre boomeramg'
active_scalar_petsc_options_iname = '-pc_type -pc_hypre_type'
active_scalar_petsc_options_value = 'hypre boomeramg'
momentum_l_abs_tol = 1e-13
pressure_l_abs_tol = 1e-13
active_scalar_l_abs_tol = 1e-13
momentum_l_tol = 0
pressure_l_tol = 0
active_scalar_l_tol = 0
# print_fields = true
continue_on_max_its = true
[]
[Outputs]
csv = true
[]
[Postprocessors]
[Re]
type = ParsedPostprocessor
expression = '10.0 * 2 * 1'
[]
[average_phase2]
type = ElementAverageValue
variable = phase_2
[]
[dp]
type = PressureDrop
boundary = 'left right'
downstream_boundary = right
pressure = pressure
upstream_boundary = left
[]
[max_phase2]
type = ElementExtremeValue
variable = phase_2
[]
[]
(modules/navier_stokes/test/tests/finite_volume/ins/mms/linear-segregated/2d-symmetric-vortex-rz/2d-symmetric-vortex-rz-spacedependent.i)
mu_ref = 1.2
mu_r = 0.1
mu_x = 0.2
rho_ref = 1.4
rho_r = 0.15
rho_x = 0.25
use_dev = true
advected_interp_method = 'average'
[Problem]
linear_sys_names = 'u_system v_system pressure_system'
previous_nl_solution_required = true
[]
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 2
ny = 2
[]
coord_type = 'RZ'
rz_coord_axis = x
[]
[UserObjects]
[rc]
type = RhieChowMassFlux
u = vel_x
v = vel_y
pressure = pressure
rho = rho_fun
p_diffusion_kernel = p_diffusion
pressure_projection_method = consistent
[]
[]
[Variables]
[vel_x]
type = MooseLinearVariableFVReal
initial_condition = 0.0
solver_sys = u_system
[]
[vel_y]
type = MooseLinearVariableFVReal
solver_sys = v_system
initial_condition = 0.0
[]
[pressure]
type = MooseLinearVariableFVReal
solver_sys = pressure_system
initial_condition = 0.0
[]
[]
[LinearFVKernels]
[u_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_x
advected_interp_method = ${advected_interp_method}
mu = mu_fun
u = vel_x
v = vel_y
momentum_component = 'x'
rhie_chow_user_object = 'rc'
use_nonorthogonal_correction = false
use_deviatoric_terms = ${use_dev}
[]
[v_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_y
advected_interp_method = ${advected_interp_method}
mu = mu_fun
u = vel_x
v = vel_y
momentum_component = 'y'
rhie_chow_user_object = 'rc'
use_nonorthogonal_correction = false
use_deviatoric_terms = ${use_dev}
[]
[u_pressure]
type = LinearFVMomentumPressure
variable = vel_x
pressure = pressure
momentum_component = 'x'
[]
[v_pressure]
type = LinearFVMomentumPressure
variable = vel_y
pressure = pressure
momentum_component = 'y'
[]
[u_forcing]
type = LinearFVSource
variable = vel_x
source_density = forcing_u
[]
[v_forcing]
type = LinearFVSource
variable = vel_y
source_density = forcing_v
[]
[v_viscous_forcing]
type = LinearFVRZViscousSource
variable = vel_y
mu = mu_fun
momentum_component = 'y'
u = vel_x
v = vel_y
use_deviatoric_terms = ${use_dev}
[]
[p_diffusion]
type = LinearFVAnisotropicDiffusion
variable = pressure
diffusion_tensor = 'Ainv'
use_nonorthogonal_correction = false
use_nonorthogonal_correction_on_boundary = false
[]
[HbyA_divergence]
type = LinearFVDivergence
variable = pressure
face_flux = 'HbyA'
force_boundary_execution = true
[]
[]
[LinearFVBCs]
[no-slip-wall-u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left right top'
variable = vel_x
functor = exact_u
[]
[no-slip-wall-v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left right top'
variable = vel_y
functor = exact_v
[]
[symmetry-u]
type = LinearFVVelocitySymmetryBC
boundary = 'bottom'
variable = vel_x
u = vel_x
v = vel_y
momentum_component = x
[]
[symmetry-v]
type = LinearFVVelocitySymmetryBC
boundary = 'bottom'
variable = vel_y
u = vel_x
v = vel_y
momentum_component = y
[]
[pressure-extrapolation]
type = LinearFVExtrapolatedPressureBC
boundary = 'top left right'
variable = pressure
use_two_term_expansion = true
[]
[pressure-symmetry]
type = LinearFVPressureSymmetryBC
boundary = 'bottom'
variable = pressure
HbyA_flux = 'HbyA'
[]
[]
[AuxVariables]
[vel_x_aux]
type = MooseLinearVariableFVReal
initial_condition = 0.0
[]
[vel_y_aux]
type = MooseLinearVariableFVReal
initial_condition = 0.0
[]
[pressure_aux]
type = MooseLinearVariableFVReal
initial_condition = 0.0
[]
[]
[AuxKernels]
[vel_x_function_aux]
type = FunctionAux
variable = vel_x_aux
function = exact_u
execute_on = TIMESTEP_END
[]
[vel_y_function_aux]
type = FunctionAux
variable = vel_y_aux
function = exact_v
execute_on = TIMESTEP_END
[]
[pressure_function_aux]
type = FunctionAux
variable = pressure_aux
function = exact_p
execute_on = TIMESTEP_END
[]
[]
[Functions]
# --------------------------------------------------
# Material property functions
# --------------------------------------------------
[rho_fun]
type = ParsedFunction
symbol_names = 'rho_ref rho_r rho_x'
symbol_values = '${rho_ref} ${rho_r} ${rho_x}'
expression = 'rho_ref + rho_x*x + rho_r*y'
[]
[mu_fun]
type = ParsedFunction
symbol_names = 'mu_ref mu_r mu_x'
symbol_values = '${mu_ref} ${mu_r} ${mu_x}'
expression = 'mu_ref + mu_x*x + mu_r*y'
[]
# --------------------------------------------------
# Convenience reciprocals
# --------------------------------------------------
[S]
type=ParsedFunction
symbol_names = 'rho_fun'
symbol_values = 'rho_fun'
expression='1.0/rho_fun'
[]
[S2]
type=ParsedFunction
symbol_names = 'rho_fun'
symbol_values = 'rho_fun'
expression='(1.0/rho_fun)^2'
[]
[S3]
type=ParsedFunction
symbol_names = 'rho_fun'
symbol_values = 'rho_fun'
expression='(1.0/rho_fun)^3'
[]
# --------------------------------------------------
# Building blocks
# --------------------------------------------------
[A]
type=ParsedFunction
expression='x^2*(1-x)^2'
[]
[Ap]
type=ParsedFunction
expression='2*x - 6*x^2 + 4*x^3'
[]
[App]
type=ParsedFunction
expression='2 - 12*x + 12*x^2'
[]
[Appp]
type=ParsedFunction
expression='-12 + 24*x'
[]
[Q]
type=ParsedFunction
expression='4*y^2 - 10*y^3 + 6*y^4'
[]
[Qp]
type=ParsedFunction
expression='8*y - 30*y^2 + 24*y^3'
[]
[Qpp]
type=ParsedFunction
expression='8 - 60*y + 72*y^2'
[]
[R]
type=ParsedFunction
expression='y^3 - 2*y^4 + y^5'
[]
[Rp]
type=ParsedFunction
expression='3*y^2 - 8*y^3 + 5*y^4'
[]
[Rpp]
type=ParsedFunction
expression='6*y - 24*y^2 + 20*y^3'
[]
# --------------------------------------------------
# Exact solutions
# --------------------------------------------------
[exact_u]
type=ParsedFunction
symbol_names = 'A Q rho_fun'
symbol_values = 'A Q rho_fun'
expression='A*Q / rho_fun'
[]
[exact_v]
type=ParsedFunction
symbol_names = 'Ap R rho_fun'
symbol_values = 'Ap R rho_fun'
expression='-Ap*R / rho_fun'
[]
[exact_p]
type=ParsedFunction
expression='x*y^2'
[]
# --------------------------------------------------
# First derivatives
# --------------------------------------------------
[ux]
type=ParsedFunction
symbol_names = 'A Ap Q rho_fun rho_x'
symbol_values = 'A Ap Q rho_fun ${rho_x}'
expression='(Ap*Q)/rho_fun - (A*Q*rho_x)/rho_fun^2'
[]
[ur]
type=ParsedFunction
symbol_names = 'A Q Qp rho_fun rho_r'
symbol_values = 'A Q Qp rho_fun ${rho_r}'
expression='(A*Qp)/rho_fun - (A*Q*rho_r)/rho_fun^2'
[]
[vx]
type=ParsedFunction
symbol_names = 'App Ap R rho_fun rho_x'
symbol_values = 'App Ap R rho_fun ${rho_x}'
expression='-(App*R)/rho_fun + (Ap*R*rho_x)/rho_fun^2'
[]
[vr]
type=ParsedFunction
symbol_names = 'Ap Rp R rho_fun rho_r'
symbol_values = 'Ap Rp R rho_fun ${rho_r}'
expression='-(Ap*Rp)/rho_fun + (Ap*R*rho_r)/rho_fun^2'
[]
# --------------------------------------------------
# Second derivatives
# --------------------------------------------------
[uxx]
type = ParsedFunction
symbol_names = 'rho_x App Q S Ap S2 A S3'
symbol_values = '${rho_x} App Q S Ap S2 A S3'
expression = 'App*Q*S - 2*Ap*Q*rho_x*S2 + 2*A*Q*(rho_x^2)*S3'
[]
[uxr]
type = ParsedFunction
symbol_names = 'rho_x rho_r Ap Qp S Q S2 A S3'
symbol_values = '${rho_x} ${rho_r} Ap Qp S Q S2 A S3'
expression = 'Ap*Qp*S - Ap*Q*rho_r*S2 - A*Qp*rho_x*S2 + 2*A*Q*(rho_x*rho_r)*S3'
[]
[urr]
type = ParsedFunction
symbol_names = 'rho_r A Qpp S Qp S2 Q S3'
symbol_values = '${rho_r} A Qpp S Qp S2 Q S3'
expression = 'A*Qpp*S - 2*A*Qp*rho_r*S2 + 2*A*Q*(rho_r^2)*S3'
[]
[vxx]
type = ParsedFunction
symbol_names = 'rho_x Appp R S App S2 Ap S3'
symbol_values = '${rho_x} Appp R S App S2 Ap S3'
expression = '-Appp*R*S + 2*App*R*rho_x*S2 - 2*Ap*R*(rho_x^2)*S3'
[]
[vxr]
type = ParsedFunction
symbol_names = 'rho_x rho_r App Rp S R Ap S2 S3'
symbol_values = '${rho_x} ${rho_r} App Rp S R Ap S2 S3'
expression = '-App*Rp*S + (App*R*rho_r + Ap*Rp*rho_x)*S2 - 2*Ap*R*(rho_x*rho_r)*S3'
[]
[vrr]
type = ParsedFunction
symbol_names = 'rho_r Ap Rpp S Rp S2 R S3'
symbol_values = '${rho_r} Ap Rpp S Rp S2 R S3'
expression = '-Ap*Rpp*S + 2*Ap*Rp*rho_r*S2 - 2*Ap*R*(rho_r^2)*S3'
[]
# --------------------------------------------------
# Derivatives of theta
# --------------------------------------------------
[theta]
type = ParsedFunction
symbol_names = 'ux vr exact_v'
symbol_values = 'ux vr exact_v'
expression = 'ux + vr + (exact_v/y)'
[]
[thetax]
type = ParsedFunction
symbol_names = 'uxx vxr vx'
symbol_values = 'uxx vxr vx'
expression = 'uxx + vxr + (vx/y)'
[]
[thetar]
type = ParsedFunction
symbol_names = 'uxr vrr vr exact_v'
symbol_values = 'uxr vrr vr exact_v'
expression = 'uxr + vrr + (vr/y) - (exact_v/(y^2))'
[]
# --------------------------------------------------
# Stress components
# --------------------------------------------------
[tau_xx]
type=ParsedFunction
symbol_names = 'ux theta mu_fun'
symbol_values = 'ux theta mu_fun'
expression='2*mu_fun*ux - (2.0/3.0)*mu_fun*theta'
[]
[tau_rr]
type=ParsedFunction
symbol_names = 'vr theta mu_fun'
symbol_values = 'vr theta mu_fun'
expression='2*mu_fun*vr - (2.0/3.0)*mu_fun*theta'
[]
[tau_xr]
type=ParsedFunction
symbol_names = 'ur vx mu_fun'
symbol_values = 'ur vx mu_fun'
expression='mu_fun*(ur + vx)'
[]
[tau_tt]
type=ParsedFunction
symbol_names = 'exact_v theta mu_fun'
symbol_values = 'exact_v theta mu_fun'
expression='2*mu_fun*(exact_v/y) - (2.0/3.0)*mu_fun*theta'
[]
# --------------------------------------------------
# Convective fluxes
# --------------------------------------------------
[Fxx]
type=ParsedFunction
symbol_names = 'exact_u rho_fun'
symbol_values = 'exact_u rho_fun'
expression='rho_fun*exact_u*exact_u'
[]
[Fxr]
type=ParsedFunction
symbol_names = 'exact_u exact_v rho_fun'
symbol_values = 'exact_u exact_v rho_fun'
expression='rho_fun*exact_u*exact_v'
[]
[Frx]
type=ParsedFunction
symbol_names = 'exact_u exact_v rho_fun'
symbol_values = 'exact_u exact_v rho_fun'
expression='rho_fun*exact_v*exact_u'
[]
[Frr]
type=ParsedFunction
symbol_names = 'exact_v rho_fun'
symbol_values = 'exact_v rho_fun'
expression='rho_fun*exact_v*exact_v'
[]
# --------------------------------------------------
# Stress derivatives
# --------------------------------------------------
[tau_xx_x]
type = ParsedFunction
symbol_names = 'mu_x ux mu_fun uxx theta thetax'
symbol_values = '${mu_x} ux mu_fun uxx theta thetax'
expression = '2*mu_x*ux + 2*mu_fun*uxx - (2.0/3.0)*(mu_x*theta + mu_fun*thetax)'
[]
[tau_xr_x]
type = ParsedFunction
symbol_names = 'mu_x ur vx mu_fun uxr vxx'
symbol_values = '${mu_x} ur vx mu_fun uxr vxx'
expression = 'mu_x*(ur + vx) + mu_fun*(uxr + vxx)'
[]
[tau_xr_r]
type = ParsedFunction
symbol_names = 'mu_r ur vx mu_fun urr vxr'
symbol_values = '${mu_r} ur vx mu_fun urr vxr'
expression = 'mu_r*(ur + vx) + mu_fun*(urr + vxr)'
[]
[tau_rr_r]
type = ParsedFunction
symbol_names = 'mu_r vr mu_fun vrr theta thetar'
symbol_values = '${mu_r} vr mu_fun vrr theta thetar'
expression = '2*mu_r*vr + 2*mu_fun*vrr - (2.0/3.0)*(mu_r*theta + mu_fun*thetar)'
[]
# --------------------------------------------------
# Conservative flux derivatives
# --------------------------------------------------
[Fxx_x]
type = ParsedFunction
symbol_names = 'rho_x A Ap Q S S2'
symbol_values = '${rho_x} A Ap Q S S2'
expression = '2*A*Ap*Q^2*S - A^2*Q^2*rho_x*S2'
[]
[Frx_r]
type = ParsedFunction
symbol_names = 'rho_r A Ap Qp R Q Rp S S2'
symbol_values = '${rho_r} A Ap Qp R Q Rp S S2'
expression = '-A*Ap*((Qp*R + Q*Rp)*S - Q*R*rho_r*S2)'
[]
[Fxr_x]
type = ParsedFunction
symbol_names = 'rho_x Ap A App Q R S S2'
symbol_values = '${rho_x} Ap A App Q R S S2'
expression = '-((Ap^2 + A*App)*Q*R*S - A*Ap*Q*R*rho_x*S2)'
[]
[Frr_r]
type = ParsedFunction
symbol_names = 'rho_r Ap R Rp S S2'
symbol_values = '${rho_r} Ap R Rp S S2'
expression = 'Ap^2*(2*R*Rp*S - R^2*rho_r*S2)'
[]
# --------------------------------------------------
# Pressure gradients
# --------------------------------------------------
[px]
type=ParsedFunction
expression='y^2'
[]
[pr]
type=ParsedFunction
expression='2*x*y'
[]
# --------------------------------------------------
# Forcing terms
# --------------------------------------------------
[forcing_u]
type = ParsedFunction
symbol_names = 'Fxx_x Frx Frx_r px tau_xx_x tau_xr tau_xr_r'
symbol_values = 'Fxx_x Frx Frx_r px tau_xx_x tau_xr tau_xr_r'
expression = 'Fxx_x + (Frx/y) + Frx_r + px - ( tau_xx_x + (tau_xr/y) + tau_xr_r )'
[]
[forcing_v]
type = ParsedFunction
symbol_names = 'Fxr_x Frr Frr_r pr tau_xr_x tau_rr tau_rr_r tau_tt'
symbol_values = 'Fxr_x Frr Frr_r pr tau_xr_x tau_rr tau_rr_r tau_tt'
expression = 'Fxr_x + (Frr/y) + Frr_r + pr - ( tau_xr_x + (tau_rr/y) + tau_rr_r - (tau_tt)/y )'
[]
[]
[Executioner]
type = SIMPLE
momentum_l_abs_tol = 1e-10
pressure_l_abs_tol = 1e-10
momentum_l_tol = 0
pressure_l_tol = 0
momentum_l_max_its = 500
pressure_l_max_its = 500
rhie_chow_user_object = 'rc'
momentum_systems = 'u_system v_system'
pressure_system = 'pressure_system'
momentum_equation_relaxation = 0.85
pressure_variable_relaxation = 1.0
num_iterations = 10000
pressure_absolute_tolerance = 1e-8
momentum_absolute_tolerance = 1e-8
momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
momentum_petsc_options_value = 'hypre boomeramg'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
pressure_petsc_options_value = 'hypre boomeramg'
print_fields = false
continue_on_max_its = true
pin_pressure = true
pressure_pin_value = 0.125
pressure_pin_point = '0.5 0.5 0.0'
[]
[Outputs]
[csv]
type = CSV
execute_on = TIMESTEP_END
[]
[]
[Postprocessors]
[h]
type = AverageElementSize
execute_on = TIMESTEP_END
[]
[L2u]
type = ElementL2FunctorError
approximate = vel_x
exact = exact_u
execute_on = TIMESTEP_END
[]
[L2v]
type = ElementL2FunctorError
approximate = vel_y
exact = exact_v
execute_on = TIMESTEP_END
[]
[L2p]
approximate = pressure
exact = exact_p
type = ElementL2FunctorError
execute_on = TIMESTEP_END
[]
[]
(modules/navier_stokes/test/tests/finite_volume/ins/mms/linear-segregated/2d-vortex/spacedependent_mu/sl.i)
rho = 1
advected_interp_method = 'average'
[Problem]
linear_sys_names = 'u_system v_system pressure_system'
previous_nl_solution_required = true
[]
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 2
ny = 2
[]
[]
[UserObjects]
[rc]
type = RhieChowMassFlux
u = vel_x
v = vel_y
pressure = pressure
rho = ${rho}
p_diffusion_kernel = p_diffusion
[]
[]
[Variables]
[vel_x]
type = MooseLinearVariableFVReal
initial_condition = 0.0
solver_sys = u_system
[]
[vel_y]
type = MooseLinearVariableFVReal
solver_sys = v_system
initial_condition = 0.0
[]
[pressure]
type = MooseLinearVariableFVReal
solver_sys = pressure_system
initial_condition = 0
[]
[]
[LinearFVKernels]
[u_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_x
advected_interp_method = ${advected_interp_method}
mu = 'mu'
u = vel_x
v = vel_y
momentum_component = 'x'
rhie_chow_user_object = 'rc'
use_nonorthogonal_correction = false
use_deviatoric_terms = false
[]
[v_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_y
advected_interp_method = ${advected_interp_method}
mu = 'mu'
u = vel_x
v = vel_y
momentum_component = 'y'
rhie_chow_user_object = 'rc'
use_nonorthogonal_correction = false
use_deviatoric_terms = false
[]
[u_pressure]
type = LinearFVMomentumPressure
variable = vel_x
pressure = pressure
momentum_component = 'x'
[]
[v_pressure]
type = LinearFVMomentumPressure
variable = vel_y
pressure = pressure
momentum_component = 'y'
[]
[u_forcing]
type = LinearFVSource
variable = vel_x
source_density = forcing_u
[]
[v_forcing]
type = LinearFVSource
variable = vel_y
source_density = forcing_v
[]
[p_diffusion]
type = LinearFVAnisotropicDiffusion
variable = pressure
diffusion_tensor = Ainv
use_nonorthogonal_correction = false
use_nonorthogonal_correction_on_boundary = false
[]
[HbyA_divergence]
type = LinearFVDivergence
variable = pressure
face_flux = HbyA
force_boundary_execution = true
[]
[]
[LinearFVBCs]
[no-slip-wall-u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left right top bottom'
variable = vel_x
functor = '0'
[]
[no-slip-wall-v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left right top bottom'
variable = vel_y
functor = '0'
[]
[pressure-extrapolation]
type = LinearFVExtrapolatedPressureBC
boundary = 'left right top bottom'
variable = pressure
use_two_term_expansion = true
[]
[]
[Functions]
[exact_u]
type = ParsedFunction
expression = 'x^2*(1-x)^2*(2*y-6*y^2+4*y^3)'
[]
[exact_v]
type = ParsedFunction
expression = '-y^2*(1-y)^2*(2*x-6*x^2+4*x^3)'
[]
[exact_p]
type = ParsedFunction
expression = 'x*(1-x)'
[]
[mu]
type = ParsedFunction
expression = '1+(x-1)*x*(y-1)*y'
[]
[forcing_u]
type = ParsedFunction
expression = '-(2*x-1)*y*(y-1)*(2*x-6*x^2+4*x^3)*(2*y-6*y^2+4*y^3)'
'-(1+x*(x-1)*y*(y-1))*(2*y-6*y^2+4*y^3)*(2-12*x+12*x^2)'
'-(2*y-1)*x*(x-1)*(x^2*(1-x)^2*(2-12*y+12*y^2))'
'-(1+x*(x-1)*y*(y-1))*(x^2*(1-x)^2*(-12+24*y))'
'+1-2*x+rho*4*x^3*y^2*(2*y^2-2*y+1)*(y-1)^2*(-1+2*x)*(x-1)^3'
symbol_names = 'rho'
symbol_values = '${rho}'
[]
[forcing_v]
type = ParsedFunction
expression = '(2*y-1)*x*(x-1)*(2*y-6*y^2+4*y^3)*(2*x-6*x^2+4*x^3)'
'+(1+x*(x-1)*y*(y-1))*(2-12*y+12*y^2)*(2*x-6*x^2+4*x^3)'
'+(2*x-1)*y*(y-1)*(y^2*(1-y)^2*(2-12*x+12*x^2))'
'+(1+x*(x-1)*y*(y-1))*(y^2*(1-y)^2*(-12+24*x))'
'+rho*4*y^3*x^2*(2*x^2-2*x+1)*(x-1)^2*(-1+2*y)*(y-1)^3'
symbol_names = 'rho'
symbol_values = '${rho}'
[]
[forcing_u_deviatoric]
type = ParsedFunction
expression = '-2*(2*x-1)*y*(y-1)*(2*x-6*x^2+4*x^3)*(2*y-6*y^2+4*y^3)'
'-2*(1+x*(x-1)*y*(y-1))*(2*y-6*y^2+4*y^3)*(2-12*x+12*x^2)'
'-(2*y-1)*x*(x-1)*(x^2*(1-x)^2*(2-12*y+12*y^2)-y^2*(1-y)^2*(2-12*x+12*x^2))'
'-(1+x*(x-1)*y*(y-1))*(x^2*(1-x)^2*(-12+24*y)-(2*y-6*y^2+4*y^3)*(2-12*x+12*x^2))'
'+1-2*x+rho*4*x^3*y^2*(2*y^2-2*y+1)*(y-1)^2*(-1+2*x)*(x-1)^3'
symbol_names = 'rho'
symbol_values = '${rho}'
[]
[forcing_v_deviatoric]
type = ParsedFunction
expression = '2*(2*y-1)*x*(x-1)*(2*y-6*y^2+4*y^3)*(2*x-6*x^2+4*x^3)'
'+2*(1+x*(x-1)*y*(y-1))*(2-12*y+12*y^2)*(2*x-6*x^2+4*x^3)'
'-(2*x-1)*y*(y-1)*(x^2*(1-x)^2*(2-12*y+12*y^2)-y^2*(1-y)^2*(2-12*x+12*x^2))'
'-(1+x*(x-1)*y*(y-1))*(-y^2*(1-y)^2*(-12+24*x)+(2*x-6*x^2+4*x^3)*(2-12*y+12*y^2))'
'+rho*4*y^3*x^2*(2*x^2-2*x+1)*(x-1)^2*(-1+2*y)*(y-1)^3'
symbol_names = 'rho'
symbol_values = '${rho}'
[]
[]
[Executioner]
type = SIMPLE
momentum_l_abs_tol = 1e-10
pressure_l_abs_tol = 1e-10
momentum_l_max_its = 30
pressure_l_max_its = 30
momentum_l_tol = 0.0
pressure_l_tol = 0.0
rhie_chow_user_object = 'rc'
momentum_systems = 'u_system v_system'
pressure_system = 'pressure_system'
momentum_equation_relaxation = 0.8
pressure_variable_relaxation = 0.3
num_iterations = 2000
pressure_absolute_tolerance = 1e-8
momentum_absolute_tolerance = 1e-8
momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
momentum_petsc_options_value = 'hypre boomeramg'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
pressure_petsc_options_value = 'hypre boomeramg'
print_fields = false
pin_pressure = true
pressure_pin_value = 0.25
pressure_pin_point = '0.5 0.5 0.0'
[]
[Outputs]
exodus = true
[csv]
type = CSV
execute_on = FINAL
[]
[]
[Postprocessors]
[h]
type = AverageElementSize
outputs = 'csv'
execute_on = FINAL
[]
[L2u]
type = ElementL2FunctorError
approximate = vel_x
exact = exact_u
outputs = 'csv'
execute_on = FINAL
[]
[L2v]
type = ElementL2FunctorError
approximate = vel_y
exact = exact_v
outputs = 'csv'
execute_on = FINAL
[]
[L2p]
approximate = pressure
exact = exact_p
type = ElementL2FunctorError
outputs = 'csv'
execute_on = FINAL
[]
[]
(modules/navier_stokes/test/tests/finite_volume/ins/channel-flow/linear-segregated/2d-symmetric/channel.i)
mu = 2.6
rho = 1.2
advected_interp_method = 'upwind'
u_inlet = 1.1
half_width = 0.2
[Mesh]
[mesh]
type = CartesianMeshGenerator
dim = 2
dx = '1.0'
dy = '${half_width}'
ix = '30'
iy = '15'
subdomain_id = '0'
[]
allow_renumbering = false
[]
[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
[]
[]
[LinearFVKernels]
inactive = v_viscous_forcing
[u_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_x
advected_interp_method = ${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 = ${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'
[]
[v_viscous_forcing]
type = LinearFVRZViscousSource
variable = vel_y
mu = ${mu}
momentum_component = 'y'
[]
[p_diffusion]
type = LinearFVAnisotropicDiffusion
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 = ${u_inlet}
[]
[inlet-v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left'
variable = vel_y
functor = '0.0'
[]
[walls-u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'top'
variable = vel_x
functor = 0.0
[]
[walls-v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'top'
variable = vel_y
functor = 0.0
[]
[symmetry-u]
type = LinearFVVelocitySymmetryBC
variable = vel_x
momentum_component = x
u = vel_x
v = vel_y
boundary = 'bottom'
[]
[symmetry-v]
type = LinearFVVelocitySymmetryBC
variable = vel_y
momentum_component = y
u = vel_x
v = vel_y
boundary = 'bottom'
[]
[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'
[]
[outlet_p]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'right'
variable = pressure
functor = 1.4
[]
[pressure-extrapolation]
type = LinearFVExtrapolatedPressureBC
boundary = 'top left'
variable = pressure
use_two_term_expansion = true
[]
[symmetry-p]
type = LinearFVPressureSymmetryBC
variable = pressure
boundary = 'bottom'
HbyA_flux = 'HbyA' # Functor created in the RhieChowMassFlux UO
[]
[]
[Functions]
[u_parabolic_profile]
type = ParsedFunction
expression = '3/2*${u_inlet}*(1 - pow(y/${half_width}, 2))' # Poiseuille profile
[]
[u_parabolic_profile_rz]
type = ParsedFunction
expression = '2*${u_inlet}*(1 - pow(y/${half_width}, 2))' # Cylindrical profile
[]
[]
[AuxVariables]
[vel_exact]
type = MooseLinearVariableFVReal
[]
[]
[AuxKernels]
[assign_vel_exact]
type = FunctionAux
variable = vel_exact
function = u_parabolic_profile
execute_on = TIMESTEP_END
[]
[]
[VectorPostprocessors]
[outlet_velocity_profile]
type = SideValueSampler
variable = 'vel_x vel_exact'
boundary = 'right'
sort_by = 'y'
execute_on = TIMESTEP_END
[]
[]
[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.5
pressure_variable_relaxation = 0.3
num_iterations = 1000
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
continue_on_max_its = true
[]
[Outputs]
csv = true
execute_on = timestep_end
[]
(modules/navier_stokes/test/tests/finite_volume/wcns/enthalpy_equation/enthalpy_equation.i)
H = 0.015 #halfwidth of the channel, 10 cm of channel height
L = 1
bulk_u = 0.01
p_ref = 101325.0
advected_interp_method = 'upwind'
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${L}
ymin = -${H}
ymax = ${H}
nx = 30
ny = 15
[]
[]
[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
solver_sys = u_system
initial_condition = ${bulk_u}
[]
[vel_y]
type = MooseLinearVariableFVReal
solver_sys = v_system
initial_condition = 0
[]
[pressure]
type = MooseLinearVariableFVReal
solver_sys = pressure_system
initial_condition = ${p_ref}
[]
[h]
type = MooseLinearVariableFVReal
solver_sys = energy_system
initial_condition = 44000 # 1900 is an approx of cp(T)
[]
[]
[AuxVariables]
[rho_var]
type = MooseLinearVariableFVReal
[]
[cp_var]
type = MooseLinearVariableFVReal
[]
[mu_var]
type = MooseLinearVariableFVReal
[]
[k_var]
type = MooseLinearVariableFVReal
[]
[T]
type = MooseLinearVariableFVReal
initial_condition = 777.
[]
[]
[LinearFVKernels]
[u_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_x
mu = 'mu'
momentum_component = 'x'
use_nonorthogonal_correction = false
advected_interp_method = ${advected_interp_method}
rhie_chow_user_object = 'rc'
u = vel_x
v = vel_y
[]
[u_pressure]
type = LinearFVMomentumPressure
variable = vel_x
pressure = pressure
momentum_component = 'x'
[]
[v_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_y
mu = 'mu'
momentum_component = 'y'
use_nonorthogonal_correction = false
advected_interp_method = ${advected_interp_method}
rhie_chow_user_object = 'rc'
u = vel_x
v = vel_y
[]
[v_pressure]
type = LinearFVMomentumPressure
variable = vel_y
pressure = pressure
momentum_component = 'y'
[]
[p_diffusion]
type = LinearFVAnisotropicDiffusion
variable = pressure
diffusion_tensor = Ainv
use_nonorthogonal_correction = false
[]
[HbyA_divergence]
type = LinearFVDivergence
variable = pressure
face_flux = HbyA
force_boundary_execution = true
[]
[temp_conduction]
type = LinearFVDiffusion
diffusion_coeff = 'alpha'
variable = h
[]
[temp_advection]
type = LinearFVEnergyAdvection
variable = h
advected_interp_method = ${advected_interp_method}
rhie_chow_user_object = 'rc'
[]
[]
[LinearFVBCs]
[inlet_u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left'
variable = vel_x
functor = ${bulk_u} #${bulk_u} #'fully_developed_velocity'
[]
[inlet-v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left'
variable = vel_y
functor = 0
[]
[inlet_h]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = h
boundary = 'left'
functor = h_from_p_T # ${fparse 1900.*860.}
[]
[inlet_T]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = T
boundary = 'left'
functor = 860.
[]
[walls-u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = vel_x
boundary = 'top bottom'
functor = 0.
[]
[walls-v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = vel_y
boundary = 'top bottom'
functor = 0.
[]
[walls_h]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = h
boundary = 'top bottom'
functor = h_from_p_T # ${fparse 1900. * 950}
[]
[walls_T]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = T
boundary = 'top bottom'
functor = 950.
[]
[walls_p]
type = LinearFVExtrapolatedPressureBC
boundary = 'top bottom'
variable = pressure
use_two_term_expansion = false
[]
[outlet_p]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'right'
variable = pressure
functor = ${p_ref}
[]
[outlet_h]
type = LinearFVAdvectionDiffusionOutflowBC
variable = h
use_two_term_expansion = false
boundary = 'right'
[]
[outlet_u]
type = LinearFVAdvectionDiffusionOutflowBC
variable = vel_x
use_two_term_expansion = false
boundary = right
[]
[outlet_v]
type = LinearFVAdvectionDiffusionOutflowBC
variable = vel_y
use_two_term_expansion = false
boundary = right
[]
[]
[FluidProperties]
[lead]
type = LeadFluidProperties
[]
[]
[FunctorMaterials]
[fluid_props_to_mat_props]
type = GeneralFunctorFluidProps
fp = lead
pressure = ${p_ref}
T_fluid = 'T'
speed = 1
porosity = 1
characteristic_length = 1
[]
[alpha]
type = ADParsedFunctorMaterial
property_name = 'alpha'
functor_names = 'k cp'
expression = 'k/cp'
[]
[enthalpy_material]
type = LinearFVEnthalpyFunctorMaterial
pressure = ${p_ref}
T_fluid = T
h = h
fp = lead
[]
[]
[AuxKernels]
[rho_out]
type = FunctorAux
functor = 'rho'
variable = 'rho_var'
execute_on = 'NONLINEAR'
[]
[cp_out]
type = FunctorAux
functor = 'cp'
variable = 'cp_var'
execute_on = 'NONLINEAR'
[]
[mu_out]
type = FunctorAux
functor = 'mu'
variable = 'mu_var'
execute_on = 'NONLINEAR'
[]
[k_out]
type = FunctorAux
functor = 'k'
variable = 'k_var'
execute_on = 'NONLINEAR'
[]
[T_from_h_functor]
type = FunctorAux
functor = 'T_from_p_h'
variable = 'T'
execute_on = 'NONLINEAR'
[]
[]
[Executioner]
type = SIMPLE
momentum_l_abs_tol = 1e-6
pressure_l_abs_tol = 1e-6
energy_l_abs_tol = 1e-8
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.7
pressure_variable_relaxation = 0.3
energy_equation_relaxation = 0.9
num_iterations = 200
pressure_absolute_tolerance = 1e-6
momentum_absolute_tolerance = 1e-6
energy_absolute_tolerance = 1e-6
print_fields = false
momentum_l_max_its = 1000
momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
momentum_petsc_options_value = 'hypre boomeramg'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
pressure_petsc_options_value = 'hypre boomeramg'
energy_petsc_options_iname = '-pc_type -pc_hypre_type'
energy_petsc_options_value = 'hypre boomeramg'
continue_on_max_its = true
[]
[Outputs]
exodus = true
execute_on = 'TIMESTEP_BEGIN FINAL'
[out]
type = Checkpoint
execute_on = 'TIMESTEP_END'
[]
[]