Skip to content

Commit

Permalink
Add free-slip friction PINSFV test
Browse files Browse the repository at this point in the history
This test almost perfectly mimics the 'problematic' input that Joe sent
us. It has friction, a symmetry boundary, and a free slip wall boundary.
The velocity field should be constant throughout the entire domain, and
that is what we see when we have two term boundary expansion turned on
which allows the pressure gradient to be constant and to perfectly
balance the friction term in the momentum balance

Refs #16765
  • Loading branch information
lindsayad committed Sep 28, 2021
1 parent 16ff5b1 commit 4ed7a08
Show file tree
Hide file tree
Showing 4 changed files with 220 additions and 2 deletions.
@@ -0,0 +1,196 @@
mu=.01
rho=1

[GlobalParams]
vel = 'velocity'
velocity_interp_method = 'rc'
advected_interp_method = 'average'
two_term_boundary_expansion = true
rhie_chow_user_object = 'rc'
[]

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

[Variables]
[u]
type = INSFVVelocityVariable
[]
[v]
type = INSFVVelocityVariable
[]
[pressure]
type = INSFVPressureVariable
[]
[lambda]
family = SCALAR
order = FIRST
[]
[]

[AuxVariables]
[U]
order = CONSTANT
family = MONOMIAL
fv = true
[]
[]

[AuxKernels]
[mag]
type = VectorMagnitudeAux
variable = U
x = u
y = v
[]
[]

[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = u
v = v
[]
[]

[FVKernels]
[mass]
type = INSFVMassAdvection
variable = pressure
pressure = pressure
u = u
v = v
rho = ${rho}
[]
[mean_zero_pressure]
type = FVScalarLagrangeMultiplier
variable = pressure
lambda = lambda
[]

[u_advection]
type = INSFVMomentumAdvection
variable = u
advected_quantity = 'rhou'
pressure = pressure
u = u
v = v
rho = ${rho}
momentum_component = 'x'
[]

[u_viscosity]
type = INSFVMomentumDiffusion
variable = u
mu = 'mu'
momentum_component = 'x'
[]

[u_pressure]
type = INSFVMomentumPressure
variable = u
momentum_component = 'x'
pressure = pressure
[]

[u_gravity]
type = INSFVMomentumGravity
variable = u
momentum_component = 'x'
rho = ${rho}
gravity = '0 -1 0'
[]

[v_advection]
type = INSFVMomentumAdvection
variable = v
advected_quantity = 'rhov'
pressure = pressure
u = u
v = v
rho = ${rho}
momentum_component = 'y'
[]

[v_viscosity]
type = INSFVMomentumDiffusion
variable = v
mu = 'mu'
momentum_component = 'y'
[]

[v_pressure]
type = INSFVMomentumPressure
variable = v
momentum_component = 'y'
pressure = pressure
[]

[v_gravity]
type = INSFVMomentumGravity
variable = v
momentum_component = 'y'
rho = ${rho}
gravity = '0 -1 0'
[]
[]

[FVBCs]
[no_slip_x]
type = INSFVNoSlipWallBC
variable = u
boundary = 'left right top bottom'
function = 0
[]

[no_slip_y]
type = INSFVNoSlipWallBC
variable = v
boundary = 'left right top bottom'
function = 0
[]
[]

[Materials]
[ins_fv]
type = INSFVMaterial
u = 'u'
v = 'v'
pressure = 'pressure'
rho = ${rho}
[]
[mu]
type = ADGenericConstantFunctorMaterial
prop_names = 'mu'
prop_values = '${mu}'
[]
[]

[Preconditioning]
[smp]
type = SMP
full = true
[]
[]

[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -ksp_gmres_restart -sub_pc_type -sub_pc_factor_shift_type'
petsc_options_value = 'asm 100 lu NONZERO'
nl_rel_tol = 1e-12
[]

[Outputs]
exodus = true
[]
Expand Up @@ -147,6 +147,7 @@ velocity_interp_method='rc'
[]

[FVBCs]
inactive = 'free-slip-u free-slip-v'
[inlet-u]
type = INSFVInletVelocityBC
boundary = 'left'
Expand All @@ -172,6 +173,16 @@ velocity_interp_method='rc'
variable = v
function = 0
[]
[free-slip-u]
type = INSFVNaturalFreeSlipBC
boundary = 'top'
variable = u
[]
[free-slip-v]
type = INSFVNaturalFreeSlipBC
boundary = 'top'
variable = v
[]
[symmetry-u]
type = PINSFVSymmetryVelocityBC
boundary = 'bottom'
Expand Down
Binary file not shown.
Expand Up @@ -94,9 +94,20 @@
input = 2d-rc-friction.i
exodiff = rc-friction.e
method = "!dbg"
requirement = 'The system shall be able to model porous flow with volumetric friction, using the Darcy and Forchheimer friction models.'
requirement = 'The system shall be able to model porous flow with volumetric friction, using the Darcy and Forchheimer friction models with no slip boundary conditions on the channel walls.'
abs_zero = 1e-9
ad_indexing_type = 'global'
cli_args = "FVBCs/active='inlet-u inlet-v outlet-p no-slip-u no-slip-v symmetry-u symmetry-v symmetry-p' Outputs/file_base='rc-friction' -pc_type lu -pc_factor_shift_type NONZERO"
cli_args = "Outputs/file_base='rc-friction' -pc_type lu -pc_factor_shift_type NONZERO"
[]
[friction-free-slip]
type = 'Exodiff'
input = 2d-rc-friction.i
exodiff = rc-friction-free-slip.e
method = "!dbg"
requirement = 'The system shall be able to model porous flow with volumetric friction, using the Darcy and Forchheimer friction models with free slip boundary conditions on the channel walls.'
abs_zero = 1e-9
ad_indexing_type = 'global'
cli_args = "FVBCs/inactive='no-slip-u no-slip-v' Outputs/file_base='rc-friction-free-slip' -pc_type lu -pc_factor_shift_type NONZERO"
issues = '#16765 #16756'
[]
[]

0 comments on commit 4ed7a08

Please sign in to comment.