- limiternoneLimiter to apply to gradients produced by this method.
Default:none
C++ Type:MooseEnum
Controllable:No
Description:Limiter to apply to gradients produced by this method.
FVGreenGaussGradient
Overview
This method computes gradients for cell-centered linear finite-volume variables using the Green-Gauss theorem Moukalled et al. (2016). For a cell with volume , the method approximates the gradient of a cell-centered field as
where ranges over the cell faces, is the face value interpolated from adjacent cell-centered values and boundary data, and is the outward face area vector.
Use this method when a linear FV variable or a gradient-based interpolation method needs gradients. MOOSE also provides two built-in method names for convenient input into gradient method parameters:
green-gauss, equivalent to anFVGreenGaussGradientwithlimiter = nonegreen-gauss-venkatakrishnan, equivalent to anFVGreenGaussGradientwithlimiter = venkatakrishnan
Named methods in [FVGradientMethods] are useful when several variables or interpolation methods should use the same gradient settings.
Limiters
The optional "limiter" parameter controls whether MOOSE limits the Green-Gauss gradient before using it. With limiter = none, the Green-Gauss result is used directly. With limiter = venkatakrishnan, MOOSE first computes the Green-Gauss gradient and then applies the Venkatakrishnan limiter Venkatakrishnan (1993). A limiter can reduce overshoots near steep solution changes.
Example Syntax
Declare a named Green-Gauss gradient method in [FVGradientMethods]:
[FVGradientMethods<<<{"href": "../../syntax/FVGradientMethods/index.html"}>>>]
[gg]
type = FVGreenGaussGradient<<<{"description": "Green-Gauss cell-centered gradient method.", "href": "FVGreenGaussGradient.html"}>>>
[]
[](test/tests/variables/linearfv/shared-gradient-method.i)Use the method as the default gradient method for a linear FV variable through "gradient_method":
[Variables<<<{"href": "../../syntax/Variables/index.html"}>>>]
[u]
type = MooseLinearVariableFVReal<<<{"description": "Base class for Moose variables. This should never be the terminal object type", "href": "../variables/MooseLinearVariableFV.html"}>>>
solver_sys<<<{"description": "If this variable is a solver variable, this is the solver system to which it should be added."}>>> = 'u_sys'
initial_condition<<<{"description": "Specifies a constant initial condition for this variable"}>>> = 1.0
gradient_method<<<{"description": "Default gradient computation method to register when a consumer requests gradients from this variable. This may be a built-in method name like 'green-gauss' or 'green-gauss-venkatakrishnan', or the name of an object in [FVGradientMethods]."}>>> = gg
[]
[](test/tests/variables/linearfv/shared-gradient-method.i)The same named method can also be used by a gradient-based interpolation method, such as FVAdvectedMUSCLDeferredCorrection:
[FVInterpolationMethods<<<{"href": "../../syntax/FVInterpolationMethods/index.html"}>>>]
[muscl]
type = FVAdvectedMUSCLDeferredCorrection<<<{"description": "MUSCL reconstruction with cell gradients from a named gradient method using deferred correction.", "href": "../fvinterpolationmethods/FVAdvectedMUSCLDeferredCorrection.html"}>>>
gradient_method<<<{"description": "Gradient method used to compute cell gradients for the high-order reconstruction."}>>> = gg
deferred_correction_factor<<<{"description": "Scales the deferred correction strength; 0 gives pure upwind (no deferred correction), 1 gives full deferred correction. Values < 1 can improve fixed point robustness."}>>> = 1.0
[]
[](test/tests/variables/linearfv/shared-gradient-method.i)Input 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:No
Description:Set the enabled status of the MooseObject.
Advanced Parameters
Input Files
- (test/tests/variables/linearfv/shared-gradient-method.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/channel-flow/linear-segregated/2d/2d-velocity-pressure.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/channel-flow/linear-segregated/2d/momentum-pressure-block-restricted.i)
- (test/tests/linearfvbcs/scalar_symmetry/advection-2d-symmetry.i)
- (modules/navier_stokes/test/tests/finite_volume/ins/channel-flow/linear-segregated/2d/2d-boussinesq-transient.i)
- (test/tests/linearfvbcs/scalar_symmetry/advection-1d-symmetry.i)
- (test/tests/linearfvbcs/scalar_symmetry/advection-1d-symmetry-two-gradient-methods.i)
References
- Fadl Moukalled, L Mangani, Marwan Darwish, and others.
The finite volume method in computational fluid dynamics.
Volume 6.
Springer, 2016.[Export]
BibTeX
@book{moukalled2016finite, author = "Moukalled, Fadl and Mangani, L and Darwish, Marwan and others", title = "The finite volume method in computational fluid dynamics", volume = "6", year = "2016", publisher = "Springer" }RIS
TY - BOOK AU - Moukalled, Fadl AU - Mangani, L AU - Darwish, Marwan AU - others TI - The finite volume method in computational fluid dynamics PY - 2016 VL - 6 PB - Springer ER -Plain Text
Fadl Moukalled, L Mangani, Marwan Darwish, and others. The finite volume method in computational fluid dynamics. Volume 6. Springer, 2016. - Venkat Venkatakrishnan.
On the accuracy of limiters and convergence to steady state solutions.
In 31st Aerospace Sciences Meeting, 880. 1993.[Export]
BibTeX
@inproceedings{venkatakrishnan1993, author = "Venkatakrishnan, Venkat", title = "On the accuracy of limiters and convergence to steady state solutions", booktitle = "31st Aerospace Sciences Meeting", pages = "880", year = "1993" }RIS
TY - CPAPER AU - Venkatakrishnan, Venkat TI - On the accuracy of limiters and convergence to steady state solutions T2 - 31st Aerospace Sciences Meeting PY - 1993 SP - 880 ER -Plain Text
Venkat Venkatakrishnan. On the accuracy of limiters and convergence to steady state solutions. In 31st Aerospace Sciences Meeting, 880. 1993.
limiter
Default:none
C++ Type:MooseEnum
Options:none, venkatakrishnan
Controllable:No
Description:Limiter to apply to gradients produced by this method.
(test/tests/variables/linearfv/shared-gradient-method.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
nx = 4
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
gradient_method = gg
[]
[v]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
gradient_method = gg
[]
[]
[FVGradientMethods]
[gg]
type = FVGreenGaussGradient
[]
[]
[FVInterpolationMethods]
[muscl]
type = FVAdvectedMUSCLDeferredCorrection
gradient_method = gg
deferred_correction_factor = 1.0
[]
[]
[LinearFVKernels]
[advection_u]
type = LinearFVAdvection
variable = u
velocity = "1 0 0"
advected_interp_method_name = muscl
[]
[source_u]
type = LinearFVSource
variable = u
source_density = source_func
[]
[advection_v]
type = LinearFVAdvection
variable = v
velocity = "1 0 0"
advected_interp_method_name = muscl
[]
[source_v]
type = LinearFVSource
variable = v
source_density = source_func
[]
[]
[LinearFVBCs]
[inflow_u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "left"
functor = analytic_solution
[]
[outflow_u]
type = LinearFVAdvectionDiffusionOutflowBC
variable = u
boundary = "right"
use_two_term_expansion = false
[]
[inflow_v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = v
boundary = "left"
functor = analytic_solution
[]
[outflow_v]
type = LinearFVAdvectionDiffusionOutflowBC
variable = v
boundary = "right"
use_two_term_expansion = false
[]
[]
[Functions]
[source_func]
type = ParsedFunction
expression = x
[]
[analytic_solution]
type = ParsedFunction
expression = '0.5+0.5*x*x'
[]
[]
[Postprocessors]
[error_u]
type = ElementL2FunctorError
approximate = u
exact = analytic_solution
execute_on = FINAL
[]
[error_v]
type = ElementL2FunctorError
approximate = v
exact = analytic_solution
execute_on = FINAL
[]
[h]
type = AverageElementSize
execute_on = FINAL
[]
[]
[Convergence]
[linear]
type = IterationCountConvergence
max_iterations = 8
converge_at_max_iterations = true
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-10
multi_system_fixed_point = true
multi_system_fixed_point_convergence = linear
multi_system_fixed_point_relaxation_factor = 1.0
petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_shift_amount -pc_factor_mat_solver_type -mat_mumps_icntl_14'
petsc_options_value = 'lu NONZERO 1e-12 mumps 50'
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
[]
[]
gradient_method
Default:green-gauss
C++ Type:GradientMethodName
Controllable:No
Description:Default gradient computation method to register when a consumer requests gradients from this variable. This may be a built-in method name like 'green-gauss' or 'green-gauss-venkatakrishnan', or the name of an object in [FVGradientMethods].
(test/tests/variables/linearfv/shared-gradient-method.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
nx = 4
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
gradient_method = gg
[]
[v]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
gradient_method = gg
[]
[]
[FVGradientMethods]
[gg]
type = FVGreenGaussGradient
[]
[]
[FVInterpolationMethods]
[muscl]
type = FVAdvectedMUSCLDeferredCorrection
gradient_method = gg
deferred_correction_factor = 1.0
[]
[]
[LinearFVKernels]
[advection_u]
type = LinearFVAdvection
variable = u
velocity = "1 0 0"
advected_interp_method_name = muscl
[]
[source_u]
type = LinearFVSource
variable = u
source_density = source_func
[]
[advection_v]
type = LinearFVAdvection
variable = v
velocity = "1 0 0"
advected_interp_method_name = muscl
[]
[source_v]
type = LinearFVSource
variable = v
source_density = source_func
[]
[]
[LinearFVBCs]
[inflow_u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "left"
functor = analytic_solution
[]
[outflow_u]
type = LinearFVAdvectionDiffusionOutflowBC
variable = u
boundary = "right"
use_two_term_expansion = false
[]
[inflow_v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = v
boundary = "left"
functor = analytic_solution
[]
[outflow_v]
type = LinearFVAdvectionDiffusionOutflowBC
variable = v
boundary = "right"
use_two_term_expansion = false
[]
[]
[Functions]
[source_func]
type = ParsedFunction
expression = x
[]
[analytic_solution]
type = ParsedFunction
expression = '0.5+0.5*x*x'
[]
[]
[Postprocessors]
[error_u]
type = ElementL2FunctorError
approximate = u
exact = analytic_solution
execute_on = FINAL
[]
[error_v]
type = ElementL2FunctorError
approximate = v
exact = analytic_solution
execute_on = FINAL
[]
[h]
type = AverageElementSize
execute_on = FINAL
[]
[]
[Convergence]
[linear]
type = IterationCountConvergence
max_iterations = 8
converge_at_max_iterations = true
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-10
multi_system_fixed_point = true
multi_system_fixed_point_convergence = linear
multi_system_fixed_point_relaxation_factor = 1.0
petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_shift_amount -pc_factor_mat_solver_type -mat_mumps_icntl_14'
petsc_options_value = 'lu NONZERO 1e-12 mumps 50'
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
[]
[]
(test/tests/variables/linearfv/shared-gradient-method.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
nx = 4
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
gradient_method = gg
[]
[v]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
gradient_method = gg
[]
[]
[FVGradientMethods]
[gg]
type = FVGreenGaussGradient
[]
[]
[FVInterpolationMethods]
[muscl]
type = FVAdvectedMUSCLDeferredCorrection
gradient_method = gg
deferred_correction_factor = 1.0
[]
[]
[LinearFVKernels]
[advection_u]
type = LinearFVAdvection
variable = u
velocity = "1 0 0"
advected_interp_method_name = muscl
[]
[source_u]
type = LinearFVSource
variable = u
source_density = source_func
[]
[advection_v]
type = LinearFVAdvection
variable = v
velocity = "1 0 0"
advected_interp_method_name = muscl
[]
[source_v]
type = LinearFVSource
variable = v
source_density = source_func
[]
[]
[LinearFVBCs]
[inflow_u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "left"
functor = analytic_solution
[]
[outflow_u]
type = LinearFVAdvectionDiffusionOutflowBC
variable = u
boundary = "right"
use_two_term_expansion = false
[]
[inflow_v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = v
boundary = "left"
functor = analytic_solution
[]
[outflow_v]
type = LinearFVAdvectionDiffusionOutflowBC
variable = v
boundary = "right"
use_two_term_expansion = false
[]
[]
[Functions]
[source_func]
type = ParsedFunction
expression = x
[]
[analytic_solution]
type = ParsedFunction
expression = '0.5+0.5*x*x'
[]
[]
[Postprocessors]
[error_u]
type = ElementL2FunctorError
approximate = u
exact = analytic_solution
execute_on = FINAL
[]
[error_v]
type = ElementL2FunctorError
approximate = v
exact = analytic_solution
execute_on = FINAL
[]
[h]
type = AverageElementSize
execute_on = FINAL
[]
[]
[Convergence]
[linear]
type = IterationCountConvergence
max_iterations = 8
converge_at_max_iterations = true
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-10
multi_system_fixed_point = true
multi_system_fixed_point_convergence = linear
multi_system_fixed_point_relaxation_factor = 1.0
petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_shift_amount -pc_factor_mat_solver_type -mat_mumps_icntl_14'
petsc_options_value = 'lu NONZERO 1e-12 mumps 50'
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
[]
[]
(test/tests/variables/linearfv/shared-gradient-method.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
nx = 4
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
gradient_method = gg
[]
[v]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
gradient_method = gg
[]
[]
[FVGradientMethods]
[gg]
type = FVGreenGaussGradient
[]
[]
[FVInterpolationMethods]
[muscl]
type = FVAdvectedMUSCLDeferredCorrection
gradient_method = gg
deferred_correction_factor = 1.0
[]
[]
[LinearFVKernels]
[advection_u]
type = LinearFVAdvection
variable = u
velocity = "1 0 0"
advected_interp_method_name = muscl
[]
[source_u]
type = LinearFVSource
variable = u
source_density = source_func
[]
[advection_v]
type = LinearFVAdvection
variable = v
velocity = "1 0 0"
advected_interp_method_name = muscl
[]
[source_v]
type = LinearFVSource
variable = v
source_density = source_func
[]
[]
[LinearFVBCs]
[inflow_u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "left"
functor = analytic_solution
[]
[outflow_u]
type = LinearFVAdvectionDiffusionOutflowBC
variable = u
boundary = "right"
use_two_term_expansion = false
[]
[inflow_v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = v
boundary = "left"
functor = analytic_solution
[]
[outflow_v]
type = LinearFVAdvectionDiffusionOutflowBC
variable = v
boundary = "right"
use_two_term_expansion = false
[]
[]
[Functions]
[source_func]
type = ParsedFunction
expression = x
[]
[analytic_solution]
type = ParsedFunction
expression = '0.5+0.5*x*x'
[]
[]
[Postprocessors]
[error_u]
type = ElementL2FunctorError
approximate = u
exact = analytic_solution
execute_on = FINAL
[]
[error_v]
type = ElementL2FunctorError
approximate = v
exact = analytic_solution
execute_on = FINAL
[]
[h]
type = AverageElementSize
execute_on = FINAL
[]
[]
[Convergence]
[linear]
type = IterationCountConvergence
max_iterations = 8
converge_at_max_iterations = true
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-10
multi_system_fixed_point = true
multi_system_fixed_point_convergence = linear
multi_system_fixed_point_relaxation_factor = 1.0
petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_shift_amount -pc_factor_mat_solver_type -mat_mumps_icntl_14'
petsc_options_value = 'lu NONZERO 1e-12 mumps 50'
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
[]
[]
(modules/navier_stokes/test/tests/finite_volume/ins/channel-flow/linear-segregated/2d/2d-velocity-pressure.i)
mu = 2.6
rho = 1.0
advected_interp_method = 'average'
pressure_gradient_method = 'green-gauss'
[Mesh]
allow_renumbering = false # Keep IDs stable for the ID-sorted ElementValueSampler output.
[mesh]
type = CartesianMeshGenerator
dim = 2
dx = '0.3'
dy = '0.3'
ix = '3'
iy = '3'
[]
[]
[Problem]
linear_sys_names = 'u_system v_system pressure_system'
previous_nl_solution_required = true
[]
[UserObjects]
[rc]
type = RhieChowMassFlux
u = vel_x
v = vel_y
pressure = pressure
rho = ${rho}
p_diffusion_kernel = p_diffusion
[]
[]
[Variables]
[vel_x]
type = MooseLinearVariableFVReal
initial_condition = 0.5
solver_sys = u_system
[]
[vel_y]
type = MooseLinearVariableFVReal
solver_sys = v_system
initial_condition = 0.0
[]
[pressure]
type = MooseLinearVariableFVReal
solver_sys = pressure_system
initial_condition = 0.2
gradient_method = ${pressure_gradient_method}
[]
[]
[FVGradientMethods]
[gg]
type = FVGreenGaussGradient
[]
[reconstructed]
type = FVReconstructedPressureGradient
base_gradient_method = green-gauss
gradient_relaxation = 0.1
[]
[]
[FVInterpolationMethods]
[average]
type = FVGeometricAverage
[]
[]
[LinearFVKernels]
[u_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_x
advected_interp_method_name = ${advected_interp_method}
mu = ${mu}
u = vel_x
v = vel_y
momentum_component = 'x'
rhie_chow_user_object = 'rc'
use_nonorthogonal_correction = false
[]
[v_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_y
advected_interp_method_name = ${advected_interp_method}
mu = ${mu}
u = vel_x
v = vel_y
momentum_component = 'y'
rhie_chow_user_object = 'rc'
use_nonorthogonal_correction = false
[]
[u_pressure]
type = LinearFVMomentumPressure
variable = vel_x
pressure = pressure
momentum_component = 'x'
[]
[v_pressure]
type = LinearFVMomentumPressure
variable = vel_y
pressure = pressure
momentum_component = 'y'
[]
[p_diffusion]
type = LinearFVPressureCorrectionDiffusion
variable = pressure
diffusion_tensor = Ainv
use_nonorthogonal_correction = false
[]
[HbyA_divergence]
type = LinearFVDivergence
variable = pressure
face_flux = HbyA
force_boundary_execution = true
[]
[]
[LinearFVBCs]
inactive = 'inlet_and_wall_pressure_flux'
[inlet-u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left'
variable = vel_x
functor = '1.1'
[]
[inlet-v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left'
variable = vel_y
functor = '0.0'
[]
[walls-u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'top bottom'
variable = vel_x
functor = 0.0
[]
[walls-v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'top bottom'
variable = vel_y
functor = 0.0
[]
[outlet_p]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'right'
variable = pressure
functor = 1.4
[]
[inlet_and_wall_pressure_flux]
type = LinearFVPressureFluxBC
boundary = 'left top bottom'
variable = pressure
HbyA_flux = HbyA
Ainv = Ainv
u = vel_x
v = vel_y
rho = ${rho}
[]
[outlet_u]
type = LinearFVAdvectionDiffusionOutflowBC
variable = vel_x
use_two_term_expansion = false
boundary = right
[]
[outlet_v]
type = LinearFVAdvectionDiffusionOutflowBC
variable = vel_y
use_two_term_expansion = false
boundary = right
[]
[]
[VectorPostprocessors]
[solution]
type = ElementValueSampler
variable = 'vel_x vel_y pressure'
sort_by = id
execute_on = TIMESTEP_END
[]
[]
[Executioner]
type = SIMPLE
momentum_l_abs_tol = 1e-10
pressure_l_abs_tol = 1e-10
momentum_l_tol = 0
pressure_l_tol = 0
rhie_chow_user_object = 'rc'
momentum_systems = 'u_system v_system'
pressure_system = 'pressure_system'
momentum_equation_relaxation = 0.8
pressure_variable_relaxation = 0.3
num_iterations = 100
pressure_absolute_tolerance = 1e-10
momentum_absolute_tolerance = 1e-10
momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
momentum_petsc_options_value = 'hypre boomeramg'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
pressure_petsc_options_value = 'hypre boomeramg'
print_fields = false
[]
[Outputs]
exodus = true
[]
(modules/navier_stokes/test/tests/finite_volume/ins/channel-flow/linear-segregated/2d/momentum-pressure-block-restricted.i)
mu = 2.6
rho = 1.0
advected_interp_method = 'average'
[Mesh]
[flow]
type = CartesianMeshGenerator
dim = 2
dx = '0.15 0.15'
dy = '0.3'
ix = '3 3'
iy = '3'
subdomain_id = '0 1'
[]
[outside]
type = GeneratedMeshGenerator
dim = 2
nx = 1
ny = 1
xmin = 2
xmax = 3
ymin = 2
ymax = 3
[]
[outside_block]
type = SubdomainIDGenerator
input = outside
subdomain_id = 2
[]
[mesh]
type = MeshCollectionGenerator
inputs = 'flow outside_block'
[]
[]
[Problem]
linear_sys_names = 'u_system v_system pressure_system'
previous_nl_solution_required = true
[]
[UserObjects]
[rc]
type = RhieChowMassFlux
u = vel_x
v = vel_y
pressure = pressure
rho = ${rho}
p_diffusion_kernel = p_diffusion
block = '0 1'
[]
[]
[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
[]
[]
[FVGradientMethods]
[gg2]
type = FVGreenGaussGradient
[]
[]
[FVInterpolationMethods]
[average]
type = FVGeometricAverage
[]
[]
[LinearFVKernels]
[u_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_x
advected_interp_method_name = ${advected_interp_method}
mu = ${mu}
u = vel_x
v = vel_y
momentum_component = 'x'
rhie_chow_user_object = 'rc'
use_nonorthogonal_correction = false
[]
[v_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_y
advected_interp_method_name = ${advected_interp_method}
mu = ${mu}
u = vel_x
v = vel_y
momentum_component = 'y'
rhie_chow_user_object = 'rc'
use_nonorthogonal_correction = false
[]
[u_pressure_left]
type = LinearFVMomentumPressure
variable = vel_x
pressure = pressure
momentum_component = 'x'
block = '0 2'
[]
[u_pressure_right]
type = LinearFVMomentumPressure
variable = vel_x
pressure = pressure
momentum_component = 'x'
block = '1 2'
[]
[v_pressure_left]
type = LinearFVMomentumPressure
variable = vel_y
pressure = pressure
momentum_component = 'y'
block = '0 2'
[]
[v_pressure_right]
type = LinearFVMomentumPressure
variable = vel_y
pressure = pressure
momentum_component = 'y'
block = '1 2'
[]
[p_diffusion]
type = LinearFVPressureCorrectionDiffusion
variable = pressure
diffusion_tensor = Ainv
use_nonorthogonal_correction = false
[]
[HbyA_divergence]
type = LinearFVDivergence
variable = pressure
face_flux = HbyA
force_boundary_execution = true
[]
[]
[LinearFVBCs]
[inlet-u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left'
variable = vel_x
functor = '1.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
[]
(test/tests/linearfvbcs/scalar_symmetry/advection-2d-symmetry.i)
vel_x = -0.1
two_term_bc=true
gradient_method = 'green-gauss'
advected_interp_method = 'average'
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 2
ny = 2
xmin = 0
xmax = ${fparse pi/3}
ymin = 0
ymax = ${fparse pi/3}
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 0.02
gradient_method = ${gradient_method}
[]
[]
[FVGradientMethods]
[gg]
type = FVGreenGaussGradient
[]
[gg_custom]
type = FVGreenGaussGradient
[]
[]
[FVInterpolationMethods]
[average]
type = FVGeometricAverage
[]
[muscl]
type = FVAdvectedMUSCLDeferredCorrection
gradient_method = gg_custom
[]
[]
[Functions]
[u_exact]
type = ParsedFunction
expression = 'cos(x)*cos(y)'
[]
[source_fn]
type = ParsedFunction
expression = '-${vel_x}*sin(x)*cos(y)'
[]
[]
[LinearFVKernels]
[advection]
type = LinearFVAdvection
variable = u
velocity = "${vel_x} 0 0"
advected_interp_method_name = ${advected_interp_method}
[]
[source]
type = LinearFVSource
variable = u
source_density = source_fn
[]
[]
[LinearFVBCs]
[symm]
type = LinearFVAdvectionDiffusionScalarSymmetryBC
variable = u
boundary = "bottom"
use_two_term_expansion = ${two_term_bc}
[]
[outflow]
type = LinearFVAdvectionDiffusionOutflowBC
variable = u
boundary = "left"
use_two_term_expansion = ${two_term_bc}
[]
[dir]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "right top"
functor = u_exact
[]
[]
[Postprocessors]
[h]
type = AverageElementSize
execute_on = 'TIMESTEP_END'
[]
[error]
type = ElementL2FunctorError
approximate = u
exact = u_exact
execute_on = 'TIMESTEP_END'
[]
[]
[Convergence]
[linear]
type = IterationCountConvergence
max_iterations = 1
converge_at_max_iterations = true
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-9
petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_shift_amount'
petsc_options_value = 'lu NONZERO 1e-10'
multi_system_fixed_point = true
multi_system_fixed_point_convergence = linear
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
[]
exodus = true
[]
(modules/navier_stokes/test/tests/finite_volume/ins/channel-flow/linear-segregated/2d/2d-boussinesq-transient.i)
mu = 2.6
rho = 1.0
advected_interp_method = 'average'
cp = 300
k = 10
alpha_b = 1e-4
pressure_gradient_method = 'green-gauss'
[Mesh]
[mesh]
type = CartesianMeshGenerator
dim = 2
dx = '1.'
dy = '0.2'
ix = '10'
iy = '5'
[]
[]
[Problem]
linear_sys_names = 'u_system v_system pressure_system energy_system'
previous_nl_solution_required = true
[]
[UserObjects]
[rc]
type = RhieChowMassFlux
u = vel_x
v = vel_y
pressure = pressure
rho = ${rho}
p_diffusion_kernel = p_diffusion
[]
[]
[Variables]
[vel_x]
type = MooseLinearVariableFVReal
initial_condition = 0.5
solver_sys = u_system
[]
[vel_y]
type = MooseLinearVariableFVReal
solver_sys = v_system
initial_condition = 0.0
[]
[pressure]
type = MooseLinearVariableFVReal
solver_sys = pressure_system
initial_condition = 0.2
gradient_method = ${pressure_gradient_method}
[]
[T]
type = MooseLinearVariableFVReal
solver_sys = energy_system
initial_condition = 300
[]
[]
[FVGradientMethods]
[gg]
type = FVGreenGaussGradient
[]
[reconstructed]
type = FVReconstructedPressureGradient
base_gradient_method = green-gauss
gradient_relaxation = 0.1
[]
[]
[FVInterpolationMethods]
[average]
type = FVGeometricAverage
[]
[]
[LinearFVKernels]
[u_time]
type = LinearFVTimeDerivative
variable = vel_x
factor = ${rho}
[]
[v_time]
type = LinearFVTimeDerivative
variable = vel_y
factor = ${rho}
[]
[u_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_x
advected_interp_method_name = ${advected_interp_method}
mu = ${mu}
u = vel_x
v = vel_y
momentum_component = 'x'
rhie_chow_user_object = 'rc'
use_nonorthogonal_correction = false
[]
[v_advection_stress]
type = LinearWCNSFVMomentumFlux
variable = vel_y
advected_interp_method_name = ${advected_interp_method}
mu = ${mu}
u = vel_x
v = vel_y
momentum_component = 'y'
rhie_chow_user_object = 'rc'
use_nonorthogonal_correction = false
[]
[u_pressure]
type = LinearFVMomentumPressure
variable = vel_x
pressure = pressure
momentum_component = 'x'
[]
[v_pressure]
type = LinearFVMomentumPressure
variable = vel_y
pressure = pressure
momentum_component = 'y'
[]
[u_boussinesq]
type = LinearFVMomentumBoussinesq
variable = vel_x
rho = ${rho}
gravity = '0 -9.81 0'
alpha_name = ${alpha_b}
ref_temperature = 300.0
T_fluid = T
momentum_component = 'x'
[]
[v_boussinesq]
type = LinearFVMomentumBoussinesq
variable = vel_y
rho = ${rho}
gravity = '0 -9.81 0'
alpha_name = ${alpha_b}
ref_temperature = 300.0
T_fluid = T
momentum_component = 'y'
[]
[p_diffusion]
type = LinearFVPressureCorrectionDiffusion
variable = pressure
diffusion_tensor = Ainv
use_nonorthogonal_correction = false
[]
[HbyA_divergence]
type = LinearFVDivergence
variable = pressure
face_flux = HbyA
force_boundary_execution = true
[]
[h_time]
type = LinearFVTimeDerivative
variable = T
factor = ${fparse rho*cp}
[]
[h_advection]
type = LinearFVEnergyAdvection
variable = T
advected_quantity = temperature
cp = ${cp}
advected_interp_method = ${advected_interp_method}
rhie_chow_user_object = 'rc'
[]
[conduction]
type = LinearFVDiffusion
variable = T
diffusion_coeff = ${k}
use_nonorthogonal_correction = false
[]
[]
[FunctorMaterials]
[constant_functors]
type = GenericFunctorMaterial
prop_names = 'cp alpha_b'
prop_values = '${cp} ${alpha_b}'
[]
[]
[LinearFVBCs]
[inlet-u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left'
variable = vel_x
functor = '1.1'
[]
[inlet-v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'left'
variable = vel_y
functor = '0.0'
[]
[walls-u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'top bottom'
variable = vel_x
functor = 0.0
[]
[walls-v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'top bottom'
variable = vel_y
functor = 0.0
[]
[outlet_p]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
boundary = 'right'
variable = pressure
functor = 1.4
[]
[outlet_u]
type = LinearFVAdvectionDiffusionOutflowBC
variable = vel_x
use_two_term_expansion = false
boundary = right
[]
[outlet_v]
type = LinearFVAdvectionDiffusionOutflowBC
variable = vel_y
use_two_term_expansion = false
boundary = right
[]
[inlet_top_T]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = T
functor = 300.0
boundary = 'left top'
[]
[bottom_T]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = T
functor = wall-temperature
boundary = bottom
[]
[outlet_T]
type = LinearFVAdvectionDiffusionOutflowBC
variable = T
use_two_term_expansion = false
boundary = right
[]
[]
[Functions]
[wall-temperature]
type = ParsedFunction
expression = '350 + 50 * sin(6.28*t)'
[]
[]
[VectorPostprocessors]
[line_sample]
type = LineValueSampler
# Sampled at the cell-center x-locations of the row of cells at mid-channel height (dx=1/ix=10
# -> 0.1-wide cells; dy=0.2/iy=5 -> 0.04-tall cells, so y=0.1 is a cell-center row) to avoid
# sampling a piecewise-constant FV variable exactly on a face.
start_point = '0.05 0.1 0'
end_point = '0.95 0.1 0'
num_points = 10
sort_by = x
variable = 'vel_x vel_y pressure T'
execute_on = FINAL
[]
[]
[Executioner]
type = PIMPLE
momentum_l_abs_tol = 1e-12
pressure_l_abs_tol = 1e-12
energy_l_abs_tol = 1e-12
momentum_l_tol = 1e-12
pressure_l_tol = 1e-12
energy_l_tol = 1e-12
rhie_chow_user_object = 'rc'
momentum_systems = 'u_system v_system'
pressure_system = 'pressure_system'
energy_system = 'energy_system'
momentum_equation_relaxation = 0.8
pressure_variable_relaxation = 0.3
energy_equation_relaxation = 0.9
num_iterations = 100
pressure_absolute_tolerance = 1e-11
momentum_absolute_tolerance = 1e-11
energy_absolute_tolerance = 1e-11
momentum_petsc_options_iname = '-pc_type -pc_hypre_type'
momentum_petsc_options_value = 'hypre boomeramg'
pressure_petsc_options_iname = '-pc_type -pc_hypre_type'
pressure_petsc_options_value = 'hypre boomeramg'
energy_petsc_options_iname = '-pc_type -pc_hypre_type'
energy_petsc_options_value = 'hypre boomeramg'
print_fields = false
continue_on_max_its = true
dt = 0.01
num_steps = 6
num_piso_iterations = 0
[]
[Outputs]
exodus = true
[csv]
type = CSV
execute_on = final
[]
[]
(test/tests/linearfvbcs/scalar_symmetry/advection-1d-symmetry.i)
vel = 0.1
gradient_method = 'green-gauss'
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
nx = 2
xmin = 0
xmax = ${fparse pi}
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
gradient_method = ${gradient_method}
[]
[]
[FVGradientMethods]
[gg]
type = FVGreenGaussGradient
[]
[gg_limited]
type = FVGreenGaussGradient
limiter = venkatakrishnan
[]
[]
[FVInterpolationMethods]
[average]
type = FVGeometricAverage
[]
[]
[Functions]
[u_exact]
type = ParsedFunction
expression = 'cos(x)'
[]
[source_fn]
type = ParsedFunction
expression = '-${vel}*sin(x)'
[]
[]
[LinearFVKernels]
[advection]
type = LinearFVAdvection
variable = u
velocity = "${vel} 0 0"
advected_interp_method_name = average
[]
[source]
type = LinearFVSource
variable = u
source_density = source_fn
[]
[]
[LinearFVBCs]
[rob_l]
type = LinearFVAdvectionDiffusionScalarSymmetryBC
variable = u
boundary = "left"
use_two_term_expansion = true
[]
[dirichlet]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "right"
functor = u_exact
[]
[]
[Postprocessors]
[h]
type = AverageElementSize
execute_on = FINAL
[]
[error]
type = ElementL2FunctorError
approximate = u
exact = u_exact
execute_on = FINAL
[]
[]
[Convergence]
[linear]
type = IterationCountConvergence
max_iterations = 4
converge_at_max_iterations = true
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-7
petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_shift_amount'
petsc_options_value = 'lu NONZERO 1e-10'
linear_convergence = linear
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
[]
[]
(test/tests/linearfvbcs/scalar_symmetry/advection-1d-symmetry-two-gradient-methods.i)
vel = 0.1
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
nx = 2
xmin = 0
xmax = ${fparse pi}
[]
[]
[Problem]
linear_sys_names = 'u_sys'
[]
[Variables]
[u]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
gradient_method = gg
[]
[v]
type = MooseLinearVariableFVReal
solver_sys = 'u_sys'
initial_condition = 1.0
gradient_method = gg_limited
[]
[]
[FVGradientMethods]
[gg]
type = FVGreenGaussGradient
[]
[gg_limited]
type = FVGreenGaussGradient
limiter = venkatakrishnan
[]
[]
[FVInterpolationMethods]
[average]
type = FVGeometricAverage
[]
[]
[Functions]
[u_exact]
type = ParsedFunction
expression = 'cos(x)'
[]
[source_fn]
type = ParsedFunction
expression = '-${vel}*sin(x)'
[]
[]
[LinearFVKernels]
[advection_u]
type = LinearFVAdvection
variable = u
velocity = "${vel} 0 0"
advected_interp_method_name = average
[]
[source_u]
type = LinearFVSource
variable = u
source_density = source_fn
[]
[advection_v]
type = LinearFVAdvection
variable = v
velocity = "${vel} 0 0"
advected_interp_method_name = average
[]
[source_v]
type = LinearFVSource
variable = v
source_density = source_fn
[]
[]
[LinearFVBCs]
[rob_l_u]
type = LinearFVAdvectionDiffusionScalarSymmetryBC
variable = u
boundary = "left"
use_two_term_expansion = true
[]
[dirichlet_u]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = u
boundary = "right"
functor = u_exact
[]
[rob_l_v]
type = LinearFVAdvectionDiffusionScalarSymmetryBC
variable = v
boundary = "left"
use_two_term_expansion = true
[]
[dirichlet_v]
type = LinearFVAdvectionDiffusionFunctorDirichletBC
variable = v
boundary = "right"
functor = u_exact
[]
[]
[Postprocessors]
[h]
type = AverageElementSize
execute_on = FINAL
[]
[error_u]
type = ElementL2FunctorError
approximate = u
exact = u_exact
execute_on = FINAL
[]
[error_v]
type = ElementL2FunctorError
approximate = v
exact = u_exact
execute_on = FINAL
[]
[]
[Convergence]
[linear]
type = IterationCountConvergence
max_iterations = 4
converge_at_max_iterations = true
[]
[]
[Executioner]
type = Steady
system_names = u_sys
l_tol = 1e-7
petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_shift_amount'
petsc_options_value = 'lu NONZERO 1e-10'
linear_convergence = linear
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
[]
[]