FVGeometricAverage
Overview
This object performs linear interpolation from cell centroids to a face using geometric weights derived from the face location along the line connecting adjacent cell centroids. On orthogonal meshes this yields second-order accurate face values for smooth fields; on general unstructured meshes it provides a consistent baseline interpolation that is often used for interpolating material coefficients (e.g., diffusion coefficients) to faces (Moukalled et al. (2016), Jasak (1996)).
Let and be cell-centered values on the element and neighbor sides of a face. Let denote the geometric weight associated with the element-side value (based on the relative distances from the face to each centroid, measured along the centroid-to-centroid line). The interpolated face value is
This method can also be used for advected interpolation with the same weights (independent of flow direction). For advection, this corresponds to a centered/linear scheme and is not Total Variation Diminishing (TVD) in general; use a limiter-based method when boundedness near sharp gradients is required (see Limiters).
Example Syntax
Declare the interpolation method in [FVInterpolationMethods]:
[FVInterpolationMethods<<<{"href": "../../syntax/FVInterpolationMethods/index.html"}>>>]
[geom]
type = FVGeometricAverage<<<{"description": "Linear interpolation that uses the geometric weighting on FaceInfo.", "href": "FVGeometricAverage.html"}>>>
[]
[](test/tests/linearfvkernels/diffusion/diffusion-1d.i)Use it for a coefficient functor via "coeff_interp_method":
[LinearFVKernels<<<{"href": "../../syntax/LinearFVKernels/index.html"}>>>]
[diffusion]
type = LinearFVDiffusion<<<{"description": "Represents the matrix and right hand side contributions of a diffusion term in a partial differential equation.", "href": "../linearfvkernels/LinearFVDiffusion.html"}>>>
variable<<<{"description": "The name of the variable whose linear system this object contributes to"}>>> = u
diffusion_coeff<<<{"description": "The diffusion coefficient. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number."}>>> = coeff_pos_func
coeff_interp_method<<<{"description": "Optional finite volume interpolation method used to compute a face-centered diffusion coefficient. If omitted, the functor is evaluated directly on the face."}>>> = geom
[]
[](test/tests/linearfvkernels/diffusion/diffusion-1d.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.
Input Files
- (test/tests/linearfvbcs/robin/advection-2d-robin.i)
- (test/tests/linearfvbcs/robin/advection-1d-robin.i)
- (test/tests/linearfvkernels/diffusion/diffusion-1d.i)
- (test/tests/linearfvbcs/scalar_symmetry/advection-1d-symmetry.i)
- (test/tests/linearfvbcs/scalar_symmetry/advection-2d-symmetry.i)
- (test/tests/linearfvkernels/advection/advection-1d.i)
- (test/tests/linearfvkernels/diffusion-reaction-advection/advection-diffusion-reaction-2d.i)
- (test/tests/linearfvkernels/advection/diagonal-step-2d-delaunay.i)
- (test/tests/linearfvkernels/diffusion-reaction-advection/advection-diffusion-reaction-1d.i)
- (test/tests/linearfvkernels/advection/diagonal-step-2d.i)
- (test/tests/linearfvkernels/block-restriction/block-restricted-adr.i)
- (test/tests/linearfvkernels/advection/advection-2d.i)
- (test/tests/linearfvkernels/advection/advection-2d-rz.i)
References
- Hrvoje Jasak.
Error analysis and estimation for the finite volume method with applications to fluid flows.
PhD thesis, Imperial College London (University of London), 1996.[BibTeX]
@phdthesis{jasak1996error, author = "Jasak, Hrvoje", title = "Error analysis and estimation for the finite volume method with applications to fluid flows.", year = "1996", school = "Imperial College London (University of London)" } - Fadl Moukalled, L Mangani, Marwan Darwish, and others.
The finite volume method in computational fluid dynamics.
Volume 6.
Springer, 2016.[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" }
(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
[]
[]
coeff_interp_method
C++ Type:InterpolationMethodName
Controllable:No
Description:Optional finite volume interpolation method used to compute a face-centered diffusion coefficient. If omitted, the functor is evaluated directly on the face.
(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
[]
[]
(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/linearfvbcs/robin/advection-1d-robin.i)
##################################################################
c = 0.1 # advection velocity (+x direction)
amp = 7.0 # sinusoid amplitude, for u_exact
x_l = ${fparse 0.0*pi} # domain bound (left)
x_r = ${fparse pi} # domain bound (right)
alpha = 5.000 # robin BC coeff for gradient term
beta = 2.000 # robin BC coeff for variable term
u0 = 3 # some positive constant for the solution, > 1
gamma = ${fparse (-alpha*amp*sin(x_l)) + beta*amp*(u0 - cos(x_l))} # RHS of Robin BC, applied at left 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
[]
[]
[FVInterpolationMethods]
[average]
type = FVGeometricAverage
[]
[]
[Functions]
[u_exact]
type = ParsedFunction
expression = '${amp}*(${u0} - cos(x))'
[]
[source_fn]
type = ParsedFunction
expression = '${fparse c*amp}*sin(x)'
[]
[]
[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}
[]
[outflow]
type = LinearFVAdvectionDiffusionOutflowBC
variable = u
boundary = "right"
use_two_term_expansion = true
[]
[]
[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/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
[]
[]
(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
[]
[]
(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/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
[]
[]
(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/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
[]
(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
[]
[]
(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
[]
(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/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
[]
[]
(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
[]
[]