NavierStokesStressIPHDGPrescribedTractionBC
This class weakly imposes a prescribed traction vector . Perhaps the most common use case for this boundary condition is for a zero traction condition at outflow boundaries, as shown in the MMS channel case
[BCs<<<{"href": "../../syntax/BCs/index.html"}>>>]
[momentum_x_diffusion_neumann]
type = NavierStokesStressIPHDGPrescribedTractionBC<<<{"description": "Implements a prescribed stress boundary condition for use with a hybridized discretization of the Navier-Stokes equation", "href": "NavierStokesStressIPHDGPrescribedTractionBC.html"}>>>
boundary<<<{"description": "The list of boundary IDs from the mesh where this object applies"}>>> = 'right'
component<<<{"description": "number of component (0 = x, 1 = y, 2 = z)"}>>> = 0
diffusivity<<<{"description": "The diffusivity"}>>> = 'mu'
face_variable<<<{"description": "The face variable"}>>> = vel_bar_x
prescribed_normal_flux<<<{"description": "The prescribed value of the flux dotted with the normal. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number."}>>> = 0
pressure_face_variable<<<{"description": "The pressure variable that lives on element faces."}>>> = pressure_bar
pressure_variable<<<{"description": "The pressure variable that lives on element interiors."}>>> = pressure
variable<<<{"description": "The name of the variable that this residual object operates on"}>>> = vel_x
[]
[]
(modules/navier_stokes/test/tests/finite_element/ins/hdg/ip/channel-flow/mms-channel.i)and
[BCs<<<{"href": "../../syntax/BCs/index.html"}>>>]
[momentum_y_diffusion_neumann]
type = NavierStokesStressIPHDGPrescribedTractionBC<<<{"description": "Implements a prescribed stress boundary condition for use with a hybridized discretization of the Navier-Stokes equation", "href": "NavierStokesStressIPHDGPrescribedTractionBC.html"}>>>
boundary<<<{"description": "The list of boundary IDs from the mesh where this object applies"}>>> = 'right'
component<<<{"description": "number of component (0 = x, 1 = y, 2 = z)"}>>> = 1
diffusivity<<<{"description": "The diffusivity"}>>> = 'mu'
face_variable<<<{"description": "The face variable"}>>> = vel_bar_y
prescribed_normal_flux<<<{"description": "The prescribed value of the flux dotted with the normal. A functor is any of the following: a variable, a functor material property, a function, a postprocessor or a number."}>>> = 0
pressure_face_variable<<<{"description": "The pressure variable that lives on element faces."}>>> = pressure_bar
pressure_variable<<<{"description": "The pressure variable that lives on element interiors."}>>> = pressure
variable<<<{"description": "The name of the variable that this residual object operates on"}>>> = vel_y
[]
[]
(modules/navier_stokes/test/tests/finite_element/ins/hdg/ip/channel-flow/mms-channel.i)When applying a zero traction condition at an outflow, if the flow is fully developed, then implicitly this applies a zero pressure condition.
(modules/navier_stokes/test/tests/finite_element/ins/hdg/ip/channel-flow/mms-channel.i)
mu = 2
rho = 2
k = FIRST
k_minus_one = CONSTANT
pressure_family = MONOMIAL
[GlobalParams]
alpha = 6
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 2
ymin = -1
ymax = 1
nx = 2
ny = 2
elem_type = TRI6
[]
[]
[Variables]
[vel_x]
family = L2_HIERARCHIC
order = ${k}
[]
[vel_y]
family = L2_HIERARCHIC
order = ${k}
[]
[pressure]
family = ${pressure_family}
order = ${k_minus_one}
[]
[vel_bar_x]
family = SIDE_HIERARCHIC
order = ${k}
[]
[vel_bar_y]
family = SIDE_HIERARCHIC
order = ${k}
[]
[pressure_bar]
family = SIDE_HIERARCHIC
order = ${k}
[]
[]
[HDGKernels]
[momentum_x_advection]
type = AdvectionIPHDGKernel
variable = vel_x
face_variable = vel_bar_x
velocity = 'velocity'
coeff = ${rho}
[]
[momentum_x_diffusion]
type = NavierStokesStressIPHDGKernel
variable = vel_x
face_variable = vel_bar_x
diffusivity = 'mu'
pressure_variable = pressure
pressure_face_variable = pressure_bar
component = 0
[]
[momentum_y_advection]
type = AdvectionIPHDGKernel
variable = vel_y
face_variable = vel_bar_y
velocity = 'velocity'
coeff = ${rho}
[]
[momentum_y_diffusion]
type = NavierStokesStressIPHDGKernel
variable = vel_y
face_variable = vel_bar_y
diffusivity = 'mu'
pressure_variable = pressure
pressure_face_variable = pressure_bar
component = 1
[]
[pressure]
type = MassContinuityIPHDGKernel
variable = pressure
face_variable = pressure_bar
interior_velocity_vars = 'vel_x vel_y'
face_velocity_functors = 'vel_bar_x vel_bar_y'
[]
[]
[Kernels]
[u_ffn]
type = BodyForce
variable = vel_x
function = forcing_u
[]
[v_ffn]
type = BodyForce
variable = vel_y
function = forcing_v
[]
[p_ffn]
type = BodyForce
variable = pressure
function = forcing_p
[]
[]
[BCs]
#
# dirichlet
#
[momentum_x_advection_dirichlet]
type = AdvectionIPHDGDirichletBC
boundary = 'top bottom left'
face_variable = vel_bar_x
functor = exact_u
variable = vel_x
velocity = velocity
coeff = ${rho}
[]
[momentum_y_advection_dirichlet]
type = AdvectionIPHDGDirichletBC
boundary = 'top bottom left'
face_variable = vel_bar_y
functor = exact_v
variable = vel_y
velocity = velocity
coeff = ${rho}
[]
[momentum_x_diffusion_dirichlet]
type = NavierStokesStressIPHDGDirichletBC
boundary = 'top bottom left'
variable = vel_x
face_variable = vel_bar_x
pressure_variable = pressure
pressure_face_variable = pressure_bar
functor = 'exact_u'
diffusivity = 'mu'
component = 0
[]
[momentum_y_diffusion_dirichlet]
type = NavierStokesStressIPHDGDirichletBC
boundary = 'top bottom left'
variable = vel_y
face_variable = vel_bar_y
pressure_variable = pressure
pressure_face_variable = pressure_bar
functor = 'exact_v'
diffusivity = 'mu'
component = 1
[]
[mass_dirichlet]
type = MassContinuityIPHDGBC
face_variable = pressure_bar
variable = pressure
boundary = 'top bottom left'
face_velocity_functors = 'exact_u exact_v'
interior_velocity_vars = 'vel_x vel_y'
[]
#
# Neumann
#
[momentum_x_advection_neumann]
type = AdvectionIPHDGOutflowBC
boundary = 'right'
constrain_lm = false
face_variable = vel_bar_x
variable = vel_x
velocity = velocity
coeff = ${rho}
[]
[momentum_y_advection_neumann]
type = AdvectionIPHDGOutflowBC
boundary = 'right'
constrain_lm = false
face_variable = vel_bar_y
variable = vel_y
velocity = velocity
coeff = ${rho}
[]
[momentum_x_diffusion_neumann]
type = NavierStokesStressIPHDGPrescribedTractionBC
boundary = 'right'
component = 0
diffusivity = 'mu'
face_variable = vel_bar_x
prescribed_normal_flux = 0
pressure_face_variable = pressure_bar
pressure_variable = pressure
variable = vel_x
[]
[momentum_y_diffusion_neumann]
type = NavierStokesStressIPHDGPrescribedTractionBC
boundary = 'right'
component = 1
diffusivity = 'mu'
face_variable = vel_bar_y
prescribed_normal_flux = 0
pressure_face_variable = pressure_bar
pressure_variable = pressure
variable = vel_y
[]
[mass_neumann]
type = MassContinuityIPHDGBC
face_variable = pressure_bar
variable = pressure
boundary = 'right'
face_velocity_functors = 'vel_bar_x vel_bar_y'
interior_velocity_vars = 'vel_x vel_y'
[]
[]
[Materials]
[const]
type = ADGenericConstantMaterial
prop_names = 'rho mu'
prop_values = '${rho} ${mu}'
[]
[vel]
type = ADVectorFromComponentVariablesMaterial
vector_prop_name = 'velocity'
u = vel_x
v = vel_y
[]
[]
[Functions]
[exact_u]
type = ParsedFunction
expression = 'sin((1/2)*y*pi)*cos((1/2)*x*pi)'
[]
[forcing_u]
type = ParsedFunction
expression = '(1/2)*pi^2*mu*sin((1/2)*y*pi)*cos((1/2)*x*pi) - 1/2*pi*rho*sin((1/4)*x*pi)*sin((1/2)*y*pi)^2*cos((1/2)*x*pi) + (1/2)*pi*rho*sin((1/4)*x*pi)*cos((1/2)*x*pi)*cos((1/2)*y*pi)^2 - pi*rho*sin((1/2)*x*pi)*sin((1/2)*y*pi)^2*cos((1/2)*x*pi) - 1/4*pi*sin((1/4)*x*pi)*sin((3/2)*y*pi)'
symbol_names = 'mu rho'
symbol_values = '${mu} ${rho}'
[]
[exact_v]
type = ParsedFunction
expression = 'sin((1/4)*x*pi)*cos((1/2)*y*pi)'
[]
[forcing_v]
type = ParsedFunction
expression = '(5/16)*pi^2*mu*sin((1/4)*x*pi)*cos((1/2)*y*pi) - pi*rho*sin((1/4)*x*pi)^2*sin((1/2)*y*pi)*cos((1/2)*y*pi) - 1/2*pi*rho*sin((1/4)*x*pi)*sin((1/2)*x*pi)*sin((1/2)*y*pi)*cos((1/2)*y*pi) + (1/4)*pi*rho*sin((1/2)*y*pi)*cos((1/4)*x*pi)*cos((1/2)*x*pi)*cos((1/2)*y*pi) + (3/2)*pi*cos((1/4)*x*pi)*cos((3/2)*y*pi)'
symbol_names = 'mu rho'
symbol_values = '${mu} ${rho}'
[]
[exact_p]
type = ParsedFunction
expression = 'sin((3/2)*y*pi)*cos((1/4)*x*pi)'
[]
[forcing_p]
type = ParsedFunction
expression = '(1/2)*pi*sin((1/4)*x*pi)*sin((1/2)*y*pi) + (1/2)*pi*sin((1/2)*x*pi)*sin((1/2)*y*pi)'
[]
[]
[Postprocessors]
[L2u]
type = ElementL2Error
function = exact_u
variable = vel_x
[]
[L2v]
type = ElementL2Error
function = exact_v
variable = vel_y
[]
[L2p]
type = ElementL2Error
function = exact_p
variable = pressure
[]
[h]
type = AverageElementSize
execute_on = 'timestep_end'
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
nl_rel_tol = 1e-12
[]
[Outputs]
csv = true
[out]
type = Exodus
hide = 'pressure_bar vel_bar_x vel_bar_y L2u L2v L2p'
[]
[]
(modules/navier_stokes/test/tests/finite_element/ins/hdg/ip/channel-flow/mms-channel.i)
mu = 2
rho = 2
k = FIRST
k_minus_one = CONSTANT
pressure_family = MONOMIAL
[GlobalParams]
alpha = 6
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 2
ymin = -1
ymax = 1
nx = 2
ny = 2
elem_type = TRI6
[]
[]
[Variables]
[vel_x]
family = L2_HIERARCHIC
order = ${k}
[]
[vel_y]
family = L2_HIERARCHIC
order = ${k}
[]
[pressure]
family = ${pressure_family}
order = ${k_minus_one}
[]
[vel_bar_x]
family = SIDE_HIERARCHIC
order = ${k}
[]
[vel_bar_y]
family = SIDE_HIERARCHIC
order = ${k}
[]
[pressure_bar]
family = SIDE_HIERARCHIC
order = ${k}
[]
[]
[HDGKernels]
[momentum_x_advection]
type = AdvectionIPHDGKernel
variable = vel_x
face_variable = vel_bar_x
velocity = 'velocity'
coeff = ${rho}
[]
[momentum_x_diffusion]
type = NavierStokesStressIPHDGKernel
variable = vel_x
face_variable = vel_bar_x
diffusivity = 'mu'
pressure_variable = pressure
pressure_face_variable = pressure_bar
component = 0
[]
[momentum_y_advection]
type = AdvectionIPHDGKernel
variable = vel_y
face_variable = vel_bar_y
velocity = 'velocity'
coeff = ${rho}
[]
[momentum_y_diffusion]
type = NavierStokesStressIPHDGKernel
variable = vel_y
face_variable = vel_bar_y
diffusivity = 'mu'
pressure_variable = pressure
pressure_face_variable = pressure_bar
component = 1
[]
[pressure]
type = MassContinuityIPHDGKernel
variable = pressure
face_variable = pressure_bar
interior_velocity_vars = 'vel_x vel_y'
face_velocity_functors = 'vel_bar_x vel_bar_y'
[]
[]
[Kernels]
[u_ffn]
type = BodyForce
variable = vel_x
function = forcing_u
[]
[v_ffn]
type = BodyForce
variable = vel_y
function = forcing_v
[]
[p_ffn]
type = BodyForce
variable = pressure
function = forcing_p
[]
[]
[BCs]
#
# dirichlet
#
[momentum_x_advection_dirichlet]
type = AdvectionIPHDGDirichletBC
boundary = 'top bottom left'
face_variable = vel_bar_x
functor = exact_u
variable = vel_x
velocity = velocity
coeff = ${rho}
[]
[momentum_y_advection_dirichlet]
type = AdvectionIPHDGDirichletBC
boundary = 'top bottom left'
face_variable = vel_bar_y
functor = exact_v
variable = vel_y
velocity = velocity
coeff = ${rho}
[]
[momentum_x_diffusion_dirichlet]
type = NavierStokesStressIPHDGDirichletBC
boundary = 'top bottom left'
variable = vel_x
face_variable = vel_bar_x
pressure_variable = pressure
pressure_face_variable = pressure_bar
functor = 'exact_u'
diffusivity = 'mu'
component = 0
[]
[momentum_y_diffusion_dirichlet]
type = NavierStokesStressIPHDGDirichletBC
boundary = 'top bottom left'
variable = vel_y
face_variable = vel_bar_y
pressure_variable = pressure
pressure_face_variable = pressure_bar
functor = 'exact_v'
diffusivity = 'mu'
component = 1
[]
[mass_dirichlet]
type = MassContinuityIPHDGBC
face_variable = pressure_bar
variable = pressure
boundary = 'top bottom left'
face_velocity_functors = 'exact_u exact_v'
interior_velocity_vars = 'vel_x vel_y'
[]
#
# Neumann
#
[momentum_x_advection_neumann]
type = AdvectionIPHDGOutflowBC
boundary = 'right'
constrain_lm = false
face_variable = vel_bar_x
variable = vel_x
velocity = velocity
coeff = ${rho}
[]
[momentum_y_advection_neumann]
type = AdvectionIPHDGOutflowBC
boundary = 'right'
constrain_lm = false
face_variable = vel_bar_y
variable = vel_y
velocity = velocity
coeff = ${rho}
[]
[momentum_x_diffusion_neumann]
type = NavierStokesStressIPHDGPrescribedTractionBC
boundary = 'right'
component = 0
diffusivity = 'mu'
face_variable = vel_bar_x
prescribed_normal_flux = 0
pressure_face_variable = pressure_bar
pressure_variable = pressure
variable = vel_x
[]
[momentum_y_diffusion_neumann]
type = NavierStokesStressIPHDGPrescribedTractionBC
boundary = 'right'
component = 1
diffusivity = 'mu'
face_variable = vel_bar_y
prescribed_normal_flux = 0
pressure_face_variable = pressure_bar
pressure_variable = pressure
variable = vel_y
[]
[mass_neumann]
type = MassContinuityIPHDGBC
face_variable = pressure_bar
variable = pressure
boundary = 'right'
face_velocity_functors = 'vel_bar_x vel_bar_y'
interior_velocity_vars = 'vel_x vel_y'
[]
[]
[Materials]
[const]
type = ADGenericConstantMaterial
prop_names = 'rho mu'
prop_values = '${rho} ${mu}'
[]
[vel]
type = ADVectorFromComponentVariablesMaterial
vector_prop_name = 'velocity'
u = vel_x
v = vel_y
[]
[]
[Functions]
[exact_u]
type = ParsedFunction
expression = 'sin((1/2)*y*pi)*cos((1/2)*x*pi)'
[]
[forcing_u]
type = ParsedFunction
expression = '(1/2)*pi^2*mu*sin((1/2)*y*pi)*cos((1/2)*x*pi) - 1/2*pi*rho*sin((1/4)*x*pi)*sin((1/2)*y*pi)^2*cos((1/2)*x*pi) + (1/2)*pi*rho*sin((1/4)*x*pi)*cos((1/2)*x*pi)*cos((1/2)*y*pi)^2 - pi*rho*sin((1/2)*x*pi)*sin((1/2)*y*pi)^2*cos((1/2)*x*pi) - 1/4*pi*sin((1/4)*x*pi)*sin((3/2)*y*pi)'
symbol_names = 'mu rho'
symbol_values = '${mu} ${rho}'
[]
[exact_v]
type = ParsedFunction
expression = 'sin((1/4)*x*pi)*cos((1/2)*y*pi)'
[]
[forcing_v]
type = ParsedFunction
expression = '(5/16)*pi^2*mu*sin((1/4)*x*pi)*cos((1/2)*y*pi) - pi*rho*sin((1/4)*x*pi)^2*sin((1/2)*y*pi)*cos((1/2)*y*pi) - 1/2*pi*rho*sin((1/4)*x*pi)*sin((1/2)*x*pi)*sin((1/2)*y*pi)*cos((1/2)*y*pi) + (1/4)*pi*rho*sin((1/2)*y*pi)*cos((1/4)*x*pi)*cos((1/2)*x*pi)*cos((1/2)*y*pi) + (3/2)*pi*cos((1/4)*x*pi)*cos((3/2)*y*pi)'
symbol_names = 'mu rho'
symbol_values = '${mu} ${rho}'
[]
[exact_p]
type = ParsedFunction
expression = 'sin((3/2)*y*pi)*cos((1/4)*x*pi)'
[]
[forcing_p]
type = ParsedFunction
expression = '(1/2)*pi*sin((1/4)*x*pi)*sin((1/2)*y*pi) + (1/2)*pi*sin((1/2)*x*pi)*sin((1/2)*y*pi)'
[]
[]
[Postprocessors]
[L2u]
type = ElementL2Error
function = exact_u
variable = vel_x
[]
[L2v]
type = ElementL2Error
function = exact_v
variable = vel_y
[]
[L2p]
type = ElementL2Error
function = exact_p
variable = pressure
[]
[h]
type = AverageElementSize
execute_on = 'timestep_end'
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
nl_rel_tol = 1e-12
[]
[Outputs]
csv = true
[out]
type = Exodus
hide = 'pressure_bar vel_bar_x vel_bar_y L2u L2v L2p'
[]
[]
(modules/navier_stokes/test/tests/finite_element/ins/hdg/ip/paper-cases/bfs/bfs-2d-root.i)
gamma = 1e4
degree = 2
alpha = '${fparse 10 * degree^2}'
rho = 1
[Mesh]
[file]
type = FileMeshGenerator
file = coarse12.msh
[]
second_order = true
[]
[Problem]
type = NavierStokesProblem
extra_tag_matrices = 'mass'
mass_matrix = 'mass'
set_schur_pre = A11_AND_MASS
[]
[Variables]
[vel_x]
family = L2_LAGRANGE
order = SECOND
[]
[vel_y]
family = L2_LAGRANGE
order = SECOND
[]
[pressure]
family = L2_LAGRANGE
order = FIRST
[]
[vel_bar_x]
family = SIDE_HIERARCHIC
order = SECOND
[]
[vel_bar_y]
family = SIDE_HIERARCHIC
order = SECOND
[]
[pressure_bar]
family = SIDE_HIERARCHIC
order = SECOND
[]
[]
[HDGKernels]
[momentum_x_advection]
type = AdvectionIPHDGKernel
variable = vel_x
face_variable = vel_bar_x
velocity = 'velocity'
coeff = ${rho}
[]
[momentum_x_diffusion]
type = NavierStokesStressIPHDGKernel
variable = vel_x
face_variable = vel_bar_x
diffusivity = 'mu'
alpha = ${alpha}
pressure_variable = pressure
pressure_face_variable = pressure_bar
component = 0
[]
[momentum_y_advection]
type = AdvectionIPHDGKernel
variable = vel_y
face_variable = vel_bar_y
velocity = 'velocity'
coeff = ${rho}
[]
[momentum_y_diffusion]
type = NavierStokesStressIPHDGKernel
variable = vel_y
face_variable = vel_bar_y
diffusivity = 'mu'
alpha = ${alpha}
pressure_variable = pressure
pressure_face_variable = pressure_bar
component = 1
[]
[pressure]
type = MassContinuityIPHDGKernel
variable = pressure
face_variable = pressure_bar
interior_velocity_vars = 'vel_x vel_y'
face_velocity_functors = 'vel_bar_x vel_bar_y'
[]
[u_jump]
type = MassFluxPenaltyIPHDG
variable = vel_x
face_variable = vel_bar_x
face_velocity = face_velocity
u = vel_x
v = vel_y
component = 0
gamma = ${gamma}
[]
[v_jump]
type = MassFluxPenaltyIPHDG
variable = vel_y
face_variable = vel_bar_y
face_velocity = face_velocity
u = vel_x
v = vel_y
component = 1
gamma = ${gamma}
[]
[pb_mass]
type = MassMatrixHDG
variable = pressure_bar
matrix_tags = 'mass'
density = '${fparse -1/gamma}'
[]
[]
[BCs]
#
# inlet
#
[momentum_x_advection_inlet]
type = AdvectionIPHDGDirichletBC
boundary = '1'
face_variable = vel_bar_x
functor = u_inlet
variable = vel_x
velocity = velocity
coeff = ${rho}
[]
[momentum_x_diffusion_inlet]
type = NavierStokesStressIPHDGDirichletBC
boundary = '1'
variable = vel_x
face_variable = vel_bar_x
pressure_variable = pressure
pressure_face_variable = pressure_bar
alpha = ${alpha}
functor = 'u_inlet'
diffusivity = 'mu'
component = 0
[]
[momentum_y_diffusion_inlet]
type = NavierStokesStressIPHDGDirichletBC
boundary = '1'
variable = vel_y
face_variable = vel_bar_y
pressure_variable = pressure
pressure_face_variable = pressure_bar
alpha = ${alpha}
functor = 0
diffusivity = 'mu'
component = 1
[]
[mass_inlet]
type = MassContinuityIPHDGBC
face_variable = pressure_bar
variable = pressure
boundary = '1'
face_velocity_functors = 'u_inlet 0'
interior_velocity_vars = 'vel_x vel_y'
[]
#
# walls
#
[momentum_x_diffusion_walls]
type = NavierStokesStressIPHDGDirichletBC
boundary = '2'
variable = vel_x
face_variable = vel_bar_x
pressure_variable = pressure
pressure_face_variable = pressure_bar
alpha = ${alpha}
functor = '0'
diffusivity = 'mu'
component = 0
[]
[momentum_y_diffusion_walls]
type = NavierStokesStressIPHDGDirichletBC
boundary = '2'
variable = vel_y
face_variable = vel_bar_y
pressure_variable = pressure
pressure_face_variable = pressure_bar
alpha = ${alpha}
functor = 0
diffusivity = 'mu'
component = 1
[]
[mass_walls]
type = MassContinuityIPHDGBC
face_variable = pressure_bar
variable = pressure
boundary = '2'
face_velocity_functors = '0 0'
interior_velocity_vars = 'vel_x vel_y'
[]
#
# Neumann
#
[momentum_x_advection_neumann]
type = AdvectionIPHDGOutflowBC
boundary = '3'
constrain_lm = false
face_variable = vel_bar_x
variable = vel_x
velocity = velocity
coeff = ${rho}
[]
[momentum_y_advection_neumann]
type = AdvectionIPHDGOutflowBC
boundary = '3'
constrain_lm = false
face_variable = vel_bar_y
variable = vel_y
velocity = velocity
coeff = ${rho}
[]
[momentum_x_diffusion_neumann]
type = NavierStokesStressIPHDGPrescribedTractionBC
boundary = '3'
component = 0
diffusivity = 'mu'
face_variable = vel_bar_x
prescribed_normal_flux = 0
pressure_face_variable = pressure_bar
pressure_variable = pressure
variable = vel_x
alpha = ${alpha}
[]
[momentum_y_diffusion_neumann]
type = NavierStokesStressIPHDGPrescribedTractionBC
boundary = '3'
component = 1
diffusivity = 'mu'
face_variable = vel_bar_y
prescribed_normal_flux = 0
pressure_face_variable = pressure_bar
pressure_variable = pressure
variable = vel_y
alpha = ${alpha}
[]
[mass_neumann]
type = MassContinuityIPHDGBC
face_variable = pressure_bar
variable = pressure
boundary = '3'
face_velocity_functors = 'vel_bar_x vel_bar_y'
interior_velocity_vars = 'vel_x vel_y'
[]
[pb_mass]
type = MassMatrixIntegratedBC
variable = pressure_bar
matrix_tags = 'mass'
boundary = '1 2 3'
density = '${fparse -1/gamma}'
[]
[u_jump_walls]
type = MassFluxPenaltyBC
variable = vel_x
face_variable = vel_bar_x
u = vel_x
v = vel_y
component = 0
boundary = '2'
gamma = ${gamma}
face_velocity = vel_walls
dirichlet_boundary = true
[]
[v_jump_walls]
type = MassFluxPenaltyBC
variable = vel_y
face_variable = vel_bar_y
u = vel_x
v = vel_y
component = 1
boundary = '2'
gamma = ${gamma}
face_velocity = vel_walls
dirichlet_boundary = true
[]
[u_jump_inlet]
type = MassFluxPenaltyBC
variable = vel_x
face_variable = vel_bar_x
u = vel_x
v = vel_y
component = 0
boundary = '1'
gamma = ${gamma}
face_velocity = vel_inlet
dirichlet_boundary = true
[]
[v_jump_inlet]
type = MassFluxPenaltyBC
variable = vel_y
face_variable = vel_bar_y
u = vel_x
v = vel_y
component = 1
boundary = '1'
gamma = ${gamma}
face_velocity = vel_inlet
dirichlet_boundary = true
[]
[u_jump_outlet]
type = MassFluxPenaltyBC
variable = vel_x
face_variable = vel_bar_x
u = vel_x
v = vel_y
component = 0
boundary = '3'
gamma = ${gamma}
face_velocity = face_velocity
dirichlet_boundary = false
[]
[v_jump_outlet]
type = MassFluxPenaltyBC
variable = vel_y
face_variable = vel_bar_y
u = vel_x
v = vel_y
component = 1
boundary = '3'
gamma = ${gamma}
face_velocity = face_velocity
dirichlet_boundary = false
[]
[]
[Materials]
[vel]
type = ADVectorFromComponentVariablesMaterial
vector_prop_name = 'velocity'
u = vel_x
v = vel_y
[]
[mu]
type = ADParsedMaterial
functor_names = 'reynolds'
functor_symbols = 'reynolds'
property_name = 'mu'
expression = '1 / reynolds'
[]
[]
[Functions]
[u_inlet]
type = ParsedFunction
expression = '4*(2-y)*(y-1)'
[]
[reynolds]
type = ParsedFunction
expression = 't'
[]
[]
[FunctorMaterials]
[face_velocity]
type = ADGenericVectorFunctorMaterial
prop_names = face_velocity
prop_values = 'vel_bar_x vel_bar_y 0'
[]
[vel_inlet]
type = GenericVectorFunctorMaterial
prop_names = vel_inlet
prop_values = 'u_inlet 0 0'
[]
[vel_walls]
type = GenericVectorFunctorMaterial
prop_names = vel_walls
prop_values = '0 0 0'
[]
[]
[Postprocessors]
[reynolds]
type = FunctionValuePostprocessor
function = reynolds
[]
[vel_mag_avg]
type = ElementAverageValue
variable = vel_mag
[]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
petsc_options = '-nl0_condensed_ksp_view'
petsc_options_iname = '-ksp_type'
petsc_options_value = 'preonly'
nl_abs_tol = 1e-7
[TimeStepper]
type = TimeSequenceStepper
time_sequence = '1 10 50 100 150 200 250 350 400 600 800 1000 1200 1400 1600 1800 2000 2200 2400 2600 2800 3000 3200 3400 3600 3800 4000 4200 4400 4600 4800 5000 5200 5400 5600 5800 6000 6200 6400 6600 6800 7000 7200 7400 7600 7800 8000 8200 8400 8600 8800 9000 9200 9400 9600 9800 10000'
use_last_t_for_end_time = true
[]
abort_on_solve_fail = true
[]
[Outputs]
print_linear_residuals = false
exodus = false
checkpoint = true
perf_graph = true
csv = true
[]
[AuxVariables]
[vel_mag]
family = L2_LAGRANGE
order = SECOND
[]
[]
[AuxKernels]
[vel_mag]
type = VectorMagnitudeAux
variable = vel_mag
x = vel_x
y = vel_y
[]
[]
(modules/navier_stokes/test/tests/finite_element/ins/hdg/ip/channel-flow/mms-channel.i)
mu = 2
rho = 2
k = FIRST
k_minus_one = CONSTANT
pressure_family = MONOMIAL
[GlobalParams]
alpha = 6
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 2
ymin = -1
ymax = 1
nx = 2
ny = 2
elem_type = TRI6
[]
[]
[Variables]
[vel_x]
family = L2_HIERARCHIC
order = ${k}
[]
[vel_y]
family = L2_HIERARCHIC
order = ${k}
[]
[pressure]
family = ${pressure_family}
order = ${k_minus_one}
[]
[vel_bar_x]
family = SIDE_HIERARCHIC
order = ${k}
[]
[vel_bar_y]
family = SIDE_HIERARCHIC
order = ${k}
[]
[pressure_bar]
family = SIDE_HIERARCHIC
order = ${k}
[]
[]
[HDGKernels]
[momentum_x_advection]
type = AdvectionIPHDGKernel
variable = vel_x
face_variable = vel_bar_x
velocity = 'velocity'
coeff = ${rho}
[]
[momentum_x_diffusion]
type = NavierStokesStressIPHDGKernel
variable = vel_x
face_variable = vel_bar_x
diffusivity = 'mu'
pressure_variable = pressure
pressure_face_variable = pressure_bar
component = 0
[]
[momentum_y_advection]
type = AdvectionIPHDGKernel
variable = vel_y
face_variable = vel_bar_y
velocity = 'velocity'
coeff = ${rho}
[]
[momentum_y_diffusion]
type = NavierStokesStressIPHDGKernel
variable = vel_y
face_variable = vel_bar_y
diffusivity = 'mu'
pressure_variable = pressure
pressure_face_variable = pressure_bar
component = 1
[]
[pressure]
type = MassContinuityIPHDGKernel
variable = pressure
face_variable = pressure_bar
interior_velocity_vars = 'vel_x vel_y'
face_velocity_functors = 'vel_bar_x vel_bar_y'
[]
[]
[Kernels]
[u_ffn]
type = BodyForce
variable = vel_x
function = forcing_u
[]
[v_ffn]
type = BodyForce
variable = vel_y
function = forcing_v
[]
[p_ffn]
type = BodyForce
variable = pressure
function = forcing_p
[]
[]
[BCs]
#
# dirichlet
#
[momentum_x_advection_dirichlet]
type = AdvectionIPHDGDirichletBC
boundary = 'top bottom left'
face_variable = vel_bar_x
functor = exact_u
variable = vel_x
velocity = velocity
coeff = ${rho}
[]
[momentum_y_advection_dirichlet]
type = AdvectionIPHDGDirichletBC
boundary = 'top bottom left'
face_variable = vel_bar_y
functor = exact_v
variable = vel_y
velocity = velocity
coeff = ${rho}
[]
[momentum_x_diffusion_dirichlet]
type = NavierStokesStressIPHDGDirichletBC
boundary = 'top bottom left'
variable = vel_x
face_variable = vel_bar_x
pressure_variable = pressure
pressure_face_variable = pressure_bar
functor = 'exact_u'
diffusivity = 'mu'
component = 0
[]
[momentum_y_diffusion_dirichlet]
type = NavierStokesStressIPHDGDirichletBC
boundary = 'top bottom left'
variable = vel_y
face_variable = vel_bar_y
pressure_variable = pressure
pressure_face_variable = pressure_bar
functor = 'exact_v'
diffusivity = 'mu'
component = 1
[]
[mass_dirichlet]
type = MassContinuityIPHDGBC
face_variable = pressure_bar
variable = pressure
boundary = 'top bottom left'
face_velocity_functors = 'exact_u exact_v'
interior_velocity_vars = 'vel_x vel_y'
[]
#
# Neumann
#
[momentum_x_advection_neumann]
type = AdvectionIPHDGOutflowBC
boundary = 'right'
constrain_lm = false
face_variable = vel_bar_x
variable = vel_x
velocity = velocity
coeff = ${rho}
[]
[momentum_y_advection_neumann]
type = AdvectionIPHDGOutflowBC
boundary = 'right'
constrain_lm = false
face_variable = vel_bar_y
variable = vel_y
velocity = velocity
coeff = ${rho}
[]
[momentum_x_diffusion_neumann]
type = NavierStokesStressIPHDGPrescribedTractionBC
boundary = 'right'
component = 0
diffusivity = 'mu'
face_variable = vel_bar_x
prescribed_normal_flux = 0
pressure_face_variable = pressure_bar
pressure_variable = pressure
variable = vel_x
[]
[momentum_y_diffusion_neumann]
type = NavierStokesStressIPHDGPrescribedTractionBC
boundary = 'right'
component = 1
diffusivity = 'mu'
face_variable = vel_bar_y
prescribed_normal_flux = 0
pressure_face_variable = pressure_bar
pressure_variable = pressure
variable = vel_y
[]
[mass_neumann]
type = MassContinuityIPHDGBC
face_variable = pressure_bar
variable = pressure
boundary = 'right'
face_velocity_functors = 'vel_bar_x vel_bar_y'
interior_velocity_vars = 'vel_x vel_y'
[]
[]
[Materials]
[const]
type = ADGenericConstantMaterial
prop_names = 'rho mu'
prop_values = '${rho} ${mu}'
[]
[vel]
type = ADVectorFromComponentVariablesMaterial
vector_prop_name = 'velocity'
u = vel_x
v = vel_y
[]
[]
[Functions]
[exact_u]
type = ParsedFunction
expression = 'sin((1/2)*y*pi)*cos((1/2)*x*pi)'
[]
[forcing_u]
type = ParsedFunction
expression = '(1/2)*pi^2*mu*sin((1/2)*y*pi)*cos((1/2)*x*pi) - 1/2*pi*rho*sin((1/4)*x*pi)*sin((1/2)*y*pi)^2*cos((1/2)*x*pi) + (1/2)*pi*rho*sin((1/4)*x*pi)*cos((1/2)*x*pi)*cos((1/2)*y*pi)^2 - pi*rho*sin((1/2)*x*pi)*sin((1/2)*y*pi)^2*cos((1/2)*x*pi) - 1/4*pi*sin((1/4)*x*pi)*sin((3/2)*y*pi)'
symbol_names = 'mu rho'
symbol_values = '${mu} ${rho}'
[]
[exact_v]
type = ParsedFunction
expression = 'sin((1/4)*x*pi)*cos((1/2)*y*pi)'
[]
[forcing_v]
type = ParsedFunction
expression = '(5/16)*pi^2*mu*sin((1/4)*x*pi)*cos((1/2)*y*pi) - pi*rho*sin((1/4)*x*pi)^2*sin((1/2)*y*pi)*cos((1/2)*y*pi) - 1/2*pi*rho*sin((1/4)*x*pi)*sin((1/2)*x*pi)*sin((1/2)*y*pi)*cos((1/2)*y*pi) + (1/4)*pi*rho*sin((1/2)*y*pi)*cos((1/4)*x*pi)*cos((1/2)*x*pi)*cos((1/2)*y*pi) + (3/2)*pi*cos((1/4)*x*pi)*cos((3/2)*y*pi)'
symbol_names = 'mu rho'
symbol_values = '${mu} ${rho}'
[]
[exact_p]
type = ParsedFunction
expression = 'sin((3/2)*y*pi)*cos((1/4)*x*pi)'
[]
[forcing_p]
type = ParsedFunction
expression = '(1/2)*pi*sin((1/4)*x*pi)*sin((1/2)*y*pi) + (1/2)*pi*sin((1/2)*x*pi)*sin((1/2)*y*pi)'
[]
[]
[Postprocessors]
[L2u]
type = ElementL2Error
function = exact_u
variable = vel_x
[]
[L2v]
type = ElementL2Error
function = exact_v
variable = vel_y
[]
[L2p]
type = ElementL2Error
function = exact_p
variable = pressure
[]
[h]
type = AverageElementSize
execute_on = 'timestep_end'
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
nl_rel_tol = 1e-12
[]
[Outputs]
csv = true
[out]
type = Exodus
hide = 'pressure_bar vel_bar_x vel_bar_y L2u L2v L2p'
[]
[]