Skip to content

Commit

Permalink
adding limiter tests Refs idaholab#28891
Browse files Browse the repository at this point in the history
  • Loading branch information
tanoret committed Oct 24, 2024
1 parent 36f0614 commit 05c8cfe
Show file tree
Hide file tree
Showing 41 changed files with 601 additions and 28 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
diff = 1e-12
advected_interp_method = 'vanLeer' #average upwind sou min_mod vanLeer quick venkatakrishnan skewness-corrected
velocity_interp_method = 'average'
[GlobalParams]
advected_interp_method = 'min_mod' #average upwind sou min_mod vanLeer quick venkatakrishnan skewness-corrected
velocity_interp_method = 'average'
[]

[UserObjects]
[rc]
Expand All @@ -10,6 +11,7 @@ velocity_interp_method = 'average'
a_u = vel_x
a_v = vel_y
pressure = pressure
velocity_interp_method = 'rc'
[]
[]

Expand All @@ -21,8 +23,8 @@ velocity_interp_method = 'average'
xmax = 1
ymin = 0
ymax = 1
nx = 50
ny = 50
nx = 10
ny = 10
[]
[]

Expand All @@ -44,26 +46,16 @@ velocity_interp_method = 'average'
[Variables]
[scalar]
type = INSFVScalarFieldVariable
two_term_boundary_expansion = false
[]
[]

[FVKernels]
[scalar_time]
type = FVFunctorTimeKernel
variable = scalar
[]
[scalar_advection]
type = INSFVScalarFieldAdvection
variable = scalar
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
rhie_chow_user_object = 'rc'
[]
[scalar_diffusion]
type = FVDiffusion
coeff = ${diff}
variable = scalar
[]
[]

[FVBCs]
Expand Down Expand Up @@ -94,13 +86,11 @@ velocity_interp_method = 'average'
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
[TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 20
linear_iteration_ratio = 2
dt = 0.1
[]
nl_abs_tol = 1e-10
dt = 0.1
end_time = 5.0
steady_state_detection = false
steady_state_tolerance = 1e-12
nl_abs_tol = 1e-12
[]

[Outputs]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
[GlobalParams]
advected_interp_method = 'min_mod' #average upwind sou min_mod vanLeer quick venkatakrishnan skewness-corrected
velocity_interp_method = 'average'
[]

[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = vel_x
v = vel_y
a_u = vel_x
a_v = vel_y
pressure = pressure
velocity_interp_method = 'rc'
[]
[]

[Mesh]
[outer_bdy]
type = PolyLineMeshGenerator
points = '0.0 0.0 0.0
0.0 1.0 0.0
1.0 1.0 0.0
1.0 0.0 0.0'
loop = true
[]
[triang]
type = XYDelaunayGenerator
boundary = 'outer_bdy'
add_nodes_per_boundary_segment = 3
refine_boundary = true
desired_area = 0.02
[]
[sidesets]
type = SideSetsFromNormalsGenerator
input = triang
normals = '-1 0 0
1 0 0
0 -1 0
0 1 0'
fixed_normal = true
new_boundary = 'left right bottom top'
[]
[]

[AuxVariables]
[vel_x]
type = INSFVVelocityVariable
initial_condition = 1.0
[]
[vel_y]
type = INSFVVelocityVariable
initial_condition = 1.0
[]
[pressure]
type = INSFVPressureVariable
initial_condition = 1.0
[]
[]

[Variables]
[scalar]
type = INSFVScalarFieldVariable
two_term_boundary_expansion = false
[]
[]

[FVKernels]
[scalar_advection]
type = INSFVScalarFieldAdvection
variable = scalar
rhie_chow_user_object = 'rc'
[]
[]

[FVBCs]
[fv_inflow]
type = NSFVOutflowTemperatureBC
u = vel_x
v = vel_y
backflow_T = 1.0
rho = 1.0
cp = 1.0
variable = scalar
boundary = 'left'
[]
[fv_outflow]
type = NSFVOutflowTemperatureBC
u = vel_x
v = vel_y
backflow_T = 0.0
rho = 1.0
cp = 1.0
variable = scalar
boundary = 'right top bottom'
[]
[]

[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
dt = 0.1
end_time = 5.0
steady_state_detection = false
steady_state_tolerance = 1e-12
nl_abs_tol = 1e-12
[]

[Outputs]
exodus = true
csv = true
[]
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
[Tests]
design = 'INSFVScalarFieldAdvection.md'
issues = '#28891'
[bottom_left_limited_scalar_advection]
requirement = 'The system shall be able to perform a variety of limiting schemes when solving scalar transport equations in cartesian meshes with bottom-left advection. These schemes include'
[sou]
type = Exodiff
input = 'bottom_left_advection.i'
exodiff = bottom_left_sou.e
cli_args = 'GlobalParams/advected_interp_method=sou Outputs/file_base=bottom_left_sou'
detail = 'second-order upwind'
[]
[vanLeer]
type = Exodiff
input = 'bottom_left_advection.i'
exodiff = bottom_left_vanLeer.e
cli_args = 'GlobalParams/advected_interp_method=vanLeer Outputs/file_base=bottom_left_vanLeer'
detail = 'van Leer'
[]
[min_mod]
type = Exodiff
input = 'bottom_left_advection.i'
exodiff = bottom_left_min_mod.e
cli_args = 'GlobalParams/advected_interp_method=min_mod Outputs/file_base=bottom_left_min_mod'
detail = 'min-mod'
[]
[quick]
type = Exodiff
input = 'bottom_left_advection.i'
exodiff = bottom_left_quick.e
cli_args = 'GlobalParams/advected_interp_method=quick Outputs/file_base=bottom_left_quick'
detail = 'QUICK'
[]
[venkatakrishnan]
type = Exodiff
input = 'bottom_left_advection.i'
exodiff = bottom_left_venkatakrishnan.e
cli_args = 'GlobalParams/advected_interp_method=venkatakrishnan Outputs/file_base=bottom_left_venkatakrishnan'
detail = 'venkatakrishnan'
[]
[]
[top_right_limited_scalar_advection]
requirement = 'The system shall be able to perform a variety of limiting schemes when solving scalar transport equations in cartesian meshes with top-right advection. These schemes include'
[sou]
type = Exodiff
input = 'top_right_advection.i'
exodiff = top_right_sou.e
cli_args = 'GlobalParams/advected_interp_method=sou Outputs/file_base=top_right_sou'
detail = 'second-order upwind'
[]
[vanLeer]
type = Exodiff
input = 'top_right_advection.i'
exodiff = top_right_vanLeer.e
cli_args = 'GlobalParams/advected_interp_method=vanLeer Outputs/file_base=top_right_vanLeer'
detail = 'van Leer'
[]
[min_mod]
type = Exodiff
input = 'top_right_advection.i'
exodiff = top_right_min_mod.e
cli_args = 'GlobalParams/advected_interp_method=min_mod Outputs/file_base=top_right_min_mod'
detail = 'min-mod'
[]
[quick]
type = Exodiff
input = 'top_right_advection.i'
exodiff = top_right_quick.e
cli_args = 'GlobalParams/advected_interp_method=quick Outputs/file_base=top_right_quick'
detail = 'QUICK'
[]
[venkatakrishnan]
type = Exodiff
input = 'top_right_advection.i'
exodiff = top_right_venkatakrishnan.e
cli_args = 'GlobalParams/advected_interp_method=venkatakrishnan Outputs/file_base=top_right_venkatakrishnan'
detail = 'venkatakrishnan'
[]
[]
[bottom_left_tri_mesh_limited_scalar_advection]
requirement = 'The system shall be able to perform a variety of limiting schemes when solving scalar transport equations in triangular meshes with bottom-left advection. These schemes include'
[vanLeer]
type = Exodiff
input = 'bottom_left_tri_mesh_advection.i'
exodiff = bottom_left_tri_mesh_vanLeer.e
cli_args = 'GlobalParams/advected_interp_method=vanLeer Outputs/file_base=bottom_left_tri_mesh_vanLeer'
detail = 'van Leer'
[]
[min_mod]
type = Exodiff
input = 'bottom_left_tri_mesh_advection.i'
exodiff = bottom_left_tri_mesh_min_mod.e
cli_args = 'GlobalParams/advected_interp_method=min_mod Outputs/file_base=bottom_left_tri_mesh_min_mod'
detail = 'min-mod'
[]
[quick]
type = Exodiff
input = 'bottom_left_tri_mesh_advection.i'
exodiff = bottom_left_tri_mesh_quick.e
cli_args = 'GlobalParams/advected_interp_method=quick Outputs/file_base=bottom_left_tri_mesh_quick'
detail = 'QUICK'
[]
[]
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
[GlobalParams]
advected_interp_method = 'min_mod' #average upwind sou min_mod vanLeer quick venkatakrishnan skewness-corrected
velocity_interp_method = 'average'
[]

[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = vel_x
v = vel_y
a_u = vel_x
a_v = vel_y
pressure = pressure
velocity_interp_method = 'rc'
[]
[]

[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 1
ymin = 0
ymax = 1
nx = 10
ny = 10
[]
[]

[AuxVariables]
[vel_x]
type = INSFVVelocityVariable
initial_condition = -1.0
[]
[vel_y]
type = INSFVVelocityVariable
initial_condition = -1.0
[]
[pressure]
type = INSFVPressureVariable
initial_condition = 1.0
[]
[]

[Variables]
[scalar]
type = INSFVScalarFieldVariable
two_term_boundary_expansion = false
[]
[]

[FVKernels]
[scalar_advection]
type = INSFVScalarFieldAdvection
variable = scalar
rhie_chow_user_object = 'rc'
[]
[]

[FVBCs]
[fv_inflow]
type = NSFVOutflowTemperatureBC
u = vel_x
v = vel_y
backflow_T = 1.0
rho = 1.0
cp = 1.0
variable = scalar
boundary = 'right'
[]
[fv_outflow]
type = NSFVOutflowTemperatureBC
u = vel_x
v = vel_y
backflow_T = 0.0
rho = 1.0
cp = 1.0
variable = scalar
boundary = 'left top bottom'
[]
[]

[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
dt = 0.1
end_time = 5.0
steady_state_detection = false
steady_state_tolerance = 1e-12
nl_abs_tol = 1e-12
[]

[Outputs]
exodus = true
csv = true
[]
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit 05c8cfe

Please sign in to comment.