- lambdaLagrange multiplier variable
C++ Type:std::vector<VariableName>
Unit:(no unit assumed)
Controllable:No
Description:Lagrange multiplier variable
- variableThe name of the variable that this residual object operates on
C++ Type:NonlinearVariableName
Unit:(no unit assumed)
Controllable:No
Description:The name of the variable that this residual object operates on
ScalarLagrangeMultiplier
This Kernel implements part of the equation that enforces the constraint of
where is a given constant, using a Lagrange multiplier approach. The residual of related to the Lagrange multiplier is given as:
(1)
In particular, this Kernel implements the residual contribution from the in Eq. (1) , and their Jacobian contributions. See also AverageValueConstraint for the residual of the Lagrange multiplier variable.
The detailed description of the derivation can be found at scalar_constraint_kernel.
Input Parameters
- blockThe list of blocks (ids or names) that this object will be applied
C++ Type:std::vector<SubdomainName>
Controllable:No
Description:The list of blocks (ids or names) that this object will be applied
- displacementsThe displacements
C++ Type:std::vector<VariableName>
Unit:(no unit assumed)
Controllable:No
Description:The displacements
- matrix_onlyFalseWhether this object is only doing assembly to matrices (no vectors)
Default:False
C++ Type:bool
Controllable:No
Description:Whether this object is only doing assembly to matrices (no vectors)
Optional Parameters
- absolute_value_vector_tagsThe tags for the vectors this residual object should fill with the absolute value of the residual contribution
C++ Type:std::vector<TagName>
Controllable:No
Description:The tags for the vectors this residual object should fill with the absolute value of the residual contribution
- extra_matrix_tagsThe extra tags for the matrices this Kernel should fill
C++ Type:std::vector<TagName>
Controllable:No
Description:The extra tags for the matrices this Kernel should fill
- extra_vector_tagsThe extra tags for the vectors this Kernel should fill
C++ Type:std::vector<TagName>
Controllable:No
Description:The extra tags for the vectors this Kernel should fill
- matrix_tagssystemThe tag for the matrices this Kernel should fill
Default:system
C++ Type:MultiMooseEnum
Options:nontime, system
Controllable:No
Description:The tag for the matrices this Kernel should fill
- vector_tagsnontimeThe tag for the vectors this Kernel should fill
Default:nontime
C++ Type:MultiMooseEnum
Options:nontime, time
Controllable:No
Description:The tag for the vectors this Kernel should fill
Contribution To Tagged Field Data 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.
- diag_save_inThe name of auxiliary variables to save this Kernel's diagonal Jacobian contributions to. Everything about that variable must match everything about this variable (the type, what blocks it's on, etc.)
C++ Type:std::vector<AuxVariableName>
Unit:(no unit assumed)
Controllable:No
Description:The name of auxiliary variables to save this Kernel's diagonal Jacobian contributions to. Everything about that variable must match everything about this variable (the type, what blocks it's on, etc.)
- enableTrueSet the enabled status of the MooseObject.
Default:True
C++ Type:bool
Controllable:Yes
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
- save_inThe name of auxiliary variables to save this Kernel's residual contributions to. Everything about that variable must match everything about this variable (the type, what blocks it's on, etc.)
C++ Type:std::vector<AuxVariableName>
Unit:(no unit assumed)
Controllable:No
Description:The name of auxiliary variables to save this Kernel's residual contributions to. Everything about that variable must match everything about this variable (the type, what blocks it's on, etc.)
- seed0The seed for the master random number generator
Default:0
C++ Type:unsigned int
Controllable:No
Description:The seed for the master random number generator
- use_displaced_meshFalseWhether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.
Default:False
C++ Type:bool
Controllable:No
Description:Whether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.
Advanced Parameters
- prop_getter_suffixAn optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.
C++ Type:MaterialPropertyName
Unit:(no unit assumed)
Controllable:No
Description:An optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.
- use_interpolated_stateFalseFor the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.
Default:False
C++ Type:bool
Controllable:No
Description:For the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.
Material Property Retrieval Parameters
Input Files
- (test/tests/kernels/vector_fe/coupled_electrostatics.i)
- (modules/navier_stokes/test/tests/finite_element/ins/hdg/ip/lid-driven/mms-lid-driven.i)
- (modules/navier_stokes/test/tests/finite_element/ins/hdg/ip/lid-driven/stokes-lid-driven.i)
- (modules/navier_stokes/test/tests/finite_element/ins/hdg/ip/lid-driven/mms-second-lid-driven.i)
- (modules/navier_stokes/test/tests/finite_element/ins/hdg/ip/lid-driven/sc-lid-driven.i)
- (test/tests/misc/check_error/coupling_field_into_scalar.i)
- (test/tests/kernels/bad_scaling_scalar_kernels/ill_conditioned_field_scalar_system.i)
- (test/tests/kernels/scalar_constraint/scalar_constraint_kernel.i)
- (test/tests/kernels/scalar_constraint/scalar_constraint_kernel_disp.i)
- (modules/navier_stokes/test/tests/finite_element/ins/lid_driven/ad_lid_driven_mean_zero_pressure.i)
- (modules/navier_stokes/test/tests/finite_element/ins/hdg/ip/lid-driven/lid-driven.i)
- (test/tests/misc/check_error/coupling_nonexistent_scalar.i)
- (modules/navier_stokes/test/tests/finite_element/ins/hdg/ip/lid-driven/matrix-testing.i)
(test/tests/kernels/vector_fe/coupled_electrostatics.i)
# Test for DivField and GradField kernels and VectorDivPenaltyDirichletBC bcs.
# This test uses Raviart-Thomas elements to solve a model div-grad problem
# in H(div). The problem is simply a div-grad formulation, u = -grad(p), and
# div(u) = f, of the standard Poisson problem div(grad(p)) = -f.
# Manufactured solution: p = cos(k*x)*sin(k*y)*cos(k*z).
k = asin(1)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 3
nx = 6
ny = 6
nz = 6
xmax = 1
ymax = 1
zmax = 1
xmin = -1
ymin = -1
zmin = -1
elem_type = HEX27
[]
[]
[Variables]
[u]
family = RAVIART_THOMAS
order = FIRST
[]
[p]
family = MONOMIAL
order = CONSTANT
[]
[lambda]
family = SCALAR
order = FIRST
[]
[]
[Functions]
[f]
type = ParsedVectorFunction
expression_x = ${k}*sin(${k}*x)*sin(${k}*y)*cos(${k}*z)
expression_y = -${k}*cos(${k}*x)*cos(${k}*y)*cos(${k}*z)
expression_z = ${k}*cos(${k}*x)*sin(${k}*y)*sin(${k}*z)
div = ${Mesh/gmg/dim}*${k}^2*cos(${k}*x)*sin(${k}*y)*cos(${k}*z)
[]
[]
[Kernels]
[coefficient]
type = VectorFunctionReaction
variable = u
sign = negative
[]
[gradient]
type = GradField
variable = u
coupled_scalar_variable = p
[]
[divergence]
type = DivField
variable = p
coupled_vector_variable = u
[]
[forcing]
type = BodyForce
variable = p
function = ${Functions/f/div}
[]
[mean_zero_p]
type = ScalarLagrangeMultiplier
variable = p
lambda = lambda
[]
[]
[ScalarKernels]
[constraint]
type = AverageValueConstraint
variable = lambda
pp_name = PP
value = 0.0
[]
[]
[BCs]
[sides]
type = VectorDivPenaltyDirichletBC
variable = u
function = f
penalty = 1e8
boundary = 'top bottom left right front back'
[]
[]
[Postprocessors]
active = PP
[PP]
type = ElementIntegralVariablePostprocessor
variable = p
execute_on = linear
[]
[L2Error]
type = ElementVectorL2Error
variable = u
function = f
[]
[HDivSemiError]
type = ElementHDivSemiError
variable = u
function = f
[]
[HDivError]
type = ElementHDivError
variable = u
function = f
[]
[]
[Preconditioning]
[SMP]
type = SMP
full = true
[]
[]
[Executioner]
type = Steady
solve_type = LINEAR
petsc_options_iname = '-pc_type -ksp_rtol -ksp_norm_type'
petsc_options_value = ' jacobi 1e-12 preconditioned'
[]
[Outputs]
exodus = true
[]
(modules/navier_stokes/test/tests/finite_element/ins/hdg/ip/lid-driven/mms-lid-driven.i)
mu = 2
rho = 2
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = -1
xmax = 1
ymin = -1
ymax = 1
nx = 2
ny = 2
elem_type = TRI6
[]
[]
[Variables]
[vel_x]
family = MONOMIAL
order = FIRST
[]
[vel_y]
family = MONOMIAL
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
[]
[lambda]
family = SCALAR
order = FIRST
[]
[]
[HDGKernels]
[momentum_x_convection]
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 = 6
pressure_variable = pressure
pressure_face_variable = pressure_bar
component = 0
[]
[momentum_y_convection]
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 = 6
pressure_variable = pressure
pressure_face_variable = pressure_bar
component = 1
[]
[pressure_convection]
type = AdvectionIPHDGKernel
variable = pressure
face_variable = pressure_bar
velocity = 'velocity'
coeff = '${fparse -rho}'
self_advection = false
[]
[]
[Kernels]
[momentum_x_ffn]
type = BodyForce
variable = vel_x
function = forcing_u
[]
[momentum_y_ffn]
type = BodyForce
variable = vel_y
function = forcing_v
[]
[mass_ffn]
type = BodyForce
variable = pressure
function = forcing_p
[]
[mean_zero_pressure]
type = ScalarLagrangeMultiplier
variable = pressure
lambda = lambda
[]
[]
[ScalarKernels]
[mean_zero_pressure_lm]
type = AverageValueConstraint
variable = lambda
pp_name = pressure_integral
value = 0
[]
[]
[BCs]
[momentum_x_diffusion_all]
type = NavierStokesStressIPHDGDirichletBC
boundary = 'left bottom right top'
variable = vel_x
face_variable = vel_bar_x
pressure_variable = pressure
pressure_face_variable = pressure_bar
alpha = 6
functor = exact_u
diffusivity = 'mu'
component = 0
[]
[momentum_y_diffusion_all]
type = NavierStokesStressIPHDGDirichletBC
boundary = 'left bottom right top'
variable = vel_y
face_variable = vel_bar_y
pressure_variable = pressure
pressure_face_variable = pressure_bar
alpha = 6
functor = exact_v
diffusivity = 'mu'
component = 1
[]
[mass_convection]
type = AdvectionIPHDGPrescribedFluxBC
face_variable = pressure_bar
variable = pressure
velocity = 'velocity'
coeff = '${fparse -rho}'
self_advection = false
boundary = 'left bottom top right'
prescribed_normal_flux = 0
[]
[]
[Functions]
[exact_u]
type = ParsedFunction
expression = 'sin(y)*cos((1/2)*x*pi)'
[]
[forcing_u]
type = ParsedFunction
expression = 'mu*sin(y)*cos((1/2)*x*pi) + (1/4)*pi^2*mu*sin(y)*cos((1/2)*x*pi) - 1/2*pi*rho*sin(x)*sin(y)*sin((1/2)*y*pi)*cos((1/2)*x*pi) + rho*sin(x)*cos(y)*cos((1/2)*x*pi)*cos((1/2)*y*pi) - pi*rho*sin(y)^2*sin((1/2)*x*pi)*cos((1/2)*x*pi) + sin(y)*cos(x)'
symbol_names = 'mu rho'
symbol_values = '${mu} ${rho}'
[]
[exact_v]
type = ParsedFunction
expression = 'sin(x)*cos((1/2)*y*pi)'
[]
[forcing_v]
type = ParsedFunction
expression = 'mu*sin(x)*cos((1/2)*y*pi) + (1/4)*pi^2*mu*sin(x)*cos((1/2)*y*pi) - pi*rho*sin(x)^2*sin((1/2)*y*pi)*cos((1/2)*y*pi) - 1/2*pi*rho*sin(x)*sin(y)*sin((1/2)*x*pi)*cos((1/2)*y*pi) + rho*sin(y)*cos(x)*cos((1/2)*x*pi)*cos((1/2)*y*pi) + sin(x)*cos(y)'
symbol_names = 'mu rho'
symbol_values = '${mu} ${rho}'
[]
[exact_p]
type = ParsedFunction
expression = 'sin(x)*sin(y)'
[]
[forcing_p]
type = ParsedFunction
expression = '(1/2)*pi*rho*sin(x)*sin((1/2)*y*pi) + (1/2)*pi*rho*sin(y)*sin((1/2)*x*pi)'
symbol_names = 'rho'
symbol_values = '${rho}'
[]
[]
[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
[]
[]
[AuxVariables]
[vel_exact_x]
[]
[vel_exact_y]
[]
[pressure_exact]
[]
[]
[AuxKernels]
[vel_exact_x]
type = FunctionAux
variable = vel_exact_x
function = exact_u
[]
[vel_exact_y]
type = FunctionAux
variable = vel_exact_y
function = exact_v
[]
[pressure_exact]
type = FunctionAux
variable = pressure_exact
function = exact_p
[]
[]
[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]
[out]
type = Exodus
hide = 'lambda pressure_integral'
[]
csv = true
[]
[Postprocessors]
[pressure_integral]
type = ElementIntegralVariablePostprocessor
variable = pressure
execute_on = linear
[]
[h]
type = AverageElementSize
execute_on = 'timestep_end'
[]
[L2u]
type = ElementL2Error
variable = vel_x
function = exact_u
execute_on = 'timestep_end'
[]
[L2v]
type = ElementL2Error
variable = vel_y
function = exact_v
execute_on = 'timestep_end'
[]
[L2p]
type = ElementL2Error
variable = pressure
function = exact_p
execute_on = 'timestep_end'
[]
[]
(modules/navier_stokes/test/tests/finite_element/ins/hdg/ip/lid-driven/stokes-lid-driven.i)
mu = 1
rho = 1
l = 1
U = 1
n = 4
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${l}
ymin = 0
ymax = ${l}
nx = ${n}
ny = ${n}
elem_type = QUAD9
[]
[]
[Variables]
[vel_x]
family = L2_HIERARCHIC
order = SECOND
[]
[vel_y]
family = L2_HIERARCHIC
order = SECOND
[]
[pressure]
family = L2_HIERARCHIC
order = FIRST
[]
[vel_bar_x]
family = SIDE_HIERARCHIC
order = SECOND
[]
[vel_bar_y]
family = SIDE_HIERARCHIC
order = SECOND
[]
[pressure_bar]
family = SIDE_HIERARCHIC
order = FIRST
[]
[lambda]
family = SCALAR
order = FIRST
[]
[]
[HDGKernels]
[momentum_x_diffusion]
type = NavierStokesStressIPHDGKernel
variable = vel_x
face_variable = vel_bar_x
diffusivity = 'mu'
alpha = 6
pressure_variable = pressure
pressure_face_variable = pressure_bar
component = 0
[]
[momentum_y_diffusion]
type = NavierStokesStressIPHDGKernel
variable = vel_y
face_variable = vel_bar_y
diffusivity = 'mu'
alpha = 6
pressure_variable = pressure
pressure_face_variable = pressure_bar
component = 1
[]
[pressure_convection]
type = AdvectionIPHDGKernel
variable = pressure
face_variable = pressure_bar
velocity = 'velocity'
coeff = '${fparse -rho}'
self_advection = false
[]
[]
[Kernels]
[mean_zero_pressure]
type = ScalarLagrangeMultiplier
variable = pressure
lambda = lambda
[]
[]
[ScalarKernels]
[mean_zero_pressure_lm]
type = AverageValueConstraint
variable = lambda
pp_name = pressure_integral
value = 0
[]
[]
[BCs]
[momentum_x_diffusion_walls]
type = NavierStokesStressIPHDGDirichletBC
boundary = 'left bottom right'
variable = vel_x
face_variable = vel_bar_x
pressure_variable = pressure
pressure_face_variable = pressure_bar
alpha = 6
functor = '0'
diffusivity = 'mu'
component = 0
[]
[momentum_x_diffusion_top]
type = NavierStokesStressIPHDGDirichletBC
boundary = 'top'
variable = vel_x
face_variable = vel_bar_x
pressure_variable = pressure
pressure_face_variable = pressure_bar
alpha = 6
functor = '${U}'
diffusivity = 'mu'
component = 0
[]
[momentum_y_diffusion_all]
type = NavierStokesStressIPHDGDirichletBC
boundary = 'left bottom right top'
variable = vel_y
face_variable = vel_bar_y
pressure_variable = pressure
pressure_face_variable = pressure_bar
alpha = 6
functor = '0'
diffusivity = 'mu'
component = 1
[]
[mass_convection]
type = AdvectionIPHDGPrescribedFluxBC
face_variable = pressure_bar
variable = pressure
velocity = 'velocity'
coeff = '${fparse -rho}'
self_advection = false
boundary = 'left bottom top right'
prescribed_normal_flux = 0
[]
[]
[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
[]
[]
[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]
[out]
type = CSV
show = 'symmetric'
execute_on = 'timestep_end'
[]
[]
[Postprocessors]
[symmetric]
type = MatrixSymmetryCheck
execute_on = 'timestep_end'
[]
[pressure_integral]
type = ElementIntegralVariablePostprocessor
variable = pressure
execute_on = linear
[]
[]
(modules/navier_stokes/test/tests/finite_element/ins/hdg/ip/lid-driven/mms-second-lid-driven.i)
mu = 2
rho = 2
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = -1
xmax = 1
ymin = -1
ymax = 1
nx = 2
ny = 2
elem_type = TRI6
[]
[]
[Variables]
[vel_x]
family = MONOMIAL
order = SECOND
[]
[vel_y]
family = MONOMIAL
order = SECOND
[]
[pressure]
family = MONOMIAL
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
[]
[lambda]
family = SCALAR
order = FIRST
[]
[]
[HDGKernels]
[momentum_x_convection]
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 = 6
pressure_variable = pressure
pressure_face_variable = pressure_bar
component = 0
[]
[momentum_y_convection]
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 = 6
pressure_variable = pressure
pressure_face_variable = pressure_bar
component = 1
[]
[pressure_convection]
type = AdvectionIPHDGKernel
variable = pressure
face_variable = pressure_bar
velocity = 'velocity'
coeff = '${fparse -rho}'
self_advection = false
[]
[]
[Kernels]
[momentum_x_ffn]
type = BodyForce
variable = vel_x
function = forcing_u
[]
[momentum_y_ffn]
type = BodyForce
variable = vel_y
function = forcing_v
[]
[mass_ffn]
type = BodyForce
variable = pressure
function = forcing_p
[]
[mean_zero_pressure]
type = ScalarLagrangeMultiplier
variable = pressure
lambda = lambda
[]
[]
[ScalarKernels]
[mean_zero_pressure_lm]
type = AverageValueConstraint
variable = lambda
pp_name = pressure_integral
value = 0
[]
[]
[BCs]
[momentum_x_diffusion_all]
type = NavierStokesStressIPHDGDirichletBC
boundary = 'left bottom right top'
variable = vel_x
face_variable = vel_bar_x
pressure_variable = pressure
pressure_face_variable = pressure_bar
alpha = 6
functor = exact_u
diffusivity = 'mu'
component = 0
[]
[momentum_y_diffusion_all]
type = NavierStokesStressIPHDGDirichletBC
boundary = 'left bottom right top'
variable = vel_y
face_variable = vel_bar_y
pressure_variable = pressure
pressure_face_variable = pressure_bar
alpha = 6
functor = exact_v
diffusivity = 'mu'
component = 1
[]
[mass_convection]
type = AdvectionIPHDGPrescribedFluxBC
face_variable = pressure_bar
variable = pressure
velocity = 'velocity'
coeff = '${fparse -rho}'
self_advection = false
boundary = 'left bottom top right'
prescribed_normal_flux = 0
[]
[]
[Functions]
[exact_u]
type = ParsedFunction
expression = 'sin(y)*cos((1/2)*x*pi)'
[]
[forcing_u]
type = ParsedFunction
expression = 'mu*sin(y)*cos((1/2)*x*pi) + (1/4)*pi^2*mu*sin(y)*cos((1/2)*x*pi) - 1/2*pi*rho*sin(x)*sin(y)*sin((1/2)*y*pi)*cos((1/2)*x*pi) + rho*sin(x)*cos(y)*cos((1/2)*x*pi)*cos((1/2)*y*pi) - pi*rho*sin(y)^2*sin((1/2)*x*pi)*cos((1/2)*x*pi) + sin(y)*cos(x)'
symbol_names = 'mu rho'
symbol_values = '${mu} ${rho}'
[]
[exact_v]
type = ParsedFunction
expression = 'sin(x)*cos((1/2)*y*pi)'
[]
[forcing_v]
type = ParsedFunction
expression = 'mu*sin(x)*cos((1/2)*y*pi) + (1/4)*pi^2*mu*sin(x)*cos((1/2)*y*pi) - pi*rho*sin(x)^2*sin((1/2)*y*pi)*cos((1/2)*y*pi) - 1/2*pi*rho*sin(x)*sin(y)*sin((1/2)*x*pi)*cos((1/2)*y*pi) + rho*sin(y)*cos(x)*cos((1/2)*x*pi)*cos((1/2)*y*pi) + sin(x)*cos(y)'
symbol_names = 'mu rho'
symbol_values = '${mu} ${rho}'
[]
[exact_p]
type = ParsedFunction
expression = 'sin(x)*sin(y)'
[]
[forcing_p]
type = ParsedFunction
expression = '(1/2)*pi*rho*sin(x)*sin((1/2)*y*pi) + (1/2)*pi*rho*sin(y)*sin((1/2)*x*pi)'
symbol_names = 'rho'
symbol_values = '${rho}'
[]
[]
[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
[]
[]
[AuxVariables]
[vel_exact_x]
[]
[vel_exact_y]
[]
[pressure_exact]
[]
[]
[AuxKernels]
[vel_exact_x]
type = FunctionAux
variable = vel_exact_x
function = exact_u
[]
[vel_exact_y]
type = FunctionAux
variable = vel_exact_y
function = exact_v
[]
[pressure_exact]
type = FunctionAux
variable = pressure_exact
function = exact_p
[]
[]
[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]
[out]
type = Exodus
hide = 'lambda pressure_integral'
[]
csv = true
[]
[Postprocessors]
[pressure_integral]
type = ElementIntegralVariablePostprocessor
variable = pressure
execute_on = linear
[]
[h]
type = AverageElementSize
execute_on = 'timestep_end'
[]
[L2u]
type = ElementL2Error
variable = vel_x
function = exact_u
execute_on = 'timestep_end'
[]
[L2v]
type = ElementL2Error
variable = vel_y
function = exact_v
execute_on = 'timestep_end'
[]
[L2p]
type = ElementL2Error
variable = pressure
function = exact_p
execute_on = 'timestep_end'
[]
[]
(modules/navier_stokes/test/tests/finite_element/ins/hdg/ip/lid-driven/sc-lid-driven.i)
mu = 1
rho = 1
l = 1
U = 100
n = 8
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${l}
ymin = 0
ymax = ${l}
nx = ${n}
ny = ${n}
elem_type = TRI6
[]
[]
[Variables]
[vel_x]
family = L2_HIERARCHIC
order = SECOND
[]
[vel_y]
family = L2_HIERARCHIC
order = SECOND
[]
[pressure]
family = L2_HIERARCHIC
order = FIRST
[]
[vel_bar_x]
family = SIDE_HIERARCHIC
order = SECOND
[]
[vel_bar_y]
family = SIDE_HIERARCHIC
order = SECOND
[]
[pressure_bar]
family = SIDE_HIERARCHIC
order = FIRST
[]
[lambda]
family = SCALAR
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'
alpha = 6
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 = 6
pressure_variable = pressure
pressure_face_variable = pressure_bar
component = 1
[]
[mass_advection]
type = AdvectionIPHDGKernel
variable = pressure
face_variable = pressure_bar
velocity = 'velocity'
coeff = '${fparse -rho}'
self_advection = false
[]
[]
[Kernels]
[mean_zero_pressure]
type = ScalarLagrangeMultiplier
variable = pressure
lambda = lambda
[]
[]
[ScalarKernels]
[mean_zero_pressure_lm]
type = AverageValueConstraint
variable = lambda
pp_name = pressure_integral
value = 0
[]
[]
[BCs]
[momentum_x_diffusion_walls]
type = NavierStokesStressIPHDGDirichletBC
boundary = 'left bottom right'
variable = vel_x
face_variable = vel_bar_x
pressure_variable = pressure
pressure_face_variable = pressure_bar
alpha = 6
functor = '0'
diffusivity = 'mu'
component = 0
[]
[momentum_x_diffusion_top]
type = NavierStokesStressIPHDGDirichletBC
boundary = 'top'
variable = vel_x
face_variable = vel_bar_x
pressure_variable = pressure
pressure_face_variable = pressure_bar
alpha = 6
functor = '${U}'
diffusivity = 'mu'
component = 0
[]
[momentum_y_diffusion_all]
type = NavierStokesStressIPHDGDirichletBC
boundary = 'left bottom right top'
variable = vel_y
face_variable = vel_bar_y
pressure_variable = pressure
pressure_face_variable = pressure_bar
alpha = 6
functor = '0'
diffusivity = 'mu'
component = 1
[]
[mass_advection]
type = AdvectionIPHDGPrescribedFluxBC
face_variable = pressure_bar
variable = pressure
velocity = 'velocity'
coeff = '${fparse -rho}'
self_advection = false
boundary = 'left bottom top right'
prescribed_normal_flux = 0
[]
[]
[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
[]
[]
[Preconditioning]
[sc]
type = StaticCondensation
petsc_options_iname = '-pc_type -pc_factor_shift_type -ksp_view_pmat'
petsc_options_value = 'lu NONZERO binary'
[]
[]
[Executioner]
type = Steady
nl_rel_tol = 1e-12
petsc_options_iname = '-ksp_type'
petsc_options_value = 'preonly'
[]
[Outputs]
[out]
type = Exodus
hide = 'lambda pressure_integral symmetric vel_bar_x vel_bar_y pressure_bar'
[]
[csv]
type = CSV
hide = 'lambda pressure_integral'
[]
[]
[Postprocessors]
[Re]
type = ParsedPostprocessor
pp_names = ''
expression = '${rho} * ${U} * ${l} / ${mu}'
[]
[symmetric]
type = MatrixSymmetryCheck
mat = binaryoutput
mat_number_to_load = 2
[]
[pressure_integral]
type = ElementIntegralVariablePostprocessor
variable = pressure
execute_on = linear
[]
[]
(test/tests/misc/check_error/coupling_field_into_scalar.i)
[Mesh]
type = GeneratedMesh
dim = 2
[]
[AuxVariables]
[./v]
[../]
[]
[Variables]
[./u]
[../]
[./a]
family = SCALAR
order = FIRST
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[./slm]
type = ScalarLagrangeMultiplier
variable = u
# this should trigger an error message, lambda is scalar
lambda = v
[../]
[]
[ScalarKernels]
[./alpha]
type = AlphaCED
variable = a
value = 1
[../]
[]
[BCs]
[./all]
type = DirichletBC
boundary = 'left right top bottom'
variable = u
value = 0
[../]
[]
[Executioner]
type = Steady
[]
(test/tests/kernels/bad_scaling_scalar_kernels/ill_conditioned_field_scalar_system.i)
[Mesh]
type = GeneratedMesh
dim = 1
nx = 2
[]
[Variables]
[./u]
[../]
[v]
family = SCALAR
initial_condition = 1
[]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[scalar]
type = ScalarLagrangeMultiplier
variable = u
lambda = v
[]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = right
value = 1
[../]
[]
[ScalarKernels]
[reaction]
type = ParsedODEKernel
expression = '10^20 * v'
variable = v
[]
[time]
type = ODETimeDerivative
variable = v
[]
[]
[Executioner]
type = Transient
num_steps = 1
dtmin = 1
solve_type = NEWTON
petsc_options = '-pc_svd_monitor -ksp_view_pmat -snes_converged_reason -ksp_converged_reason'
petsc_options_iname = '-pc_type -snes_stol'
petsc_options_value = 'svd 0'
[]
[Outputs]
exodus = true
[]
(test/tests/kernels/scalar_constraint/scalar_constraint_kernel.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = -1
xmax = 1
ymin = -1
ymax = 1
nx = 2
ny = 2
elem_type = QUAD9
[]
[Functions]
[./exact_fn]
type = ParsedFunction
expression = 'x*x+y*y'
[../]
[./ffn]
type = ParsedFunction
expression = -4
[../]
[./bottom_bc_fn]
type = ParsedFunction
expression = -2*y
[../]
[./right_bc_fn]
type = ParsedFunction
expression = 2*x
[../]
[./top_bc_fn]
type = ParsedFunction
expression = 2*y
[../]
[./left_bc_fn]
type = ParsedFunction
expression = -2*x
[../]
[]
[Variables]
[./u]
family = LAGRANGE
order = SECOND
[../]
[./lambda]
family = SCALAR
order = FIRST
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[./ffnk]
type = BodyForce
variable = u
function = ffn
[../]
[./sk_lm]
type = ScalarLagrangeMultiplier
variable = u
lambda = lambda
[../]
[]
[ScalarKernels]
[./constraint]
type = AverageValueConstraint
variable = lambda
pp_name = pp
value = 2.666666666666666
[../]
[]
[BCs]
[./bottom]
type = FunctionNeumannBC
variable = u
boundary = 'bottom'
function = bottom_bc_fn
[../]
[./right]
type = FunctionNeumannBC
variable = u
boundary = 'right'
function = right_bc_fn
[../]
[./top]
type = FunctionNeumannBC
variable = u
boundary = 'top'
function = top_bc_fn
[../]
[./left]
type = FunctionNeumannBC
variable = u
boundary = 'left'
function = left_bc_fn
[../]
[]
[Postprocessors]
[./pp]
type = ElementIntegralVariablePostprocessor
variable = u
execute_on = linear
[../]
[./l2_err]
type = ElementL2Error
variable = u
function = exact_fn
execute_on = 'initial timestep_end'
[../]
[]
[Preconditioning]
[./pc]
type = SMP
full = true
solve_type = 'NEWTON'
[../]
[]
[Executioner]
type = Steady
nl_rel_tol = 1e-9
l_tol = 1.e-10
nl_max_its = 10
# This example builds an indefinite matrix, so "-pc_type hypre -pc_hypre_type boomeramg" cannot
# be used reliably on this problem. ILU(0) seems to do OK in both serial and parallel in my testing,
# I have not seen any zero pivot issues.
petsc_options_iname = '-pc_type -sub_pc_type'
petsc_options_value = 'bjacobi ilu'
# This is a linear problem, so we don't need to recompute the
# Jacobian. This isn't a big deal for a Steady problems, however, as
# there is only one solve.
solve_type = 'LINEAR'
[]
[Outputs]
exodus = true
hide = lambda
[]
(test/tests/kernels/scalar_constraint/scalar_constraint_kernel_disp.i)
#
# This test is identical to scalar_constraint_kernel.i, but it everything is evaluated on the displaced mesh
#
[GlobalParams]
use_displaced_mesh = true
[]
[Mesh]
type = GeneratedMesh
dim = 2
xmin = -1
xmax = 1
ymin = -1
ymax = 1
nx = 2
ny = 2
elem_type = QUAD9
displacements = 'disp_x disp_y'
[]
[Functions]
[./exact_fn]
type = ParsedFunction
expression = 'x*x+y*y'
[../]
[./ffn]
type = ParsedFunction
expression = -4
[../]
[./bottom_bc_fn]
type = ParsedFunction
expression = -2*y
[../]
[./right_bc_fn]
type = ParsedFunction
expression = 2*x
[../]
[./top_bc_fn]
type = ParsedFunction
expression = 2*y
[../]
[./left_bc_fn]
type = ParsedFunction
expression = -2*x
[../]
[]
[AuxVariables]
[./disp_x]
family = LAGRANGE
order = SECOND
[../]
[./disp_y]
family = LAGRANGE
order = SECOND
[../]
[]
[AuxKernels]
[./disp_x_ak]
type = ConstantAux
variable = disp_x
value = 0
[../]
[./disp_y_ak]
type = ConstantAux
variable = disp_y
value = 0
[../]
[]
# NL
[Variables]
[./u]
family = LAGRANGE
order = SECOND
[../]
[./lambda]
family = SCALAR
order = FIRST
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[./ffnk]
type = BodyForce
variable = u
function = ffn
[../]
[./sk_lm]
type = ScalarLagrangeMultiplier
variable = u
lambda = lambda
[../]
[]
[ScalarKernels]
[./constraint]
type = AverageValueConstraint
variable = lambda
pp_name = pp
value = 2.666666666666666
# overrride the global setting, scalar kernels do not live on a mesh
use_displaced_mesh = false
[../]
[]
[BCs]
[./bottom]
type = FunctionNeumannBC
variable = u
boundary = '0'
function = bottom_bc_fn
[../]
[./right]
type = FunctionNeumannBC
variable = u
boundary = '1'
function = right_bc_fn
[../]
[./top]
type = FunctionNeumannBC
variable = u
boundary = '2'
function = top_bc_fn
[../]
[./left]
type = FunctionNeumannBC
variable = u
boundary = '3'
function = left_bc_fn
[../]
[]
[Postprocessors]
[./pp]
type = ElementIntegralVariablePostprocessor
variable = u
execute_on = linear
[../]
[./l2_err]
type = ElementL2Error
variable = u
function = exact_fn
execute_on = 'initial timestep_end'
[../]
[]
[Preconditioning]
[./pc]
type = SMP
full = true
solve_type = 'PJFNK'
[../]
[]
[Executioner]
type = Steady
nl_rel_tol = 1e-14
l_tol = 1e-7
[]
[Outputs]
exodus = true
hide = lambda
[]
(modules/navier_stokes/test/tests/finite_element/ins/lid_driven/ad_lid_driven_mean_zero_pressure.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 1.0
ymin = 0
ymax = 1.0
nx = 16
ny = 16
elem_type = QUAD9
[]
[]
[AuxVariables]
[vel_x]
order = SECOND
[]
[vel_y]
order = SECOND
[]
[]
[AuxKernels]
[vel_x]
type = VectorVariableComponentAux
variable = vel_x
vector_variable = velocity
component = 'x'
[]
[vel_y]
type = VectorVariableComponentAux
variable = vel_y
vector_variable = velocity
component = 'y'
[]
[]
[Variables]
[./velocity]
order = SECOND
family = LAGRANGE_VEC
[../]
[./T]
order = SECOND
[./InitialCondition]
type = ConstantIC
value = 1.0
[../]
[../]
[./p]
[../]
[./lambda]
family = SCALAR
order = FIRST
[../]
[]
[Kernels]
[./mass]
type = INSADMass
variable = p
[../]
[./momentum_time]
type = INSADMomentumTimeDerivative
variable = velocity
[../]
[./momentum_convection]
type = INSADMomentumAdvection
variable = velocity
[../]
[./momentum_viscous]
type = INSADMomentumViscous
variable = velocity
[../]
[./momentum_pressure]
type = INSADMomentumPressure
variable = velocity
pressure = p
integrate_p_by_parts = true
[../]
[./temperature_time]
type = INSADHeatConductionTimeDerivative
variable = T
[../]
[./temperature_advection]
type = INSADEnergyAdvection
variable = T
[../]
[./temperature_conduction]
type = ADHeatConduction
variable = T
thermal_conductivity = 'k'
[../]
[./mean_zero_pressure]
type = ScalarLagrangeMultiplier
variable = p
lambda = lambda
[../]
[]
[ScalarKernels]
[./mean_zero_pressure_lm]
type = AverageValueConstraint
variable = lambda
pp_name = pressure_integral
value = 0
[../]
[]
[BCs]
[./no_slip]
type = VectorFunctionDirichletBC
variable = velocity
boundary = 'bottom right left'
[../]
[./lid]
type = VectorFunctionDirichletBC
variable = velocity
boundary = 'top'
function_x = 'lid_function'
[../]
[./T_hot]
type = DirichletBC
variable = T
boundary = 'bottom'
value = 1
[../]
[./T_cold]
type = DirichletBC
variable = T
boundary = 'top'
value = 0
[../]
[]
[Materials]
[./const]
type = ADGenericConstantMaterial
prop_names = 'rho mu cp k'
prop_values = '1 1 1 .01'
[../]
[ins_mat]
type = INSAD3Eqn
velocity = velocity
pressure = p
temperature = T
[]
[]
[Postprocessors]
[./pressure_integral]
type = ElementIntegralVariablePostprocessor
variable = p
execute_on = linear
[../]
[]
[Functions]
[./lid_function]
# We pick a function that is exactly represented in the velocity
# space so that the Dirichlet conditions are the same regardless
# of the mesh spacing.
type = ParsedFunction
expression = '4*x*(1-x)'
[../]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
solve_type = 'NEWTON'
[../]
[]
[Executioner]
type = Transient
# Run for 100+ timesteps to reach steady state.
num_steps = 5
dt = .5
dtmin = .5
petsc_options_iname = '-pc_type -pc_asm_overlap -sub_pc_type -sub_pc_factor_levels -sub_pc_factor_shift_type'
petsc_options_value = 'asm 2 ilu 4 NONZERO'
line_search = 'none'
nl_rel_tol = 1e-12
nl_abs_tol = 1e-13
nl_max_its = 6
l_tol = 1e-6
l_max_its = 500
[]
[Outputs]
exodus = true
perf_graph = true
[]
(modules/navier_stokes/test/tests/finite_element/ins/hdg/ip/lid-driven/lid-driven.i)
mu = 1
rho = 1
l = 1
U = 100
n = 8
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${l}
ymin = 0
ymax = ${l}
nx = ${n}
ny = ${n}
elem_type = TRI6
[]
[]
[Variables]
[vel_x]
family = L2_HIERARCHIC
order = SECOND
[]
[vel_y]
family = L2_HIERARCHIC
order = SECOND
[]
[pressure]
family = L2_HIERARCHIC
order = FIRST
[]
[vel_bar_x]
family = SIDE_HIERARCHIC
order = SECOND
[]
[vel_bar_y]
family = SIDE_HIERARCHIC
order = SECOND
[]
[pressure_bar]
family = SIDE_HIERARCHIC
order = FIRST
[]
[lambda]
family = SCALAR
order = FIRST
[]
[]
[HDGKernels]
[momentum_x_convection]
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 = 6
pressure_variable = pressure
pressure_face_variable = pressure_bar
component = 0
[]
[momentum_y_convection]
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 = 6
pressure_variable = pressure
pressure_face_variable = pressure_bar
component = 1
[]
[pressure_convection]
type = AdvectionIPHDGKernel
variable = pressure
face_variable = pressure_bar
velocity = 'velocity'
coeff = '${fparse -rho}'
self_advection = false
[]
[]
[Kernels]
[mean_zero_pressure]
type = ScalarLagrangeMultiplier
variable = pressure
lambda = lambda
[]
[]
[ScalarKernels]
[mean_zero_pressure_lm]
type = AverageValueConstraint
variable = lambda
pp_name = pressure_integral
value = 0
[]
[]
[BCs]
[momentum_x_diffusion_walls]
type = NavierStokesStressIPHDGDirichletBC
boundary = 'left bottom right'
variable = vel_x
face_variable = vel_bar_x
pressure_variable = pressure
pressure_face_variable = pressure_bar
alpha = 6
functor = '0'
diffusivity = 'mu'
component = 0
[]
[momentum_x_diffusion_top]
type = NavierStokesStressIPHDGDirichletBC
boundary = 'top'
variable = vel_x
face_variable = vel_bar_x
pressure_variable = pressure
pressure_face_variable = pressure_bar
alpha = 6
functor = '${U}'
diffusivity = 'mu'
component = 0
[]
[momentum_y_diffusion_all]
type = NavierStokesStressIPHDGDirichletBC
boundary = 'left bottom right top'
variable = vel_y
face_variable = vel_bar_y
pressure_variable = pressure
pressure_face_variable = pressure_bar
alpha = 6
functor = '0'
diffusivity = 'mu'
component = 1
[]
[mass_convection]
type = AdvectionIPHDGPrescribedFluxBC
face_variable = pressure_bar
variable = pressure
velocity = 'velocity'
coeff = '${fparse -rho}'
self_advection = false
boundary = 'left bottom top right'
prescribed_normal_flux = 0
[]
[]
[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
[]
[]
[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]
[out]
type = Exodus
hide = 'lambda pressure_integral vel_bar_x vel_bar_y pressure_bar'
[]
[]
[Postprocessors]
[Re]
type = ParsedPostprocessor
pp_names = ''
expression = '${rho} * ${U} * ${l} / ${mu}'
[]
[pressure_integral]
type = ElementIntegralVariablePostprocessor
variable = pressure
execute_on = linear
[]
[]
(test/tests/misc/check_error/coupling_nonexistent_scalar.i)
[Mesh]
type = GeneratedMesh
dim = 2
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./slm]
type = ScalarLagrangeMultiplier
variable = u
# 'b' does not exist -> error
lambda = b
[../]
[]
[Executioner]
type = Steady
[]
(modules/navier_stokes/test/tests/finite_element/ins/hdg/ip/lid-driven/matrix-testing.i)
mu = 1
rho = 1
U = 1
n = 5
l = 1
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${l}
ymin = 0
ymax = ${l}
nx = ${n}
ny = ${n}
elem_type = TRI6
[]
[]
[Problem]
type = PrintMatricesNSProblem
extra_tag_matrices = 'mass jump combined grad_div'
pressure_mass_matrix = 'mass'
velocity_mass_matrix = 'mass'
augmented_lagrange_matrices = 'jump grad_div combined'
u = vel_x
v = vel_y
pressure = pressure
pressure_bar = pressure_bar
print = false
[]
[Variables]
[vel_x]
family = MONOMIAL
order = FIRST
[]
[vel_y]
family = MONOMIAL
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
[]
[lambda]
family = SCALAR
order = FIRST
[]
[]
[HDGKernels]
[momentum_x_diffusion]
type = NavierStokesStressIPHDGKernel
variable = vel_x
face_variable = vel_bar_x
diffusivity = 'mu'
alpha = 6
pressure_variable = pressure
pressure_face_variable = pressure_bar
component = 0
[]
[momentum_y_diffusion]
type = NavierStokesStressIPHDGKernel
variable = vel_y
face_variable = vel_bar_y
diffusivity = 'mu'
alpha = 6
pressure_variable = pressure
pressure_face_variable = pressure_bar
component = 1
[]
[pressure_convection]
type = AdvectionIPHDGKernel
variable = pressure
face_variable = pressure_bar
velocity = 'velocity'
coeff = '${fparse -rho}'
self_advection = false
[]
[]
[Kernels]
[mean_zero_pressure]
type = ScalarLagrangeMultiplier
variable = pressure
lambda = lambda
[]
[mass_matrix_vel_x]
type = MassMatrix
variable = vel_x
matrix_tags = 'mass'
[]
[mass_matrix_vel_y]
type = MassMatrix
variable = vel_y
matrix_tags = 'mass'
[]
[mass_matrix_pressure]
type = MassMatrix
variable = pressure
matrix_tags = 'mass'
[]
[u_jump]
type = GradDiv
matrix_only = true
variable = vel_x
u = vel_x
v = vel_y
component = 0
vector_tags = ''
matrix_tags = 'grad_div combined'
[]
[v_jump]
type = GradDiv
matrix_only = true
variable = vel_y
u = vel_x
v = vel_y
component = 1
vector_tags = ''
matrix_tags = 'grad_div combined'
[]
[]
[ScalarKernels]
[mean_zero_pressure_lm]
type = AverageValueConstraint
variable = lambda
pp_name = pressure_integral
value = 0
[]
[]
[DGKernels]
[pb_mass]
type = MassMatrixDGKernel
variable = pressure_bar
matrix_tags = 'mass'
[]
[u_jump]
type = MassFluxPenalty
matrix_only = true
variable = vel_x
u = vel_x
v = vel_y
component = 0
vector_tags = ''
matrix_tags = 'jump combined'
[]
[v_jump]
type = MassFluxPenalty
matrix_only = true
variable = vel_y
u = vel_x
v = vel_y
component = 1
vector_tags = ''
matrix_tags = 'jump combined'
[]
[]
[BCs]
[momentum_x_diffusion_walls]
type = NavierStokesStressIPHDGDirichletBC
boundary = 'left bottom right'
variable = vel_x
face_variable = vel_bar_x
pressure_variable = pressure
pressure_face_variable = pressure_bar
alpha = 6
functor = '0'
diffusivity = 'mu'
component = 0
[]
[momentum_x_diffusion_top]
type = NavierStokesStressIPHDGDirichletBC
boundary = 'top'
variable = vel_x
face_variable = vel_bar_x
pressure_variable = pressure
pressure_face_variable = pressure_bar
alpha = 6
functor = '${U}'
diffusivity = 'mu'
component = 0
[]
[momentum_y_diffusion_all]
type = NavierStokesStressIPHDGDirichletBC
boundary = 'left bottom right top'
variable = vel_y
face_variable = vel_bar_y
pressure_variable = pressure
pressure_face_variable = pressure_bar
alpha = 6
functor = '0'
diffusivity = 'mu'
component = 1
[]
[mass_convection]
type = AdvectionIPHDGPrescribedFluxBC
face_variable = pressure_bar
variable = pressure
velocity = 'velocity'
coeff = '${fparse -rho}'
self_advection = false
boundary = 'left bottom top right'
prescribed_normal_flux = 0
[]
[pb_mass]
type = MassMatrixIntegratedBC
variable = pressure_bar
matrix_tags = 'mass'
boundary = 'left right bottom top'
[]
[u_jump_walls]
type = MassFluxPenaltyBC
matrix_only = true
variable = vel_x
u = vel_x
v = vel_y
component = 0
vector_tags = ''
matrix_tags = 'jump combined'
boundary = 'left right bottom'
dirichlet_value = 'walls'
[]
[v_jump_walls]
type = MassFluxPenaltyBC
matrix_only = true
variable = vel_y
u = vel_x
v = vel_y
component = 1
vector_tags = ''
matrix_tags = 'jump combined'
boundary = 'left right bottom'
dirichlet_value = 'walls'
[]
[u_jump_top]
type = MassFluxPenaltyBC
matrix_only = true
variable = vel_x
u = vel_x
v = vel_y
component = 0
vector_tags = ''
matrix_tags = 'jump combined'
boundary = 'top'
dirichlet_value = 'top'
[]
[v_jump_top]
type = MassFluxPenaltyBC
matrix_only = true
variable = vel_y
u = vel_x
v = vel_y
component = 1
vector_tags = ''
matrix_tags = 'jump combined'
boundary = 'top'
dirichlet_value = 'top'
[]
[]
[Functions]
[top]
type = ParsedVectorFunction
value_x = ${U}
value_y = 0
[]
[walls]
type = ParsedVectorFunction
value_x = 0
value_y = 0
[]
[]
[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
[]
[]
[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]
[out]
type = CSV
hide = 'pressure_integral lambda'
execute_on = 'timestep_end'
[]
[]
[Postprocessors]
[symmetric]
type = MatrixSymmetryCheck
execute_on = 'timestep_end'
[]
[pressure_integral]
type = ElementIntegralVariablePostprocessor
variable = pressure
execute_on = linear
[]
[fe_jump_and_upb_equiv]
type = MatrixEqualityCheck
mat1 = 'vel_pb_grad_div.mat'
mat2 = 'jump.mat'
[]
[fe_grad_div_and_up_equiv]
type = MatrixEqualityCheck
mat1 = 'vel_p_grad_div.mat'
mat2 = 'grad_div.mat'
[]
[fe_combined_and_upall_equiv]
type = MatrixEqualityCheck
mat1 = 'vel_all_p_grad_div.mat'
mat2 = 'combined.mat'
[]
[upb_grad_div_num_zero_eig]
type = MatrixEigenvalueCheck
mat = vel_pb_grad_div.mat
[]
[upb_div_grad_num_zero_eig]
type = MatrixEigenvalueCheck
mat = vel_pb_div_grad.mat
[]
[up_grad_div_num_zero_eig]
type = MatrixEigenvalueCheck
mat = vel_p_grad_div.mat
[]
[up_div_grad_num_zero_eig]
type = MatrixEigenvalueCheck
mat = vel_p_div_grad.mat
[]
[upall_grad_div_num_zero_eig]
type = MatrixEigenvalueCheck
mat = vel_all_p_grad_div.mat
[]
[upall_div_grad_num_zero_eig]
type = MatrixEigenvalueCheck
mat = vel_all_p_div_grad.mat
[]
[]