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/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/compatibility/ip-hdg.i)
mu = 1
rho = 1
[GlobalParams]
alpha = 6
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 10
ymin = -1
ymax = 1
nx = 10
ny = 2
elem_type = TRI6
[]
[]
[Variables]
[vel_x]
family = L2_HIERARCHIC
order = FIRST
[]
[vel_y]
family = L2_HIERARCHIC
order = FIRST
[]
[pressure]
family = MONOMIAL
order = CONSTANT
[]
[vel_bar_x]
family = SIDE_HIERARCHIC
order = FIRST
[]
[vel_bar_y]
family = SIDE_HIERARCHIC
order = FIRST
[]
[pressure_bar]
family = SIDE_HIERARCHIC
order = FIRST
[]
[temperature]
family = L2_HIERARCHIC
order = FIRST
[]
[temperature_bar]
family = SIDE_HIERARCHIC
order = FIRST
[]
[]
[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'
[]
[temperature_advection]
type = AdvectionIPHDGKernel
variable = temperature
face_variable = temperature_bar
velocity = velocity
coeff = 1
[]
[temperature_diffusion]
type = DiffusionIPHDGKernel
variable = temperature
face_variable = temperature_bar
diffusivity = thermal_conductivity
[]
[]
[Functions]
[u_inlet]
type = ParsedFunction
expression = '1.5*(1-y*y)'
[]
[]
[BCs]
[momentum_x_advection_dirichlet]
type = AdvectionIPHDGDirichletBC
boundary = 'left top bottom'
variable = vel_x
face_variable = vel_bar_x
functor = u_inlet
velocity = velocity
coeff = ${rho}
[]
[momentum_y_advection_dirichlet]
type = AdvectionIPHDGDirichletBC
boundary = 'left top bottom'
variable = vel_y
face_variable = vel_bar_y
functor = 0
velocity = velocity
coeff = ${rho}
[]
[momentum_x_diffusion_dirichlet]
type = NavierStokesStressIPHDGDirichletBC
boundary = 'left top bottom'
variable = vel_x
face_variable = vel_bar_x
pressure_variable = pressure
pressure_face_variable = pressure_bar
functor = u_inlet
diffusivity = mu
component = 0
[]
[momentum_y_diffusion_dirichlet]
type = NavierStokesStressIPHDGDirichletBC
boundary = 'left top bottom'
variable = vel_y
face_variable = vel_bar_y
pressure_variable = pressure
pressure_face_variable = pressure_bar
functor = 0
diffusivity = mu
component = 1
[]
[mass_dirichlet]
type = MassContinuityIPHDGBC
boundary = 'left top bottom'
variable = pressure
face_variable = pressure_bar
face_velocity_functors = 'u_inlet 0'
interior_velocity_vars = 'vel_x vel_y'
[]
[momentum_x_advection_outflow]
type = AdvectionIPHDGOutflowBC
boundary = right
constrain_lm = false
variable = vel_x
face_variable = vel_bar_x
velocity = velocity
coeff = ${rho}
[]
[momentum_y_advection_outflow]
type = AdvectionIPHDGOutflowBC
boundary = right
constrain_lm = false
variable = vel_y
face_variable = vel_bar_y
velocity = velocity
coeff = ${rho}
[]
[momentum_x_diffusion_outflow]
type = NavierStokesStressIPHDGPrescribedTractionBC
boundary = right
component = 0
diffusivity = mu
variable = vel_x
face_variable = vel_bar_x
prescribed_normal_flux = 0
pressure_variable = pressure
pressure_face_variable = pressure_bar
[]
[momentum_y_diffusion_outflow]
type = NavierStokesStressIPHDGPrescribedTractionBC
boundary = right
component = 1
diffusivity = mu
variable = vel_y
face_variable = vel_bar_y
prescribed_normal_flux = 0
pressure_variable = pressure
pressure_face_variable = pressure_bar
[]
[mass_outflow]
type = MassContinuityIPHDGBC
boundary = right
variable = pressure
face_variable = pressure_bar
face_velocity_functors = 'vel_bar_x vel_bar_y'
interior_velocity_vars = 'vel_x vel_y'
[]
[temperature_advection_inlet]
type = AdvectionIPHDGDirichletBC
boundary = left
variable = temperature
face_variable = temperature_bar
functor = 1
velocity = velocity
coeff = 1
[]
[temperature_diffusion_inlet]
type = DiffusionIPHDGDirichletBC
boundary = left
variable = temperature
face_variable = temperature_bar
functor = 1
diffusivity = thermal_conductivity
[]
[temperature_diffusion_insulated]
type = DiffusionIPHDGPrescribedFluxBC
boundary = 'top bottom right'
variable = temperature
face_variable = temperature_bar
prescribed_normal_flux = 0
diffusivity = thermal_conductivity
[]
[temperature_advection_outflow]
type = AdvectionIPHDGOutflowBC
boundary = right
constrain_lm = false
variable = temperature
face_variable = temperature_bar
velocity = velocity
coeff = 1
[]
[]
[Materials]
[constants]
type = ADGenericConstantMaterial
prop_names = 'mu thermal_conductivity'
prop_values = '${mu} 1'
[]
[velocity]
type = ADVectorFromComponentVariablesMaterial
vector_prop_name = velocity
u = vel_x
v = vel_y
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_mat_solver_type'
petsc_options_value = 'lu NONZERO mumps'
nl_rel_tol = 1e-12
[]
[Postprocessors]
[outlet_velocity]
type = SideAverageValue
boundary = right
variable = vel_x
[]
[outlet_temperature]
type = SideAverageValue
boundary = right
variable = temperature
[]
[]
[Outputs]
csv = true
[]