- converge_at_max_iterationsFalseConverge at 'max_iterations' instead of diverging
Default:False
C++ Type:bool
Controllable:No
Description:Converge at 'max_iterations' instead of diverging
- max_iterations50Maximum number of iterations
Default:50
C++ Type:unsigned int
Controllable:No
Description:Maximum number of iterations
- min_iterations0Minimum number of iterations
Default:0
C++ Type:unsigned int
Controllable:No
Description:Minimum number of iterations
- verboseFalseEnable printing of additional information, including convergence and divergence reasons.
Default:False
C++ Type:bool
Controllable:No
Description:Enable printing of additional information, including convergence and divergence reasons.
IterationCountConvergence
This Convergence specifies:
, the maximum number of iterations, via "max_iterations", and
, the minimum number of iterations, via "min_iterations".
If "converge_at_max_iterations" is set to true
, then the solve will converge when instead of diverge.
Some iteration loops, such as nonlinear iteration, begin with a convergence check with before taking any "step"; then after the first step, it has . Other iteration loops such as the fixed point iteration loop do not have such an initial convergence check, so in that case corresponds to the end of the first step. Choose "max_iterations" and "min_iterations" accordingly.
Design
Other Convergence
objects may inherit from this class and override checkConvergenceInner(iter)
instead of the usual checkConvergence(iter)
, to inherit the iteration bounds. An example is PostprocessorConvergence.
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.
- 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
Advanced Parameters
Input Files
- (test/tests/linearfvkernels/diffusion-reaction-advection/advection-diffusion-reaction-1d.i)
- (test/tests/linearfvkernels/block-restriction/block-restricted-adr.i)
- (test/tests/linearfvbcs/robin/advection-2d-robin.i)
- (test/tests/linearfvkernels/diffusion-reaction-advection/advection-diffusion-reaction-2d.i)
- (test/tests/linearfvkernels/block-restriction/block-restricted-diffusion-react.i)
- (test/tests/multisystem/picard/linearfv_nonlinearfv/same_input.i)
- (test/tests/linearfvkernels/anisotropic-diffusion/anisotropic-diffusion-2d.i)
- (test/tests/time_steppers/iteration_adaptive/adapt_linear_systems.i)
- (test/tests/linearfvkernels/advection/advection-2d-rz.i)
- (test/tests/linearfvkernels/block-restriction/block-restricted-diffusion.i)
- (test/tests/linearfvbcs/robin/diffusion-2d-robin.i)
- (test/tests/outputs/csv/all_columns_parent.i)
- (test/tests/multisystem/picard/two_way.i)
- (test/tests/executioners/executioner/diverged_steady_state.i)
- (test/tests/linearfvkernels/advection/advection-1d.i)
- (test/tests/convergence/default_multiapp_fixed_point_convergence/other_convergence.i)
- (test/tests/linearfvkernels/diffusion/diffusion-2d_neumann.i)
- (test/tests/linearfvkernels/diffusion/diffusion-2d-rz.i)
- (test/tests/linearfvbcs/robin/diffusion-1d-robin.i)
- (test/tests/multisystem/picard/one_way.i)
- (test/tests/linearfvkernels/advection/advection-2d.i)
- (test/tests/linearfvbcs/robin/advection-1d-robin.i)
- (test/tests/linearfvkernels/diffusion/diffusion-2d.i)
Child Objects
max_iterations
Default:50
C++ Type:unsigned int
Controllable:No
Description:Maximum number of iterations
min_iterations
Default:0
C++ Type:unsigned int
Controllable:No
Description:Minimum number of iterations
converge_at_max_iterations
Default:False
C++ Type:bool
Controllable:No
Description:Converge at 'max_iterations' instead of diverging
max_iterations
Default:50
C++ Type:unsigned int
Controllable:No
Description:Maximum number of iterations
min_iterations
Default:0
C++ Type:unsigned int
Controllable:No
Description:Minimum number of iterations
(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
[]
[]
[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 = 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/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
[]
[]
[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 = 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/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
[]
[]
[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 = 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/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
[]
[]
[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 = 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/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/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/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
[]
(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
[]
[]
[LinearFVKernels]
[advection]
type = LinearFVAdvection
variable = u
velocity = "0.0 0.5 0"
advected_interp_method = 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/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
[]
[]
(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/outputs/csv/all_columns_parent.i)
# Heat conduction with fixed temperature on left and convection BC on right:
#
# d/dx(-k dT/dx) = S'''(T) (0,1)X(0,1)
# T = T_inf x = 0
# -k dT/dx = htc (T - T_inf) x = 1
#
# Source is temperature-dependent and is calculated in the child app:
# S(T) = B - A * (T - T_inf)^2
k = 15.0
htc = 100.0
T_ambient = 300.0
[Mesh]
type = GeneratedMesh
dim = 2
nx = 5
ny = 5
[]
[Variables]
[T]
[]
[]
[AuxVariables]
[S_parent]
[]
[Tavg_scalar]
family = SCALAR
order = FIRST
[]
[]
[Functions]
[Tavg_scalar_fn]
type = PostprocessorFunction
pp = Tavg_pp
[]
[]
[AuxScalarKernels]
[Tavg_scalar_kernel]
type = FunctionScalarAux
variable = Tavg_scalar
function = Tavg_scalar_fn
execute_on = 'TIMESTEP_END'
[]
[]
[FunctorMaterials]
[heat_flux_mat]
type = ADParsedFunctorMaterial
expression = 'htc * (T - T_inf)'
functor_symbols = 'T T_inf htc'
functor_names = 'T ${T_ambient} ${htc}'
property_name = 'heat_flux'
[]
[]
[Kernels]
[diff]
type = FunctionDiffusion
variable = T
function = ${k}
[]
[source]
type = CoupledForce
variable = T
v = S_parent
[]
[]
[BCs]
[left_bc]
type = DirichletBC
variable = T
boundary = left
value = ${T_ambient}
[]
[right_bc]
type = FunctorNeumannBC
variable = T
boundary = right
functor = heat_flux
flux_is_inward = false
[]
[]
[Convergence]
[fp_conv]
type = IterationCountConvergence
max_iterations = 3
converge_at_max_iterations = true
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
multiapp_fixed_point_convergence = fp_conv
[]
[MultiApps]
[source_app]
type = FullSolveMultiApp
positions = '0 0 0'
input_files = all_columns_child.i
execute_on = 'TIMESTEP_END'
[]
[]
[Transfers]
[T_to_child]
type = MultiAppCopyTransfer
to_multi_app = source_app
source_variable = T
variable = T_child
execute_on = 'SAME_AS_MULTIAPP'
[]
[S_from_child]
type = MultiAppCopyTransfer
from_multi_app = source_app
source_variable = S
variable = S_parent
execute_on = 'SAME_AS_MULTIAPP'
[]
[]
[Postprocessors]
[Tavg_pp]
type = AverageNodalVariableValue
variable = T
execute_on = 'TIMESTEP_END'
[]
[fp_it]
type = NumFixedPointIterations
get_index_instead_of_count = true
execute_on = 'TIMESTEP_END'
[]
[]
[Outputs]
[console]
type = Console
new_row_detection_columns = ALL
execute_postprocessors_on = 'MULTIAPP_FIXED_POINT_ITERATION_END'
execute_scalars_on = 'MULTIAPP_FIXED_POINT_ITERATION_END'
execute_on = 'MULTIAPP_FIXED_POINT_ITERATION_END'
[]
[out]
type = CSV
new_row_detection_columns = ALL
execute_postprocessors_on = 'MULTIAPP_FIXED_POINT_ITERATION_END'
execute_scalars_on = 'MULTIAPP_FIXED_POINT_ITERATION_END'
execute_on = 'MULTIAPP_FIXED_POINT_ITERATION_END'
[]
[]
(test/tests/multisystem/picard/two_way.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 5
ny = 5
[]
[Variables]
[u]
[]
[v]
[]
[]
[Kernels]
[diff_u]
type = Diffusion
variable = u
[]
[diff_v]
type = Diffusion
variable = v
[]
[source_v]
type = CoupledForce
variable = v
v = u
[]
[source_u]
type = CoupledForce
variable = u
v = v
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = left
value = 0
[]
[right]
type = DirichletBC
variable = u
boundary = right
value = 1
[]
[left_v]
type = DirichletBC
variable = v
boundary = left
value = 0
[]
[right_v]
type = DirichletBC
variable = v
boundary = right
value = 1
[]
[]
[Convergence]
[multisys]
type = IterationCountConvergence
min_iterations = 0
max_iterations = 10
converge_at_max_iterations = true
[]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type'
petsc_options_value = 'hypre'
# We are over-converging these problems
line_search = 'none'
nl_abs_tol = 1e-14
[]
[Outputs]
exodus = true
[]
(test/tests/executioners/executioner/diverged_steady_state.i)
!include transient.i
[Convergence]
[iteration_conv]
type = IterationCountConvergence
max_iterations = 3
[]
[]
[Executioner]
steady_state_detection = true
steady_state_convergence = iteration_conv
[]
(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
[]
[]
[LinearFVKernels]
[advection]
type = LinearFVAdvection
variable = u
velocity = "0.5 0 0"
advected_interp_method = 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
[]
[Outputs]
[csv]
type = CSV
execute_on = FINAL
[]
[]
(test/tests/convergence/default_multiapp_fixed_point_convergence/other_convergence.i)
!include ../parent.i
[Convergence]
[fp_conv]
type = IterationCountConvergence
max_iterations = 5
converge_at_max_iterations = true
[]
[]
[Outputs]
file_base = other_convergence
[]
(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
[]
[]
(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 = "left right top bottom"
functor = analytic_solution
[]
[]
[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/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'
[]
(test/tests/multisystem/picard/one_way.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 5
ny = 5
[]
[Variables]
[u]
[]
[v]
[]
[]
[Kernels]
[diff_u]
type = Diffusion
variable = u
[]
[diff_v]
type = Diffusion
variable = v
[]
[source_v]
type = CoupledForce
variable = v
v = u
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = left
value = 0
[]
[right]
type = DirichletBC
variable = u
boundary = right
value = 1
[]
[left_v]
type = DirichletBC
variable = v
boundary = left
value = 0
[]
[right_v]
type = DirichletBC
variable = v
boundary = right
value = 1
[]
[]
[Convergence]
[multisys]
type = IterationCountConvergence
min_iterations = 0
max_iterations = 10
converge_at_max_iterations = true
[]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type'
petsc_options_value = 'hypre'
# We are over-converging these problems
line_search = 'none'
nl_abs_tol = 1e-14
[]
[Outputs]
exodus = true
[]
(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
[]
[]
[LinearFVKernels]
[advection]
type = LinearFVAdvection
variable = u
velocity = "0.5 0 0"
advected_interp_method = 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'
petsc_options_value = 'lu NONZERO 1e-10'
[]
[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
[]
[]
[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 = 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-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
[]
[]
(framework/include/convergence/PostprocessorConvergence.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 "IterationCountConvergence.h"
/**
* Compares a post-processor to a tolerance.
*/
class PostprocessorConvergence : public IterationCountConvergence
{
public:
static InputParameters validParams();
PostprocessorConvergence(const InputParameters & parameters);
protected:
virtual MooseConvergenceStatus checkConvergenceInner(unsigned int iter) override;
/// Post-processor to use for convergence criteria
const PostprocessorValue & _postprocessor;
/// Tolerance to which post-processor is compared
const Real _tol;
};
(test/include/convergence/SuppliedStatusConvergence.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 "IterationCountConvergence.h"
/**
* Takes a user-supplied vector of convergence statuses for each iteration.
*/
class SuppliedStatusConvergence : public IterationCountConvergence
{
public:
static InputParameters validParams();
SuppliedStatusConvergence(const InputParameters & parameters);
protected:
virtual MooseConvergenceStatus checkConvergenceInner(unsigned int iter) override;
/// Convergence status for each iteration
const std::vector<int> & _convergence_statuses;
};