- 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
- functorThe functor for this boundary condition. 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 functor for this boundary condition. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
- variableThe name of the variable that this boundary condition applies to
C++ Type:LinearVariableName
Unit:(no unit assumed)
Controllable:No
Description:The name of the variable that this boundary condition applies to
LinearFVAdvectionDiffusionFunctorDirichletBC
Description
LinearFVAdvectionDiffusionFunctorDirichletBC will specify the value of a field at the boundary. The value will be determined by a Functor (through the "functor" parameter).
This boundary condition should only be used for problems which involve advection and/or diffusion problems.
Example Syntax
In this example the functor is defined using a ParsedFunction.
[LinearFVBCs<<<{"href": "../../syntax/LinearFVBCs/index.html"}>>>]
[dir]
type = LinearFVAdvectionDiffusionFunctorDirichletBC<<<{"description": "Adds a dirichlet BC which can be used for the assembly of linear finite volume system and whose face values are determined using a functor. This kernel is only designed to work with advection-diffusion problems.", "href": "LinearFVAdvectionDiffusionFunctorDirichletBC.html"}>>>
variable<<<{"description": "The name of the variable that this boundary condition applies to"}>>> = u
boundary<<<{"description": "The list of boundary IDs from the mesh where this object applies"}>>> = "left right top bottom"
functor<<<{"description": "The functor for this boundary condition. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number."}>>> = analytic_solution
[]
[](test/tests/linearfvkernels/diffusion/diffusion-2d.i)Input 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
- (test/tests/linearfvkernels/diffusion/diffusion-1d_neumann.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/turbulence/channel/linear-segregated/channel_ERCOFTAC.i)
- (test/tests/linearfvbcs/scalar_symmetry/advection-1d-symmetry.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/cht/bulk_heat_transfer/flow-around-square-linear.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/channel-flow/linear-segregated/2d/2d-velocity-pressure.i)
- (test/tests/time_integrators/implicit-euler/ie-linearfv.i)
- (test/tests/vectorpostprocessors/side_value_sampler/side_value_sampler_fv.i)
- (modules/heat_transfer/test/tests/radiation_participating_media/rad_T_coupled_medium_1d.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/turbulence/channel/linear-segregated/channel_heated-physics.i)
- (test/tests/multisystem/picard/linearfv_nonlinearfv/same_input.i)
- (test/tests/linearfvkernels/anisotropic-diffusion/anisotropic-diffusion-2d.i)
- (test/tests/postprocessors/side_diffusive_flux_integral/side_diffusive_flux_integral_linear_fv.i)
- (modules/navier_stokes/test/tests/finite_volume/wcns/enthalpy_equation/1d_test_h_fp.i)
- (test/tests/postprocessors/linearfv_flux_integral/linearfv_flux_integral.i)
- (test/tests/linearfvkernels/diffusion/diffusion-1d.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/turbulence/channel/linear-segregated/channel_ERCOFTAC_mu_eff.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/turbulence/lid-driven/linear-segregated/lid-driven-turb-std-wall.i)
- (test/tests/linearfvbcs/scalar_symmetry/advection-2d-symmetry.i)
- (test/tests/linearfvkernels/diffusion-reaction-advection/advection-diffusion-reaction-1d.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/turbulence/lid-driven/linear-segregated/lid-driven-turb-non-eq-wall.i)
- (test/tests/variables/linearfv/diffusion-1d-aux.i)
- (test/tests/linearfvkernels/advection/diagonal-step-2d.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/cht/conjugate_heat_transfer/cht_neu-dir.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/cht/conjugate_heat_transfer/cht_rob-rob.i)
- (test/tests/linearfvbcs/robin/diffusion-2d-robin.i)
- (test/tests/linearfvkernels/diffusion-reaction-advection/advection-diffusion-reaction-2d.i)
- (test/tests/linearfvbcs/robin/diffusion-1d-robin.i)
- (modules/heat_transfer/test/tests/radiation_participating_media/rad_T_coupled_medium_1d_T.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/channel-flow/SIMPLEC/3d/3d-velocity-pressure.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/cht/bulk_heat_transfer/flow-around-square-linear-fluidonly.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/turbulence/bfs/linear-segregated/BFS_ERCOFTAC.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/mms/linear-segregated/2d-vortex/2d-vortex.i)
- (test/tests/multiapps/linearfv_nonlinearfv/linearfv.i)
- (test/tests/linearfvkernels/diffusion/diffusion-2d_neumann.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/channel-flow/linear-segregated/2d/rotated-channel.i)
- (test/tests/time_steppers/iteration_adaptive/adapt_linear_systems.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/natural_convection/linear_segregated/2d/diff_heated_cavity_linear_segregated.i)
- (test/tests/linearfvbcs/scalar_symmetry/diffusion-2d-symmetry.i)
- (modules/heat_transfer/test/tests/linearfvbcs/linear_fv_functor_radiative_bc/linear_fv_functor_radiative_bc.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/turbulence/channel/linear-segregated/channel_ERCOFTAC-physics.i)
- (test/tests/multisystem/restore_multiapp/parent.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/turbulence/channel/linear-segregated/channel_ERCOFTAC_symmetric.i)
- (modules/navier_stokes/test/tests/finite_volume/wcns/enthalpy_equation/enthalpy_equation.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/natural_convection/linear_segregated/2d/diff_heated_cavity_linear_buoyancy.i)
- (test/tests/linearfvkernels/block-restriction/block-restricted-diffusion-react.i)
- (test/tests/linearfvkernels/advection/diagonal-step-2d-delaunay.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/radiation_participating_media/p1_radiation_cht_SIMPLE.i)
- (modules/navier_stokes/test/tests/finite_volume/two_phase/mixture_model/segregated/rayleigh-bernard-two-phase-physics.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/mms/linear-segregated/2d-vortex/spacedependent_mu/sl.i)
- (test/tests/linearfvkernels/advection/advection-2d-rz.i)
- (test/tests/time_integrators/bdf2/linearfv.i)
- (test/tests/tag/tag-linearfv.i)
- (modules/heat_transfer/test/tests/linearfvbcs/linear_fv_functor_radiative_bc/linear_fv_functor_radiative_bc_mms_2d.i)
- (test/tests/variables/linearfv/diffusion-1d-pp.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/channel-flow/segregated-comparison/segregated-linear.i)
- (test/tests/linearfvbcs/robin/advection-2d-robin.i)
- (test/tests/linearfvkernels/block-restriction/block-restricted-diffusion-variable-functor-bc.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/turbulence/channel/linear-segregated-transient/channel_ERCOFTAC.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/channel-flow/linear-segregated/3d/3d-velocity-pressure.i)
- (test/tests/multisystem/restore_multiapp/sub.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/channel-flow/linear-segregated/2d-symmetric/channel.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/turbulence/channel/linear-segregated/channel_scalars-physics.i)
- (modules/navier_stokes/test/tests/finite_volume/wcns/enthalpy_equation/1d_test_h.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/turbulence/bfs/linear-segregated-transient/BFS_ERCOFTAC.i)
- (test/tests/linearfvkernels/diffusion/diffusion-2d-rz.i)
- (test/tests/linearfvkernels/advection/advection-2d.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/channel-flow/SIMPLEC/2d/2d-velocity-pressure.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/lid-driven/linear-segregated/lid-driven-segregated.i)
- (test/tests/transfers/multiapp_copy_transfer/linear_sys_to_aux/linear_sub.i)
- (test/tests/linearfvkernels/block-restriction/block-restricted-adr.i)
- (test/tests/controls/conditional_functional_enable/linear-fv-bc-control-switch.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/channel-flow/linear-segregated/2d-heated/fluid.i)
- (modules/navier_stokes/test/tests/postprocessors/flow_rates/conservation_LinearFV.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/turbulence/block-restricted/block-ke.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/mms/linear-segregated/2d-symmetric-vortex/2d-symmetric-vortex.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/channel-flow/linear-segregated/2d-scalar/channel.i)
- (modules/navier_stokes/test/tests/finite_volume/two_phase/mixture_model/segregated/lid-driven-two-phase-physics.i)
- (modules/heat_transfer/test/tests/linearfvbcs/linear_fv_functor_radiative_bc/linear_fv_functor_radiative_bc_mms.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/mms/linear-segregated/2d-symmetric-vortex-rz/2d-symmetric-vortex-rz.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/channel-flow/linear-segregated/2d/2d-boussinesq-transient.i)
- (test/tests/linearfvkernels/block-restriction/block-restricted-diffusion.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/channel-flow/linear-segregated/2d/2d-boussinesq.i)
- (test/tests/linearfvkernels/diffusion/diffusion-2d.i)
- (test/tests/linearfvbcs/scalar_symmetry/diffusion-1d-symmetry.i)
- (test/tests/linearfvkernels/advection/advection-1d.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/channel-flow/linear-segregated/steady-transient-compare/common-blocks.i)
- (test/tests/outputs/debug/show_execution_linear_fv_flux.i)
Child Objects
functor
C++ Type:MooseFunctorName
Unit:(no unit assumed)
Controllable:No
Description:The functor for this boundary condition. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number.
(test/tests/linearfvkernels/diffusion/diffusion-2d.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 2
ny = 1
ymax = 0.5
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
[]
[]
[LinearFVKernels]
[diffusion]
type = LinearFVDiffusion
variable = u
diffusion_coeff = coeff_func
use_nonorthogonal_correction = false
[]
[source]
type = LinearFVSource
variable = u
source_density = source_func
[]
[]
[LinearFVBCs]
[dir]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "left right top bottom"
functor = analytic_solution
[]
[]
[Functions]
[coeff_func]
type = ParsedFunction
expression = '1+0.5*x*y'
[]
[source_func]
type = ParsedFunction
expression = '2*(1.5-y*y)+2*x*y*(1.5-y*y)+2*(1.5-x*x)+2*x*y*(1.5-x*x)'
[]
[analytic_solution]
type = ParsedFunction
expression = '(1.5-x*x)*(1.5-y*y)'
[]
[]
[Postprocessors]
[h]
type = AverageElementSize
execute_on = FINAL
[]
[error]
type = ElementL2FunctorError
approximate = u
exact = analytic_solution
execute_on = FINAL
[]
[]
[Convergence]
[linear]
type = IterationCountConvergence
max_iterations = 1
converge_at_max_iterations = true
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-10
multi_system_fixed_point=true
multi_system_fixed_point_convergence=linear
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
[]
[]
(test/tests/linearfvkernels/diffusion/diffusion-1d_neumann.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
nx = 2
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
[]
[]
[LinearFVKernels]
[diffusion]
type = LinearFVDiffusion
variable = u
diffusion_coeff = coeff_func
[]
[source]
type = LinearFVSource
variable = u
source_density = source_func
[]
[]
[LinearFVBCs]
[dir]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "right"
functor = analytic_solution
[]
[neu]
type = LinearFVAdvectionDiffusionFunctorNeumannBC
variable = u
boundary = "left"
functor = analytic_solution_neumann
[]
[]
[Functions]
[coeff_func]
type = ParsedFunction
expression = '0.5*x'
[]
[source_func]
type = ParsedFunction
expression = '2*x'
[]
[analytic_solution]
type = ParsedFunction
expression = '1-x*x'
[]
[analytic_solution_neumann]
type = ParsedFunction
expression = '-(0.5*x)*(-2*x)'
[]
[]
[Postprocessors]
[h]
type = AverageElementSize
execute_on = FINAL
[]
[error]
type = ElementL2FunctorError
approximate = u
exact = analytic_solution
execute_on = FINAL
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-10
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
[]
[]
(modules/navier_stokes/test/tests/finite_volume/ins/turbulence/channel/linear-segregated/channel_ERCOFTAC.i)
!include header_and_mesh.i
[Problem]
linear_sys_names = 'u_system v_system pressure_system TKE_system TKED_system'
previous_nl_solution_required = true
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
advected_interp_method = ${advected_interp_method}
[]
[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 = ${bulk_u}
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
advected_interp_method = ${advected_interp_method}
# we use mu_eff directly here to be able to have deviatoric term for both mu and mu_t
mu = 'mu_eff'
u = vel_x
v = vel_y
momentum_component = 'x'
rhie_chow_user_object = 'rc'
use_nonorthogonal_correction = false
use_deviatoric_terms = yes
[]
[u_pressure]
type = LinearFVMomentumPressure
variable = vel_x
pressure = pressure
momentum_component = 'x'
[]
[v_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_y
advected_interp_method = ${advected_interp_method}
mu = 'mu_eff'
u = vel_x
v = vel_y
momentum_component = 'y'
rhie_chow_user_object = 'rc'
use_nonorthogonal_correction = false
use_deviatoric_terms = yes
[]
[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]
[inlet-u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left'
variable = vel_x
functor = '${bulk_u}'
[]
[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_u]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = 'right'
variable = vel_x
use_two_term_expansion = false
[]
[outlet_v]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = 'right'
variable = vel_y
use_two_term_expansion = false
[]
[outlet_p]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'right'
variable = pressure
functor = 0.0
[]
[inlet_TKE]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left'
variable = TKE
functor = '${k_init}'
[]
[outlet_TKE]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = 'right'
variable = TKE
use_two_term_expansion = false
[]
[inlet_TKED]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left'
variable = TKED
functor = '${eps_init}'
[]
[outlet_TKED]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = 'right'
variable = TKED
use_two_term_expansion = false
[]
[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}'
[]
[]
[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
[]
[]
[FunctorMaterials]
[compute_mu_eff]
type = FunctorEffectiveDynamicViscosity
property_name = mu_eff
mu = ${mu}
mu_t = mu_t
mu_t_inverse_factor = 1
execute_on = 'ALWAYS'
[]
[]
!include executioner_regular_channel.i
variables_to_sample = 'vel_x vel_y pressure_over_density TKE TKED'
!include postprocessing.i
(test/tests/linearfvbcs/scalar_symmetry/advection-1d-symmetry.i)
vel = 0.1
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
nx = 2
xmin = 0
xmax = ${fparse pi}
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
[]
[]
[FVInterpolationMethods]
[average]
type = FVGeometricAverage
[]
[]
[Functions]
[u_exact]
type = ParsedFunction
expression = 'cos(x)'
[]
[source_fn]
type = ParsedFunction
expression = '-${vel}*sin(x)'
[]
[]
[LinearFVKernels]
[advection]
type = LinearFVAdvection
variable = u
velocity = "${vel} 0 0"
advected_interp_method_name = average
[]
[source]
type = LinearFVSource
variable = u
source_density = source_fn
[]
[]
[LinearFVBCs]
[rob_l]
type = LinearFVAdvectionDiffusionScalarSymmetryBC
variable = u
boundary = "left"
use_two_term_expansion = true
[]
[dirichlet]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "right"
functor = u_exact
[]
[]
[Postprocessors]
[h]
type = AverageElementSize
execute_on = FINAL
[]
[error]
type = ElementL2FunctorError
approximate = u
exact = u_exact
execute_on = FINAL
[]
[]
[Convergence]
[linear]
type = IterationCountConvergence
max_iterations = 4
converge_at_max_iterations = true
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-7
petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_shift_amount'
petsc_options_value = 'lu NONZERO 1e-10'
linear_convergence = linear
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
[]
[]
(modules/navier_stokes/test/tests/finite_volume/ins/cht/bulk_heat_transfer/flow-around-square-linear.i)
mu = 0.01
rho = 1.1
k = 0.0005
cp = 10
k_s = 3.0
h_conv = 5
power_density = 10000
advected_interp_method = 'upwind'
[Mesh]
[generated_mesh]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 10
xmin = 0
ymin = 0
ymax = 0.1
xmax = 0.1
[]
[subdomain1]
type = SubdomainBoundingBoxGenerator
input = generated_mesh
block_name = subdomain1
bottom_left = '0.04 0.04 0'
block_id = 1
top_right = '0.06 0.06 0'
[]
[interface]
type = SideSetsBetweenSubdomainsGenerator
input = subdomain1
primary_block = 0
paired_block = 1
new_boundary = interface
[]
[]
[Problem]
linear_sys_names = 'u_system v_system pressure_system energy_system solid_energy_system'
previous_nl_solution_required = true
[]
[UserObjects]
[rc]
type = RhieChowMassFlux
u = vel_x
v = vel_y
pressure = pressure
rho = ${rho}
p_diffusion_kernel = p_diffusion
block = 0
[]
[]
[Variables]
[vel_x]
type = MooseLinearVariableFVReal
initial_condition = 0.1
solver_sys = u_system
block = 0
[]
[vel_y]
type = MooseLinearVariableFVReal
solver_sys = v_system
initial_condition = 0.01
block = 0
[]
[pressure]
type = MooseLinearVariableFVReal
solver_sys = pressure_system
initial_condition = 0.2
block = 0
[]
[T_fluid]
type = MooseLinearVariableFVReal
solver_sys = energy_system
initial_condition = 300
block = 0
[]
[T_solid]
type = MooseLinearVariableFVReal
solver_sys = solid_energy_system
initial_condition = 500
block = 1
[]
[]
[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 = true
[]
[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 = true
[]
[u_pressure]
type = LinearFVMomentumPressure
variable = vel_x
pressure = pressure
momentum_component = 'x'
[]
[v_pressure]
type = LinearFVMomentumPressure
variable = vel_y
pressure = pressure
momentum_component = 'y'
[]
[p_diffusion]
type = LinearFVAnisotropicDiffusion
variable = pressure
diffusion_tensor = Ainv
use_nonorthogonal_correction = true
[]
[HbyA_divergence]
type = LinearFVDivergence
variable = pressure
face_flux = HbyA
force_boundary_execution = true
[]
[h_advection]
type = LinearFVEnergyAdvection
variable = T_fluid
advected_quantity = temperature
cp = ${cp}
advected_interp_method = ${advected_interp_method}
rhie_chow_user_object = 'rc'
[]
[conduction]
type = LinearFVDiffusion
variable = T_fluid
diffusion_coeff = ${k}
use_nonorthogonal_correction = true
[]
[solid-conduction]
type = LinearFVDiffusion
variable = T_solid
diffusion_coeff = ${k_s}
use_nonorthogonal_correction = true
[]
[solid-source]
type = LinearFVSource
variable = T_solid
source_density = ${power_density}
[]
[]
[LinearFVBCs]
[inlet-u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left'
variable = vel_x
functor = '0.1'
[]
[inlet-v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left'
variable = vel_y
functor = '0.0'
[]
[walls-u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'top bottom interface'
variable = vel_x
functor = 0.0
[]
[walls-v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'top bottom interface'
variable = vel_y
functor = 0.0
[]
[outlet_p]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'right'
variable = pressure
functor = 1.4
[]
[outlet_u]
type = LinearFVAdvectionDiffusionOutflowBC
variable = vel_x
use_two_term_expansion = false
boundary = right
[]
[outlet_v]
type = LinearFVAdvectionDiffusionOutflowBC
variable = vel_y
use_two_term_expansion = false
boundary = right
[]
[inlet_T]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = T_fluid
functor = 300
boundary = 'left'
[]
[walls_T]
type = LinearFVAdvectionDiffusionFunctorNeumannBC
variable = T_fluid
functor = 0.0
boundary = 'top bottom'
[]
[outlet_T]
type = LinearFVAdvectionDiffusionOutflowBC
variable = T_fluid
use_two_term_expansion = false
boundary = right
[]
[fluid_solid]
type = LinearFVConvectiveHeatTransferBC
variable = T_fluid
T_solid = T_solid
T_fluid = T_fluid
boundary = interface
h = ${h_conv}
[]
[solid_fluid]
type = LinearFVConvectiveHeatTransferBC
variable = T_solid
T_solid = T_solid
T_fluid = T_fluid
boundary = interface
h = ${h_conv}
[]
[]
[FunctorMaterials]
[rhocpT]
property_name = 'rhocpT'
type = ParsedFunctorMaterial
functor_names = 'T_fluid'
expression = '${rho}*${cp}*T_fluid'
[]
[]
[Postprocessors]
[h_in]
type = VolumetricFlowRate
boundary = left
vel_x = vel_x
vel_y = vel_y
rhie_chow_user_object = rc
advected_quantity = 'rhocpT'
subtract_mesh_velocity = false
[]
[h_out]
type = VolumetricFlowRate
boundary = right
vel_x = vel_x
vel_y = vel_y
rhie_chow_user_object = rc
advected_quantity = 'rhocpT'
advected_interp_method = upwind
subtract_mesh_velocity = false
[]
[power]
type = ElementIntegralFunctorPostprocessor
functor = ${power_density}
block = 1
[]
[]
[Executioner]
type = SIMPLE
momentum_l_abs_tol = 1e-13
pressure_l_abs_tol = 1e-13
energy_l_abs_tol = 1e-13
solid_energy_l_abs_tol = 1e-13
momentum_l_tol = 0
pressure_l_tol = 0
energy_l_tol = 0
solid_energy_l_tol = 0
rhie_chow_user_object = 'rc'
momentum_systems = 'u_system v_system'
pressure_system = 'pressure_system'
energy_system = 'energy_system'
solid_energy_system = 'solid_energy_system'
momentum_equation_relaxation = 0.8
energy_equation_relaxation = 1.0
pressure_variable_relaxation = 0.3
num_iterations = 1000
pressure_absolute_tolerance = 1e-10
momentum_absolute_tolerance = 1e-10
energy_absolute_tolerance = 1e-10
solid_energy_absolute_tolerance = 1e-10
momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
momentum_petsc_options_value = 'hypre boomeramg'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
pressure_petsc_options_value = 'hypre boomeramg'
energy_petsc_options_iname = '-pc_type -pc_hypre_type'
energy_petsc_options_value = 'hypre boomeramg'
solid_energy_petsc_options_iname = '-pc_type -pc_hypre_type'
solid_energy_petsc_options_value = 'hypre boomeramg'
print_fields = false
continue_on_max_its = true
[]
[Outputs]
exodus = true
execute_on = timestep_end
[]
(modules/navier_stokes/test/tests/finite_volume/ins/channel-flow/linear-segregated/2d/2d-velocity-pressure.i)
mu = 2.6
rho = 1.0
advected_interp_method = 'average'
[Mesh]
[mesh]
type = CartesianMeshGenerator
dim = 2
dx = '0.3'
dy = '0.3'
ix = '3'
iy = '3'
[]
[]
[Problem]
linear_sys_names = 'u_system v_system pressure_system'
previous_nl_solution_required = true
[]
[UserObjects]
[rc]
type = RhieChowMassFlux
u = vel_x
v = vel_y
pressure = pressure
rho = ${rho}
p_diffusion_kernel = p_diffusion
[]
[]
[Variables]
[vel_x]
type = MooseLinearVariableFVReal
initial_condition = 0.5
solver_sys = u_system
[]
[vel_y]
type = MooseLinearVariableFVReal
solver_sys = v_system
initial_condition = 0.0
[]
[pressure]
type = MooseLinearVariableFVReal
solver_sys = pressure_system
initial_condition = 0.2
[]
[]
[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]
[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
[]
[]
[Executioner]
type = SIMPLE
momentum_l_abs_tol = 1e-10
pressure_l_abs_tol = 1e-10
momentum_l_tol = 0
pressure_l_tol = 0
rhie_chow_user_object = 'rc'
momentum_systems = 'u_system v_system'
pressure_system = 'pressure_system'
momentum_equation_relaxation = 0.8
pressure_variable_relaxation = 0.3
num_iterations = 100
pressure_absolute_tolerance = 1e-10
momentum_absolute_tolerance = 1e-10
momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
momentum_petsc_options_value = 'hypre boomeramg'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
pressure_petsc_options_value = 'hypre boomeramg'
print_fields = false
[]
[Outputs]
exodus = true
[]
(test/tests/time_integrators/implicit-euler/ie-linearfv.i)
###########################################################
# This is a simple test with a time-dependent problem
# demonstrating the use of the TimeIntegrator system.
#
# Testing a solution that is second order in space
# and first order in time
#
# @Requirement F1.30
###########################################################
[Mesh]
type = GeneratedMesh
dim = 2
xmin = -1
xmax = 1
ymin = -1
ymax = 1
nx = 10
ny = 10
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 0.0
[]
[]
[Functions]
[forcing_fn]
type = ParsedFunction
expression = ((x*x)+(y*y))-(4*t)
[]
[exact_fn]
type = ParsedFunction
expression = t*((x*x)+(y*y))
[]
[]
[LinearFVKernels]
[ie]
type = LinearFVTimeDerivative
variable = u
[]
[diff]
type = LinearFVDiffusion
variable = u
[]
[source]
type = LinearFVSource
variable = u
source_density = forcing_fn
[]
[]
[LinearFVBCs]
[all]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = '0 1 2 3'
functor = exact_fn
[]
[]
[Postprocessors]
[l2_err]
type = ElementL2Error
variable = u
function = exact_fn
[]
[]
[Executioner]
type = Transient
system_names = u_sys
l_tol = 1e-10
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
# Test of the TimeIntegrator System
scheme = 'implicit-euler'
start_time = 0.0
num_steps = 5
dt = 0.25
[]
[Outputs]
exodus = true
[]
(test/tests/vectorpostprocessors/side_value_sampler/side_value_sampler_fv.i)
[Mesh]
[mesh]
type = CartesianMeshGenerator
dim = 2
dx = '0.5 0.5'
dy = '1'
ix = '5 5'
iy = '10'
subdomain_id = '1 1'
[]
# Limited to 1 side to avoid inconsistencies in parallel
[internal_sideset]
type = ParsedGenerateSideset
combinatorial_geometry = 'y<0.51 & y>0.49 & x<0.11'
new_sideset_name = 'center'
input = 'mesh'
[]
# this keeps numbering continuous so tests dont fail on different ids in CSV
allow_renumbering = false
[]
[Problem]
nl_sys_names = 'u_sys'
linear_sys_names = 'v_sys'
[]
[Variables]
[u]
type = MooseVariableFVReal
solver_sys = u_sys
[]
[v]
type = MooseLinearVariableFVReal
solver_sys = v_sys
[]
[]
[FVKernels]
[diff]
type = FVDiffusion
variable = u
coeff = 1.0
[]
[]
[LinearFVKernels]
[diff]
type = LinearFVDiffusion
variable = v
[]
[]
[FVBCs]
[all]
type = FVFunctorDirichletBC
variable = u
boundary = 'top bottom left right'
functor = linear_x
[]
[]
[LinearFVBCs]
[all]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = v
boundary = 'top bottom left right'
functor = linear_x
[]
[]
[Functions]
[linear_x]
type = ParsedFunction
expression = '5*x'
[]
[]
[VectorPostprocessors]
[side_sample]
type = SideValueSampler
variable = 'u v'
boundary = top
sort_by = x
[]
[internal_sample]
type = SideValueSampler
variable = 'u v'
boundary = center
sort_by = 'id'
[]
[]
[Executioner]
type = Steady
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
system_names = 'u_sys v_sys'
l_tol = 1e-8
[]
[Outputs]
execute_on = 'timestep_end'
[vpp_csv]
type = CSV
[]
[]
(modules/heat_transfer/test/tests/radiation_participating_media/rad_T_coupled_medium_1d.i)
# The test guarantees that the P1 participating media radiation model in the LinearFV
# system can couple with the energy equation of a semi-transparent fluid with fixed
# temperatures at the left and right walls.
# A simple multi-linear system solver approach is used. Due to the strong coupling between T and G
# multi-system fixed point iterations need to be set.
k = 1e-2
sigma_a = 1.
G_diffusion_coef = ${fparse 1/(3*sigma_a)}
sigma = 5.670374419e-8
[Mesh]
[mesh]
type = GeneratedMeshGenerator
dim = 1
nx = 20
xmin = 0
xmax = 1
[]
[]
[Problem]
linear_sys_names = 'energy_system radiation_system'
previous_nl_solution_required = true
[]
[Variables]
[T]
type = MooseLinearVariableFVReal
solver_sys = 'energy_system'
initial_condition = 100
[]
[G]
type = MooseLinearVariableFVReal
solver_sys = 'radiation_system'
initial_condition = ${fparse sigma*100^4}
[]
[]
[LinearFVKernels]
[temp_conduction]
type = LinearFVDiffusion
diffusion_coeff = ${k}
variable = T
[]
[temp_radiation]
type = LinearFVP1TemperatureSourceSink
variable = T
G = 'G'
absorption_coeff = ${sigma_a}
[]
[G_diffusion]
type = LinearFVDiffusion
variable = G
diffusion_coeff = ${G_diffusion_coef}
[]
[source_and_sink]
type = LinearFVP1RadiationSourceSink
variable = G
temperature_radiation = 'T'
absorption_coeff = ${sigma_a}
[]
[]
[LinearFVBCs]
[right_bc_G]
type = LinearFVP1RadiationMarshakBC
boundary = 'right'
variable = G
temperature_radiation = 'T'
coeff_diffusion = ${G_diffusion_coef}
boundary_emissivity = 1.0
[]
[right_bc_T]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = T
boundary = 'right'
functor = 100.
[]
[left_bc_T]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = T
boundary = 'left'
functor = 50.
[]
[left_bc_G]
type = LinearFVP1RadiationMarshakBC
boundary = 'left'
variable = G
temperature_radiation = 'T'
coeff_diffusion = ${G_diffusion_coef}
boundary_emissivity = 1.0
[]
[]
[Postprocessors]
[mean_value_G]
type = ElementIntegralFunctorPostprocessor
functor = G
[]
[max_value_G]
type = ElementExtremeFunctorValue
functor = G
[]
[mean_value_T]
type = ElementIntegralFunctorPostprocessor
functor = T
[]
[max_value_T]
type = ElementExtremeFunctorValue
functor = T
[]
[]
[Convergence]
[linear]
type = IterationCountConvergence
max_iterations = 70
converge_at_max_iterations = true
[]
[]
[Executioner]
type = Steady
solve_type = 'Linear' #'NEWTON'
petsc_options_iname = '-energy_system_pc_type -energy_system_pc_factor_shift_type -radiation_system_pc_type -radiation_system_pc_factor_shift_type'
petsc_options_value = 'hypre boomeramg hypre boomeramg'
l_abs_tol = 1e-14
l_tol = 1e-14
nl_abs_tol = 1e-14
multi_system_fixed_point=true
multi_system_fixed_point_convergence=linear
[]
[Outputs]
#file_base = rad_isothermal_medium_1d_adiabatic
csv = true
exodus = true
execute_on = timestep_end
[]
(modules/navier_stokes/test/tests/finite_volume/ins/turbulence/channel/linear-segregated/channel_heated-physics.i)
!include header_and_mesh.i
q = 5
cp = 300
[Problem]
linear_sys_names = 'u_system v_system pressure_system energy_system TKE_system TKED_system'
previous_nl_solution_required = true
[]
# These are only needed when solving for enthalpy
# Alternatively, a FluidProperties user object may be used
[FunctorMaterials]
active = 'rho_h'
# These two are for solving for enthalpy without using a FluidProperties object
[h_from_T]
type = ParsedFunctorMaterial
expression = '${cp} * T_fluid'
functor_names = 'T_fluid'
property_name = 'h_from_p_T_functor'
[]
[T_from_h]
type = ParsedFunctorMaterial
expression = 'h / ${cp}'
functor_names = 'h'
property_name = 'T_from_p_h_functor'
[]
# This one is for computing the enthalpy density without using a FluidProperties object
[rho_h]
type = ParsedFunctorMaterial
expression = '${rho} * ${cp} * T_fluid'
functor_names = 'T_fluid'
property_name = 'rho_h'
[]
[]
[Physics]
[NavierStokes]
[FlowSegregated/flow]
velocity_variable = 'vel_x vel_y'
pressure_variable = 'pressure'
# Initial conditions
initial_velocity = '${bulk_u} 0 0'
initial_pressure = '1e-8'
# Material properties
density = ${rho}
dynamic_viscosity = ${mu}
# Boundary conditions
inlet_boundaries = 'left'
momentum_inlet_types = 'fixed-velocity'
momentum_inlet_functors = '${bulk_u} 0'
wall_boundaries = 'top bottom'
momentum_wall_types = 'noslip noslip'
outlet_boundaries = 'right'
momentum_outlet_types = 'fixed-pressure'
pressure_functors = '0'
# Numerical parameters
include_deviatoric_stress = true
orthogonality_correction = false
pressure_two_term_bc_expansion = false
momentum_two_term_bc_expansion = false
momentum_advection_interpolation = ${advected_interp_method}
system_names = 'u_system v_system pressure_system'
[]
[FluidHeatTransferSegregated/energy]
# turbulence Physics coupling picked up automatically
initial_temperature = 0
thermal_conductivity = 1.1
specific_heat = ${cp}
energy_inlet_types = 'fixed-temperature'
energy_inlet_functors = '0'
energy_wall_types = 'heatflux heatflux'
energy_wall_functors = '0 0'
external_heat_source = '${q}'
[]
[TurbulenceSegregated/k-epsilon]
# Model
turbulence_handling = 'k-epsilon'
tke_name = TKE
tked_name = TKED
system_names = 'TKE_system TKED_system'
fluid_heat_transfer_physics = energy
initial_tke = ${k_init}
initial_tked = ${eps_init}
# Model parameters
mu_t_ratio_max = 1e20
sigma_k = ${sigma_k}
sigma_eps = ${sigma_eps}
C_pl = 1e10
C1_eps = ${C1_eps}
C2_eps = ${C2_eps}
Pr_t = 0.9
k_t_as_aux_variable = true
turbulence_walls = ${walls}
wall_treatment_eps = ${wall_treatment}
bulk_wall_treatment = ${bulk_wall_treatment}
use_nonorthogonal_correction = false
[]
[]
[]
# Boundary conditions are not implemented for turbulent quantities at this time
[LinearFVBCs]
[inlet_TKE]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left'
variable = TKE
functor = '${k_init}'
[]
[outlet_TKE]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = 'right'
variable = TKE
use_two_term_expansion = false
[]
[inlet_TKED]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left'
variable = TKED
functor = '${eps_init}'
[]
[outlet_TKED]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = 'right'
variable = TKED
use_two_term_expansion = false
[]
[]
[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'
turbulence_systems = 'TKE_system TKED_system'
momentum_l_abs_tol = 1e-14
pressure_l_abs_tol = 1e-14
turbulence_l_abs_tol = 1e-14
energy_l_abs_tol = 1e-14
momentum_l_tol = 1e-14
pressure_l_tol = 1e-14
energy_l_tol = 1e-14
turbulence_l_tol = 1e-14
momentum_equation_relaxation = 0.7
pressure_variable_relaxation = 0.3
energy_equation_relaxation = 0.8
turbulence_equation_relaxation = '0.2 0.2'
turbulence_field_relaxation = '0.2 0.2'
num_iterations = 1000
pressure_absolute_tolerance = 1e-12
momentum_absolute_tolerance = 1e-12
energy_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'
energy_petsc_options_iname = '-pc_type -pc_hypre_type'
energy_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
[]
variables_to_sample = 'vel_x vel_y pressure T_fluid TKE TKED'
!include postprocessing.i
# More postprocessor for temperature
[Postprocessors]
[outlet_T]
type = SideAverageValue
boundary = right
variable = T_fluid
[]
[Q_out]
type = VolumetricFlowRate
boundary = 'right'
vel_x = 'vel_x'
vel_y = 'vel_y'
advected_quantity = 'rho_h'
rhie_chow_user_object = 'ins_rhie_chow_interpolator'
[]
[balance_percent]
type = ParsedPostprocessor
expression = '100 * (0 - Q_out + 2 * ${L} * ${H} * ${q}) / Q_out'
pp_names = 'Q_out'
[]
[]
(test/tests/multisystem/picard/linearfv_nonlinearfv/same_input.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
nx = 6
[]
[]
[Problem]
nl_sys_names = 'v_sys'
linear_sys_names = 'u_sys'
[]
[Variables]
[v]
type = MooseVariableFVReal
initial_condition = 2.0
solver_sys = v_sys
[]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
[]
[]
[FVKernels]
[diffusion]
type = FVDiffusion
variable = v
coeff = u
[]
[source]
type = FVBodyForce
variable = v
function = 3
[]
[]
[LinearFVKernels]
[diffusion]
type = LinearFVDiffusion
variable = u
diffusion_coeff = v
[]
[source]
type = LinearFVSource
variable = u
source_density = 1
[]
[]
[FVBCs]
[dir]
type = FVFunctorDirichletBC
variable = v
boundary = "left right"
functor = 2
[]
[]
[LinearFVBCs]
[dir]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "left right"
functor = 1
[]
[]
[Convergence]
[linear]
type = IterationCountConvergence
max_iterations = 6
converge_at_max_iterations = true
[]
[]
[Executioner]
type = Steady
system_names = 'v_sys u_sys'
l_abs_tol = 1e-12
l_tol = 1e-10
nl_abs_tol = 1e-10
multi_system_fixed_point=true
multi_system_fixed_point_convergence=linear
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true
execute_on = timestep_end
[]
(test/tests/linearfvkernels/anisotropic-diffusion/anisotropic-diffusion-2d.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 2
ny = 1
ymax = 0.5
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
[]
[]
[LinearFVKernels]
[diffusion]
type = LinearFVAnisotropicDiffusion
variable = u
diffusion_tensor = diffusivity_tensor
use_nonorthogonal_correction = false
[]
[source]
type = LinearFVSource
variable = u
source_density = source_func
[]
[]
[LinearFVBCs]
[dir]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "left right top bottom"
functor = analytic_solution
[]
[]
[FunctorMaterials]
[diff_tensor]
type = GenericVectorFunctorMaterial
prop_names = diffusivity_tensor
prop_values = 'coeff_func_x coeff_func_y 0.0'
[]
[]
[Functions]
[coeff_func_x]
type = ParsedFunction
expression = '1+0.5*x*y'
[]
[coeff_func_y]
type = ParsedFunction
expression = '1+x*y'
[]
[source_func]
type = ParsedFunction
expression = '(1.5-y*y)*(2+2*x*y)+(1.5-x*x)*(2+4*x*y)'
[]
[analytic_solution]
type = ParsedFunction
expression = '(1.5-x*x)*(1.5-y*y)'
[]
[]
[Postprocessors]
[h]
type = AverageElementSize
execute_on = FINAL
[]
[error]
type = ElementL2FunctorError
approximate = u
exact = analytic_solution
execute_on = FINAL
[]
[]
[Convergence]
[linear]
type = IterationCountConvergence
max_iterations = 1
converge_at_max_iterations = true
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-10
multi_system_fixed_point=true
multi_system_fixed_point_convergence=linear
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
[]
[]
(test/tests/postprocessors/side_diffusive_flux_integral/side_diffusive_flux_integral_linear_fv.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
solver_sys = 'u_sys'
type = MooseLinearVariableFVReal
[]
[]
[LinearFVKernels]
[diff]
type = LinearFVDiffusion
variable = u
diffusion_coeff = diffusivity
[]
[]
[LinearFVBCs]
[left]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = left
functor = 0
[]
[right]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = right
functor = 1
[]
[]
[FunctorMaterials]
[mat_props]
type = GenericFunctorMaterial
prop_names = diffusivity
prop_values = 1
[]
[]
[AuxVariables]
[grad]
family = MONOMIAL_VEC
order = CONSTANT
[]
[]
[AuxKernels]
[grad]
variable = grad
functor = u
type = FunctorElementalGradientAux
[]
[]
[Postprocessors]
[avg_left]
type = SideAverageValue
variable = u
boundary = left
[]
[avg_right]
type = SideAverageValue
variable = u
boundary = right
[]
[avg_flux_left]
type = SideDiffusiveFluxAverage
variable = u
boundary = left
functor_diffusivity = diffusivity
[]
[avg_flux_right]
type = SideDiffusiveFluxAverage
variable = u
boundary = right
functor_diffusivity = diffusivity
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-10
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true
[]
(modules/navier_stokes/test/tests/finite_volume/wcns/enthalpy_equation/1d_test_h_fp.i)
L = 30
nx = 600
bulk_u = 0.01
p_ref = 101325.0
T_in = 860.
q_source = 20000.
advected_interp_method = 'upwind'
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
xmin = 0
xmax = ${L}
nx = ${nx}
[]
allow_renumbering = false
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
advected_interp_method = ${advected_interp_method}
u = vel_x
[]
[Problem]
linear_sys_names = 'u_system pressure_system energy_system'
previous_nl_solution_required = true
[]
[UserObjects]
[rc]
type = RhieChowMassFlux
u = vel_x
pressure = pressure
rho = 'rho'
p_diffusion_kernel = p_diffusion
[]
[]
[Variables]
[vel_x]
type = MooseLinearVariableFVReal
solver_sys = u_system
initial_condition = ${bulk_u}
[]
[pressure]
type = MooseLinearVariableFVReal
solver_sys = pressure_system
initial_condition = ${p_ref}
[]
[h]
type = MooseLinearVariableFVReal
solver_sys = energy_system
initial_condition = ${fparse 860.*240.}
[]
[]
[AuxVariables]
[rho_var]
type = MooseLinearVariableFVReal
[]
[cp_var]
type = MooseLinearVariableFVReal
[]
[mu_var]
type = MooseLinearVariableFVReal
[]
[k_var]
type = MooseLinearVariableFVReal
[]
[T]
type = MooseLinearVariableFVReal
initial_condition = ${T_in}
[]
[h_aux]
type = MooseLinearVariableFVReal
[]
[]
[LinearFVKernels]
[u_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_x
mu = 'mu'
momentum_component = 'x'
use_nonorthogonal_correction = false
[]
[u_pressure]
type = LinearFVMomentumPressure
variable = vel_x
pressure = pressure
momentum_component = 'x'
[]
[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_advection]
type = LinearFVEnergyAdvection
variable = h
[]
[source]
type = LinearFVSource
variable = h
source_density = source_func
[]
[]
[LinearFVBCs]
[inlet_u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left'
variable = vel_x
functor = ${bulk_u}
[]
[inlet_h]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = h
boundary = 'left'
functor = 'h_from_p_T'
[]
[inlet_T]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = T
boundary = 'left'
functor = ${T_in}
[]
[outlet_p]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'right'
variable = pressure
functor = ${p_ref}
[]
[outlet_h]
type = LinearFVAdvectionDiffusionOutflowBC
variable = h
use_two_term_expansion = false
boundary = 'right'
[]
[outlet_u]
type = LinearFVAdvectionDiffusionOutflowBC
variable = vel_x
use_two_term_expansion = false
boundary = 'right'
[]
[]
[FluidProperties]
[lead]
type = LeadFluidProperties
[]
[]
[FunctorMaterials]
[enthalpy_material]
type = LinearFVEnthalpyFunctorMaterial
pressure = ${p_ref}
T_fluid = T
h = h
fp = lead
[]
[fluid_props_to_mat_props]
type = GeneralFunctorFluidProps
fp = lead
pressure = ${p_ref}
T_fluid = 'T'
speed = 1
porosity = 1
characteristic_length = 1
[]
[source_func]
type = ADParsedFunctorMaterial
property_name = source_func
functor_names = 'rho'
expression = ${q_source}
[]
[]
[AuxKernels]
[rho_out]
type = FunctorAux
functor = 'rho'
variable = 'rho_var'
execute_on = 'NONLINEAR'
[]
[cp_out]
type = FunctorAux
functor = 'cp'
variable = 'cp_var'
execute_on = 'NONLINEAR'
[]
[mu_out]
type = FunctorAux
functor = 'mu'
variable = 'mu_var'
execute_on = 'NONLINEAR'
[]
[k_out]
type = FunctorAux
functor = 'k'
variable = 'k_var'
execute_on = 'NONLINEAR'
[]
[T_from_h_functor_aux]
type = FunctorAux
functor = 'T_from_p_h'
variable = 'T'
execute_on = 'NONLINEAR'
[]
[h_from_T_functor_aux]
type = FunctorAux
functor = 'h_from_p_T'
variable = 'h_aux'
execute_on = 'NONLINEAR'
[]
[]
[Postprocessors]
[T_out_sim]
type = ElementalVariableValue
variable = T
elementid = ${fparse nx-1}
[]
[]
[Executioner]
type = SIMPLE
momentum_l_abs_tol = 1e-12
pressure_l_abs_tol = 1e-12
energy_l_abs_tol = 1e-12
momentum_l_tol = 0
pressure_l_tol = 0
energy_l_tol = 0
rhie_chow_user_object = 'rc'
momentum_systems = 'u_system'
pressure_system = 'pressure_system'
energy_system = 'energy_system'
momentum_equation_relaxation = 0.7
pressure_variable_relaxation = 0.3
energy_equation_relaxation = 0.95
num_iterations = 100
pressure_absolute_tolerance = 1e-8
momentum_absolute_tolerance = 1e-8
energy_absolute_tolerance = 1e-6
print_fields = false
momentum_l_max_its = 200
momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
momentum_petsc_options_value = 'hypre boomeramg'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
pressure_petsc_options_value = 'hypre boomeramg'
energy_petsc_options_iname = '-pc_type -pc_hypre_type'
energy_petsc_options_value = 'hypre boomeramg'
continue_on_max_its = true
[]
[Outputs]
[out]
type = CSV
[]
[]
(test/tests/postprocessors/linearfv_flux_integral/linearfv_flux_integral.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
nx = 100
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 0.25
[]
[]
[FVInterpolationMethods]
[upwind]
type = FVAdvectedUpwind
[]
[]
[LinearFVKernels]
[diffusion]
type = LinearFVDiffusion
variable = u
diffusion_coeff = 0.5
use_nonorthogonal_correction = false
[]
[advection]
type = LinearFVAdvection
variable = u
velocity = '0.5 0 0'
advected_interp_method_name = upwind
[]
[]
[LinearFVBCs]
[left]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = left
functor = 1
[]
[right]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = right
functor = 0
[]
[]
[Postprocessors]
[flux_left_total]
type = BoundaryLinearFVFluxIntegral
boundary = left
linearfvkernels = 'diffusion advection'
[]
[flux_left_diff]
type = BoundaryLinearFVFluxIntegral
boundary = left
linearfvkernels = 'diffusion'
[]
[flux_left_adv]
type = BoundaryLinearFVFluxIntegral
boundary = left
linearfvkernels = 'advection'
[]
[flux_right_total]
type = BoundaryLinearFVFluxIntegral
boundary = right
linearfvkernels = 'diffusion advection'
[]
[flux_right_diff]
type = BoundaryLinearFVFluxIntegral
boundary = right
linearfvkernels = 'diffusion'
[]
[flux_right_adv]
type = BoundaryLinearFVFluxIntegral
boundary = right
linearfvkernels = 'advection'
[]
[flux_left_sum_error]
type = ParsedPostprocessor
expression = 'f_total - f_diff - f_adv'
pp_names = 'flux_left_total flux_left_diff flux_left_adv'
pp_symbols = 'f_total f_diff f_adv'
[]
[flux_right_sum_error]
type = ParsedPostprocessor
expression = 'f_total - f_diff - f_adv'
pp_names = 'flux_right_total flux_right_diff flux_right_adv'
pp_symbols = 'f_total f_diff f_adv'
[]
[flux_balance]
type = ParsedPostprocessor
expression = 'f_left + f_right'
pp_names = 'flux_left_total flux_right_total'
pp_symbols = 'f_left f_right'
[]
# These are the analytic solutions, when we refine we get closer and closer
[analytic_flux_left_adv]
type = ParsedPostprocessor
expression = '-v'
constant_names = 'v'
constant_expressions = '0.5'
[]
[analytic_flux_left_diff]
type = ParsedPostprocessor
expression = '-v / (exp(v / k * L) - 1)'
constant_names = 'v k L'
constant_expressions = '0.5 0.5 1'
[]
[analytic_flux_right_adv]
type = ParsedPostprocessor
expression = '0'
[]
[analytic_flux_right_diff]
type = ParsedPostprocessor
expression = 'v * exp(v / k * L) / (exp(v / k * L) - 1)'
constant_names = 'v k L'
constant_expressions = '0.5 0.5 1'
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-12
l_abs_tol = 1e-12
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[Outputs]
csv = true
execute_on = timestep_end
[]
(test/tests/linearfvkernels/diffusion/diffusion-1d.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
nx = 2
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
[]
[]
[FVInterpolationMethods]
[geom]
type = FVGeometricAverage
[]
[harm]
type = FVHarmonicAverage
[]
[]
[LinearFVKernels]
[diffusion]
type = LinearFVDiffusion
variable = u
diffusion_coeff = coeff_func
[]
[source]
type = LinearFVSource
variable = u
source_density = source_func
[]
[]
[LinearFVBCs]
[dir]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "left right"
functor = analytic_solution
[]
[]
[Functions]
[coeff_func]
type = ParsedFunction
expression = '0.5*x'
[]
[coeff_pos_func]
type = ParsedFunction
expression = '1+0.5*x'
[]
[source_func]
type = ParsedFunction
expression = '2*x'
[]
[analytic_solution]
type = ParsedFunction
expression = '1-x*x'
[]
[]
[Postprocessors]
[h]
type = AverageElementSize
execute_on = FINAL
[]
[error]
type = ElementL2FunctorError
approximate = u
exact = analytic_solution
execute_on = FINAL
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-10
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
[]
[]
(modules/navier_stokes/test/tests/finite_volume/ins/turbulence/channel/linear-segregated/channel_ERCOFTAC_mu_eff.i)
!include header_and_mesh.i
[Problem]
linear_sys_names = 'u_system v_system pressure_system TKE_system TKED_system'
previous_nl_solution_required = true
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
advected_interp_method = ${advected_interp_method}
[]
[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 = ${bulk_u}
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
advected_interp_method = ${advected_interp_method}
mu = 'mu_eff'
u = vel_x
v = vel_y
momentum_component = 'x'
rhie_chow_user_object = 'rc'
use_nonorthogonal_correction = false
use_deviatoric_terms = yes
[]
[u_pressure]
type = LinearFVMomentumPressure
variable = vel_x
pressure = pressure
momentum_component = 'x'
[]
[v_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_y
advected_interp_method = ${advected_interp_method}
mu = 'mu_eff'
u = vel_x
v = vel_y
momentum_component = 'y'
rhie_chow_user_object = 'rc'
use_nonorthogonal_correction = false
use_deviatoric_terms = yes
[]
[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_eff_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_eff_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]
[inlet-u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left'
variable = vel_x
functor = '${bulk_u}'
[]
[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_u]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = 'right'
variable = vel_x
use_two_term_expansion = false
[]
[outlet_v]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = 'right'
variable = vel_y
use_two_term_expansion = false
[]
[outlet_p]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'right'
variable = pressure
functor = 0.0
[]
[inlet_TKE]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left'
variable = TKE
functor = '${k_init}'
[]
[outlet_TKE]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = 'right'
variable = TKE
use_two_term_expansion = false
[]
[inlet_TKED]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left'
variable = TKED
functor = '${eps_init}'
[]
[outlet_TKED]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = 'right'
variable = TKED
use_two_term_expansion = false
[]
[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}'
[]
[]
[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
[]
[]
[FunctorMaterials]
[compute_mu_eff]
type = FunctorEffectiveDynamicViscosity
property_name = mu_eff
mu = ${mu}
mu_t = mu_t
mu_t_inverse_factor = 1
execute_on = 'ALWAYS'
[]
[compute_mu_eff_k]
type = FunctorEffectiveDynamicViscosity
property_name = mu_eff_k
mu = ${mu}
mu_t = mu_t
mu_t_inverse_factor = ${sigma_k}
execute_on = 'ALWAYS'
[]
[compute_mu_eff_eps]
type = FunctorEffectiveDynamicViscosity
property_name = mu_eff_eps
mu = ${mu}
mu_t = mu_t
mu_t_inverse_factor = ${sigma_eps}
execute_on = 'ALWAYS'
[]
[]
!include executioner_regular_channel.i
variables_to_sample = 'vel_x vel_y pressure_over_density TKE TKED'
!include postprocessing.i
(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'
[]
[]
(test/tests/linearfvbcs/scalar_symmetry/advection-2d-symmetry.i)
vel_x = -0.1
two_term_bc=true
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 2
ny = 2
xmin = 0
xmax = ${fparse pi/3}
ymin = 0
ymax = ${fparse pi/3}
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 0.02
[]
[]
[FVInterpolationMethods]
[average]
type = FVGeometricAverage
[]
[]
[Functions]
[u_exact]
type = ParsedFunction
expression = 'cos(x)*cos(y)'
[]
[source_fn]
type = ParsedFunction
expression = '-${vel_x}*sin(x)*cos(y)'
[]
[]
[LinearFVKernels]
[advection]
type = LinearFVAdvection
variable = u
velocity = "${vel_x} 0 0"
advected_interp_method_name = average
[]
[source]
type = LinearFVSource
variable = u
source_density = source_fn
[]
[]
[LinearFVBCs]
[symm]
type = LinearFVAdvectionDiffusionScalarSymmetryBC
variable = u
boundary = "bottom"
use_two_term_expansion = ${two_term_bc}
[]
[outflow]
type = LinearFVAdvectionDiffusionOutflowBC
variable = u
boundary = "left"
use_two_term_expansion = ${two_term_bc}
[]
[dir]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "right top"
functor = u_exact
[]
[]
[Postprocessors]
[h]
type = AverageElementSize
execute_on = 'TIMESTEP_END'
[]
[error]
type = ElementL2FunctorError
approximate = u
exact = u_exact
execute_on = 'TIMESTEP_END'
[]
[]
[Convergence]
[linear]
type = IterationCountConvergence
max_iterations = 1
converge_at_max_iterations = true
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-9
petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_shift_amount'
petsc_options_value = 'lu NONZERO 1e-10'
multi_system_fixed_point = true
multi_system_fixed_point_convergence = linear
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
[]
exodus = true
[]
(test/tests/linearfvkernels/diffusion-reaction-advection/advection-diffusion-reaction-1d.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
nx = 2
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
[]
[]
[FVInterpolationMethods]
[average]
type = FVGeometricAverage
[]
[]
[LinearFVKernels]
[diffusion]
type = LinearFVDiffusion
variable = u
diffusion_coeff = diff_coeff_func
use_nonorthogonal_correction = false
[]
[advection]
type = LinearFVAdvection
variable = u
velocity = "0.5 0 0"
advected_interp_method_name = average
[]
[reaction]
type = LinearFVReaction
variable = u
coeff = coeff_func
[]
[source]
type = LinearFVSource
variable = u
source_density = source_func
[]
[]
[LinearFVBCs]
inactive = "outflow neumann"
[dir]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "left right"
functor = analytic_solution
[]
[outflow]
type = LinearFVAdvectionDiffusionOutflowBC
variable = u
boundary = "right"
use_two_term_expansion = true
[]
[neumann]
type = LinearFVAdvectionDiffusionFunctorNeumannBC
variable = u
boundary = "left"
functor = analytic_solution_neumann_left
diffusion_coeff = diff_coeff_func
[]
[]
[Functions]
[diff_coeff_func]
type = ParsedFunction
expression = '1+0.5*x'
[]
[coeff_func]
type = ParsedFunction
expression = '1+1/(1+x)'
[]
[source_func]
type = ParsedFunction
expression = '(1+1/(x+1))*(sin(pi/2*x)+1.5)+0.25*pi*pi*(0.5*x+1)*sin(pi/2*x)'
[]
[analytic_solution]
type = ParsedFunction
expression = 'sin(pi/2*x)+1.5'
[]
[analytic_solution_neumann_left]
type = ParsedFunction
expression = '-(1+0.5*x)*cos(pi/2*x)*pi/2'
[]
[]
[Postprocessors]
[h]
type = AverageElementSize
execute_on = FINAL
[]
[error]
type = ElementL2FunctorError
approximate = u
exact = analytic_solution
execute_on = FINAL
[]
[]
[Convergence]
[linear]
type = IterationCountConvergence
max_iterations = 1
converge_at_max_iterations = true
[]
[]
[Executioner]
type = Steady
system_names = u_sys
multi_system_fixed_point=true
multi_system_fixed_point_convergence=linear
petsc_options_iname = '-pc_type -pc_hypre_type -ksp_rtol'
petsc_options_value = 'hypre boomeramg 1e-10'
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
[]
[]
(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'
[]
[]
(test/tests/variables/linearfv/diffusion-1d-aux.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
nx = 10
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
[]
[]
[AuxVariables]
[v_volume]
type = MooseLinearVariableFVReal
initial_condition = 50
[]
[v_functor]
type = MooseLinearVariableFVReal
initial_condition = 25
[]
[v_parsed]
type = MooseLinearVariableFVReal
initial_condition = 12.5
[]
[]
[AuxKernels]
[volume]
type = VolumeAux
variable = v_volume
[]
[functor]
type = FunctorAux
variable = v_functor
functor = u
[]
[parsed]
type = ParsedAux
variable = v_parsed
coupled_variables = 'v_volume v_functor'
expression = '0.5*v_volume+0.5*v_functor'
[]
[]
[LinearFVKernels]
[diffusion]
type = LinearFVDiffusion
variable = u
diffusion_coeff = coeff_func
[]
[source]
type = LinearFVSource
variable = u
source_density = source_func
[]
[]
[LinearFVBCs]
[dir]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "left right"
functor = analytic_solution
[]
[]
[Functions]
[coeff_func]
type = ParsedFunction
expression = '0.5*x'
[]
[source_func]
type = ParsedFunction
expression = '2*x'
[]
[analytic_solution]
type = ParsedFunction
expression = '1-x*x'
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-10
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true
execute_on = TIMESTEP_END
[]
(test/tests/linearfvkernels/advection/diagonal-step-2d.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 51
ny = 51
[]
# Prevent test diffing on distributed parallel element numbering
allow_renumbering = false
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 0.5
[]
[]
[FVInterpolationMethods]
[upwind]
type = FVAdvectedUpwind
[]
[average]
type = FVGeometricAverage
[]
[muscl_venkat]
type = FVAdvectedVenkatakrishnanDeferredCorrection
deferred_correction_factor = 1.0
[]
[nvd_vanleer]
type = FVAdvectedVanLeerWeightBased
blending_factor = 0.75
[]
[nvd_minmod]
type = FVAdvectedMinmodWeightBased
blending_factor = 0.75
[]
[]
[LinearFVKernels]
[advection]
type = LinearFVAdvection
variable = u
velocity = "1 1 0"
advected_interp_method_name = nvd_minmod
[]
[]
[LinearFVBCs]
[left_inflow]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = left
functor = 0.5
[]
[bottom_inflow]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = bottom
functor = 1
[]
[outflow]
type = LinearFVAdvectionDiffusionOutflowBC
variable = u
boundary = 'right top'
use_two_term_expansion = true
[]
[]
[VectorPostprocessors]
[diag_sample]
type = LineValueSampler
variable = u
start_point = '1.0 0 0'
end_point = '0 1.0 0'
num_points = 101
sort_by = id
warn_discontinuous_face_values = false
execute_on = TIMESTEP_END
[]
[]
[Convergence]
[linear]
type = IterationCountConvergence
max_iterations = 50
converge_at_max_iterations = true
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-12
multi_system_fixed_point = true
multi_system_fixed_point_convergence = linear
multi_system_fixed_point_relaxation_factor = 0.3
petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_shift_amount -pc_factor_mat_solver_type -mat_mumps_icntl_14'
petsc_options_value = 'lu NONZERO 1e-12 mumps 50'
[]
[Outputs]
csv = true
exodus = true
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/cht/conjugate_heat_transfer/cht_neu-dir.i)
### benchmark sources:
### https://doi.org/10.1016/j.compfluid.2018.06.016
### https://doi.org/10.1016/0017-9310(74)90087-8
b = 0.01 # plate thickness
l = 0.2 # plate length
nxi = 24 # nx in the inlet/entrance region
nyf = 18 # ny in fluid
nxf = 24 # nx in the main fluid region
nys = 8 # ny in the solid domain
fx1_bias = 1.00 # bdry layer bias - fluid
fx2_bias = '${fparse 1.0/1.00}' # bdry layer bias - solid
fy_bias = 1.20 # bdry layer bias - fluid
sy_bias = '${fparse 1.0/1.05}' # bdry layer bias - solid
k_s = 0.2876
rho = 0.3525
mu = 3.95e-5
k = 0.06808
cp = 1142.6
vin = 12.0
Tin = 1000.0
T_s_bottom = 600.0
P_out = 1.03e5
h_s = 0.0
advected_interp_method = 'upwind'
[Mesh]
[fluid_channel]
type = GeneratedMeshGenerator
dim = 2
nx = ${nxf}
ny = ${nyf}
xmin = 0
xmax = ${l}
ymin = 0
ymax = '${fparse 10.0*b}'
subdomain_ids = '1'
subdomain_name = 'fluid'
bias_x = '${fx1_bias}'
bias_y = '${fparse fy_bias}'
boundary_name_prefix = 'fluid'
[]
[solid_base]
type = GeneratedMeshGenerator
dim = 2
nx = ${nxf}
ny = ${nys}
xmin = 0
xmax = ${l}
ymin = '${fparse -b}'
ymax = 0
subdomain_ids = '2'
subdomain_name = 'solid'
bias_x = ${fx1_bias}
bias_y = '${fparse sy_bias}'
boundary_id_offset = 10
boundary_name_prefix = 'solid'
[]
[entrance]
type = GeneratedMeshGenerator
dim = 2
nx = '${fparse 2.0*nxi}'
ny = ${nyf}
xmin = '${fparse -2.0*l}'
xmax = 0
ymin = 0
ymax = '${fparse 10.0*b}'
subdomain_ids = '0'
subdomain_name = 'entrance'
bias_x = ${fx2_bias}
bias_y = '${fparse fy_bias}'
boundary_id_offset = 20
boundary_name_prefix = 'ent'
[]
[smg]
type = StitchedMeshGenerator
inputs = 'entrance fluid_channel solid_base'
stitch_boundaries_pairs = 'ent_right fluid_left;
fluid_bottom solid_top'
prevent_boundary_ids_overlap = false
[]
[interface]
type = SideSetsBetweenSubdomainsGenerator
input = 'smg'
primary_block = 'fluid'
paired_block = 'solid'
new_boundary = interface
[]
[symmetry_transform]
type = SymmetryTransformGenerator
input = interface
mirror_point = '0 0 0'
mirror_normal_vector = '0 1 0'
[]
inactive = 'symmetry_transform'
[]
[Problem]
linear_sys_names = 'u_system v_system pressure_system energy_system solid_energy_system'
previous_nl_solution_required = true
[]
[UserObjects]
[rc]
type = RhieChowMassFlux
u = vel_x
v = vel_y
pressure = pressure
rho = ${rho}
p_diffusion_kernel = p_diffusion
block = '0 1'
[]
[]
[Variables]
[vel_x]
type = MooseLinearVariableFVReal
initial_condition = ${vin}
solver_sys = u_system
block = '0 1'
[]
[vel_y]
type = MooseLinearVariableFVReal
solver_sys = v_system
initial_condition = 0.0
block = '0 1'
[]
[pressure]
type = MooseLinearVariableFVReal
solver_sys = pressure_system
initial_condition = ${P_out}
block = '0 1'
[]
[T_fluid]
type = MooseLinearVariableFVReal
solver_sys = energy_system
initial_condition = ${Tin}
block = '0 1'
[]
[T_solid]
type = MooseLinearVariableFVReal
solver_sys = solid_energy_system
initial_condition = ${T_s_bottom}
block = 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
[]
[h_advection]
type = LinearFVEnergyAdvection
variable = T_fluid
advected_quantity = temperature
cp = ${cp}
advected_interp_method = ${advected_interp_method}
rhie_chow_user_object = 'rc'
[]
[conduction]
type = LinearFVDiffusion
variable = T_fluid
diffusion_coeff = ${k}
use_nonorthogonal_correction = false
[]
[solid-conduction]
type = LinearFVDiffusion
variable = T_solid
diffusion_coeff = ${k_s}
use_nonorthogonal_correction = false
[]
[]
[LinearFVBCs]
# velocity BCs
[inlet-u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'ent_left'
variable = vel_x
functor = ${vin}
[]
[inlet-v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'ent_left'
variable = vel_y
functor = '0.000'
[]
[walls-u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'ent_bottom interface'
variable = vel_x
functor = 0.0
[]
[walls-v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'ent_bottom interface'
variable = vel_y
functor = 0.0
[]
[outlet_p]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'fluid_right'
variable = pressure
functor = ${P_out}
[]
[outlet_u]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = 'fluid_right'
variable = vel_x
use_two_term_expansion = false
[]
[outlet_v]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = 'fluid_right'
variable = vel_y
use_two_term_expansion = false
[]
# freestream BCs for top of fluid domain
[freestream_u]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = 'fluid_top ent_top'
variable = vel_x
use_two_term_expansion = false
[]
[freestream_v]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = 'fluid_top ent_top'
variable = vel_y
use_two_term_expansion = false
[]
[freestream_p]
type = LinearFVAdvectionDiffusionFunctorNeumannBC
boundary = 'fluid_top ent_top'
variable = pressure
functor = 0
[]
# temperature BCs
[inlet_T]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = T_fluid
functor = ${Tin}
boundary = 'ent_left'
[]
[heated_wall_solid]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = T_solid
functor = ${T_s_bottom}
boundary = 'solid_bottom'
[]
[insulated_fluid]
type = LinearFVAdvectionDiffusionFunctorNeumannBC
variable = T_fluid
functor = 0
boundary = 'ent_bottom ent_top fluid_top'
[]
[insulated_solid]
type = LinearFVAdvectionDiffusionFunctorNeumannBC
variable = T_solid
functor = 0
boundary = 'solid_left solid_right'
[]
[outlet_T]
type = LinearFVAdvectionDiffusionOutflowBC
variable = T_fluid
use_two_term_expansion = false
boundary = 'fluid_right'
[]
[fluid_solid]
type = LinearFVDirichletCHTBC
variable = T_fluid
boundary = interface
functor = interface_temperature_solid_interface
[]
[solid_fluid]
type = LinearFVRobinCHTBC
variable = T_solid
boundary = interface
h = ${h_s}
thermal_conductivity = ${k_s}
incoming_flux = heat_flux_to_solid_interface
surface_temperature = interface_temperature_fluid_interface
[]
[]
[FunctorMaterials]
[rhocpT]
property_name = 'rhocpT'
type = ParsedFunctorMaterial
functor_names = 'T_fluid'
expression = '${rho}*${cp}*T_fluid'
[]
[]
[Postprocessors]
[h_in]
type = VolumetricFlowRate
boundary = 'ent_left'
vel_x = vel_x
vel_y = vel_y
rhie_chow_user_object = rc
advected_quantity = 'rhocpT'
subtract_mesh_velocity = false
[]
[h_out]
type = VolumetricFlowRate
boundary = 'fluid_right fluid_top ent_top interface'
vel_x = vel_x
vel_y = vel_y
rhie_chow_user_object = rc
advected_quantity = 'rhocpT'
advected_interp_method = upwind
subtract_mesh_velocity = false
[]
[]
[VectorPostprocessors]
[y_vs_ts]
type = LineValueSampler
variable = 'T_solid'
start_point = '0.05 -1e-9 0' # making sure we are always in the domain
end_point = '0.05 ${fparse -b+1e-9} 0'
num_points = 8
sort_by = id
warn_discontinuous_face_values = false
[]
[y_vs_tf]
type = LineValueSampler
variable = 'T_fluid'
start_point = '0.05 1e-9 0' # making sure we are always in the domain
end_point = '0.05 ${fparse b-1e-9} 0'
num_points = 12
sort_by = id
warn_discontinuous_face_values = false
[]
[]
[Executioner]
type = SIMPLE
num_iterations = 1000
momentum_systems = 'u_system v_system'
pressure_system = 'pressure_system'
rhie_chow_user_object = 'rc'
momentum_l_abs_tol = 1e-10
pressure_l_abs_tol = 1e-10
momentum_l_tol = 0
pressure_l_tol = 0
momentum_equation_relaxation = 0.9
pressure_variable_relaxation = 0.3
momentum_absolute_tolerance = 1e-7
pressure_absolute_tolerance = 1e-7
momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
momentum_petsc_options_value = 'hypre boomeramg'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
pressure_petsc_options_value = 'hypre boomeramg'
energy_system = 'energy_system'
solid_energy_system = 'solid_energy_system'
energy_l_abs_tol = 1e-10
solid_energy_l_abs_tol = 1e-10
energy_l_tol = 0
solid_energy_l_tol = 0
energy_equation_relaxation = 1.0
energy_absolute_tolerance = 1e-7
solid_energy_absolute_tolerance = 1e-7
energy_petsc_options_iname = '-pc_type -pc_hypre_type'
energy_petsc_options_value = 'hypre boomeramg'
solid_energy_petsc_options_iname = '-pc_type -pc_hypre_type'
solid_energy_petsc_options_value = 'hypre boomeramg'
cht_interfaces = 'interface'
cht_solid_flux_relaxation = 0.4
cht_fluid_flux_relaxation = 0.4
cht_solid_temperature_relaxation = 0.4
cht_fluid_temperature_relaxation = 0.4
max_cht_fpi = 3
print_fields = false
[]
[Outputs]
csv = true
execute_on = timestep_end
[]
(modules/navier_stokes/test/tests/finite_volume/ins/cht/conjugate_heat_transfer/cht_rob-rob.i)
### benchmark sources:
### https://doi.org/10.1016/j.compfluid.2018.06.016
### https://doi.org/10.1016/0017-9310(74)90087-8
b = 0.01 # plate thickness
l = 0.2 # plate length
nxi = 24 # nx in the inlet/entrance region
nyf = 18 # ny in fluid
nxf = 24 # nx in the main fluid region
nys = 8 # ny in the solid domain
fx1_bias = 1.00 # bdry layer bias - fluid
fx2_bias = '${fparse 1.0/1.00}' # bdry layer bias - solid
fy_bias = 1.20 # bdry layer bias - fluid
sy_bias = '${fparse 1.0/1.05}' # bdry layer bias - solid
k_s = 0.2876
rho = 0.3525
mu = 3.95e-5
k = 0.06808
cp = 1142.6
vin = 12.0
Tin = 1000.0
T_s_bottom = 600.0
P_out = 1.03e5
h_s = 1.0
h_f = 1.0
advected_interp_method = 'upwind'
[Mesh]
[fluid_channel]
type = GeneratedMeshGenerator
dim = 2
nx = ${nxf}
ny = ${nyf}
xmin = 0
xmax = ${l}
ymin = 0
ymax = '${fparse 10.0*b}'
subdomain_ids = '1'
subdomain_name = 'fluid'
bias_x = '${fx1_bias}'
bias_y = '${fparse fy_bias}'
boundary_name_prefix = 'fluid'
[]
[solid_base]
type = GeneratedMeshGenerator
dim = 2
nx = ${nxf}
ny = ${nys}
xmin = 0
xmax = ${l}
ymin = '${fparse -b}'
ymax = 0
subdomain_ids = '2'
subdomain_name = 'solid'
bias_x = ${fx1_bias}
bias_y = '${fparse sy_bias}'
boundary_id_offset = 10
boundary_name_prefix = 'solid'
[]
[entrance]
type = GeneratedMeshGenerator
dim = 2
nx = '${fparse 2.0*nxi}'
ny = ${nyf}
xmin = '${fparse -2.0*l}'
xmax = 0
ymin = 0
ymax = '${fparse 10.0*b}'
subdomain_ids = '0'
subdomain_name = 'entrance'
bias_x = ${fx2_bias}
bias_y = '${fparse fy_bias}'
boundary_id_offset = 20
boundary_name_prefix = 'ent'
[]
[smg]
type = StitchedMeshGenerator
inputs = 'entrance fluid_channel solid_base'
stitch_boundaries_pairs = 'ent_right fluid_left;
fluid_bottom solid_top'
prevent_boundary_ids_overlap = false
[]
[interface]
type = SideSetsBetweenSubdomainsGenerator
input = 'smg'
primary_block = 'fluid'
paired_block = 'solid'
new_boundary = interface
[]
[symmetry_transform]
type = SymmetryTransformGenerator
input = interface
mirror_point = '0 0 0'
mirror_normal_vector = '0 1 0'
[]
inactive = 'symmetry_transform'
[]
[Problem]
linear_sys_names = 'u_system v_system pressure_system energy_system solid_energy_system'
previous_nl_solution_required = true
[]
[UserObjects]
[rc]
type = RhieChowMassFlux
u = vel_x
v = vel_y
pressure = pressure
rho = ${rho}
p_diffusion_kernel = p_diffusion
block = '0 1'
[]
[]
[Variables]
[vel_x]
type = MooseLinearVariableFVReal
initial_condition = ${vin}
solver_sys = u_system
block = '0 1'
[]
[vel_y]
type = MooseLinearVariableFVReal
solver_sys = v_system
initial_condition = 0.0
block = '0 1'
[]
[pressure]
type = MooseLinearVariableFVReal
solver_sys = pressure_system
initial_condition = ${P_out}
block = '0 1'
[]
[T_fluid]
type = MooseLinearVariableFVReal
solver_sys = energy_system
initial_condition = ${Tin}
block = '0 1'
[]
[T_solid]
type = MooseLinearVariableFVReal
solver_sys = solid_energy_system
initial_condition = ${T_s_bottom}
block = 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
[]
[h_advection]
type = LinearFVEnergyAdvection
variable = T_fluid
advected_quantity = temperature
cp = ${cp}
advected_interp_method = ${advected_interp_method}
rhie_chow_user_object = 'rc'
[]
[conduction]
type = LinearFVDiffusion
variable = T_fluid
diffusion_coeff = ${k}
use_nonorthogonal_correction = false
[]
[solid-conduction]
type = LinearFVDiffusion
variable = T_solid
diffusion_coeff = ${k_s}
use_nonorthogonal_correction = false
[]
[]
[LinearFVBCs]
# velocity BCs
[inlet-u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'ent_left'
variable = vel_x
functor = ${vin}
[]
[inlet-v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'ent_left'
variable = vel_y
functor = '0.000'
[]
[walls-u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'ent_bottom interface'
variable = vel_x
functor = 0.0
[]
[walls-v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'ent_bottom interface'
variable = vel_y
functor = 0.0
[]
[outlet_p]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'fluid_right'
variable = pressure
functor = ${P_out}
[]
[outlet_u]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = 'fluid_right'
variable = vel_x
use_two_term_expansion = false
[]
[outlet_v]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = 'fluid_right'
variable = vel_y
use_two_term_expansion = false
[]
# freestream BCs for top of fluid domain
[freestream_u]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = 'fluid_top ent_top'
variable = vel_x
use_two_term_expansion = false
[]
[freestream_v]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = 'fluid_top ent_top'
variable = vel_y
use_two_term_expansion = false
[]
[freestream_p]
type = LinearFVAdvectionDiffusionFunctorNeumannBC
boundary = 'fluid_top ent_top'
variable = pressure
functor = 0
[]
# temperature BCs
[inlet_T]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = T_fluid
functor = ${Tin}
boundary = 'ent_left'
[]
[heated_wall_solid]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = T_solid
functor = ${T_s_bottom}
boundary = 'solid_bottom'
[]
[insulated_fluid]
type = LinearFVAdvectionDiffusionFunctorNeumannBC
variable = T_fluid
functor = 0
boundary = 'ent_top ent_bottom fluid_top'
[]
[insulated_solid]
type = LinearFVAdvectionDiffusionFunctorNeumannBC
variable = T_solid
functor = 0
boundary = 'solid_left solid_right'
[]
[outlet_T]
type = LinearFVAdvectionDiffusionOutflowBC
variable = T_fluid
use_two_term_expansion = false
boundary = 'fluid_right'
[]
[fluid_solid]
type = LinearFVRobinCHTBC
variable = T_fluid
boundary = interface
h = ${h_f}
incoming_flux = heat_flux_to_fluid_interface
surface_temperature = interface_temperature_solid_interface
thermal_conductivity = ${k}
[]
[solid_fluid]
type = LinearFVRobinCHTBC
variable = T_solid
boundary = interface
h = ${h_s}
incoming_flux = heat_flux_to_solid_interface
surface_temperature = interface_temperature_fluid_interface
thermal_conductivity = ${k_s}
[]
[]
[FunctorMaterials]
[rhocpT]
property_name = 'rhocpT'
type = ParsedFunctorMaterial
functor_names = 'T_fluid'
expression = '${rho}*${cp}*T_fluid'
[]
[]
[Postprocessors]
[h_in]
type = VolumetricFlowRate
boundary = 'ent_left'
vel_x = vel_x
vel_y = vel_y
rhie_chow_user_object = rc
advected_quantity = 'rhocpT'
subtract_mesh_velocity = false
[]
[h_out]
type = VolumetricFlowRate
boundary = 'fluid_right fluid_top ent_top interface'
vel_x = vel_x
vel_y = vel_y
rhie_chow_user_object = rc
advected_quantity = 'rhocpT'
advected_interp_method = upwind
subtract_mesh_velocity = false
[]
[]
[VectorPostprocessors]
[y_vs_ts]
type = LineValueSampler
variable = 'T_solid'
start_point = '0.05 -1e-9 0' # making sure we are always in the domain
end_point = '0.05 ${fparse -b+1e-9} 0'
num_points = 8
sort_by = id
warn_discontinuous_face_values = false
[]
[y_vs_tf]
type = LineValueSampler
variable = 'T_fluid'
start_point = '0.05 1e-9 0' # making sure we are always in the domain
end_point = '0.05 ${fparse b-1e-9} 0'
num_points = 12
sort_by = id
warn_discontinuous_face_values = false
[]
[]
[Executioner]
type = SIMPLE
num_iterations = 1000
momentum_systems = 'u_system v_system'
pressure_system = 'pressure_system'
rhie_chow_user_object = 'rc'
momentum_l_abs_tol = 1e-10
pressure_l_abs_tol = 1e-10
momentum_l_tol = 0
pressure_l_tol = 0
momentum_equation_relaxation = 0.9
pressure_variable_relaxation = 0.3
momentum_absolute_tolerance = 1e-7
pressure_absolute_tolerance = 1e-7
momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
momentum_petsc_options_value = 'hypre boomeramg'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
pressure_petsc_options_value = 'hypre boomeramg'
energy_system = 'energy_system'
solid_energy_system = 'solid_energy_system'
energy_l_abs_tol = 1e-10
solid_energy_l_abs_tol = 1e-10
energy_l_tol = 0
solid_energy_l_tol = 0
energy_equation_relaxation = 1.0
energy_absolute_tolerance = 1e-7
solid_energy_absolute_tolerance = 1e-7
energy_petsc_options_iname = '-pc_type -pc_hypre_type'
energy_petsc_options_value = 'hypre boomeramg'
solid_energy_petsc_options_iname = '-pc_type -pc_hypre_type'
solid_energy_petsc_options_value = 'hypre boomeramg'
cht_interfaces = 'interface'
cht_solid_flux_relaxation = 1.0
cht_fluid_flux_relaxation = 1.0
cht_solid_temperature_relaxation = 1.0
cht_fluid_temperature_relaxation = 1.0
max_cht_fpi = 2
print_fields = false
[]
[Outputs]
exodus = true
csv = true
execute_on = timestep_end
[]
(test/tests/linearfvbcs/robin/diffusion-2d-robin.i)
#################################################################
k = 7.0 # diffusion coeff.
amp = 3.6 # sinusoid amplitude, for u_exact
x1 = ${fparse 0.1*pi}
x2 = ${fparse 1.0*pi}
y1 = ${fparse 0.0*pi}
y2 = ${fparse 1.0*pi}
alpha = 2.000 # robin BC coeff for gradient term
beta = 5.000 # robin BC coeff for variable term
nx = 2
ny = 2
##################################################################
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = ${nx}
ny = ${ny}
xmin = ${x1}
xmax = ${x2}
ymin = ${y1}
ymax = ${y2}
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 0.0
[]
[]
[Functions]
[u_exact]
type = ParsedFunction
expression = '(${amp}*sin(x)*sin(y))'
[]
[source_fn]
type = ParsedFunction
expression = '${fparse k*amp}*2.0*sin(x)*sin(y)'
[]
[gamma_fn]
type = ParsedFunction
expression = '${fparse -amp*alpha}*cos(x)*sin(y) + ${beta} * u_e'
symbol_names = 'u_e'
symbol_values = 'u_exact'
[]
[]
[LinearFVKernels]
[diffusion]
type = LinearFVDiffusion
variable = u
diffusion_coeff = ${k}
use_nonorthogonal_correction = true
[]
[source]
type = LinearFVSource
variable = u
source_density = source_fn
[]
[]
[LinearFVBCs]
[right]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "right"
functor = u_exact
[]
[top]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "top"
functor = u_exact
[]
[bottom]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "bottom"
functor = u_exact
[]
[robin_left]
type = LinearFVAdvectionDiffusionFunctorRobinBC
variable = u
boundary = "left"
alpha = ${alpha}
beta = ${beta}
gamma = gamma_fn
[]
[]
[Postprocessors]
[h]
type = AverageElementSize
execute_on = FINAL
[]
[error]
type = ElementL2FunctorError
approximate = u
exact = u_exact
execute_on = FINAL
[]
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
[]
[]
[Convergence]
[linear]
type = IterationCountConvergence
max_iterations = 4
converge_at_max_iterations = true
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-7
multi_system_fixed_point = true
multi_system_fixed_point_convergence = linear
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
linear_convergence = linear
[]
(test/tests/linearfvkernels/diffusion-reaction-advection/advection-diffusion-reaction-2d.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 2
ny = 1
ymax = 0.5
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
[]
[]
[FVInterpolationMethods]
[average]
type = FVGeometricAverage
[]
[]
[LinearFVKernels]
[diffusion]
type = LinearFVDiffusion
variable = u
diffusion_coeff = diff_coeff_func
use_nonorthogonal_correction = false
[]
[advection]
type = LinearFVAdvection
variable = u
velocity = "0.5 0 0"
advected_interp_method_name = average
[]
[reaction]
type = LinearFVReaction
variable = u
coeff = coeff_func
[]
[source]
type = LinearFVSource
variable = u
source_density = source_func
[]
[]
[LinearFVBCs]
inactive = "outflow neumann"
[dir]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "left right top bottom"
functor = analytic_solution
[]
[outflow]
type = LinearFVAdvectionDiffusionOutflowBC
variable = u
boundary = "right"
use_two_term_expansion = true
[]
[neumann]
type = LinearFVAdvectionDiffusionFunctorNeumannBC
variable = u
boundary = "top"
functor = analytic_solution_neumann_top
diffusion_coeff = diff_coeff_func
[]
[]
[Functions]
[diff_coeff_func]
type = ParsedFunction
expression = '1.0+0.5*x*y'
[]
[coeff_func]
type = ParsedFunction
expression = '1.0+1.0/(1+x*y)'
[]
[source_func]
type = ParsedFunction
expression = '-1.0*x*pi*sin((1/2)*x*pi)*cos(2*y*pi) - 0.25*y*pi*sin(2*y*pi)*cos((1/2)*x*pi) + (1.0 + 1.0/(x*y + 1))*(sin((1/2)*x*pi)*sin(2*y*pi) + 1.5) + (17/4)*pi^2*(0.5*x*y + 1.0)*sin((1/2)*x*pi)*sin(2*y*pi) + 0.25*pi*sin(2*y*pi)*cos((1/2)*x*pi)'
[]
[analytic_solution]
type = ParsedFunction
expression = 'sin((1/2)*x*pi)*sin(2*y*pi) + 1.5'
[]
[analytic_solution_neumann_top]
type = ParsedFunction
expression = '(1.0+0.5*x*y)*sin((1/2)*x*pi)*cos(2*y*pi)*2*pi'
[]
[]
[Postprocessors]
[h]
type = AverageElementSize
execute_on = FINAL
[]
[error]
type = ElementL2FunctorError
approximate = u
exact = analytic_solution
execute_on = FINAL
[]
[]
[Convergence]
[linear]
type = IterationCountConvergence
max_iterations = 1
converge_at_max_iterations = true
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-10
multi_system_fixed_point=true
multi_system_fixed_point_convergence=linear
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
[]
[]
(test/tests/linearfvbcs/robin/diffusion-1d-robin.i)
##################################################################
k = 7.0 # diffusion coeff.
amp = 3.6 # sinusoid amplitude, for u_exact
x_l = ${fparse 0.0*pi} # domain bound (left)
x_r = ${fparse 0.9*pi} # domain bound (right)
alpha = 5.000 # robin BC coeff for gradient term
beta = 2.000 # robin BC coeff for variable term
gamma = ${fparse (alpha*amp*cos(x_r) ) + (beta*amp*sin(x_r))} # RHS of Robin BC, applied at right boundary
npts = 2
##################################################################
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
nx = ${npts}
xmin = ${x_l}
xmax = ${x_r}
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 0.0
[]
[]
[Functions]
[u_exact]
type = ParsedFunction
expression = '${amp}*sin(x)'
[]
[source_fn]
type = ParsedFunction
expression = '${fparse k*amp}*sin(x)'
[]
[]
[LinearFVKernels]
[diffusion]
type = LinearFVDiffusion
variable = u
diffusion_coeff = ${k}
use_nonorthogonal_correction = False
[]
[source]
type = LinearFVSource
variable = u
source_density = source_fn
[]
[]
[LinearFVBCs]
[dir_r]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "left"
functor = 0
[]
[rob_l]
type = LinearFVAdvectionDiffusionFunctorRobinBC
variable = u
boundary = "right"
alpha = ${alpha}
beta = ${beta}
gamma = ${gamma}
[]
[]
[Postprocessors]
[h]
type = AverageElementSize
execute_on = FINAL
[]
[error]
type = ElementL2FunctorError
approximate = u
exact = u_exact
execute_on = FINAL
[]
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
[]
[]
[Convergence]
[linear]
type = IterationCountConvergence
max_iterations = 4
converge_at_max_iterations = true
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-7
linear_convergence = linear
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
(modules/heat_transfer/test/tests/radiation_participating_media/rad_T_coupled_medium_1d_T.i)
# The test guarantees that the P1 radiation model in the Linear FV system using the linear system solver
# can be used with MultiApps. The solution update of the energy system is relaxed to improve convergence
# of the coupled energy and radiative systems.
# This simulation is a 1D test with Dirichlet BCs on the left and right of the domain. Marshak BCs are
# applied at the boundaries for G.
k = 1.0
sigma_a = 0.33333
r_wall_temp = 400.0
l_wall_temp = 300.0
[Mesh]
[salt_mesh]
type = GeneratedMeshGenerator
dim = 1
nx = 100
xmin = -0.5
xmax = 0.5
[]
[]
[Problem]
linear_sys_names = 'energy_system'
previous_nl_solution_required = true
[]
[Variables]
[T]
type = MooseLinearVariableFVReal
solver_sys = 'energy_system'
initial_condition = 350
[]
[]
[AuxVariables]
[G]
type = MooseLinearVariableFVReal
initial_condition = 3400
[]
[]
[LinearFVKernels]
[temp_conduction]
type = LinearFVDiffusion
diffusion_coeff = ${k}
variable = T
[]
[temp_radiation]
type = LinearFVP1TemperatureSourceSink
variable = T
G = 'G'
absorption_coeff = ${sigma_a}
[]
[]
[LinearFVBCs]
[left_bc_T]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = T
boundary = 'left'
functor = ${l_wall_temp}
[]
[right_bc_T]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = T
boundary = 'right'
functor = ${r_wall_temp}
[]
[]
[Postprocessors]
[mean_value_G]
type = ElementIntegralFunctorPostprocessor
functor = G
[]
[max_value_G]
type = ElementExtremeFunctorValue
functor = G
[]
[mean_value_T]
type = ElementIntegralFunctorPostprocessor
functor = T
[]
[max_value_T]
type = ElementExtremeFunctorValue
functor = T
[]
[]
[Executioner]
type = Steady
solve_type = 'Linear'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
l_abs_tol = 1e-14
l_tol = 1e-14
nl_abs_tol = 1e-14
# MultiApp fixed point iteration parameters
fixed_point_min_its = 2
fixed_point_max_its = 500
relaxation_factor = 0.9
transformed_variables = 'T'
fixed_point_rel_tol = 1e-12
fixed_point_abs_tol = 1e-12
[]
[Outputs]
csv = true
exodus = true
execute_on = timestep_end
[]
[MultiApps]
[sub_app]
type = FullSolveMultiApp
input_files = 'rad_T_coupled_medium_1d_G.i'
[]
[]
[Transfers]
[push]
type = MultiAppCopyTransfer
to_multi_app = sub_app
source_variable = 'T'
variable = 'T'
[]
[pull]
type = MultiAppCopyTransfer
from_multi_app = sub_app
source_variable = 'G'
variable = 'G'
[]
[]
(modules/navier_stokes/test/tests/finite_volume/ins/channel-flow/SIMPLEC/3d/3d-velocity-pressure.i)
mu = 2.6
rho = 1.0
advected_interp_method = 'average'
[Mesh]
[mesh]
type = CartesianMeshGenerator
dim = 3
dx = '1.0'
dy = '0.3'
dz = '0.3'
ix = '10'
iy = '3'
iz = '3'
[]
[]
[Problem]
linear_sys_names = 'u_system v_system w_system pressure_system'
previous_nl_solution_required = true
[]
[UserObjects]
[rc]
type = RhieChowMassFlux
u = vel_x
v = vel_y
w = vel_z
pressure = pressure
rho = ${rho}
p_diffusion_kernel = p_diffusion
pressure_projection_method = consistent
[]
[]
[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
[]
[vel_z]
type = MooseLinearVariableFVReal
solver_sys = w_system
initial_condition = 0.0
[]
[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
w = vel_z
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
w = vel_z
momentum_component = 'y'
rhie_chow_user_object = 'rc'
use_nonorthogonal_correction = false
[]
[w_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_z
advected_interp_method = ${advected_interp_method}
mu = ${mu}
u = vel_x
v = vel_y
w = vel_z
momentum_component = 'z'
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'
[]
[w_pressure]
type = LinearFVMomentumPressure
variable = vel_z
pressure = pressure
momentum_component = 'z'
[]
[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 = '1.1'
[]
[inlet-v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left'
variable = vel_y
functor = '0.0'
[]
[inlet-w]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left'
variable = vel_z
functor = '0.0'
[]
[walls-u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'top bottom back front'
variable = vel_x
functor = 0.0
[]
[walls-v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'top bottom back front'
variable = vel_y
functor = 0.0
[]
[walls-w]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'top bottom back front'
variable = vel_z
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
[]
[outlet_w]
type = LinearFVAdvectionDiffusionOutflowBC
variable = vel_z
use_two_term_expansion = false
boundary = right
[]
[]
[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 w_system'
pressure_system = 'pressure_system'
momentum_equation_relaxation = 0.8
pressure_variable_relaxation = 1.0
num_iterations = 100
pressure_absolute_tolerance = 1e-10
momentum_absolute_tolerance = 1e-10
momentum_petsc_options_iname = '-pc_type -pc_hypre_type -pc_hypre_boomeramg_agg_nl -pc_hypre_boomeramg_agg_num_paths -pc_hypre_boomeramg_truncfactor -pc_hypre_boomeramg_strong_threshold -pc_hypre_boomeramg_coarsen_type -pc_hypre_boomeramg_interp_type'
momentum_petsc_options_value = 'hypre boomeramg 4 1 0.1 0.6 HMIS ext+i'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type -pc_hypre_boomeramg_agg_nl -pc_hypre_boomeramg_agg_num_paths -pc_hypre_boomeramg_truncfactor -pc_hypre_boomeramg_strong_threshold -pc_hypre_boomeramg_coarsen_type -pc_hypre_boomeramg_interp_type'
pressure_petsc_options_value = 'hypre boomeramg 2 1 0.1 0.6 HMIS ext+i'
print_fields = false
[]
[Outputs]
exodus = true
[]
(modules/navier_stokes/test/tests/finite_volume/ins/cht/bulk_heat_transfer/flow-around-square-linear-fluidonly.i)
mu = 0.01
rho = 1.1
k = 0.0005
cp = 10
h_conv = 5
advected_interp_method = 'upwind'
[Mesh]
[generated_mesh]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 10
xmin = 0
ymin = 0
ymax = 0.1
xmax = 0.1
[]
[subdomain1]
type = SubdomainBoundingBoxGenerator
input = generated_mesh
block_name = subdomain1
bottom_left = '0.04 0.04 0'
block_id = 1
top_right = '0.06 0.06 0'
[]
[interface]
type = SideSetsBetweenSubdomainsGenerator
input = subdomain1
primary_block = 0
paired_block = 1
new_boundary = interface
[]
[delete]
type = BlockDeletionGenerator
input = interface
block = 1
[]
[]
[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
block = 0
[]
[]
[Variables]
[vel_x]
type = MooseLinearVariableFVReal
initial_condition = 0.1
solver_sys = u_system
block = 0
[]
[vel_y]
type = MooseLinearVariableFVReal
solver_sys = v_system
initial_condition = 0.01
block = 0
[]
[pressure]
type = MooseLinearVariableFVReal
solver_sys = pressure_system
initial_condition = 0.2
block = 0
[]
[T_fluid]
type = MooseLinearVariableFVReal
solver_sys = energy_system
initial_condition = 300
block = 0
[]
[]
[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 = true
[]
[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 = true
[]
[u_pressure]
type = LinearFVMomentumPressure
variable = vel_x
pressure = pressure
momentum_component = 'x'
[]
[v_pressure]
type = LinearFVMomentumPressure
variable = vel_y
pressure = pressure
momentum_component = 'y'
[]
[p_diffusion]
type = LinearFVAnisotropicDiffusion
variable = pressure
diffusion_tensor = Ainv
use_nonorthogonal_correction = true
[]
[HbyA_divergence]
type = LinearFVDivergence
variable = pressure
face_flux = HbyA
force_boundary_execution = true
[]
[h_advection]
type = LinearFVEnergyAdvection
variable = T_fluid
advected_quantity = temperature
cp = ${cp}
advected_interp_method = ${advected_interp_method}
rhie_chow_user_object = 'rc'
[]
[conduction]
type = LinearFVDiffusion
variable = T_fluid
diffusion_coeff = ${k}
use_nonorthogonal_correction = true
[]
[]
[LinearFVBCs]
[inlet-u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left'
variable = vel_x
functor = '0.1'
[]
[inlet-v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left'
variable = vel_y
functor = '0.0'
[]
[walls-u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'top bottom interface'
variable = vel_x
functor = 0.0
[]
[walls-v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'top bottom interface'
variable = vel_y
functor = 0.0
[]
[outlet_p]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'right'
variable = pressure
functor = 1.4
[]
[outlet_u]
type = LinearFVAdvectionDiffusionOutflowBC
variable = vel_x
use_two_term_expansion = false
boundary = right
[]
[outlet_v]
type = LinearFVAdvectionDiffusionOutflowBC
variable = vel_y
use_two_term_expansion = false
boundary = right
[]
[inlet_T]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = T_fluid
functor = 300
boundary = 'left'
[]
[walls_T]
type = LinearFVAdvectionDiffusionFunctorNeumannBC
variable = T_fluid
functor = 0.0
boundary = 'top bottom'
[]
[outlet_T]
type = LinearFVAdvectionDiffusionOutflowBC
variable = T_fluid
use_two_term_expansion = false
boundary = right
[]
[fluid_solid]
type = LinearFVConvectiveHeatTransferBC
variable = T_fluid
T_solid = boundary_value
T_fluid = T_fluid
boundary = interface
h = ${h_conv}
[]
[]
[FunctorMaterials]
[rhocpT]
property_name = 'rhocpT'
type = ParsedFunctorMaterial
functor_names = 'T_fluid'
expression = '${rho}*${cp}*T_fluid'
[]
[]
[Functions]
[boundary_value]
type = ConstantFunction
value = 350
[]
[]
[Executioner]
type = SIMPLE
momentum_l_abs_tol = 1e-13
pressure_l_abs_tol = 1e-13
energy_l_abs_tol = 1e-13
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 = 1.0
pressure_variable_relaxation = 0.3
num_iterations = 1000
pressure_absolute_tolerance = 1e-10
momentum_absolute_tolerance = 1e-10
energy_absolute_tolerance = 1e-10
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
[]
[Outputs]
exodus = true
execute_on = timestep_end
[]
(modules/navier_stokes/test/tests/finite_volume/ins/turbulence/bfs/linear-segregated/BFS_ERCOFTAC.i)
Re = 5100
rho = 1.0
bulk_u = 1.0
H = 1.0
mu = '${fparse rho * bulk_u * H / Re}'
advected_interp_method = 'upwind'
### k-epsilon Closure Parameters ###
sigma_k = 1.0
sigma_eps = 1.3
C1_eps = 1.44
C2_eps = 1.92
C_mu = 0.09
### Initial and Boundary Conditions ###
intensity = 0.01
k_init = '${fparse 1.5*(intensity * bulk_u)^2}'
eps_init = '${fparse C_mu^0.75 * k_init^1.5 / H}'
### Modeling parameters ###
bulk_wall_treatment = false
walls = 'bottom wall-side top'
wall_treatment = 'eq_incremental' # Options: eq_newton, eq_incremental, eq_linearized, neq
[Mesh]
[gen]
type = CartesianMeshGenerator
dim = 2
dx = '${fparse 10.0*H} ${fparse 20.0*H}'
dy = '${H} ${fparse 5*H}'
ix = '8 16'
iy = '2 8'
subdomain_id = '
2 1
1 1
'
[]
[corner_walls]
type = SideSetsBetweenSubdomainsGenerator
input = gen
primary_block = '1'
paired_block = '2'
new_boundary = 'wall-side'
[]
[delete_bottom]
type = BlockDeletionGenerator
input = corner_walls
block = '2'
[]
# 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
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
advected_interp_method = ${advected_interp_method}
[]
[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 = ${bulk_u}
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
advected_interp_method = ${advected_interp_method}
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
advected_interp_method = ${advected_interp_method}
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]
[inlet-u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left'
variable = vel_x
functor = '${bulk_u}'
[]
[inlet-v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left'
variable = vel_y
functor = '0.0'
[]
[inlet_TKE]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left'
variable = TKE
functor = '${k_init}'
[]
[inlet_TKED]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left'
variable = TKED
functor = '${eps_init}'
[]
[outlet_p]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'right'
variable = pressure
functor = 0.0
[]
[outlet_u]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = 'right'
variable = vel_x
use_two_term_expansion = false
[]
[outlet_v]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = 'right'
variable = vel_y
use_two_term_expansion = false
[]
[outlet_TKE]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = 'right'
variable = TKE
use_two_term_expansion = false
[]
[outlet_TKED]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = 'right'
variable = TKED
use_two_term_expansion = false
[]
[walls-u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = ${walls}
variable = vel_x
functor = 0.0
[]
[walls-v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = ${walls}
variable = vel_y
functor = 0.0
[]
[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 + mu}'
[]
[]
[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
[]
[Outputs]
csv = true
[console]
type = Console
outlier_variable_norms = false
[]
[]
[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'
[]
[line_entry_channel_wall]
type = LineValueSampler
start_point = '${fparse 0.5 * H} ${fparse 1.00001 * H} 0'
end_point = '${fparse 29.5 * H} ${fparse 1.00001 * H} 0'
num_points = 24
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[line_quarter_entry_channel]
type = LineValueSampler
start_point = '${fparse 0.5 * H} ${fparse 2.25001 * H} 0'
end_point = '${fparse 29.5 * H} ${fparse 2.25001 * H} 0'
num_points = 24
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[]
(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
[]
[]
(test/tests/multiapps/linearfv_nonlinearfv/linearfv.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
nx = 6
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
[]
[]
[AuxVariables]
[diff_var]
type = MooseVariableFVReal
initial_condition = 2.0
[]
[]
[LinearFVKernels]
[diffusion]
type = LinearFVDiffusion
variable = u
diffusion_coeff = diff_var
[]
[source]
type = LinearFVSource
variable = u
source_density = 1
[]
[]
[LinearFVBCs]
[dir]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "left right"
functor = 1
[]
[]
[MultiApps]
inactive = 'nonlinear'
[nonlinear]
type = FullSolveMultiApp
input_files = nonlinearfv.i
execute_on = timestep_begin
no_restore = true
[]
[]
[Transfers]
inactive = 'from_nonlinear to_nonlinear'
[from_nonlinear]
type = MultiAppCopyTransfer
from_multi_app = nonlinear
source_variable = 'v'
variable = 'diff_var'
execute_on = timestep_begin
[]
[to_nonlinear]
type = MultiAppCopyTransfer
to_multi_app = nonlinear
source_variable = 'u'
variable = 'diff_var'
execute_on = timestep_begin
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-10
petsc_options_iname = '-pc_type -pc_factor_mat_solver_type'
petsc_options_value = 'lu mumps'
fixed_point_rel_tol = 1e-10
[]
[Outputs]
exodus = true
execute_on = timestep_end
[]
(test/tests/linearfvkernels/diffusion/diffusion-2d_neumann.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 2
ny = 1
ymax = 0.5
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
[]
[]
[LinearFVKernels]
[diffusion]
type = LinearFVDiffusion
variable = u
diffusion_coeff = coeff_func
use_nonorthogonal_correction = false
[]
[source]
type = LinearFVSource
variable = u
source_density = source_func
[]
[]
[LinearFVBCs]
[dir]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "left right"
functor = analytic_solution
[]
[neu_bottom]
type = LinearFVAdvectionDiffusionFunctorNeumannBC
variable = u
boundary = "bottom"
functor = analytic_solution_neumann_bottom
diffusion_coeff = coeff_func
[]
[neu_top]
type = LinearFVAdvectionDiffusionFunctorNeumannBC
variable = u
boundary = "top"
functor = analytic_solution_neumann_top
diffusion_coeff = coeff_func
[]
[]
[Functions]
[coeff_func]
type = ParsedFunction
expression = '1+0.5*x*y'
[]
[source_func]
type = ParsedFunction
expression = '2*(1.5-y*y)+2*x*y*(1.5-y*y)+2*(1.5-x*x)+2*x*y*(1.5-x*x)'
[]
[analytic_solution]
type = ParsedFunction
expression = '(1.5-x*x)*(1.5-y*y)'
[]
[analytic_solution_neumann_bottom]
type = ParsedFunction
expression = '-(1+0.5*x*y)*(1.5-x*x)*(-2*y)'
[]
[analytic_solution_neumann_top]
type = ParsedFunction
expression = '(1+0.5*x*y)*(1.5-x*x)*(-2*y)'
[]
[]
[Postprocessors]
[h]
type = AverageElementSize
execute_on = FINAL
[]
[error]
type = ElementL2FunctorError
approximate = u
exact = analytic_solution
execute_on = FINAL
[]
[]
[Convergence]
[linear]
type = IterationCountConvergence
max_iterations = 1
converge_at_max_iterations = true
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-10
multi_system_fixed_point=true
multi_system_fixed_point_convergence=linear
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
[]
[]
(modules/navier_stokes/test/tests/finite_volume/ins/channel-flow/linear-segregated/2d/rotated-channel.i)
mu = 1
rho = 1
advected_interp_method = 'average'
[Mesh]
[mesh]
type = GeneratedMeshGenerator
dim = 2
xmax = 5
nx = 20
ny = 4
[]
[transform]
type = TransformGenerator
transform = rotate
vector_value = '45 0 0'
input = mesh
[]
[]
[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
solver_sys = u_system
[]
[vel_y]
type = MooseLinearVariableFVReal
solver_sys = v_system
[]
[pressure]
type = MooseLinearVariableFVReal
solver_sys = pressure_system
[]
[]
[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]
[inlet-u]
type = LinearFVNormalVelocityFunctorDirichletBC
boundary = 'left'
variable = vel_x
normal_velocity = '-1'
component = 'x'
[]
[inlet-v]
type = LinearFVNormalVelocityFunctorDirichletBC
boundary = 'left'
variable = vel_y
normal_velocity = '-1'
component = 'y'
[]
[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 = 0
[]
[outlet_u]
type = LinearFVAdvectionDiffusionOutflowBC
variable = vel_x
use_two_term_expansion = false
boundary = right
[]
[outlet_v]
type = LinearFVAdvectionDiffusionOutflowBC
variable = vel_y
use_two_term_expansion = false
boundary = right
[]
[]
[Executioner]
type = SIMPLE
momentum_l_abs_tol = 1e-10
pressure_l_abs_tol = 1e-10
momentum_l_tol = 0
pressure_l_tol = 0
rhie_chow_user_object = 'rc'
momentum_systems = 'u_system v_system'
pressure_system = 'pressure_system'
momentum_equation_relaxation = 0.8
pressure_variable_relaxation = 0.3
num_iterations = 100
pressure_absolute_tolerance = 1e-10
momentum_absolute_tolerance = 1e-10
momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
momentum_petsc_options_value = 'hypre boomeramg'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
pressure_petsc_options_value = 'hypre boomeramg'
print_fields = false
[]
[Outputs]
exodus = true
[]
(test/tests/time_steppers/iteration_adaptive/adapt_linear_systems.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 50
ny = 2
xmax = 5
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
[]
[]
[LinearFVKernels]
[time]
type = LinearFVTimeDerivative
variable = 'u'
[]
[diffusion]
type = LinearFVDiffusion
variable = u
diffusion_coeff = 5
[]
[source]
type = LinearFVSource
variable = u
source_density = 2
[]
[]
[LinearFVBCs]
[dir]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "left right"
functor = 12
[]
[]
[Executioner]
type = Transient
system_names = u_sys
start_time = 0.0
end_time = 19
n_startup_steps = 2
dtmax = 6.0
[TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 8
dt = 1.0
[]
verbose = true
linear_convergence = much_logic
[]
[Convergence]
[force_grow]
type = IterationCountConvergence
min_iterations = 0
max_iterations = 4
converge_at_max_iterations = true
[]
[force_shrink]
type = IterationCountConvergence
min_iterations = 12
max_iterations = 13
converge_at_max_iterations = true
[]
[much_logic]
type = ParsedConvergence
convergence_expression = 'if(time < 5, force_grow, force_shrink)'
symbol_names = 'time force_grow force_shrink'
symbol_values = 'time force_grow force_shrink'
[]
[]
[Postprocessors]
[_dt]
type = TimestepSize
[]
[time]
type = TimePostprocessor
[]
[]
[Outputs]
csv = true
[]
(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/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
body_force_kernel_names = "u_buoyancy; v_buoyancy"
[]
[]
[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
[]
[]
[LinearFVKernels]
[u_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_x
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
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 = LinearFVAnisotropicDiffusion
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
[]
[]
[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'
[]
[]
(test/tests/linearfvbcs/scalar_symmetry/diffusion-2d-symmetry.i)
diff = 0.1 # diffusion coeff.
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 2
ny = 2
xmin = 0
xmax = ${fparse pi/3}
ymin = 0
ymax = ${fparse pi/3}
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 0.0
[]
[]
[Functions]
[u_exact]
type = ParsedFunction
expression = 'cos(x)*cos(y)'
[]
[source_fn]
type = ParsedFunction
expression = '2*${diff}*cos(x)*cos(y)'
[]
[]
[LinearFVKernels]
[diffusion]
type = LinearFVDiffusion
variable = u
diffusion_coeff = ${diff}
use_nonorthogonal_correction = true
[]
[source]
type = LinearFVSource
variable = u
source_density = source_fn
[]
[]
[LinearFVBCs]
[dir]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "right top"
functor = u_exact
[]
[symm]
type = LinearFVAdvectionDiffusionScalarSymmetryBC
variable = u
boundary = "bottom left"
use_two_term_expansion = true
[]
[]
[Postprocessors]
[h]
type = AverageElementSize
execute_on = FINAL
[]
[error]
type = ElementL2FunctorError
approximate = u
exact = u_exact
execute_on = FINAL
[]
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
[]
[]
[Convergence]
[linear]
type = IterationCountConvergence
max_iterations = 10
converge_at_max_iterations = true
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-7
multi_system_fixed_point = true
multi_system_fixed_point_convergence = linear
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
linear_convergence = linear
[]
(modules/heat_transfer/test/tests/linearfvbcs/linear_fv_functor_radiative_bc/linear_fv_functor_radiative_bc.i)
# 1D steady-state heat conduction with a radiative BC on the right boundary.
# The domain is [0,1] with:
# Left: Dirichlet temperature T_L (fixed)
# Right: LinearFVFunctorRadiativeBC, q = sigma * eps * (T^4 - Tinf^4)
# A pseudo-transient approach (large dt steps) iteratively updates the
# lagged linearization coefficients until convergence to the nonlinear solution.
T_L = 1000.0 # Left boundary temperature [K]
T_inf = 300.0 # Far-field radiation temperature [K]
eps = 1.0 # Emissivity
k = 1.0 # Thermal conductivity [W/(m-K)]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 1
nx = 50
xmin = 0
xmax = 1
[]
[]
[Problem]
linear_sys_names = 'heat_system'
[]
[Variables]
[T]
type = MooseLinearVariableFVReal
solver_sys = 'heat_system'
initial_condition = ${T_L}
[]
[]
[LinearFVKernels]
[time]
type = LinearFVTimeDerivative
variable = T
[]
[diffusion]
type = LinearFVDiffusion
variable = T
diffusion_coeff = ${k}
[]
[]
[LinearFVBCs]
[left]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = T
boundary = 'left'
functor = ${T_L}
[]
[right]
type = LinearFVFunctorRadiativeBC
variable = T
boundary = 'right'
emissivity = ${eps}
Tinfinity = ${T_inf}
diffusion_coeff = ${k}
[]
[]
[Postprocessors]
[T_avg]
type = ElementAverageValue
variable = T
[]
[T_max]
type = ElementExtremeValue
variable = T
value_type = max
[]
[T_min]
type = ElementExtremeValue
variable = T
value_type = min
[]
[]
[Executioner]
type = Transient
system_names = heat_system
scheme = 'implicit-euler'
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
dt = 1e6
num_steps = 50
l_tol = 1e-10
[]
[Outputs]
file_base = 'linear_fv_functor_radiative_bc_hot_body_out'
[csv]
type = CSV
execute_on = final
[]
[]
(modules/navier_stokes/test/tests/finite_volume/ins/turbulence/channel/linear-segregated/channel_ERCOFTAC-physics.i)
!include header_and_mesh.i
[Problem]
linear_sys_names = 'u_system v_system pressure_system TKE_system TKED_system'
previous_nl_solution_required = true
[]
[Physics]
[NavierStokes]
[FlowSegregated/flow]
velocity_variable = 'vel_x vel_y'
pressure_variable = 'pressure'
# Initial conditions
initial_velocity = '${bulk_u} 0 0'
initial_pressure = '1e-8'
# Material properties
density = ${rho}
dynamic_viscosity = ${mu}
# Boundary conditions
inlet_boundaries = 'left'
momentum_inlet_types = 'fixed-velocity'
momentum_inlet_functors = '${bulk_u} 0'
wall_boundaries = 'top bottom'
momentum_wall_types = 'noslip noslip'
outlet_boundaries = 'right'
momentum_outlet_types = 'fixed-pressure'
pressure_functors = '0'
# Numerical parameters
include_deviatoric_stress = true
orthogonality_correction = false
pressure_two_term_bc_expansion = false
momentum_two_term_bc_expansion = false
momentum_advection_interpolation = ${advected_interp_method}
system_names = 'u_system v_system pressure_system'
# consistency with kernel syntax input, allows to use the same executioner block
rhie_chow_uo_name = 'rc'
[]
[TurbulenceSegregated/k-epsilon]
# Model
turbulence_handling = 'k-epsilon'
tke_name = TKE
tked_name = TKED
system_names = 'TKE_system TKED_system'
initial_tke = ${k_init}
initial_tked = ${eps_init}
# Model parameters
mu_t_ratio_max = 1e20
sigma_k = ${sigma_k}
sigma_eps = ${sigma_eps}
C_pl = 1e10
C1_eps = ${C1_eps}
C2_eps = ${C2_eps}
turbulence_walls = ${walls}
wall_treatment_eps = ${wall_treatment}
bulk_wall_treatment = ${bulk_wall_treatment}
use_nonorthogonal_correction = false
[]
[]
[]
# Boundary conditions are not implemented for turbulent quantities at this time
[LinearFVBCs]
[inlet_TKE]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left'
variable = TKE
functor = '${k_init}'
[]
[outlet_TKE]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = 'right'
variable = TKE
use_two_term_expansion = false
[]
[inlet_TKED]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left'
variable = TKED
functor = '${eps_init}'
[]
[outlet_TKED]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = 'right'
variable = TKED
use_two_term_expansion = false
[]
[]
!include executioner_regular_channel.i
variables_to_sample = 'vel_x vel_y pressure_over_density TKE TKED'
!include postprocessing.i
(test/tests/multisystem/restore_multiapp/parent.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
nx = 6
[]
[]
[Problem]
nl_sys_names = 'v_sys'
linear_sys_names = 'u_sys'
[]
[Variables]
[v]
type = MooseVariableFVReal
initial_condition = 2.0
solver_sys = v_sys
[]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
[]
[]
[FVKernels]
[diffusion]
type = FVDiffusion
variable = v
coeff = u
[]
[source]
type = FVBodyForce
variable = v
function = 3
[]
[]
[LinearFVKernels]
[diffusion]
type = LinearFVDiffusion
variable = u
diffusion_coeff = v
[]
[source]
type = LinearFVSource
variable = u
source_density = 1
[]
[]
[FVBCs]
[dir]
type = FVFunctorDirichletBC
variable = v
boundary = "left right"
functor = 2
[]
[]
[LinearFVBCs]
[dir]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "left right"
functor = 1
[]
[]
[Convergence]
[linear]
type = IterationCountConvergence
max_iterations = 6
converge_at_max_iterations = true
[]
[]
[MultiApps]
[sub]
type = FullSolveMultiApp
input_files = sub.i
execute_on = TIMESTEP_END
keep_solution_during_restore = true
# The choice does not matter here, but conceptually there is no need to override
# the old solution when the subapp is a Steady solve
update_old_solution_when_keeping_solution_during_restore = false
[]
[]
[Executioner]
type = Steady
system_names = 'v_sys u_sys'
l_abs_tol = 1e-12
l_tol = 1e-10
nl_abs_tol = 1e-10
multi_system_fixed_point=true
multi_system_fixed_point_convergence=linear
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
fixed_point_max_its = 2
fixed_point_min_its = 2
#disable_fixed_point_residual_norm_check = true
accept_on_max_fixed_point_iteration = true
[]
(modules/navier_stokes/test/tests/finite_volume/ins/turbulence/channel/linear-segregated/channel_ERCOFTAC_symmetric.i)
H = 1 #halfwidth of the channel
L = 100
Re = 13700
rho = 1
bulk_u = 1
mu = '${fparse rho * bulk_u * 2 * H / Re}'
advected_interp_method = 'upwind'
### k-epsilon Closure Parameters ###
sigma_k = 1.0
sigma_eps = 1.3
C1_eps = 1.44
C2_eps = 1.92
C_mu = 0.09
### Initial and Boundary Conditions ###
intensity = '${fparse 0.16*Re^(-1./8.)}'
k_init = '${fparse 1.5*(intensity * bulk_u)^2}'
eps_init = '${fparse C_mu^0.75 * k_init^1.5 / (2*H)}'
### Modeling parameters ###
bulk_wall_treatment = false
walls = 'top'
wall_treatment = 'eq_newton' # Options: eq_newton, eq_incremental, eq_linearized, neq
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${L}
ymin = 0
ymax = ${H}
nx = 4
ny = 4
bias_y = 0.7
[]
allow_renumbering = false
[]
[Problem]
linear_sys_names = 'u_system v_system pressure_system TKE_system TKED_system'
previous_nl_solution_required = true
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
advected_interp_method = ${advected_interp_method}
[]
[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 = ${bulk_u}
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
advected_interp_method = ${advected_interp_method}
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
advected_interp_method = ${advected_interp_method}
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]
[inlet-u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left'
variable = vel_x
functor = '${bulk_u}'
[]
[inlet-v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left'
variable = vel_y
functor = '0.0'
[]
[walls-u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = ${walls}
variable = vel_x
functor = 0.0
[]
[walls-v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = ${walls}
variable = vel_y
functor = 0.0
[]
[symmetry-u]
type = LinearFVVelocitySymmetryBC
variable = vel_x
boundary = 'bottom'
momentum_component = 'x'
u = 'vel_x'
v = 'vel_y'
[]
[symmetry-v]
type = LinearFVVelocitySymmetryBC
variable = vel_y
boundary = 'bottom'
momentum_component = 'y'
u = 'vel_x'
v = 'vel_y'
[]
[outlet_u]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = 'right'
variable = vel_x
use_two_term_expansion = false
[]
[outlet_v]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = 'right'
variable = vel_y
use_two_term_expansion = false
[]
[symmetry-p]
type = LinearFVPressureSymmetryBC
variable = pressure
boundary = 'bottom'
HbyA_flux = 'HbyA' # Functor created in the RhieChowMassFlux UO
[]
[outlet_p]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'right'
variable = pressure
functor = 0.0
[]
[inlet_TKE]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left'
variable = TKE
functor = '${k_init}'
[]
[outlet_TKE]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = 'right'
variable = TKE
use_two_term_expansion = false
[]
[inlet_TKED]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left'
variable = TKED
functor = '${eps_init}'
[]
[outlet_TKED]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = 'right'
variable = TKED
use_two_term_expansion = false
[]
[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
[]
[]
[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'
[]
[]
[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.2 0.2'
turbulence_field_relaxation = '0.2 0.2'
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
[]
[Outputs]
csv = true
execute_on = 'TIMESTEP_END'
[]
[AuxVariables]
[pressure_over_density]
type = MooseLinearVariableFVReal
solver_sys = TKE_system
initial_condition = ${k_init}
[]
[]
[AuxKernels]
[compute_pressure_over_density]
type = ParsedAux
variable = pressure_over_density
coupled_variables = 'pressure'
expression = 'pressure/${rho}'
[]
[]
[VectorPostprocessors]
[side_top]
type = SideValueSampler
boundary = 'top'
variable = 'vel_x vel_y pressure_over_density TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[line_center_channel]
type = LineValueSampler
start_point = '${fparse 0.125 * L} ${fparse 0.0001} 0'
end_point = '${fparse 0.875 * L} ${fparse 0.0001} 0'
num_points = ${Mesh/gmg/nx}
variable = 'vel_x vel_y pressure_over_density TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[line_quarter_radius_channel]
type = LineValueSampler
start_point = '${fparse 0.125 * L} ${fparse 0.5 * H} 0'
end_point = '${fparse 0.875 * L} ${fparse 0.5 * H} 0'
num_points = ${Mesh/gmg/nx}
variable = 'vel_x vel_y pressure_over_density TKE TKED'
sort_by = 'x'
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'
[]
[]
(modules/navier_stokes/test/tests/finite_volume/ins/natural_convection/linear_segregated/2d/diff_heated_cavity_linear_buoyancy.i)
################################################################################
# MATERIAL PROPERTIES
################################################################################
rho_0 = 3279.
mu = 1.0
k_cond = 38.0
cp = ${fparse 640}
alpha_b = 3.26e-5
T_0 = 875.0
walls = 'right left top bottom'
[GlobalParams]
rhie_chow_user_object = 'ins_rhie_chow_interpolator'
advected_interp_method = 'upwind'
u = vel_x
v = vel_y
[]
[Problem]
linear_sys_names = 'u_system v_system pressure_system energy_system'
previous_nl_solution_required = true
[]
################################################################################
# GEOMETRY
################################################################################
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 1
xmax = 2.0
ymin = 1.0
ymax = 2.0
nx = 15
ny = 15
[]
[]
################################################################################
# EQUATIONS: VARIABLES, KERNELS & BCS
################################################################################
[UserObjects]
[ins_rhie_chow_interpolator]
type = RhieChowMassFlux
u = vel_x
v = vel_y
pressure = pressure
rho = 'rho'
p_diffusion_kernel = p_diffusion
body_force_kernel_names = 'u_buoyancy; v_buoyancy'
[]
[]
[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
[]
[]
[LinearFVKernels]
[u_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_x
mu = ${mu}
momentum_component = 'x'
use_nonorthogonal_correction = false
[]
[u_pressure]
type = LinearFVMomentumPressure
variable = vel_x
pressure = pressure
momentum_component = 'x'
[]
[u_buoyancy]
type = LinearFVMomentumBuoyancy
variable = vel_x
rho = 'rho'
reference_rho = ${rho_0}
gravity = '0 -9.81 0'
momentum_component = 'x'
[]
[v_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_y
mu = ${mu}
momentum_component = 'y'
use_nonorthogonal_correction = false
[]
[v_pressure]
type = LinearFVMomentumPressure
variable = vel_y
pressure = pressure
momentum_component = 'y'
[]
[v_buoyancy]
type = LinearFVMomentumBuoyancy
variable = vel_y
rho = 'rho'
reference_rho = ${rho_0}
gravity = '0 -9.81 0'
momentum_component = 'y'
[]
[p_diffusion]
type = LinearFVAnisotropicDiffusion
variable = pressure
diffusion_tensor = Ainv
use_nonorthogonal_correction = false
[]
[HbyA_divergence]
type = LinearFVDivergence
variable = pressure
face_flux = HbyA
force_boundary_execution = false
[]
####### FUEL ENERGY EQUATION #######
[heat_advection]
type = LinearFVEnergyAdvection
variable = T_fluid
advected_quantity = temperature
cp = ${cp}
[]
[conduction]
type = LinearFVDiffusion
variable = T_fluid
diffusion_coeff = ${k_cond}
[]
[]
[LinearFVBCs]
[no-slip-u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = vel_x
boundary = ${walls}
functor = 0
[]
[no-slip-v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = vel_y
boundary = ${walls}
functor = 0
[]
[T_cold]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = T_fluid
boundary = 'right'
functor = 870.0
[]
[T_hot]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = T_fluid
boundary = 'left'
functor = 880.0
[]
[T_all]
type = LinearFVAdvectionDiffusionFunctorNeumannBC
variable = T_fluid
boundary = 'top bottom'
functor = 0.0
[]
[pressure]
type = LinearFVPressureFluxBC
boundary = 'top bottom left right'
variable = pressure
HbyA_flux = HbyA
Ainv = Ainv
[]
[]
[FunctorMaterials]
[rho_function]
type = ParsedFunctorMaterial
property_name = 'rho'
functor_names = 'T_fluid'
expression = '${rho_0}*(1-${alpha_b}*(T_fluid-${T_0})) '
[]
[]
################################################################################
# EXECUTION / SOLVE
################################################################################
[Executioner]
type = SIMPLE
momentum_l_abs_tol = 1e-11
pressure_l_abs_tol = 1e-11
energy_l_abs_tol = 1e-11
momentum_l_tol = 0
pressure_l_tol = 0
energy_l_tol = 0
rhie_chow_user_object = 'ins_rhie_chow_interpolator'
momentum_systems = 'u_system v_system'
pressure_system = 'pressure_system'
energy_system = 'energy_system'
momentum_equation_relaxation = 0.7
pressure_variable_relaxation = 0.3
energy_equation_relaxation = 0.9
num_iterations = 1500
pressure_absolute_tolerance = 1e-8
momentum_absolute_tolerance = 1e-8
energy_absolute_tolerance = 1e-8
print_fields = false
momentum_l_max_its = 300
pin_pressure = true
pressure_pin_value = 0.0
pressure_pin_point = '1.5 1.5 0.0'
momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
momentum_petsc_options_value = 'hypre boomeramg'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
pressure_petsc_options_value = 'hypre boomeramg'
energy_petsc_options_iname = '-pc_type -pc_hypre_type'
energy_petsc_options_value = 'hypre boomeramg'
continue_on_max_its = true
[]
################################################################################
# SIMULATION OUTPUTS
################################################################################
[Outputs]
exodus = true
[]
(test/tests/linearfvkernels/block-restriction/block-restricted-diffusion-react.i)
source=1
diff_coeff=2
reac_coeff=3
[Mesh]
[cmg]
type = CartesianMeshGenerator
dim = 1
dx = '0.5 0.5'
ix = '20 20'
subdomain_id = '1 2'
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
[]
[]
[LinearFVKernels]
[diffusion]
type = LinearFVDiffusion
variable = u
diffusion_coeff = ${diff_coeff}
use_nonorthogonal_correction = false
block = 1
[]
[reaction]
type = LinearFVReaction
variable = u
coeff = ${reac_coeff}
block = 2
[]
[source]
type = LinearFVSource
variable = u
source_density = ${source}
[]
[]
[LinearFVBCs]
[dir]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "left"
functor = 0
[]
[]
[Functions]
[analytic_solution]
type = ParsedFunction
expression = 'if(x<0.5, -x*x*S/2/D+(S/C+0.5*0.5/2/D*S)/0.5*x, S/C)'
symbol_names = 'S D C'
symbol_values = '${source} ${diff_coeff} ${reac_coeff}'
[]
[]
[Postprocessors]
[h]
type = AverageElementSize
execute_on = TIMESTEP_END
block = 2
[]
[error]
type = ElementL2FunctorError
approximate = u
exact = analytic_solution
execute_on = TIMESTEP_END
block = 2
[]
[]
[Convergence]
[linear]
type = IterationCountConvergence
max_iterations = 1
converge_at_max_iterations = true
[]
[]
[Executioner]
type = Steady
system_names = u_sys
multi_system_fixed_point=true
multi_system_fixed_point_convergence=linear
petsc_options_iname = '-pc_type -pc_hypre_type -ksp_rtol'
petsc_options_value = 'hypre boomeramg 1e-10'
[]
[Outputs]
[csv]
type = CSV
execute_on = TIMESTEP_END
[]
[]
(test/tests/linearfvkernels/advection/diagonal-step-2d-delaunay.i)
[Mesh]
[file_mesh]
type = FileMeshGenerator
file = diagonal-step-2d-delaunay_in.e
[]
# Prevent test diffing on distributed parallel element numbering
allow_renumbering = false
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 0.5
[]
[]
[FVInterpolationMethods]
[upwind]
type = FVAdvectedUpwind
[]
[average]
type = FVGeometricAverage
[]
[muscl_venkat]
type = FVAdvectedVenkatakrishnanDeferredCorrection
deferred_correction_factor = 1.0
[]
[nvd_vanleer]
type = FVAdvectedVanLeerWeightBased
blending_factor = 0.75
[]
[nvd_minmod]
type = FVAdvectedMinmodWeightBased
blending_factor = 0.75
[]
[]
[LinearFVKernels]
[advection]
type = LinearFVAdvection
variable = u
velocity = "1 1 0"
advected_interp_method_name = muscl_venkat
[]
[]
[LinearFVBCs]
[left_inflow]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = left
functor = 0.5
[]
[bottom_inflow]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = bottom
functor = 1
[]
[outflow]
type = LinearFVAdvectionDiffusionOutflowBC
variable = u
boundary = 'right top'
use_two_term_expansion = false
[]
[]
[VectorPostprocessors]
[diag_sample]
type = LineValueSampler
variable = u
start_point = '1.0 0 0'
end_point = '0 1.0 0'
num_points = 101
sort_by = id
warn_discontinuous_face_values = false
execute_on = TIMESTEP_END
[]
[]
[Convergence]
[linear]
type = IterationCountConvergence
max_iterations = 200
converge_at_max_iterations = true
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-12
multi_system_fixed_point = true
multi_system_fixed_point_convergence = linear
multi_system_fixed_point_relaxation_factor = 0.3
petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_shift_amount -pc_factor_mat_solver_type -mat_mumps_icntl_14'
petsc_options_value = 'lu NONZERO 1e-12 mumps 50'
[]
[Outputs]
csv = true
exodus = true
execute_on = TIMESTEP_END
[]
(modules/navier_stokes/test/tests/finite_volume/ins/radiation_participating_media/p1_radiation_cht_SIMPLE.i)
# Coupled conduction and radiative heat transfer test in the linear FV system using the SIMPLE executioner.
# A 1D P1 radiation model is solved in the fluid region. Energy is solved in the
# fluid and solid region using two different variables. The radiative and conductive flux
# is maintained at the fluid-solid interface using conjugate heat transfer, Robin BCs for
# the solid side and Dirichlet BCs for the fluid side. Fixed temperatures are set at the solid and
# fluid external boundaries.
### Benchmark sources:
### https://hal.science/hal-02070285/document
nx = 10
Tw_left = 1.0
Tw_right = 0.0
sigma = 5.670374419e-8
sigma_a = 1.0
N = 0.1 # Stark number N = k sigma_a / (4*sigma*pow(T_w,3))
k_salt = ${fparse N*4*sigma*pow(Tw_left,3)/sigma_a}
k_solid = ${fparse 4.0*k_salt}
diffusion_coef = ${fparse 1/(3*sigma_a)}
b_eps = 1.0
rho = 1.
mu = 5.
h_s = 0.0
advected_interp_method = 'upwind'
[Mesh]
[salt_mesh]
type = GeneratedMeshGenerator
dim = 1
nx = ${nx}
xmin = 0
xmax = 1
subdomain_ids = 0
[]
[solid_mesh]
type = GeneratedMeshGenerator
dim = 1
nx = ${nx}
xmin = 1
xmax = 2
subdomain_ids = 1
[]
[give_name_solid]
type = RenameBlockGenerator
input = solid_mesh
old_block = 1
new_block = 'solid'
[]
[give_name_salt]
type = RenameBlockGenerator
input = salt_mesh
old_block = 0
new_block = 'salt'
[]
[stitch]
type = StitchMeshGenerator
inputs = 'give_name_salt give_name_solid'
stitch_boundaries_pairs = 'right left'
[]
[interface]
input = stitch
type = SideSetsBetweenSubdomainsGenerator
primary_block = 'solid'
paired_block = 'salt'
new_boundary = interface
[]
# Prevent test diffing on distributed parallel element numbering
allow_renumbering = false
[]
[Problem]
linear_sys_names = 'u_system pressure_system energy_system solid_energy_system radiation_system '
previous_nl_solution_required = true
[]
[UserObjects]
[rc]
type = RhieChowMassFlux
u = vel_x
pressure = pressure
rho = ${rho}
p_diffusion_kernel = p_diffusion
block = 'salt'
[]
[]
[Variables]
[vel_x]
type = MooseLinearVariableFVReal
initial_condition = 1e-6
solver_sys = 'u_system'
block = 'salt'
[]
[pressure]
type = MooseLinearVariableFVReal
solver_sys = 'pressure_system'
initial_condition = 1e-6
block = 'salt'
[]
[T_fluid]
type = MooseLinearVariableFVReal
solver_sys = 'energy_system'
initial_condition = ${fparse Tw_left/2}
block = 'salt'
[]
[G]
type = MooseLinearVariableFVReal
solver_sys = 'radiation_system'
initial_condition = ${fparse 4*sigma*pow(Tw_left/2,4)}
block = 'salt'
[]
[T_solid]
type = MooseLinearVariableFVReal
solver_sys = 'solid_energy_system'
initial_condition = ${fparse Tw_left/2}
block = 'solid'
[]
[]
[Postprocessors]
[T_fluid_iface]
type = ElementalVariableValue
variable = T_fluid
elementid = ${fparse nx-1}
[]
[T_solid_iface]
type = ElementalVariableValue
variable = T_solid
elementid = ${fparse nx}
[]
[]
[LinearFVKernels]
[u_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_x
advected_interp_method = ${advected_interp_method}
mu = ${mu}
u = vel_x
momentum_component = 'x'
rhie_chow_user_object = 'rc'
use_nonorthogonal_correction = false
[]
[u_pressure]
type = LinearFVMomentumPressure
variable = vel_x
pressure = pressure
momentum_component = 'x'
[]
[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
[]
[fluid_conduction]
type = LinearFVDiffusion
variable = T_fluid
diffusion_coeff = ${k_salt}
use_nonorthogonal_correction = false
block = salt
[]
[fluid_radiation]
type = LinearFVP1TemperatureSourceSink
variable = T_fluid
G = 'G'
absorption_coeff = ${sigma_a}
block = salt
[]
[G_diffusion]
type = LinearFVDiffusion
variable = G
diffusion_coeff = ${diffusion_coef}
block = salt
[]
[G_source_and_sink]
type = LinearFVP1RadiationSourceSink
variable = G
temperature_radiation = 'T_fluid'
absorption_coeff = ${sigma_a}
block = salt
[]
[solid_conduction]
type = LinearFVDiffusion
variable = T_solid
diffusion_coeff = ${k_solid}
use_nonorthogonal_correction = false
block = solid
[]
[]
[LinearFVBCs]
# velocity BCs
[walls-u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left interface'
variable = vel_x
functor = 0.0
[]
# temperature BCs
[left_bc_T]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = T_fluid
boundary = 'left'
functor = ${Tw_left}
[]
[right_bc_T]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = T_solid
boundary = 'right'
functor = ${Tw_right}
[]
# G
[right_bc_G]
type = LinearFVP1RadiationMarshakBC
boundary = 'interface'
variable = G
temperature_radiation = 'T_fluid'
coeff_diffusion = ${diffusion_coef}
boundary_emissivity = ${b_eps}
[]
[left_bc_G]
type = LinearFVP1RadiationMarshakBC
boundary = 'left'
variable = G
temperature_radiation = ${Tw_left}
coeff_diffusion = ${diffusion_coef}
boundary_emissivity = ${b_eps}
[]
# cht
[fluid_solid]
type = LinearFVDirichletCHTBC
variable = T_fluid
boundary = interface
functor = interface_temperature_solid_interface
[]
[solid_fluid]
type = LinearFVRobinCHTBC
variable = T_solid
boundary = interface
h = ${h_s}
thermal_conductivity = ${k_solid}
incoming_flux = heat_flux_to_solid_interface
surface_temperature = interface_temperature_fluid_interface
[]
[]
[Executioner]
type = SIMPLE
num_iterations = 2000
momentum_systems = 'u_system '
pressure_system = 'pressure_system'
rhie_chow_user_object = 'rc'
momentum_l_abs_tol = 1e-8
pressure_l_abs_tol = 1e-7
momentum_l_tol = 0
pressure_l_tol = 0
momentum_equation_relaxation = 0.7
pressure_variable_relaxation = 0.3
momentum_absolute_tolerance = 1e-5
pressure_absolute_tolerance = 1e-5
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_systems = 'radiation_system'
pm_radiation_systems = 'radiation_system'
energy_system = 'energy_system'
solid_energy_system = 'solid_energy_system'
#active_scalar_l_abs_tol = 1e-14
pm_radiation_l_abs_tol = 1e-11
energy_l_abs_tol = 1e-11
solid_energy_l_abs_tol = 1e-11
#active_scalar_l_tol = 0
pm_radiation_l_tol = 0
energy_l_tol = 0
solid_energy_l_tol = 0
#active_scalar_equation_relaxation = 0.95
pm_radiation_equation_relaxation = 1.0
energy_equation_relaxation = 0.9
energy_absolute_tolerance = 1e-10
solid_energy_absolute_tolerance = 1e-10
#active_scalar_absolute_tolerance = 1e-14
#active_scalar_petsc_options_iname = '-pc_type -pc_hypre_type'
#active_scalar_petsc_options_value = 'hypre boomeramg'
pm_radiation_absolute_tolerance = 1e-10
pm_radiation_petsc_options_iname = '-pc_type -pc_hypre_type'
pm_radiation_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'
cht_interfaces = 'interface'
cht_solid_flux_relaxation = 0.3
cht_fluid_flux_relaxation = 0.3
cht_solid_temperature_relaxation = 0.3
cht_fluid_temperature_relaxation = 0.3
cht_heat_flux_tolerance = 1e-4
max_cht_fpi = 10
print_fields = false
continue_on_max_its = true
[]
[Outputs]
csv = true
execute_on = timestep_end
exodus = true
[]
(modules/navier_stokes/test/tests/finite_volume/two_phase/mixture_model/segregated/rayleigh-bernard-two-phase-physics.i)
mu = 1.0
rho = 1e3
mu_d = 0.3
rho_d = 1.0
dp = 0.01
U_lid = 0.0
g = -9.81
advected_interp_method = 'upwind'
# Currently required
k = 1
k_d = 1
cp = 1
cp_d = 1
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = .1
ymin = 0
ymax = .1
nx = 11
ny = 11
[]
[]
[Problem]
linear_sys_names = 'u_system v_system pressure_system phi_system'
[]
[Physics]
[NavierStokes]
[FlowSegregated]
[flow]
compressibility = 'incompressible'
density = 'rho_mixture'
dynamic_viscosity = 'mu_mixture'
gravity = '0 ${g} 0'
# Initial conditions
initial_velocity = '1e-12 1e-12 0'
initial_pressure = 0.2
wall_boundaries = 'top left right bottom'
momentum_wall_types = 'noslip noslip noslip noslip'
momentum_wall_functors = '${U_lid} 0; 0 0; 0 0; 0 0'
orthogonality_correction = false
pressure_two_term_bc_expansion = true
momentum_advection_interpolation = ${advected_interp_method}
[]
[]
[TwoPhaseMixtureSegregated]
[mixture]
system_names = 'phi_system'
phase_1_fraction_name = 'phase_1'
phase_2_fraction_name = 'phase_2'
add_phase_transport_equation = true
phase_advection_interpolation = '${advected_interp_method}'
phase_fraction_diffusivity = 1e-3
# We could consider adding fixed-value-yet-not-an-inlet
# boundary conditions to the TwoPhaseMixture physics
# Base phase material properties
phase_1_density_name = ${rho}
phase_1_viscosity_name = ${mu}
phase_1_specific_heat_name = ${cp}
phase_1_thermal_conductivity_name = ${k}
# Other phase material properties
phase_2_density_name = ${rho_d}
phase_2_viscosity_name = ${mu_d}
phase_2_specific_heat_name = ${cp_d}
phase_2_thermal_conductivity_name = ${k_d}
output_all_properties = true
# Friction model, not actually used!
use_dispersed_phase_drag_model = true
particle_diameter = ${dp}
add_advection_slip_term = false
# To match Rayleigh Bernard nonlinear test setup
add_gravity_term_in_slip_velocity = false
[]
[]
[]
[]
[LinearFVBCs]
[botttom-phase-2]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'bottom'
variable = phase_2
functor = '1'
[]
[top-phase-2]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'top'
variable = phase_2
functor = '0'
[]
[]
[Executioner]
type = PIMPLE
rhie_chow_user_object = 'ins_rhie_chow_interpolator'
end_time = 1e8
[TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 10
iteration_window = 2
growth_factor = 2
cutback_factor = 0.5
dt = 1e-3
[]
# 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_factor_shift_type' # -pc_hypre_type'
active_scalar_petsc_options_value = 'lu NONZERO'
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
pin_pressure = true
pressure_pin_value = 0.0
pressure_pin_point = '0.0 0.0 0.0'
[]
[Outputs]
exodus = false
[out]
type = CSV
execute_on = 'FINAL'
[]
[]
[AuxVariables]
[U]
order = CONSTANT
family = MONOMIAL
fv = true
[]
[]
[Postprocessors]
[average_void]
type = ElementAverageValue
variable = 'phase_2'
[]
[max_y_velocity]
type = ElementExtremeValue
variable = 'vel_y'
value_type = max
[]
[min_y_velocity]
type = ElementExtremeValue
variable = 'vel_y'
value_type = min
[]
[max_x_velocity]
type = ElementExtremeValue
variable = 'vel_x'
value_type = max
[]
[min_x_velocity]
type = ElementExtremeValue
variable = 'vel_x'
value_type = min
[]
[max_x_slip_velocity]
type = ElementExtremeFunctorValue
functor = 'vel_slip_x'
value_type = max
[]
[max_y_slip_velocity]
type = ElementExtremeFunctorValue
functor = 'vel_slip_y'
value_type = max
[]
[max_drag_coefficient_x]
type = ElementExtremeFunctorValue
functor = 'Darcy_coefficient_vec_out_x'
value_type = max
[]
[max_drag_coefficient_y]
type = ElementExtremeFunctorValue
functor = 'Darcy_coefficient_vec_out_y'
value_type = max
[]
[]
(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
[]
[]
(test/tests/linearfvkernels/advection/advection-2d-rz.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 2
ny= 1
ymax = 0.5
[]
coord_type = RZ
rz_coord_axis = Y
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
[]
[]
[FVInterpolationMethods]
[upwind]
type = FVAdvectedUpwind
[]
[average]
type = FVGeometricAverage
[]
[]
[LinearFVKernels]
[advection]
type = LinearFVAdvection
variable = u
velocity = "0.0 0.5 0"
advected_interp_method_name = average
[]
[source]
type = LinearFVSource
variable = u
source_density = source_func
[]
[]
[LinearFVBCs]
[inflow]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "left right bottom"
functor = analytic_solution
[]
[outflow]
type = LinearFVAdvectionDiffusionOutflowBC
variable = u
boundary = "top"
use_two_term_expansion = true
[]
[]
[Functions]
[source_func]
type = ParsedFunction
expression = '1.0*pi*sin(x*pi)*cos(2*y*pi)'
[]
[analytic_solution]
type = ParsedFunction
expression = 'sin(x*pi)*sin(2*y*pi) + 1.5'
[]
[]
[Postprocessors]
[error]
type = ElementL2FunctorError
approximate = u
exact = analytic_solution
execute_on = FINAL
[]
[h]
type = AverageElementSize
execute_on = FINAL
[]
[]
[Convergence]
[linear]
type = IterationCountConvergence
max_iterations = 10
converge_at_max_iterations = true
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-10
multi_system_fixed_point=true
multi_system_fixed_point_convergence=linear
petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_shift_amount'
petsc_options_value = 'lu NONZERO 1e-10'
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
[]
[]
(test/tests/time_integrators/bdf2/linearfv.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 4
ny = 4
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
[]
[]
[LinearFVKernels]
[timeu]
type = LinearFVTimeDerivative
variable = u
[]
[diffu]
type = LinearFVDiffusion
variable = u
[]
[forceu]
type = LinearFVSource
variable = u
source_density = force
[]
[]
[Functions]
[exact]
type = ParsedFunction
expression = 't^3*x*y'
[]
[force]
type = ParsedFunction
expression = '3*x*y*t^2'
[]
[]
[LinearFVBCs]
[allu]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
functor = exact
variable = u
boundary = 'left right top bottom'
[]
[]
[Executioner]
type = Transient
system_names = u_sys
l_tol = 1e-10
petsc_options_iname = '-pc_type'
petsc_options_value = 'hypre'
dt = 1
end_time = 3
scheme = 'bdf2'
[]
[Postprocessors]
[L2u]
type = ElementL2Error
function = exact
variable = u
[]
[]
[Outputs]
csv = true
[]
(test/tests/tag/tag-linearfv.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
nx = 3
[]
[]
[Problem]
linear_sys_names = 'u_sys v_sys'
extra_tag_matrices = 'mat_tag_u; mat_tag_v'
extra_tag_vectors = 'vec_tag_u; vec_tag_v'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
initial_condition = 1.0
solver_sys = u_sys
[]
[v]
type = MooseLinearVariableFVReal
initial_condition = 0.5
solver_sys = v_sys
[]
[]
[LinearFVKernels]
[diffusion]
type = LinearFVDiffusion
variable = u
diffusion_coeff = 2.0
[]
[reaction]
type = LinearFVReaction
variable = u
coeff = 3.0
matrix_tags = 'system mat_tag_u'
[]
[source]
type = LinearFVSource
variable = u
source_density = 60.0
vector_tags = 'rhs vec_tag_u'
[]
[diffusion_v]
type = LinearFVDiffusion
variable = v
diffusion_coeff = 1.0
[]
[reaction_v]
type = LinearFVReaction
variable = v
coeff = 1.5
matrix_tags = 'system mat_tag_v'
[]
[source_v]
type = LinearFVSource
variable = v
source_density = 20.0
vector_tags = 'rhs vec_tag_v'
[]
[]
[LinearFVBCs]
[left_u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = left
functor = 1.0
[]
[right_u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = right
functor = 3.0
[]
[left_v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = v
boundary = left
functor = 1.0
[]
[right_v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = v
boundary = right
functor = 3.0
[]
[]
[AuxVariables]
[soln_u_dof]
type = MooseLinearVariableFVReal
[]
[soln_u]
type = MooseLinearVariableFVReal
[]
[rhs_u_dof]
type = MooseLinearVariableFVReal
[]
[rhs_u]
type = MooseLinearVariableFVReal
[]
[vector_tag_u]
type = MooseLinearVariableFVReal
[]
[matrix_u_diag]
type = MooseLinearVariableFVReal
[]
[soln_v_dof]
type = MooseLinearVariableFVReal
[]
[soln_v]
type = MooseLinearVariableFVReal
[]
[rhs_v_dof]
type = MooseLinearVariableFVReal
[]
[rhs_v]
type = MooseLinearVariableFVReal
[]
[vector_tag_v]
type = MooseLinearVariableFVReal
[]
[matrix_v_diag]
type = MooseLinearVariableFVReal
[]
[]
[AuxKernels]
[soln_u_dof]
type = TagVectorDofValueAux
variable = soln_u_dof
v = u
vector_tag = 'solution'
[]
[soln_u]
type = TagVectorAux
variable = soln_u
v = u
vector_tag = 'solution'
[]
[rhs_u_dof]
type = TagVectorDofValueAux
variable = rhs_u_dof
v = u
vector_tag = 'rhs'
[]
[rhs_u]
type = TagVectorAux
variable = rhs_u
v = u
vector_tag = 'rhs'
[]
[extra_vector_u_dof]
type = TagVectorDofValueAux
variable = vector_tag_u
v = u
vector_tag = 'vec_tag_u'
[]
[extra_vector_u]
type = TagVectorAux
variable = vector_tag_u
v = u
vector_tag = 'vec_tag_u'
[]
[extra_matrix_u]
type = TagMatrixAux
variable = matrix_u_diag
v = u
matrix_tag = 'mat_tag_u'
[]
[soln_v_dof]
type = TagVectorDofValueAux
variable = soln_v_dof
v = v
vector_tag = 'solution'
[]
[soln_v]
type = TagVectorAux
variable = soln_v
v = v
vector_tag = 'solution'
[]
[rhs_v_dof]
type = TagVectorDofValueAux
variable = rhs_v_dof
v = v
vector_tag = 'rhs'
[]
[rhs_v]
type = TagVectorAux
variable = rhs_v
v = v
vector_tag = 'rhs'
[]
[extra_vector_v_dof]
type = TagVectorDofValueAux
variable = vector_tag_v
v = v
vector_tag = 'vec_tag_v'
[]
[extra_vector_v]
type = TagVectorAux
variable = vector_tag_v
v = v
vector_tag = 'vec_tag_v'
[]
[extra_matrix_v]
type = TagMatrixAux
variable = matrix_v_diag
v = v
matrix_tag = 'mat_tag_v'
[]
[]
[Executioner]
type = Steady
solve_type = 'LINEAR'
system_names = 'u_sys v_sys'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true
execute_on = timestep_end
[]
(modules/heat_transfer/test/tests/linearfvbcs/linear_fv_functor_radiative_bc/linear_fv_functor_radiative_bc_mms_2d.i)
# 2D MMS convergence test for LinearFVFunctorRadiativeBC.
#
# Exact solution: T(x,y) = T_L + B_x*(exp(x) - 1) + B_y*x*sin(pi*y)
# where B_x = (T_R_mms - T_L) / (e - 1).
#
# The solution combines a 1D exponential profile with a sinusoidal 2D
# perturbation B_y*x*sin(pi*y). The sinusoidal y-dependence is
# non-polynomial, ensuring the FV scheme has genuine O(h^2) truncation
# error in the y-direction.
#
# At the radiative boundary (x=1):
# T(1,y) = T_R_mms + B_y*sin(pi*y)
# dT/dx(1,y) = B_x*e + B_y*sin(pi*y)
#
# A spatially varying T_inf(y) is computed analytically so the radiative
# BC is satisfied exactly at every boundary face:
# T_inf(y)^4 = T(1,y)^4 + k*dT/dx(1,y)/(sigma*eps)
# At y=0,1 this recovers the 1D far-field temperature T_inf ~ 300 K.
#
# Boundary conditions:
# Left (x=0): Dirichlet T = T_L (constant, since x=0)
# Right (x=1): Radiative Robin with T_inf(y) (spatially varying)
# Bottom (y=0): Dirichlet T = T_L + B_x*(exp(x) - 1) (sin(0)=0)
# Top (y=1): Dirichlet T = T_L + B_x*(exp(x) - 1) (sin(pi)=0)
#
# Source: f(x,y) = -k*(B_x*exp(x) - B_y*pi^2*x*sin(pi*y))
#
# T_R_mms must be supplied via CLI args, as the root of:
# k*(T_L - T_R)*e/(e-1) = sigma*eps*(T_R^4 - T_inf^4)
# (computed in the Python convergence script).
T_L = 1000.0
k = 1.0
eps = 1.0
sigma = 5.670374419e-8
B_y = 200.0
T_R_mms = 0 # set via CLI: T_R_mms=<value>
B_x = '${fparse (T_R_mms - T_L) / (exp(1.0) - 1.0)}'
B_x_e = '${fparse B_x * exp(1.0)}'
flux_scale = '${fparse k / (sigma * eps)}'
pi_val = '${fparse pi}'
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
nx = 10 # overridden by CLI
ny = 10 # overridden by CLI
xmin = 0
xmax = 1
ymin = 0
ymax = 1
[]
[]
[Problem]
linear_sys_names = 'heat_system'
[]
[Variables]
[T]
type = MooseLinearVariableFVReal
solver_sys = 'heat_system'
initial_condition = ${T_L}
[]
[]
[Functions]
[exact_T]
type = ParsedFunction
expression = 'T_L + Bx * (exp(x) - 1.0) + By * x * sin(pv * y)'
symbol_names = 'T_L Bx By pv'
symbol_values = '${T_L} ${B_x} ${B_y} ${pi_val}'
[]
[source_fn]
type = ParsedFunction
expression = '-k * Bx * exp(x) + k * By * pv * pv * x * sin(pv * y)'
symbol_names = 'k Bx By pv'
symbol_values = '${k} ${B_x} ${B_y} ${pi_val}'
[]
[T_inf_fn]
type = ParsedFunction
expression = 'pow(pow(TR + By * sin(pv * y), 4) + fs * (Bxe + By * sin(pv * y)), 0.25)'
symbol_names = 'TR By fs Bxe pv'
symbol_values = '${T_R_mms} ${B_y} ${flux_scale} ${B_x_e} ${pi_val}'
[]
[bottom_top_T]
type = ParsedFunction
expression = 'T_L + Bx * (exp(x) - 1.0)'
symbol_names = 'T_L Bx'
symbol_values = '${T_L} ${B_x}'
[]
[]
[LinearFVKernels]
[time]
type = LinearFVTimeDerivative
variable = T
[]
[diffusion]
type = LinearFVDiffusion
variable = T
diffusion_coeff = ${k}
[]
[source]
type = LinearFVSource
variable = T
source_density = source_fn
[]
[]
[LinearFVBCs]
[left]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = T
boundary = 'left'
functor = ${T_L}
[]
[right]
type = LinearFVFunctorRadiativeBC
variable = T
boundary = 'right'
emissivity = ${eps}
Tinfinity = T_inf_fn
diffusion_coeff = ${k}
[]
[bottom]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = T
boundary = 'bottom'
functor = bottom_top_T
[]
[top]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = 'T'
boundary = 'top'
functor = bottom_top_T
[]
[]
[Postprocessors]
[l2_error]
type = ElementL2FunctorError
approximate = T
exact = exact_T
execute_on = TIMESTEP_END
[]
[]
[Executioner]
type = Transient
system_names = heat_system
scheme = 'implicit-euler'
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
dt = 1e6
num_steps = 100
l_tol = 1e-12
[]
[Outputs]
[out]
type = CSV
execute_on = final
[]
[]
(test/tests/variables/linearfv/diffusion-1d-pp.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
nx = 50
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
[]
[]
[LinearFVKernels]
[diffusion]
type = LinearFVDiffusion
variable = u
diffusion_coeff = coeff_func
[]
[source]
type = LinearFVSource
variable = u
source_density = source_func
[]
[]
[LinearFVBCs]
[dir]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "left right"
functor = analytic_solution
[]
[]
[Functions]
[coeff_func]
type = ParsedFunction
expression = '0.5*x'
[]
[source_func]
type = ParsedFunction
expression = '2*x'
[]
[analytic_solution]
type = ParsedFunction
expression = '1-x*x'
[]
[]
[Postprocessors]
[average]
type = ElementAverageValue
variable = u
execute_on = TIMESTEP_END
outputs = csv
[]
[min]
type = ElementExtremeValue
variable = u
value_type = min
execute_on = TIMESTEP_END
outputs = csv
[]
[max]
type = ElementExtremeValue
variable = u
value_type = max
execute_on = TIMESTEP_END
outputs = csv
[]
[num_dofs]
type = NumDOFs
execute_on = TIMESTEP_END
outputs = csv
[]
[elem_value]
type = ElementalVariableValue
variable = u
elementid = 10
execute_on = TIMESTEP_END
outputs = csv
[]
[point_value]
type = PointValue
variable = u
point = '0.33333 0 0'
execute_on = TIMESTEP_END
outputs = csv
[]
[]
[VectorPostprocessors]
[line-sample]
type = LineValueSampler
variable = u
start_point = '0.13333 0 0'
end_point = '0.766666 0 0'
num_points = 9
sort_by = x
execute_on = TIMESTEP_END
outputs = vpp_csv
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-10
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
[csv]
type = CSV
execute_on = TIMESTEP_END
[]
[vpp_csv]
type = CSV
execute_on = TIMESTEP_END
[]
[]
(modules/navier_stokes/test/tests/finite_volume/ins/channel-flow/segregated-comparison/segregated-linear.i)
mu = 2.6
rho = 1.0
advected_interp_method = 'average'
[Mesh]
[mesh]
type = CartesianMeshGenerator
dim = 2
dx = '0.3'
dy = '0.3'
ix = '3'
iy = '3'
[]
[]
[Problem]
linear_sys_names = 'u_system v_system pressure_system'
previous_nl_solution_required = true
[]
[UserObjects]
[rc]
type = RhieChowMassFlux
u = vel_x
v = vel_y
pressure = pressure
rho = ${rho}
p_diffusion_kernel = p_diffusion
[]
[]
[Variables]
[vel_x]
type = MooseLinearVariableFVReal
initial_condition = 0.5
solver_sys = u_system
[]
[vel_y]
type = MooseLinearVariableFVReal
solver_sys = v_system
initial_condition = 0.0
[]
[pressure]
type = MooseLinearVariableFVReal
solver_sys = pressure_system
initial_condition = 0.2
[]
[]
[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]
[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
[]
[]
[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 = 2
pressure_absolute_tolerance = 1e-10
momentum_absolute_tolerance = 1e-10
momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
momentum_petsc_options_value = 'hypre boomeramg'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
pressure_petsc_options_value = 'hypre boomeramg'
print_fields = false
[]
[Outputs]
exodus = true
execute_on = TIMESTEP_END
[]
(test/tests/linearfvbcs/robin/advection-2d-robin.i)
##################################################################
c = 0.01 # advection velocity (+x direction)
amp = 1.0 # sinusoid amplitude, for u_exact
u0 = 1.2 # any positive constant > 1.0
x_l = ${fparse 0.0*pi}
x_r = ${fparse pi}
y_l = ${fparse 0.0*pi}
y_r = ${fparse 1.0*pi}
alpha = 5.000 # robin BC coeff for gradient term
beta = 2.000 # robin BC coeff for variable term
nx = 2
ny = 2
##################################################################
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = ${nx}
ny = ${ny}
xmin = ${x_l}
xmax = ${x_r}
ymin = ${y_l}
ymax = ${y_r}
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 0.01
[]
[]
[FVInterpolationMethods]
[average]
type = FVGeometricAverage
[]
[]
[Functions]
[u_exact]
type = ParsedFunction
expression = '${amp} * (${u0} - cos(x)) * sin(y)'
[]
[source_fn]
type = ParsedFunction
expression = '${fparse c*amp} * sin(x) * sin(y)'
[]
[gamma_fn]
type = ParsedFunction
expression = '(${fparse -amp*alpha}*sin(x)*sin(y)) + (${beta} * u_e)'
symbol_names = 'u_e'
symbol_values = 'u_exact'
[]
[]
[LinearFVKernels]
[advection]
type = LinearFVAdvection
variable = u
velocity = "${c} 0 0"
advected_interp_method_name = average
[]
[source]
type = LinearFVSource
variable = u
source_density = source_fn
[]
[]
[LinearFVBCs]
[rob_l]
type = LinearFVAdvectionDiffusionFunctorRobinBC
variable = u
boundary = "left"
alpha = ${alpha}
beta = ${beta}
gamma = gamma_fn
[]
[outflow]
type = LinearFVAdvectionDiffusionOutflowBC
variable = u
boundary = "right"
use_two_term_expansion = true
[]
[top]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "top"
functor = 0.0
[]
[bottom]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "bottom"
functor = 0.0
[]
[]
[Postprocessors]
[h]
type = AverageElementSize
execute_on = FINAL
[]
[error]
type = ElementL2FunctorError
approximate = u
exact = u_exact
execute_on = FINAL
[]
[]
[Convergence]
[linear]
type = IterationCountConvergence
max_iterations = 4
converge_at_max_iterations = true
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-7
petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_shift_amount'
petsc_options_value = 'lu NONZERO 1e-10'
linear_convergence = linear
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
[]
[]
(test/tests/linearfvkernels/block-restriction/block-restricted-diffusion-variable-functor-bc.i)
[Mesh]
[cmg]
type = CartesianMeshGenerator
dim = 1
dx = '0.5 0.5'
ix = '5 5'
subdomain_id = '1 2'
[]
[create_interface]
type = SideSetsBetweenSubdomainsGenerator
input = cmg
new_boundary = interface
primary_block = 2
paired_block = 1
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 0.0
block = 2
[]
[]
[AuxVariables]
[v]
type = MooseLinearVariableFVReal
initial_condition = 1.0
block = 1
[]
[]
[LinearFVKernels]
[diffusion]
type = LinearFVDiffusion
variable = u
diffusion_coeff = 1
use_nonorthogonal_correction = false
block = 2
[]
[]
[LinearFVBCs]
[interface]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = interface
functor = v
[]
[right]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = right
functor = 0
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-12
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[VectorPostprocessors]
[u_sample]
type = LineValueSampler
variable = u
start_point = '0.55 0 0'
end_point = '0.95 0 0'
num_points = 5
sort_by = x
[]
[]
[Outputs]
csv = true
execute_on = timestep_end
[]
(modules/navier_stokes/test/tests/finite_volume/ins/turbulence/channel/linear-segregated-transient/channel_ERCOFTAC.i)
H = 1 #halfwidth of the channel
L = 100
Re = 13700
rho = 1
bulk_u = 1
mu = '${fparse rho * bulk_u * 2 * H / Re}'
advected_interp_method = 'upwind'
### k-epsilon Closure Parameters ###
sigma_k =1.0
sigma_eps = 1.3
C1_eps = 1.44
C2_eps = 1.92
C_mu = 0.09
### Initial and Boundary Conditions ###
intensity = 0.01
k_init = '${fparse 1.5*(intensity * bulk_u)^2}'
eps_init = '${fparse C_mu^0.75 * k_init^1.5 / (2*H)}'
### Modeling parameters ###
bulk_wall_treatment = false
walls = 'top bottom'
wall_treatment = 'eq_newton' # Options: eq_newton, eq_incremental, eq_linearized, neq
[Mesh]
[block_1]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${L}
ymin = 0
ymax = ${H}
nx = 4
ny = 3
bias_y = 0.7
[]
[block_2]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${L}
ymin = ${fparse -H}
ymax = 0
nx = 4
ny = 3
bias_y = ${fparse 1/0.7}
[]
[smg]
type = StitchedMeshGenerator
inputs = 'block_1 block_2'
clear_stitched_boundary_ids = true
stitch_boundaries_pairs = 'bottom top'
merge_boundaries_with_same_name = true
[]
# 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
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
advected_interp_method = ${advected_interp_method}
[]
[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 = ${bulk_u}
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_time]
type = LinearFVTimeDerivative
variable = vel_x
factor = ${rho}
[]
[u_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_x
advected_interp_method = ${advected_interp_method}
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_time]
type = LinearFVTimeDerivative
variable = vel_y
factor = ${rho}
[]
[v_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_y
advected_interp_method = ${advected_interp_method}
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_time]
type = LinearFVTimeDerivative
variable = TKE
factor = ${rho}
[]
[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_time]
type = LinearFVTimeDerivative
variable = TKED
factor = ${rho}
[]
[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]
[inlet-u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left'
variable = vel_x
functor = '${bulk_u}'
[]
[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_u]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = 'right'
variable = vel_x
use_two_term_expansion = false
[]
[outlet_v]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = 'right'
variable = vel_y
use_two_term_expansion = false
[]
[outlet_p]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'right'
variable = pressure
functor = 0.0
[]
[inlet_TKE]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left'
variable = TKE
functor = '${k_init}'
[]
[outlet_TKE]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = 'right'
variable = TKE
use_two_term_expansion = false
[]
[inlet_TKED]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left'
variable = TKED
functor = '${eps_init}'
[]
[outlet_TKED]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = 'right'
variable = TKED
use_two_term_expansion = false
[]
[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 = PIMPLE
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.25 0.25'
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
dt = 1.0
num_steps = 2
[]
[Outputs]
csv = 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'
[]
[line_center_channel]
type = LineValueSampler
start_point = '${fparse 0.125 * L} ${fparse 0.0001} 0'
end_point = '${fparse 0.875 * L} ${fparse 0.0001} 0'
num_points = ${Mesh/block_1/nx}
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[line_quarter_radius_channel]
type = LineValueSampler
start_point = '${fparse 0.125 * L} ${fparse 0.5 * H} 0'
end_point = '${fparse 0.875 * L} ${fparse 0.5 * H} 0'
num_points = ${Mesh/block_1/nx}
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[]
(modules/navier_stokes/test/tests/finite_volume/ins/channel-flow/linear-segregated/3d/3d-velocity-pressure.i)
mu = 2.6
rho = 1.0
advected_interp_method = 'average'
[Mesh]
[mesh]
type = CartesianMeshGenerator
dim = 3
dx = '0.3'
dy = '0.3'
dz = '0.3'
ix = '3'
iy = '3'
iz = '3'
[]
[]
[Problem]
linear_sys_names = 'u_system v_system w_system pressure_system'
previous_nl_solution_required = true
[]
[UserObjects]
[rc]
type = RhieChowMassFlux
u = vel_x
v = vel_y
w = vel_z
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
[]
[vel_z]
type = MooseLinearVariableFVReal
solver_sys = w_system
initial_condition = 0.0
[]
[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
w = vel_z
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
w = vel_z
momentum_component = 'y'
rhie_chow_user_object = 'rc'
use_nonorthogonal_correction = false
[]
[w_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_z
advected_interp_method = ${advected_interp_method}
mu = ${mu}
u = vel_x
v = vel_y
w = vel_z
momentum_component = 'z'
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'
[]
[w_pressure]
type = LinearFVMomentumPressure
variable = vel_z
pressure = pressure
momentum_component = 'z'
[]
[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 = '1.1'
[]
[inlet-v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left'
variable = vel_y
functor = '0.0'
[]
[inlet-w]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left'
variable = vel_z
functor = '0.0'
[]
[walls-u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'top bottom back front'
variable = vel_x
functor = 0.0
[]
[walls-v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'top bottom back front'
variable = vel_y
functor = 0.0
[]
[walls-w]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'top bottom back front'
variable = vel_z
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
[]
[outlet_w]
type = LinearFVAdvectionDiffusionOutflowBC
variable = vel_z
use_two_term_expansion = false
boundary = right
[]
[]
[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 w_system'
pressure_system = 'pressure_system'
momentum_equation_relaxation = 0.8
pressure_variable_relaxation = 0.3
num_iterations = 100
pressure_absolute_tolerance = 1e-10
momentum_absolute_tolerance = 1e-10
momentum_petsc_options_iname = '-pc_type -pc_hypre_type -pc_hypre_boomeramg_agg_nl -pc_hypre_boomeramg_agg_num_paths -pc_hypre_boomeramg_truncfactor -pc_hypre_boomeramg_strong_threshold -pc_hypre_boomeramg_coarsen_type -pc_hypre_boomeramg_interp_type'
momentum_petsc_options_value = 'hypre boomeramg 4 1 0.1 0.6 HMIS ext+i'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type -pc_hypre_boomeramg_agg_nl -pc_hypre_boomeramg_agg_num_paths -pc_hypre_boomeramg_truncfactor -pc_hypre_boomeramg_strong_threshold -pc_hypre_boomeramg_coarsen_type -pc_hypre_boomeramg_interp_type'
pressure_petsc_options_value = 'hypre boomeramg 2 1 0.1 0.6 HMIS ext+i'
print_fields = false
[]
[Outputs]
exodus = true
[]
(test/tests/multisystem/restore_multiapp/sub.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
nx = 6
[]
[]
[Problem]
nl_sys_names = 'v_sys'
linear_sys_names = 'u_sys'
[]
[Variables]
[v]
type = MooseVariableFVReal
initial_condition = 2.0
solver_sys = v_sys
[]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
[]
[]
[FVKernels]
[diffusion]
type = FVDiffusion
variable = v
coeff = u
[]
[source]
type = FVBodyForce
variable = v
function = 3
[]
[]
[LinearFVKernels]
[diffusion]
type = LinearFVDiffusion
variable = u
diffusion_coeff = v
[]
[source]
type = LinearFVSource
variable = u
source_density = 1
[]
[]
[FVBCs]
[dir]
type = FVFunctorDirichletBC
variable = v
boundary = "left right"
functor = 2
[]
[]
[LinearFVBCs]
[dir]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "left right"
functor = 1
[]
[]
[Convergence]
[linear]
type = IterationCountConvergence
max_iterations = 6
converge_at_max_iterations = true
[]
[]
[Executioner]
type = Steady
#type = Transient
#steady_state_detection = true
system_names = 'v_sys u_sys'
l_abs_tol = 1e-12
l_tol = 1e-10
nl_abs_tol = 1e-10
multi_system_fixed_point=true
multi_system_fixed_point_convergence=linear
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true
#execute_on = timestep_end
[]
(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/ins/turbulence/channel/linear-segregated/channel_scalars-physics.i)
!include header_and_mesh.i
qs = 5
[Problem]
linear_sys_names = 'u_system v_system pressure_system scalar_system TKE_system TKED_system'
previous_nl_solution_required = true
[]
[Physics]
[NavierStokes]
[FlowSegregated/flow]
velocity_variable = 'vel_x vel_y'
pressure_variable = 'pressure'
# Initial conditions
initial_velocity = '${bulk_u} 0 0'
initial_pressure = '1e-8'
# Material properties
density = ${rho}
dynamic_viscosity = ${mu}
# Boundary conditions
inlet_boundaries = 'left'
momentum_inlet_types = 'fixed-velocity'
momentum_inlet_functors = '${bulk_u} 0'
wall_boundaries = 'top bottom'
momentum_wall_types = 'noslip noslip'
outlet_boundaries = 'right'
momentum_outlet_types = 'fixed-pressure'
pressure_functors = '0'
# Numerical parameters
include_deviatoric_stress = true
orthogonality_correction = false
pressure_two_term_bc_expansion = false
momentum_two_term_bc_expansion = false
momentum_advection_interpolation = ${advected_interp_method}
system_names = 'u_system v_system pressure_system'
[]
[ScalarTransportSegregated/scalar]
# turbulence Physics coupling picked up automatically
passive_scalar_names = 'advected_scalar'
passive_scalar_inlet_types = 'fixed-value'
passive_scalar_inlet_functors = '0'
passive_scalar_source = '${qs}'
system_names = 'scalar_system'
[]
[TurbulenceSegregated/k-epsilon]
# Model
turbulence_handling = 'k-epsilon'
tke_name = TKE
tked_name = TKED
system_names = 'TKE_system TKED_system'
scalar_transport_physics = scalar
initial_tke = ${k_init}
initial_tked = ${eps_init}
# Model parameters
mu_t_ratio_max = 1e20
sigma_k = ${sigma_k}
sigma_eps = ${sigma_eps}
C_pl = 1e10
C1_eps = ${C1_eps}
C2_eps = ${C2_eps}
Sc_t = 0.9
turbulence_walls = ${walls}
wall_treatment_eps = ${wall_treatment}
bulk_wall_treatment = ${bulk_wall_treatment}
use_nonorthogonal_correction = false
[]
[]
[]
# Boundary conditions are not implemented for turbulent quantities at this time
[LinearFVBCs]
[inlet_TKE]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left'
variable = TKE
functor = '${k_init}'
[]
[outlet_TKE]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = 'right'
variable = TKE
use_two_term_expansion = false
[]
[inlet_TKED]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left'
variable = TKED
functor = '${eps_init}'
[]
[outlet_TKED]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = 'right'
variable = TKED
use_two_term_expansion = false
[]
[]
[Executioner]
type = SIMPLE
rhie_chow_user_object = 'ins_rhie_chow_interpolator'
momentum_systems = 'u_system v_system'
pressure_system = 'pressure_system'
passive_scalar_systems = 'scalar_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
passive_scalar_l_abs_tol = 1e-14
momentum_l_tol = 1e-14
pressure_l_tol = 1e-14
passive_scalar_l_tol = 1e-14
turbulence_l_tol = 1e-14
momentum_equation_relaxation = 0.7
pressure_variable_relaxation = 0.3
passive_scalar_equation_relaxation = 0.8
turbulence_equation_relaxation = '0.2 0.2'
turbulence_field_relaxation = '0.2 0.2'
num_iterations = 1000
pressure_absolute_tolerance = 1e-12
momentum_absolute_tolerance = 1e-12
passive_scalar_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'
passive_scalar_petsc_options_iname = '-pc_type -pc_hypre_type'
passive_scalar_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
[]
variables_to_sample = 'vel_x vel_y pressure advected_scalar TKE TKED'
!include postprocessing.i
# More postprocessor for scalar conservation analysis
[Postprocessors]
[outlet_scalar]
type = SideAverageValue
boundary = right
variable = advected_scalar
[]
[S_out]
type = VolumetricFlowRate
boundary = 'right'
vel_x = 'vel_x'
vel_y = 'vel_y'
advected_quantity = 'advected_scalar'
rhie_chow_user_object = 'ins_rhie_chow_interpolator'
[]
[balance_percent]
type = ParsedPostprocessor
expression = '100 * (0 - S_out + 2 * ${L} * ${H} * ${qs}) / S_out'
pp_names = 'S_out'
[]
[]
(modules/navier_stokes/test/tests/finite_volume/wcns/enthalpy_equation/1d_test_h.i)
L = 30
nx = 600
bulk_u = 0.01
q_source = 50000.
A_cp = 976.78
B_cp = 1.0634
T_in = 860.
p_ref = 101325.0
rho = 2000.
advected_interp_method = 'upwind'
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
xmin = 0
xmax = ${L}
nx = ${nx}
[]
allow_renumbering = false
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
advected_interp_method = ${advected_interp_method}
u = vel_x
[]
[Problem]
linear_sys_names = 'u_system pressure_system energy_system'
previous_nl_solution_required = true
[]
[UserObjects]
[rc]
type = RhieChowMassFlux
u = vel_x
pressure = pressure
rho = 'rho'
p_diffusion_kernel = p_diffusion
[]
[]
[Variables]
[vel_x]
type = MooseLinearVariableFVReal
solver_sys = u_system
initial_condition = ${bulk_u}
[]
[pressure]
type = MooseLinearVariableFVReal
solver_sys = pressure_system
initial_condition = ${p_ref}
[]
[h]
type = MooseLinearVariableFVReal
solver_sys = energy_system
initial_condition = ${fparse 860.*1900.}
[]
[]
[AuxVariables]
[rho_var]
type = MooseLinearVariableFVReal
[]
[cp_var]
type = MooseLinearVariableFVReal
[]
[mu_var]
type = MooseLinearVariableFVReal
[]
[k_var]
type = MooseLinearVariableFVReal
[]
[T]
type = MooseLinearVariableFVReal
initial_condition = 860.
[]
[h_aux]
type = MooseLinearVariableFVReal
[]
[]
[LinearFVKernels]
[u_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_x
mu = 'mu'
momentum_component = 'x'
use_nonorthogonal_correction = false
[]
[u_pressure]
type = LinearFVMomentumPressure
variable = vel_x
pressure = pressure
momentum_component = 'x'
[]
[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_advection]
type = LinearFVEnergyAdvection
variable = h
[]
[source]
type = LinearFVSource
variable = h
source_density = source_func
[]
[]
[LinearFVBCs]
[inlet_u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left'
variable = vel_x
functor = ${bulk_u} #${bulk_u} #'fully_developed_velocity'
[]
[inlet_h]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = h
boundary = 'left'
functor = 'h_from_p_T'
[]
[inlet_T]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = T
boundary = 'left'
functor = ${T_in}
[]
[outlet_p]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'right'
variable = pressure
functor = ${p_ref}
[]
[outlet_h]
type = LinearFVAdvectionDiffusionOutflowBC
variable = h
use_two_term_expansion = false
boundary = 'right'
[]
[outlet_u]
type = LinearFVAdvectionDiffusionOutflowBC
variable = vel_x
use_two_term_expansion = false
boundary = 'right'
[]
[]
[Functions]
[source_func]
type = ParsedFunction
expression = ${q_source}
[]
[T_analytical]
type = ParsedFunction
expression = ${fparse (-A_cp+sqrt(A_cp^2-2*B_cp*(-q_source/rho/bulk_u*L-A_cp*T_in-B_cp/2*T_in*T_in)))/B_cp}
[]
[]
[FunctorMaterials]
[enthalpy_material]
type = LinearFVEnthalpyFunctorMaterial
pressure = ${p_ref}
T_fluid = T
h = h
h_from_p_T_functor = h_from_p_T_functor
T_from_p_h_functor = T_from_p_h_functor
[]
[h_from_p_T_functor]
type = ParsedFunctorMaterial
property_name = 'h_from_p_T_functor'
functor_names = 'T'
expression = '${A_cp}*T+${B_cp}/2*(T^2)'
[]
[T_from_p_h_functor]
type = ParsedFunctorMaterial
property_name = 'T_from_p_h_functor'
functor_names = 'h'
expression = '(-${A_cp}+sqrt(${A_cp}^2+2*h*${B_cp}))/${B_cp}'
[]
[rho]
type = ADParsedFunctorMaterial
property_name = 'rho'
functor_names = 'T'
expression = ${rho}
[]
[cp]
type = ADParsedFunctorMaterial
property_name = 'cp'
functor_names = 'T'
expression = '${A_cp}+${B_cp}*T'
[]
[mu]
type = ADParsedFunctorMaterial
property_name = 'mu'
functor_names = 'T'
expression = '4.5e-3'
[]
[k]
type = ADParsedFunctorMaterial
property_name = 'k'
functor_names = 'T'
expression = 0.7
[]
[]
[AuxKernels]
[rho_out]
type = FunctorAux
functor = 'rho'
variable = 'rho_var'
execute_on = 'NONLINEAR'
[]
[cp_out]
type = FunctorAux
functor = 'cp'
variable = 'cp_var'
execute_on = 'NONLINEAR'
[]
[mu_out]
type = FunctorAux
functor = 'mu'
variable = 'mu_var'
execute_on = 'NONLINEAR'
[]
[k_out]
type = FunctorAux
functor = 'k'
variable = 'k_var'
execute_on = 'NONLINEAR'
[]
[T_from_h_functor_aux]
type = FunctorAux
functor = 'T_from_p_h'
variable = 'T'
execute_on = 'NONLINEAR'
[]
[h_from_T_functor_aux]
type = FunctorAux
functor = 'h_from_p_T'
variable = 'h_aux'
execute_on = 'NONLINEAR'
[]
[]
[Postprocessors]
[T_out_sim]
type = ElementalVariableValue
variable = T
elementid = ${fparse nx-1}
[]
[T_out_analytic]
type = FunctionValuePostprocessor
function = T_analytical
[]
[]
[Executioner]
type = SIMPLE
momentum_l_abs_tol = 1e-12
pressure_l_abs_tol = 1e-12
energy_l_abs_tol = 1e-12
momentum_l_tol = 0
pressure_l_tol = 0
energy_l_tol = 0
rhie_chow_user_object = 'rc'
momentum_systems = 'u_system'
pressure_system = 'pressure_system'
energy_system = 'energy_system'
momentum_equation_relaxation = 0.7
pressure_variable_relaxation = 0.3
energy_equation_relaxation = 0.95
num_iterations = 100
pressure_absolute_tolerance = 1e-8
momentum_absolute_tolerance = 1e-8
energy_absolute_tolerance = 1e-6
print_fields = false
momentum_l_max_its = 200
momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
momentum_petsc_options_value = 'hypre boomeramg'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
pressure_petsc_options_value = 'hypre boomeramg'
energy_petsc_options_iname = '-pc_type -pc_hypre_type'
energy_petsc_options_value = 'hypre boomeramg'
continue_on_max_its = true
[]
[Outputs]
[out]
type = CSV
[]
[]
(modules/navier_stokes/test/tests/finite_volume/ins/turbulence/bfs/linear-segregated-transient/BFS_ERCOFTAC.i)
Re = 5100
rho = 1.0
bulk_u = 1.0
H = 1.0
mu = '${fparse rho * bulk_u * H / Re}'
advected_interp_method = 'upwind'
### k-epsilon Closure Parameters ###
sigma_k = 1.0
sigma_eps = 1.3
C1_eps = 1.44
C2_eps = 1.92
C_mu = 0.09
### Initial and Boundary Conditions ###
intensity = 0.01
k_init = '${fparse 1.5*(intensity * bulk_u)^2}'
eps_init = '${fparse C_mu^0.75 * k_init^1.5 / H}'
### Modeling parameters ###
bulk_wall_treatment = false
walls = 'bottom wall-side top'
wall_treatment = 'neq' # Options: eq_newton, eq_incremental, eq_linearized, neq
[Mesh]
[gen]
type = CartesianMeshGenerator
dim = 2
dx = '${fparse 10.0*H} ${fparse 20.0*H}'
dy = '${H} ${fparse 5*H}'
ix = '8 16'
iy = '2 8'
subdomain_id = '
2 1
1 1
'
[]
[corner_walls]
type = SideSetsBetweenSubdomainsGenerator
input = gen
primary_block ='1'
paired_block ='2'
new_boundary = 'wall-side'
[]
[delete_bottom]
type = BlockDeletionGenerator
input = corner_walls
block ='2'
[]
# 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
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
advected_interp_method = ${advected_interp_method}
[]
[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 = ${bulk_u}
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_time]
type = LinearFVTimeDerivative
variable = vel_x
factor = ${rho}
[]
[u_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_x
advected_interp_method = ${advected_interp_method}
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_time]
type = LinearFVTimeDerivative
variable = vel_y
factor = ${rho}
[]
[v_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_y
advected_interp_method = ${advected_interp_method}
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_time]
type = LinearFVTimeDerivative
variable = TKE
factor = ${rho}
[]
[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_time]
type = LinearFVTimeDerivative
variable = TKED
factor = ${rho}
[]
[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]
[inlet-u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left'
variable = vel_x
functor = '${bulk_u}'
[]
[inlet-v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left'
variable = vel_y
functor = '0.0'
[]
[inlet_TKE]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left'
variable = TKE
functor = '${k_init}'
[]
[inlet_TKED]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left'
variable = TKED
functor = '${eps_init}'
[]
[outlet_p]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'right'
variable = pressure
functor = 0.0
[]
[outlet_u]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = 'right'
variable = vel_x
use_two_term_expansion = false
[]
[outlet_v]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = 'right'
variable = vel_y
use_two_term_expansion = false
[]
[outlet_TKE]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = 'right'
variable = TKE
use_two_term_expansion = false
[]
[outlet_TKED]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = 'right'
variable = TKED
use_two_term_expansion = false
[]
[walls-u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = ${walls}
variable = vel_x
functor = 0.0
[]
[walls-v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = ${walls}
variable = vel_y
functor = 0.0
[]
[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 + mu}'
[]
[]
[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 = PIMPLE
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 = 20
pressure_absolute_tolerance = 1e-6
momentum_absolute_tolerance = 1e-6
turbulence_absolute_tolerance = '1e-6 1e-6'
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
dt = 10.0
num_steps = 10
num_piso_iterations = 2
[]
[Outputs]
csv = 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'
[]
[line_entry_channel_wall]
type = LineValueSampler
start_point = '${fparse 0.5 * H} ${fparse 1.00001 * H} 0'
end_point = '${fparse 29.5 * H} ${fparse 1.00001 * H} 0'
num_points = 24
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[line_quarter_entry_channel]
type = LineValueSampler
start_point = '${fparse 0.5 * H} ${fparse 2.25001 * H} 0'
end_point = '${fparse 29.5 * H} ${fparse 2.25001 * H} 0'
num_points = 24
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[]
(test/tests/linearfvkernels/diffusion/diffusion-2d-rz.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 2
ny = 1
ymax = 0.5
[]
coord_type = RZ
rz_coord_axis = Y
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
[]
[]
[LinearFVKernels]
[diffusion]
type = LinearFVDiffusion
variable = u
diffusion_coeff = coeff_func
use_nonorthogonal_correction = true
[]
[source]
type = LinearFVSource
variable = u
source_density = source_func
[]
[]
[LinearFVBCs]
[dir]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "right top bottom"
functor = analytic_solution
[]
[symmetry]
type = LinearFVAdvectionDiffusionScalarSymmetryBC
variable = u
boundary = "left"
[]
[]
[Functions]
[coeff_func]
type = ParsedFunction
expression = '1+0.5*x*y'
[]
[source_func]
type = ParsedFunction
expression = '-(-1.0*x^2*y*(1.5 - x^2) + x*(1.5 - x^2)*(-1.0*x*y - 2))/x - (-1.0*x^2*y*(1.5 - y^2) - 4*x*(1.5 - y^2)*(0.5*x*y + 1))/x'
[]
[analytic_solution]
type = ParsedFunction
expression = '(1.5-x*x)*(1.5-y*y)'
[]
[]
[Postprocessors]
[h]
type = AverageElementSize
execute_on = FINAL
[]
[error]
type = ElementL2FunctorError
approximate = u
exact = analytic_solution
execute_on = FINAL
[]
[]
[Convergence]
[linear]
type = IterationCountConvergence
max_iterations = 1
converge_at_max_iterations = true
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-10
multi_system_fixed_point = true
multi_system_fixed_point_convergence = linear
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
[]
[exo]
type = Exodus
execute_on = FINAL
[]
[]
(test/tests/linearfvkernels/advection/advection-2d.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 2
ny= 1
ymax = 0.5
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
[]
[]
[FVInterpolationMethods]
[upwind]
type = FVAdvectedUpwind
[]
[average]
type = FVGeometricAverage
[]
[muscl_venkat]
type = FVAdvectedVenkatakrishnanDeferredCorrection
deferred_correction_factor = 1.0
[]
[nvd_vanleer]
type = FVAdvectedVanLeerWeightBased
blending_factor = 1.0
[]
[nvd_minmod]
type = FVAdvectedMinmodWeightBased
blending_factor = 1.0
[]
[]
[LinearFVKernels]
[advection]
type = LinearFVAdvection
variable = u
velocity = "0.5 0 0"
advected_interp_method_name = upwind
[]
[source]
type = LinearFVSource
variable = u
source_density = source_func
[]
[]
[LinearFVBCs]
[inflow]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "left top bottom"
functor = analytic_solution
[]
[outflow]
type = LinearFVAdvectionDiffusionOutflowBC
variable = u
boundary = "right"
use_two_term_expansion = false
[]
[]
[Functions]
[source_func]
type = ParsedFunction
expression = '0.5*pi*sin(2*y*pi)*cos(x*pi)'
[]
[analytic_solution]
type = ParsedFunction
expression = 'sin(x*pi)*sin(2*y*pi) + 1.5'
[]
[]
[Postprocessors]
[error]
type = ElementL2FunctorError
approximate = u
exact = analytic_solution
execute_on = FINAL
[]
[h]
type = AverageElementSize
execute_on = FINAL
[]
[]
[Convergence]
[linear]
type = IterationCountConvergence
max_iterations = 1
converge_at_max_iterations = true
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-10
multi_system_fixed_point=true
multi_system_fixed_point_convergence=linear
petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_shift_amount -pc_factor_mat_solver_type -mat_mumps_icntl_14'
petsc_options_value = 'lu NONZERO 1e-12 mumps 50'
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
[]
[]
(modules/navier_stokes/test/tests/finite_volume/ins/channel-flow/SIMPLEC/2d/2d-velocity-pressure.i)
mu = 2.6
rho = 1.0
advected_interp_method = 'average'
[Mesh]
[mesh]
type = CartesianMeshGenerator
dim = 2
dx = '1.0'
dy = '0.1'
ix = '20'
iy = '3'
[]
[]
[Problem]
linear_sys_names = 'u_system v_system pressure_system'
previous_nl_solution_required = true
[]
[UserObjects]
[rc]
type = RhieChowMassFlux
u = vel_x
v = vel_y
pressure = pressure
rho = ${rho}
p_diffusion_kernel = p_diffusion
pressure_projection_method = consistent
[]
[]
[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]
[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]
[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
[]
[]
[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 = 1.0
num_iterations = 100
pressure_absolute_tolerance = 1e-10
momentum_absolute_tolerance = 1e-10
momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
momentum_petsc_options_value = 'hypre boomeramg'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
pressure_petsc_options_value = 'hypre boomeramg'
print_fields = false
[]
[Outputs]
exodus = true
[]
(modules/navier_stokes/test/tests/finite_volume/ins/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
[]
(test/tests/transfers/multiapp_copy_transfer/linear_sys_to_aux/linear_sub.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
nx = 10
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
[]
[]
[LinearFVKernels]
[diffusion]
type = LinearFVDiffusion
variable = u
diffusion_coeff = coeff_func
[]
[source]
type = LinearFVSource
variable = u
source_density = source_func
[]
[]
[LinearFVBCs]
[dir]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "left right"
functor = analytic_solution
[]
[]
[Functions]
[coeff_func]
type = ParsedFunction
expression = '0.5*x'
[]
[source_func]
type = ParsedFunction
expression = '2*x'
[]
[analytic_solution]
type = ParsedFunction
expression = '1-x*x'
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-10
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true
execute_on = TIMESTEP_END
[]
(test/tests/linearfvkernels/block-restriction/block-restricted-adr.i)
[Mesh]
[cmg]
type = CartesianMeshGenerator
dim = 2
dx = '0.1 1 0.1'
dy = '0.1 0.5 0.1'
ix = '1 2 1'
iy = '1 1 1'
subdomain_id = '1 1 1 1 2 3 1 1 1'
[]
[transform]
type = TransformGenerator
input = cmg
transform = TRANSLATE
vector_value = '-0.1 -0.1 0.0'
[]
[create_sides]
type = SideSetsBetweenSubdomainsGenerator
input = transform
new_boundary = sides
primary_block = 2
paired_block = 1
[]
[create_outlet]
type = SideSetsBetweenSubdomainsGenerator
input = create_sides
new_boundary = outlet
primary_block = 2
paired_block = 3
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
block = 2
[]
[]
[FVInterpolationMethods]
[average]
type = FVGeometricAverage
[]
[]
[LinearFVKernels]
[diffusion]
type = LinearFVDiffusion
variable = u
diffusion_coeff = diff_coeff_func
use_nonorthogonal_correction = false
[]
[advection]
type = LinearFVAdvection
variable = u
velocity = "0.5 0 0"
advected_interp_method_name = average
[]
[reaction]
type = LinearFVReaction
variable = u
coeff = coeff_func
[]
[source]
type = LinearFVSource
variable = u
source_density = source_func
[]
[]
[LinearFVBCs]
inactive = "outflow"
[dir]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "sides outlet"
functor = analytic_solution
[]
[outflow]
type = LinearFVAdvectionDiffusionOutflowBC
variable = u
boundary = "right"
use_two_term_expansion = true
[]
[]
[Functions]
[diff_coeff_func]
type = ParsedFunction
expression = '1.0+0.5*x*y'
[]
[coeff_func]
type = ParsedFunction
expression = '1.0+1.0/(1+x*y)'
[]
[source_func]
type = ParsedFunction
expression = '-1.0*x*pi*sin((1/2)*x*pi)*cos(2*y*pi) - 0.25*y*pi*sin(2*y*pi)*cos((1/2)*x*pi) + (1.0 + 1.0/(x*y + 1))*(sin((1/2)*x*pi)*sin(2*y*pi) + 1.5) + (17/4)*pi^2*(0.5*x*y + 1.0)*sin((1/2)*x*pi)*sin(2*y*pi) + 0.25*pi*sin(2*y*pi)*cos((1/2)*x*pi)'
[]
[analytic_solution]
type = ParsedFunction
expression = 'sin((1/2)*x*pi)*sin(2*y*pi) + 1.5'
[]
[]
[Postprocessors]
[h]
type = AverageElementSize
execute_on = FINAL
block = 2
[]
[error]
type = ElementL2FunctorError
approximate = u
exact = analytic_solution
execute_on = FINAL
block = 2
[]
[]
[Convergence]
[linear]
type = IterationCountConvergence
max_iterations = 1
converge_at_max_iterations = true
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-10
multi_system_fixed_point=true
multi_system_fixed_point_convergence=linear
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
[]
[]
(test/tests/controls/conditional_functional_enable/linear-fv-bc-control-switch.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 1
nx = 20
xmin = 0
xmax = 1
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 0.0
[]
[]
[LinearFVKernels]
[diffusion]
type = LinearFVDiffusion
variable = u
[]
[]
[LinearFVBCs]
[left]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = left
functor = 0
[]
# "Off" right BC: u=0, initially enabled; disabled by Control
[right_off]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = right
functor = 0
enable = true
[]
# "On" right BC: u=1, initially disabled; enabled by Control
[right_on]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = right
functor = 1
enable = false
[]
[]
[Functions]
[always_on]
type = ParsedFunction
expression = '1'
[]
[]
[Controls]
[switch_right_bc]
type = ConditionalFunctionEnableControl
conditional_function = always_on
enable_objects = 'LinearFVBCs::right_on'
disable_objects = 'LinearFVBCs::right_off'
[]
[]
[Postprocessors]
[side_avg_right]
type = SideAverageValue
variable = u
boundary = right
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-10
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[Outputs]
[out]
type = CSV
execute_on = 'TIMESTEP_END'
[]
[]
(modules/navier_stokes/test/tests/finite_volume/ins/channel-flow/linear-segregated/2d-heated/fluid.i)
mu = 2.6
rho = 1.0
advected_interp_method = 'upwind'
cp = 1000
k = 1
[Mesh]
[mesh]
type = CartesianMeshGenerator
dim = 2
dx = '0.25 0.25'
dy = '0.2'
ix = '5 5'
iy = '5'
subdomain_id = '0 1'
[]
[]
[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_fluid]
type = MooseLinearVariableFVReal
solver_sys = energy_system
initial_condition = 300
[]
[]
[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
[]
[h_advection]
type = LinearFVEnergyAdvection
variable = T_fluid
advected_quantity = temperature
cp = ${cp}
advected_interp_method = ${advected_interp_method}
rhie_chow_user_object = 'rc'
[]
[conduction]
type = LinearFVDiffusion
variable = T_fluid
diffusion_coeff = ${k}
use_nonorthogonal_correction = false
[]
[heat_exchange]
type = LinearFVVolumetricHeatTransfer
variable = T_fluid
h_solid_fluid = 100
T_fluid = T_fluid
T_solid = T_solid
is_solid = false
block = 1
[]
[]
[FunctorMaterials]
[constant_functors]
type = GenericFunctorMaterial
prop_names = 'cp'
prop_values = '${cp}'
[]
[]
[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_wall_T]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = T_fluid
functor = 300
boundary = 'left top bottom'
[]
[outlet_T]
type = LinearFVAdvectionDiffusionOutflowBC
variable = T_fluid
use_two_term_expansion = false
boundary = right
[]
[]
[AuxVariables]
[T_solid]
type = MooseLinearVariableFVReal
initial_condition = 300
block = 1
[]
[]
[MultiApps]
inactive = 'solid'
[solid]
type = FullSolveMultiApp
input_files = solid.i
execute_on = timestep_begin
no_restore = true
[]
[]
[Transfers]
inactive = 'from_solid to_solid'
[from_solid]
type = MultiAppGeneralFieldShapeEvaluationTransfer
from_multi_app = solid
source_variable = 'T_solid'
variable = 'T_solid'
execute_on = timestep_begin
from_blocks = 1
[]
[to_solid]
type = MultiAppGeneralFieldShapeEvaluationTransfer
to_multi_app = solid
source_variable = 'T_fluid'
variable = 'T_fluid'
execute_on = timestep_begin
to_blocks = 1
[]
[]
[Executioner]
type = SIMPLE
momentum_l_abs_tol = 1e-13
pressure_l_abs_tol = 1e-13
energy_l_abs_tol = 1e-13
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 = 20
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
continue_on_max_its = true
[]
[Outputs]
exodus = true
execute_on = timestep_end
[]
(modules/navier_stokes/test/tests/postprocessors/flow_rates/conservation_LinearFV.i)
mu = 2.6
rho = 1.1
advected_interp_method='average'
[UserObjects]
[rc]
type = RhieChowMassFlux
u = vel_x
v = vel_y
pressure = pressure
rho = ${rho}
p_diffusion_kernel = p_diffusion
[]
[]
[Mesh]
[mesh]
type = CartesianMeshGenerator
dim = 2
dx = '0.3'
dy = '0.3'
ix = '3'
iy = '3'
[]
[]
[Problem]
linear_sys_names = 'u_system v_system pressure_system'
previous_nl_solution_required = true
[]
[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]
[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]
[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
[]
[]
[Executioner]
type = SIMPLE
momentum_l_abs_tol = 1e-10
pressure_l_abs_tol = 1e-10
momentum_l_tol = 0
pressure_l_tol = 0
rhie_chow_user_object = 'rc'
momentum_systems = 'u_system v_system'
pressure_system = 'pressure_system'
momentum_equation_relaxation = 0.8
pressure_variable_relaxation = 0.3
num_iterations = 100
pressure_absolute_tolerance = 1e-10
momentum_absolute_tolerance = 1e-10
momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
momentum_petsc_options_value = 'hypre boomeramg'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
pressure_petsc_options_value = 'hypre boomeramg'
print_fields = false
[]
[Postprocessors]
[inlet_mass]
type = VolumetricFlowRate
boundary = left
rhie_chow_user_object = rc
advected_quantity = ${rho}
vel_x = vel_x
vel_y = vel_y
subtract_mesh_velocity = false
[]
[outlet_mass]
type = VolumetricFlowRate
boundary = right
rhie_chow_user_object = rc
advected_quantity = ${rho}
vel_x = vel_x
vel_y = vel_y
subtract_mesh_velocity = false
[]
[]
[Outputs]
csv = true
[]
(modules/navier_stokes/test/tests/finite_volume/ins/turbulence/block-restricted/block-ke.i)
H = 1 #halfwidth of the channel
L = 100
Re = 13700
rho = 1
bulk_u = 1
mu = '${fparse rho * bulk_u * 2 * H / Re}'
advected_interp_method = 'upwind'
### k-epsilon Closure Parameters ###
sigma_k = 1.0
sigma_eps = 1.3
C1_eps = 1.44
C2_eps = 1.92
C_mu = 0.09
### Initial and Boundary Conditions ###
intensity = '${fparse 0.16*Re^(-1./8.)}'
k_init = '${fparse 1.5*(intensity * bulk_u)^2}'
eps_init = '${fparse C_mu^0.75 * k_init^1.5 / (2*H)}'
### Modeling parameters ###
bulk_wall_treatment = false
walls = 'walls'
wall_treatment = 'eq_newton' # Options: eq_newton, eq_incremental, eq_linearized, neq
[Mesh]
[block_left]
type = GeneratedMeshGenerator
dim = 2
xmin = '${fparse -2*H}'
xmax = '${fparse -H}'
ymin = 0
ymax = ${L}
nx = 3
ny = 4
[]
[block_1]
type = GeneratedMeshGenerator
dim = 2
xmin = '${fparse -H}'
xmax = 0
ymin = 0
ymax = ${L}
nx = 4
ny = 4
bias_x = '${fparse 1/0.7}'
[]
[block_2]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${H}
ymin = 0
ymax = ${L}
nx = 4
ny = 4
bias_x = 0.7
[]
[block_right]
type = GeneratedMeshGenerator
dim = 2
xmin = ${H}
xmax = '${fparse 2*H}'
ymin = 0
ymax = ${L}
nx = 3
ny = 4
[]
[smg]
type = StitchedMeshGenerator
inputs = 'block_left block_1 block_2 block_right'
stitch_boundaries_pairs = 'right left; right left; right left'
[]
[middle]
input = smg
type = SubdomainBoundingBoxGenerator
block_id = 1
bottom_left = '${fparse -H} 0 0'
top_right = '${H} ${L} 50'
[]
[walls]
type = SideSetsBetweenSubdomainsGenerator
primary_block = 1
paired_block = 0
new_boundary = walls
input = middle
[]
# 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
[]
[GlobalParams]
rhie_chow_user_object = 'rc'
advected_interp_method = ${advected_interp_method}
[]
[UserObjects]
[rc]
type = RhieChowMassFlux
u = vel_x
v = vel_y
pressure = pressure
rho = ${rho}
p_diffusion_kernel = p_diffusion
block = 1
[]
[]
[Variables]
[vel_x]
type = MooseLinearVariableFVReal
initial_condition = 0.0
solver_sys = u_system
block = 1
[]
[vel_y]
type = MooseLinearVariableFVReal
initial_condition = ${bulk_u}
solver_sys = v_system
block = 1
[]
[pressure]
type = MooseLinearVariableFVReal
initial_condition = 1e-8
solver_sys = pressure_system
block = 1
[]
[TKE]
type = MooseLinearVariableFVReal
solver_sys = TKE_system
initial_condition = ${k_init}
block = 1
[]
[TKED]
type = MooseLinearVariableFVReal
solver_sys = TKED_system
initial_condition = ${eps_init}
block = 1
[]
[]
[LinearFVKernels]
[u_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_x
advected_interp_method = ${advected_interp_method}
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
advected_interp_method = ${advected_interp_method}
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]
[inlet-u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'bottom'
variable = vel_x
functor = 0
[]
[inlet-v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'bottom'
variable = vel_y
functor = '${bulk_u}'
[]
[walls-u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'walls'
variable = vel_x
functor = 0.0
[]
[walls-v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'walls'
variable = vel_y
functor = 0.0
[]
[outlet_u]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = 'top'
variable = vel_x
use_two_term_expansion = false
[]
[outlet_v]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = 'top'
variable = vel_y
use_two_term_expansion = false
[]
[outlet_p]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'top'
variable = pressure
functor = 0.0
[]
[inlet_TKE]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'bottom'
variable = TKE
functor = '${k_init}'
[]
[outlet_TKE]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = 'top'
variable = TKE
use_two_term_expansion = false
[]
[inlet_TKED]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'bottom'
variable = TKED
functor = '${eps_init}'
[]
[outlet_TKED]
type = LinearFVAdvectionDiffusionOutflowBC
boundary = 'top'
variable = TKED
use_two_term_expansion = false
[]
[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}'
block = 1
[]
[yplus]
type = MooseLinearVariableFVReal
block = 1
[]
[mu_eff]
type = MooseLinearVariableFVReal
initial_condition = '${fparse rho * C_mu * ${k_init}^2 / eps_init}'
block = 1
[]
[]
[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.2 0.2'
turbulence_field_relaxation = '0.2 0.2'
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
[]
[Outputs]
exodus = true
execute_on = timestep_end
csv = true
[]
[VectorPostprocessors]
[line_wall]
type = LineValueSampler
start_point = '${fparse 0.99 * H} ${fparse 0.125 * L} 0'
end_point = '${fparse 0.99 * H} ${fparse 0.875 * L} 0'
num_points = ${Mesh/block_1/nx}
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[line_center_channel]
type = LineValueSampler
start_point = ' ${fparse 0.0001 * H} ${fparse 0.125 * L} 0'
end_point = '${fparse 0.0001 * H} ${fparse 0.875 * L} 0'
num_points = ${Mesh/block_1/nx}
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[line_quarter_radius_channel]
type = LineValueSampler
start_point = '${fparse 0.51 * H} ${fparse 0.125 * L} 0'
end_point = '${fparse 0.51 * H} ${fparse 0.875 * L} 0'
num_points = ${Mesh/block_1/nx}
variable = 'vel_x vel_y pressure TKE TKED'
sort_by = 'x'
execute_on = 'timestep_end'
[]
[]
(modules/navier_stokes/test/tests/finite_volume/ins/mms/linear-segregated/2d-symmetric-vortex/2d-symmetric-vortex.i)
mu = 1.2
rho = 1.5
advected_interp_method = 'average'
[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
body_force_kernel_names = "u_forcing; v_forcing"
[]
[]
[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
[]
[p_diffusion]
type = LinearFVAnisotropicDiffusion
variable = pressure
diffusion_tensor = 'Ainv' # Functor created in the RhieChowMassFlux UO
use_nonorthogonal_correction = false
use_nonorthogonal_correction_on_boundary = false
[]
[HbyA_divergence]
type = LinearFVDivergence
variable = pressure
face_flux = 'HbyA' # Functor created in the RhieChowMassFlux UO
force_boundary_execution = true
[]
[]
[LinearFVBCs]
[no-slip-wall-u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left right top'
variable = vel_x
functor = exact_u
[]
[no-slip-wall-v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left right top'
variable = vel_y
functor = exact_v
[]
[symmetry-u]
type = LinearFVVelocitySymmetryBC
boundary = 'bottom'
variable = vel_x
u = vel_x
v = vel_y
momentum_component = x
[]
[symmetry-v]
type = LinearFVVelocitySymmetryBC
boundary = 'bottom'
variable = vel_y
u = vel_x
v = vel_y
momentum_component = y
[]
[pressure-extrapolation]
type = LinearFVPressureFluxBC
boundary = 'top left right'
variable = pressure
HbyA_flux = HbyA
Ainv = Ainv
[]
[pressure-symmetry]
type = LinearFVPressureSymmetryBC
boundary = 'bottom'
variable = pressure
HbyA_flux = 'HbyA' # Functor created in the RhieChowMassFlux UO
[]
[]
[Functions]
[exact_u]
type = ParsedFunction
expression = 'x^2*(1-x)^2*(8*y^3 - 9*y^2 + 1)'
[]
[exact_v]
type = ParsedFunction
expression = '-(2*x - 6*x^2 + 4*x^3)*y*(1-y)^2*(2*y+1)'
[]
[exact_p]
type = ParsedFunction
expression = 'y^2'
[]
[forcing_u]
type = ParsedFunction
symbol_names = 'mu rho'
symbol_values = '${mu} ${rho}'
expression = 'rho*( (x^2*(1-x)^2)*(2*x - 6*x^2 + 4*x^3)*
( (8*y^3 - 9*y^2 + 1)^2
- (2*y^4 - 3*y^3 + y)*(24*y^2 - 18*y) ) )
- mu*( (2 - 12*x + 12*x^2)*(8*y^3 - 9*y^2 + 1)
+ (x^2*(1-x)^2)*(48*y - 18) )'
[]
[forcing_v]
type = ParsedFunction
symbol_names = 'mu rho'
symbol_values = '${mu} ${rho}'
expression = 'rho*( (8*y^3 - 9*y^2 + 1)*(2*y^4 - 3*y^3 + y)*
( (2*x - 6*x^2 + 4*x^3)^2
- (x^2*(1-x)^2)*(2 - 12*x + 12*x^2) ) )
+ mu*( (24*x - 12)*(2*y^4 - 3*y^3 + y)
+ (2*x - 6*x^2 + 4*x^3)*(24*y^2 - 18*y) )
+ 2*y'
[]
[]
[Executioner]
type = SIMPLE
momentum_l_abs_tol = 1e-8
pressure_l_abs_tol = 1e-8
momentum_l_tol = 0
pressure_l_tol = 0
rhie_chow_user_object = 'rc'
momentum_systems = 'u_system v_system'
pressure_system = 'pressure_system'
momentum_equation_relaxation = 0.8
pressure_variable_relaxation = 0.3
num_iterations = 10000
pressure_absolute_tolerance = 1e-7
momentum_absolute_tolerance = 1e-7
momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
momentum_petsc_options_value = 'hypre boomeramg'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
pressure_petsc_options_value = 'hypre boomeramg'
print_fields = false
continue_on_max_its = true
pin_pressure = true
pressure_pin_value = 0.25
pressure_pin_point = '0.5 0.5 0.0'
[]
[Outputs]
exodus = true
[csv]
type = CSV
execute_on = TIMESTEP_END
[]
[]
[Postprocessors]
[h]
type = AverageElementSize
execute_on = TIMESTEP_END
[]
[L2u]
type = ElementL2FunctorError
approximate = vel_x
exact = exact_u
execute_on = TIMESTEP_END
[]
[L2v]
type = ElementL2FunctorError
approximate = vel_y
exact = exact_v
execute_on = TIMESTEP_END
[]
[L2p]
approximate = pressure
exact = exact_p
type = ElementL2FunctorError
execute_on = TIMESTEP_END
[]
[]
(modules/navier_stokes/test/tests/finite_volume/ins/channel-flow/linear-segregated/2d-scalar/channel.i)
mu = 2.6
rho = 1.0
advected_interp_method = 'upwind'
k1 = 0.1
k2 = 0.2
[Mesh]
[mesh]
type = CartesianMeshGenerator
dim = 2
dx = '0.25 0.25'
dy = '0.2'
ix = '5 5'
iy = '5'
subdomain_id = '0 1'
[]
[]
[Problem]
linear_sys_names = 'u_system v_system pressure_system s1_system s2_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
[]
[scalar1]
type = MooseLinearVariableFVReal
solver_sys = s1_system
initial_condition = 1.1
[]
[scalar2]
type = MooseLinearVariableFVReal
solver_sys = s2_system
initial_condition = 3
[]
[]
[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
[]
[s1_advection]
type = LinearFVScalarAdvection
variable = scalar1
advected_interp_method = ${advected_interp_method}
rhie_chow_user_object = 'rc'
[]
[s1_diffusion]
type = LinearFVDiffusion
variable = scalar1
diffusion_coeff = ${k1}
use_nonorthogonal_correction = false
[]
[s2_diffusion]
type = LinearFVScalarAdvection
variable = scalar2
advected_interp_method = ${advected_interp_method}
rhie_chow_user_object = 'rc'
[]
[s2_conduction]
type = LinearFVDiffusion
variable = scalar2
diffusion_coeff = ${k2}
use_nonorthogonal_correction = false
[]
[]
[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_wall_scalar1]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = scalar1
functor = 1
boundary = 'left'
[]
[outlet_scalar1]
type = LinearFVAdvectionDiffusionOutflowBC
variable = scalar1
use_two_term_expansion = false
boundary = right
[]
[inlet_wall_scalar2]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = scalar2
functor = 2
boundary = 'left'
[]
[outlet_scalar2]
type = LinearFVAdvectionDiffusionOutflowBC
variable = scalar2
use_two_term_expansion = false
boundary = right
[]
[]
[Executioner]
type = SIMPLE
momentum_l_abs_tol = 1e-13
pressure_l_abs_tol = 1e-13
passive_scalar_l_abs_tol = 1e-13
momentum_l_tol = 0
pressure_l_tol = 0
passive_scalar_l_tol = 0
rhie_chow_user_object = 'rc'
momentum_systems = 'u_system v_system'
pressure_system = 'pressure_system'
passive_scalar_systems = 's1_system s2_system'
momentum_equation_relaxation = 0.8
passive_scalar_equation_relaxation = '0.9 0.9'
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
# The solution being flat, the normalization factor based on fluxes goes to
# 0. The convergence criteria being multiplied by said factor, we won't do any
# better than this. For a non-flat solution, use tighter tolerances
passive_scalar_absolute_tolerance = '1e-2 1e-2'
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'
passive_scalar_petsc_options_iname = '-pc_type -pc_hypre_type'
passive_scalar_petsc_options_value = 'hypre boomeramg'
print_fields = false
continue_on_max_its = true
[]
[Outputs]
exodus = true
execute_on = timestep_end
hide = 'pressure vel_x vel_y'
[]
(modules/navier_stokes/test/tests/finite_volume/two_phase/mixture_model/segregated/lid-driven-two-phase-physics.i)
mu = 1.0
rho = 1.0e3
mu_d = 0.3
rho_d = 5e2
dp = 0.01
U_lid = 0.1
advected_interp_method = 'upwind'
k = 1
k_d = 1
cp = 1
cp_d = 1
[Mesh]
inactive = 'make_skew'
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = .1
ymin = 0
ymax = .1
nx = 10
ny = 10
[]
[make_skew]
type = MoveNodeGenerator
input = 'gen'
node_id = 0
shift_position = '0.007 0.0021 0'
[]
[]
[Problem]
linear_sys_names = 'u_system v_system pressure_system phi_system'
[]
[Physics]
[NavierStokes]
[FlowSegregated]
[flow]
compressibility = 'incompressible'
density = 'rho_mixture'
dynamic_viscosity = 'mu_mixture'
# Initial conditions
initial_velocity = '1e-12 1e-12 0'
initial_pressure = 0.2
wall_boundaries = 'top left right bottom'
momentum_wall_types = 'noslip noslip noslip noslip'
momentum_wall_functors = '${U_lid} 0; 0 0; 0 0; 0 0'
orthogonality_correction = false
pressure_two_term_bc_expansion = true
momentum_advection_interpolation = ${advected_interp_method}
[]
[]
[TwoPhaseMixtureSegregated]
[mixture]
system_names = 'phi_system'
phase_1_fraction_name = 'phase_1'
phase_2_fraction_name = 'phase_2'
add_phase_transport_equation = true
phase_advection_interpolation = '${advected_interp_method}'
phase_fraction_diffusivity = 1e-3
# We could consider adding fixed-value-yet-not-an-inlet
# boundary conditions to the TwoPhaseMixture physics
# Base phase material properties
phase_1_density_name = ${rho}
phase_1_viscosity_name = ${mu}
phase_1_specific_heat_name = ${cp}
phase_1_thermal_conductivity_name = ${k}
# Other phase material properties
phase_2_density_name = ${rho_d}
phase_2_viscosity_name = ${mu_d}
phase_2_specific_heat_name = ${cp_d}
phase_2_thermal_conductivity_name = ${k_d}
output_all_properties = true
# Friction model, not actually used!
use_dispersed_phase_drag_model = true
particle_diameter = ${dp}
add_advection_slip_term = false
[]
[]
[]
[]
[LinearFVBCs]
[botttom-phase-2]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'bottom'
variable = phase_2
functor = '0'
[]
[top-phase-2]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'top'
variable = phase_2
functor = '1'
[]
[]
[Executioner]
type = PIMPLE
rhie_chow_user_object = 'ins_rhie_chow_interpolator'
dt = 1
end_time = 10
# 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_factor_shift_type' # -pc_hypre_type'
active_scalar_petsc_options_value = 'lu NONZERO'
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
pin_pressure = true
pressure_pin_value = 0.0
pressure_pin_point = '0.05 0.05 0.0'
[]
[Outputs]
exodus = true
[out]
type = CSV
execute_on = 'FINAL'
[]
[]
[AuxVariables]
[drag_coefficient]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[populate_cd]
type = FunctorAux
variable = drag_coefficient
functor = 'Darcy_coefficient'
execute_on = 'TIMESTEP_END'
[]
[]
[Postprocessors]
[average_void]
type = ElementAverageValue
variable = 'phase_2'
[]
[max_y_velocity]
type = ElementExtremeValue
variable = 'vel_y'
value_type = max
[]
[min_y_velocity]
type = ElementExtremeValue
variable = 'vel_y'
value_type = min
[]
[max_x_velocity]
type = ElementExtremeValue
variable = 'vel_x'
value_type = max
[]
[min_x_velocity]
type = ElementExtremeValue
variable = 'vel_x'
value_type = min
[]
[max_x_slip_velocity]
type = ElementExtremeFunctorValue
functor = 'vel_slip_x'
value_type = max
[]
[max_y_slip_velocity]
type = ElementExtremeFunctorValue
functor = 'vel_slip_y'
value_type = max
[]
[max_drag_coefficient]
type = ElementExtremeFunctorValue
functor = 'drag_coefficient'
value_type = max
[]
[]
(modules/heat_transfer/test/tests/linearfvbcs/linear_fv_functor_radiative_bc/linear_fv_functor_radiative_bc_mms.i)
# MMS convergence test for LinearFVFunctorRadiativeBC.
#
# Exact solution: T_exact(x) = T_L + B * (exp(x) - 1)
# where B = (T_R_mms - T_L) / (e - 1).
#
# This satisfies:
# Left BC: T(0) = T_L (Dirichlet)
# Right BC: -k * T'(1) = sigma*eps*(T_R_mms^4 - T_inf^4) (radiative)
# with T'(1) = B*e = (T_R_mms - T_L)*e/(e-1)
# i.e. k*(T_L - T_R_mms)*e/(e-1) = sigma*eps*(T_R_mms^4 - T_inf^4)
# Source: f(x) = -k * T_exact'' = -k * B * exp(x) (spatially varying)
#
# The exponential profile produces non-trivial interior discretization error,
# ensuring the convergence test exercises both the FV interior scheme and the
# Robin boundary condition simultaneously.
#
# T_R_mms must be supplied via CLI args, as the root of:
# k*(T_L - T_R)*e/(e-1) = sigma*eps*(T_R^4 - T_inf^4)
# (computed in the Python convergence script).
T_L = 1000.0
T_inf = 300.0
k = 1.0
eps = 1.0
T_R_mms = 0 # set via CLI: T_R_mms=<value>
B_mms = '${fparse (T_R_mms - T_L) / (exp(1.0) - 1.0)}'
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 1
nx = 10 # overridden by CLI: Mesh/gen/nx=<N>
xmin = 0
xmax = 1
[]
[]
[Problem]
linear_sys_names = 'heat_system'
[]
[Variables]
[T]
type = MooseLinearVariableFVReal
solver_sys = 'heat_system'
initial_condition = ${T_L}
[]
[]
[Functions]
[exact_T]
type = ParsedFunction
expression = 'T_L + B_mms * (exp(x) - 1.0)'
symbol_names = 'T_L B_mms'
symbol_values = '${T_L} ${B_mms}'
[]
[source_fn]
type = ParsedFunction
expression = '-k * B_mms * exp(x)'
symbol_names = 'k B_mms'
symbol_values = '${k} ${B_mms}'
[]
[]
[LinearFVKernels]
[time]
type = LinearFVTimeDerivative
variable = T
[]
[diffusion]
type = LinearFVDiffusion
variable = T
diffusion_coeff = ${k}
[]
[source]
type = LinearFVSource
variable = T
source_density = source_fn
[]
[]
[LinearFVBCs]
[left]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = T
boundary = 'left'
functor = ${T_L}
[]
[right]
type = LinearFVFunctorRadiativeBC
variable = T
boundary = 'right'
emissivity = ${eps}
Tinfinity = ${T_inf}
diffusion_coeff = ${k}
[]
[]
[Postprocessors]
[l2_error]
type = ElementL2FunctorError
approximate = T
exact = exact_T
execute_on = TIMESTEP_END
[]
[]
[Executioner]
type = Transient
system_names = heat_system
scheme = 'implicit-euler'
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
dt = 1e6
num_steps = 100
l_tol = 1e-12
[]
[Outputs]
[out]
type = CSV
execute_on = final
[]
[]
(modules/navier_stokes/test/tests/finite_volume/ins/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/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
[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
[]
[]
[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 = ${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_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 = LinearFVAnisotropicDiffusion
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)'
[]
[]
[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
[]
(test/tests/linearfvkernels/block-restriction/block-restricted-diffusion.i)
[Mesh]
[cmg]
type = CartesianMeshGenerator
dim = 2
dx = '0.1 1 0.1'
dy = '0.1 0.5 0.1'
ix = '1 2 1'
iy = '1 1 1'
subdomain_id = '1 1 1 1 2 3 1 1 1'
[]
[transform]
type = TransformGenerator
input = cmg
transform = TRANSLATE
vector_value = '-0.1 -0.1 0.0'
[]
[create_sides]
type = SideSetsBetweenSubdomainsGenerator
input = transform
new_boundary = sides
primary_block = 2
paired_block = 1
[]
[create_outlet]
type = SideSetsBetweenSubdomainsGenerator
input = create_sides
new_boundary = outlet
primary_block = 2
paired_block = 3
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
block = 2
[]
[]
[LinearFVKernels]
[diffusion]
type = LinearFVDiffusion
variable = u
diffusion_coeff = diff_coeff_func
use_nonorthogonal_correction = false
[]
[source]
type = LinearFVSource
variable = u
source_density = source_func
[]
[]
[LinearFVBCs]
[dir]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "sides outlet"
functor = analytic_solution
[]
[]
[Functions]
[diff_coeff_func]
type = ParsedFunction
expression = '1.0+0.5*x*y'
[]
[source_func]
type = ParsedFunction
expression = '-1.0*x*pi*sin(x*pi)*cos(2*y*pi) - 0.5*y*pi*sin(2*y*pi)*cos(x*pi) + 5*pi^2*(0.5*x*y + 1.0)*sin(x*pi)*sin(2*y*pi)'
[]
[analytic_solution]
type = ParsedFunction
expression = 'sin(x*pi)*sin(2*y*pi) + 1.5'
[]
[]
[Postprocessors]
[h]
type = AverageElementSize
execute_on = FINAL
block = 2
[]
[error]
type = ElementL2FunctorError
approximate = u
exact = analytic_solution
execute_on = FINAL
block = 2
[]
[]
[Convergence]
[linear]
type = IterationCountConvergence
max_iterations = 1
converge_at_max_iterations = true
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-10
multi_system_fixed_point=true
multi_system_fixed_point_convergence=linear
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
[]
[]
(modules/navier_stokes/test/tests/finite_volume/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
[]
[]
[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_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 = LinearFVAnisotropicDiffusion
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
[]
(test/tests/linearfvkernels/diffusion/diffusion-2d.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 2
ny = 1
ymax = 0.5
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
[]
[]
[LinearFVKernels]
[diffusion]
type = LinearFVDiffusion
variable = u
diffusion_coeff = coeff_func
use_nonorthogonal_correction = false
[]
[source]
type = LinearFVSource
variable = u
source_density = source_func
[]
[]
[LinearFVBCs]
[dir]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "left right top bottom"
functor = analytic_solution
[]
[]
[Functions]
[coeff_func]
type = ParsedFunction
expression = '1+0.5*x*y'
[]
[source_func]
type = ParsedFunction
expression = '2*(1.5-y*y)+2*x*y*(1.5-y*y)+2*(1.5-x*x)+2*x*y*(1.5-x*x)'
[]
[analytic_solution]
type = ParsedFunction
expression = '(1.5-x*x)*(1.5-y*y)'
[]
[]
[Postprocessors]
[h]
type = AverageElementSize
execute_on = FINAL
[]
[error]
type = ElementL2FunctorError
approximate = u
exact = analytic_solution
execute_on = FINAL
[]
[]
[Convergence]
[linear]
type = IterationCountConvergence
max_iterations = 1
converge_at_max_iterations = true
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-10
multi_system_fixed_point=true
multi_system_fixed_point_convergence=linear
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
[]
[]
(test/tests/linearfvbcs/scalar_symmetry/diffusion-1d-symmetry.i)
diff = 0.1
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
nx = 2
xmin = 0
xmax = ${fparse pi}
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
[]
[]
[Functions]
[u_exact]
type = ParsedFunction
expression = 'cos(x)'
[]
[source_fn]
type = ParsedFunction
expression = '${diff}*cos(x)'
[]
[]
[LinearFVKernels]
[advection]
type = LinearFVDiffusion
variable = u
diffusion_coeff = ${diff}
[]
[source]
type = LinearFVSource
variable = u
source_density = source_fn
[]
[]
[LinearFVBCs]
[rob_l]
type = LinearFVAdvectionDiffusionScalarSymmetryBC
variable = u
boundary = "left"
use_two_term_expansion = true
[]
[dirichlet]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "right"
functor = u_exact
[]
[]
[Postprocessors]
[h]
type = AverageElementSize
execute_on = FINAL
[]
[error]
type = ElementL2FunctorError
approximate = u
exact = u_exact
execute_on = FINAL
[]
[]
[Convergence]
[linear]
type = IterationCountConvergence
max_iterations = 4
converge_at_max_iterations = true
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-7
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
linear_convergence = linear
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
[]
[]
(test/tests/linearfvkernels/advection/advection-1d.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
nx = 2
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
[]
[]
[FVInterpolationMethods]
[upwind]
type = FVAdvectedUpwind
[]
[average]
type = FVGeometricAverage
[]
[muscl_venkat]
type = FVAdvectedVenkatakrishnanDeferredCorrection
deferred_correction_factor = 1.0
[]
[nvd_vanleer]
type = FVAdvectedVanLeerWeightBased
blending_factor = 1.0
[]
[nvd_minmod]
type = FVAdvectedMinmodWeightBased
blending_factor = 1.0
[]
[]
[LinearFVKernels]
[advection]
type = LinearFVAdvection
variable = u
velocity = "0.5 0 0"
advected_interp_method_name = upwind
[]
[source]
type = LinearFVSource
variable = u
source_density = source_func
[]
[]
[LinearFVBCs]
[inflow]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "left"
functor = analytic_solution
[]
[outflow]
type = LinearFVAdvectionDiffusionOutflowBC
variable = u
boundary = "right"
use_two_term_expansion = false
[]
[]
[Functions]
[source_func]
type = ParsedFunction
expression = '0.5*x'
[]
[analytic_solution]
type = ParsedFunction
expression = '0.5+0.5*x*x'
[]
[]
[Postprocessors]
[error]
type = ElementL2FunctorError
approximate = u
exact = analytic_solution
execute_on = FINAL
[]
[h]
type = AverageElementSize
execute_on = FINAL
[]
[]
[Convergence]
[linear]
type = IterationCountConvergence
max_iterations = 1
converge_at_max_iterations = true
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-10
multi_system_fixed_point=true
multi_system_fixed_point_convergence=linear
multi_system_fixed_point_relaxation_factor = 1.0
petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_shift_amount -pc_factor_mat_solver_type -mat_mumps_icntl_14'
petsc_options_value = 'lu NONZERO 1e-12 mumps 50'
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
[]
[]
(modules/navier_stokes/test/tests/finite_volume/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
[]
[]
[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_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 = LinearFVAnisotropicDiffusion
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
[]
(test/tests/outputs/debug/show_execution_linear_fv_flux.i)
[Mesh]
[gen_mesh]
type = GeneratedMeshGenerator
dim = 1
xmin = 0
xmax = 10
nx = 50
[]
[left]
type = ParsedSubdomainMeshGenerator
input = 'gen_mesh'
combinatorial_geometry = 'x < 0.5'
block_id = '1'
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
[]
[]
[LinearFVKernels]
[diffusion_1]
type = LinearFVDiffusion
variable = u
diffusion_coeff = 1.5
block = 0
[]
[diffusion_2]
type = LinearFVDiffusion
variable = u
diffusion_coeff = 2.5
block = 1
[]
[source_1]
type = LinearFVSource
variable = u
source_density = 3.5
block = 0
[]
[source_2]
type = LinearFVSource
variable = u
source_density = 4.5
block = 1
[]
[]
[LinearFVBCs]
[left_bc]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = 'left right'
functor = 0
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-10
[]
[Debug]
show_execution_order = 'NONLINEAR'
[]
(modules/navier_stokes/include/linearfvbcs/LinearFVNormalVelocityFunctorDirichletBC.h)
// This file is part of the MOOSE framework
// https://mooseframework.inl.gov
//
// All rights reserved, see COPYRIGHT for full restrictions
// https://github.com/idaholab/moose/blob/master/COPYRIGHT
//
// Licensed under LGPL 2.1, please see LICENSE for details
// https://www.gnu.org/licenses/lgpl-2.1.html
#pragma once
#include "LinearFVAdvectionDiffusionFunctorDirichletBC.h"
/**
* Adds a dirichlet BC for prescribing a velocity parallel to the boundary face normal direction;
* this boundary condition is meant for the velocity component variables for the Navier-Stokes
* momentum equation. A positive dirichlet value would denote outflow, while negative denotes inflow
*/
class LinearFVNormalVelocityFunctorDirichletBC : public LinearFVAdvectionDiffusionFunctorDirichletBC
{
public:
/**
* Class constructor.
* @param parameters The InputParameters for the object
*/
LinearFVNormalVelocityFunctorDirichletBC(const InputParameters & parameters);
static InputParameters validParams();
virtual Real computeBoundaryValue() const override;
protected:
/// The velocity component this Dirichlet condition object is for
const enum Component : int { X = 0, Y, Z } _component;
};
(modules/navier_stokes/include/linearfvbcs/LinearFVDirichletCHTBC.h)
// This file is part of the MOOSE framework
// https://mooseframework.inl.gov
//
// All rights reserved, see COPYRIGHT for full restrictions
// https://github.com/idaholab/moose/blob/master/COPYRIGHT
//
// Licensed under LGPL 2.1, please see LICENSE for details
// https://www.gnu.org/licenses/lgpl-2.1.html
#pragma once
#include "LinearFVCHTBCInterface.h"
#include "LinearFVAdvectionDiffusionFunctorDirichletBC.h"
/**
* Conjugate heat transfer BC for Dirichlet boundary condition-based
* coupling. Differs from regular BCs due to the need of error checking.
*/
class LinearFVDirichletCHTBC : public LinearFVAdvectionDiffusionFunctorDirichletBC,
public LinearFVCHTBCInterface
{
public:
/**
* Class constructor.
* @param parameters The InputParameters for the object
*/
LinearFVDirichletCHTBC(const InputParameters & parameters);
static InputParameters validParams();
};