- componentnumber of component (0 = x, 1 = y, 2 = z)
C++ Type:unsigned int
Controllable:No
Description:number of component (0 = x, 1 = y, 2 = z)
- pressurepressure
C++ Type:std::vector<VariableName>
Unit:(no unit assumed)
Controllable:No
Description:pressure
- 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
PressureGradient
Implements the pressure gradient term for one of the Navier Stokes momentum equations.
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
- integrate_p_by_partsTrueWhether to integrate the pressure term by parts
Default:True
C++ Type:bool
Controllable:No
Description:Whether to integrate the pressure term by parts
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_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)
- 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.
- 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
- search_methodnearest_node_connected_sidesChoice of search algorithm. All options begin by finding the nearest node in the primary boundary to a query point in the secondary boundary. In the default nearest_node_connected_sides algorithm, primary boundary elements are searched iff that nearest node is one of their nodes. This is fast to determine via a pregenerated node-to-elem map and is robust on conforming meshes. In the optional all_proximate_sides algorithm, primary boundary elements are searched iff they touch that nearest node, even if they are not topologically connected to it. This is more CPU-intensive but is necessary for robustness on any boundary surfaces which has disconnections (such as Flex IGA meshes) or non-conformity (such as hanging nodes in adaptively h-refined meshes).
Default:nearest_node_connected_sides
C++ Type:MooseEnum
Options:nearest_node_connected_sides, all_proximate_sides
Controllable:No
Description:Choice of search algorithm. All options begin by finding the nearest node in the primary boundary to a query point in the secondary boundary. In the default nearest_node_connected_sides algorithm, primary boundary elements are searched iff that nearest node is one of their nodes. This is fast to determine via a pregenerated node-to-elem map and is robust on conforming meshes. In the optional all_proximate_sides algorithm, primary boundary elements are searched iff they touch that nearest node, even if they are not topologically connected to it. This is more CPU-intensive but is necessary for robustness on any boundary surfaces which has disconnections (such as Flex IGA meshes) or non-conformity (such as hanging nodes in adaptively h-refined meshes).
- 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
- (modules/navier_stokes/test/tests/finite_element/ins/compatibility/dg-stokes.i)
- (modules/navier_stokes/test/tests/finite_element/ins/cg-dg-hybrid/mms/lid-driven-skewed/hybrid-skewed-vortex.i)
- (modules/navier_stokes/test/tests/finite_element/ins/RZ_cone/unstabilized-velocity-component-objects.i)
- (modules/navier_stokes/test/tests/finite_element/ins/compatibility/hybrid-cg-dg.i)
- (modules/navier_stokes/test/tests/finite_element/ins/compatibility/cg.i)
- (modules/navier_stokes/test/tests/finite_element/ins/cg-dg-hybrid/channel-flow/channel-hybrid.i)
- (modules/navier_stokes/test/tests/finite_element/ins/cg-dg-hybrid/lid-driven/hybrid-cg-dg.i)
- (modules/navier_stokes/test/tests/finite_element/ins/compatibility/dg-stokes-rz.i)
- (modules/navier_stokes/test/tests/finite_element/ins/cg-dg-hybrid/mms/lid-driven/hybrid-cg-dg-mms.i)
(modules/navier_stokes/test/tests/finite_element/ins/compatibility/dg-stokes.i)
mu = 1
rho = 1
sigma = 10
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 10
ymin = -1
ymax = 1
nx = 10
ny = 2
elem_type = TRI6
[]
[]
[Variables]
[u]
family = MONOMIAL
order = FIRST
[]
[v]
family = MONOMIAL
order = FIRST
[]
[pressure]
family = MONOMIAL
order = CONSTANT
[]
[temperature]
family = MONOMIAL
order = CONSTANT
[]
[]
[Kernels]
[momentum_x_diffusion]
type = MatDiffusion
variable = u
diffusivity = mu
[]
[momentum_x_pressure]
type = PressureGradient
integrate_p_by_parts = true
variable = u
pressure = pressure
component = 0
[]
[momentum_y_diffusion]
type = MatDiffusion
variable = v
diffusivity = mu
[]
[momentum_y_pressure]
type = PressureGradient
integrate_p_by_parts = true
variable = v
pressure = pressure
component = 1
[]
[mass]
type = ADConservativeAdvection
variable = pressure
velocity_material = velocity
advected_quantity = -1
[]
[temperature_diffusion]
type = MatDiffusion
variable = temperature
diffusivity = 1
[]
[]
[DGKernels]
[momentum_x_diffusion]
type = DGDiffusion
variable = u
sigma = ${sigma}
epsilon = -1
diff = mu
[]
[momentum_y_diffusion]
type = DGDiffusion
variable = v
sigma = ${sigma}
epsilon = -1
diff = mu
[]
[momentum_x_pressure]
type = INSPressureGradientDGKernel
variable = u
pressure = pressure
component = 0
[]
[momentum_y_pressure]
type = INSPressureGradientDGKernel
variable = v
pressure = pressure
component = 1
[]
[mass_convection]
type = ADDGAdvection
variable = pressure
velocity = velocity
advected_quantity = -1
[]
[temperature_diffusion]
type = DGDiffusion
variable = temperature
epsilon = -1
sigma = ${sigma}
[]
[]
[Functions]
[u_inlet]
type = ParsedFunction
expression = '1.5*(1-y*y)'
[]
[v_inlet]
type = ParsedVectorFunction
expression_x = '1.5*(1-y*y)'
[]
[]
[BCs]
[diffusion_momentum_x_in]
type = DGFunctionDiffusionDirichletBC
boundary = left
variable = u
sigma = ${sigma}
epsilon = -1
function = u_inlet
diff = mu
[]
[diffusion_momentum_y_in]
type = DGFunctionDiffusionDirichletBC
boundary = left
variable = v
sigma = ${sigma}
epsilon = -1
function = 0
diff = mu
[]
[diffusion_temperature_in]
type = DGFunctionDiffusionDirichletBC
boundary = left
function = 1
epsilon = -1
sigma = ${sigma}
variable = temperature
[]
[diffusion_momentum_x_walls]
type = DGFunctionDiffusionDirichletBC
boundary = 'bottom top'
variable = u
sigma = ${sigma}
epsilon = -1
function = 0
diff = mu
[]
[diffusion_momentum_y_walls]
type = DGFunctionDiffusionDirichletBC
boundary = 'bottom top'
variable = v
sigma = ${sigma}
epsilon = -1
function = 0
diff = mu
[]
[advection_mass_in]
type = ADConservativeAdvectionBC
boundary = left
variable = pressure
velocity_function = v_inlet
advected_quantity = -1
[]
[advection_mass_out]
type = ADConservativeAdvectionBC
boundary = right
variable = pressure
velocity_mat_prop = velocity
advected_quantity = -1
[]
[implicit_pressure_x_in]
type = INSPressureGradientBC
boundary = left
component = 0
pressure = pressure
variable = u
[]
[implicit_pressure_y_in_and_walls]
type = INSPressureGradientBC
boundary = 'left top bottom'
component = 1
pressure = pressure
variable = v
[]
[]
[Materials]
[const]
type = ADGenericConstantMaterial
prop_names = rho
prop_values = ${rho}
[]
[const_reg]
type = GenericConstantMaterial
prop_names = mu
prop_values = ${mu}
[]
[vel]
type = ADVectorFromComponentVariablesMaterial
vector_prop_name = velocity
u = u
v = v
[]
[rhou]
type = ADParsedMaterial
property_name = rhou
coupled_variables = u
material_property_names = rho
expression = 'rho*u'
[]
[rhov]
type = ADParsedMaterial
property_name = rhov
coupled_variables = v
material_property_names = rho
expression = 'rho*v'
[]
[]
[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 = u
[]
[outlet_temperature]
type = SideAverageValue
boundary = right
variable = temperature
[]
[]
[Outputs]
csv = true
[]
(modules/navier_stokes/test/tests/finite_element/ins/cg-dg-hybrid/mms/lid-driven-skewed/hybrid-skewed-vortex.i)
rho=1
mu=1
[Mesh]
[gen_mesh]
type = FileMeshGenerator
file = skewed.msh
[]
[corner_node]
type = ExtraNodesetGenerator
new_boundary = 'pinned_node'
nodes = '0'
input = gen_mesh
[]
[]
[Variables]
[u]
family = MONOMIAL
order = SECOND
[]
[v]
family = MONOMIAL
order = SECOND
[]
[pressure][]
[]
[Kernels]
[momentum_x_convection]
type = ADConservativeAdvection
variable = u
velocity_material = 'velocity'
[]
[momentum_x_diffusion]
type = Diffusion
variable = u
[]
[momentum_x_pressure]
type = PressureGradient
integrate_p_by_parts = false
variable = u
pressure = pressure
component = 0
[]
[u_forcing]
type = BodyForce
variable = u
function = forcing_u
[]
[momentum_y_convection]
type = ADConservativeAdvection
variable = v
velocity_material = 'velocity'
[]
[momentum_y_diffusion]
type = Diffusion
variable = v
[]
[momentum_y_pressure]
type = PressureGradient
integrate_p_by_parts = false
variable = v
pressure = pressure
component = 1
[]
[v_forcing]
type = BodyForce
variable = v
function = forcing_v
[]
[mass]
type = ADConservativeAdvection
variable = pressure
velocity_material = velocity
advected_quantity = -1
[]
[]
[DGKernels]
[momentum_x_convection]
type = ADDGAdvection
variable = u
velocity = 'velocity'
[]
[momentum_x_diffusion]
type = DGDiffusion
variable = u
sigma = 6
epsilon = -1
[]
[momentum_y_convection]
type = ADDGAdvection
variable = v
velocity = 'velocity'
[]
[momentum_y_diffusion]
type = DGDiffusion
variable = v
sigma = 6
epsilon = -1
[]
[]
[BCs]
[u_walls]
type = DGFunctionDiffusionDirichletBC
boundary = 'left bottom right top'
variable = u
sigma = 6
epsilon = -1
function = exact_u
[]
[v_walls]
type = DGFunctionDiffusionDirichletBC
boundary = 'left bottom right top'
variable = v
sigma = 6
epsilon = -1
function = exact_v
[]
[pressure_pin]
type = FunctionDirichletBC
variable = pressure
boundary = 'pinned_node'
function = 'exact_p'
[]
[]
[Materials]
[rho]
type = ADGenericConstantMaterial
prop_names = 'rho'
prop_values = '${rho}'
[]
[vel]
type = ADVectorFromComponentVariablesMaterial
vector_prop_name = 'velocity'
u = u
v = v
[]
[rhou]
type = ADParsedMaterial
property_name = 'rhou'
coupled_variables = 'u'
material_property_names = 'rho'
expression = 'rho*u'
[]
[rhov]
type = ADParsedMaterial
property_name = 'rhov'
coupled_variables = 'v'
material_property_names = 'rho'
expression = 'rho*v'
[]
[]
[Functions]
[exact_u]
type = ParsedFunction
expression = 'x^2*(1-x)^2*(2*y-6*y^2+4*y^3)'
[]
[exact_v]
type = ParsedFunction
expression = '-y^2*(1-y)^2*(2*x-6*x^2+4*x^3)'
[]
[exact_p]
type = ParsedFunction
expression = 'x*(1-x)-2/12'
[]
[forcing_u]
type = ParsedFunction
expression = '-4*mu/rho*(-1+2*y)*(y^2-6*x*y^2+6*x^2*y^2-y+6*x*y-6*x^2*y+3*x^2-6*x^3+3*x^4)+1-2*x+4*x^3'
'*y^2*(2*y^2-2*y+1)*(y-1)^2*(-1+2*x)*(x-1)^3'
symbol_names = 'mu rho'
symbol_values = '${mu} ${rho}'
[]
[forcing_v]
type = ParsedFunction
expression = '4*mu/rho*(-1+2*x)*(x^2-6*y*x^2+6*x^2*y^2-x+6*x*y-6*x*y^2+3*y^2-6*y^3+3*y^4)+4*y^3*x^2*(2'
'*x^2-2*x+1)*(x-1)^2*(-1+2*y)*(y-1)^3'
symbol_names = 'mu rho'
symbol_values = '${mu} ${rho}'
[]
[]
[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
[]
[Outputs]
exodus = true
csv = true
[]
[Postprocessors]
[h]
type = AverageElementSize
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[L2u]
type = ElementL2Error
variable = u
function = exact_u
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[L2v]
variable = v
function = exact_v
type = ElementL2Error
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[L2p]
variable = pressure
function = exact_p
type = ElementL2Error
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[]
(modules/navier_stokes/test/tests/finite_element/ins/RZ_cone/unstabilized-velocity-component-objects.i)
[Mesh]
file = '2d_cone.msh'
coord_type = RZ
[]
[Variables]
[vel_x]
order = SECOND
[]
[vel_y]
order = SECOND
[]
[p][]
[]
[Kernels]
[momentum_x_time]
type = TimeDerivative
variable = vel_x
[]
[momentum_x_convection]
type = ADAdvection
variable = vel_x
velocity = 'velocity'
[]
[momentum_x_diffusion]
type = MatDiffusion
variable = vel_x
diffusivity = 1
[]
[momentum_x_diffusion_rz]
type = ADMomentumViscousRZ
variable = vel_x
mu_name = 1
component = 0
[]
[momentum_x_pressure]
type = PressureGradient
integrate_p_by_parts = true
variable = vel_x
pressure = p
component = 0
[]
[momentum_y_time]
type = TimeDerivative
variable = vel_y
[]
[momentum_y_convection]
type = ADAdvection
variable = vel_y
velocity = 'velocity'
[]
[momentum_y_diffusion]
type = MatDiffusion
variable = vel_y
diffusivity = 1
[]
[momentum_y_diffusion_rz]
type = ADMomentumViscousRZ
variable = vel_y
mu_name = 1
component = 1
[]
[momentum_y_pressure]
type = PressureGradient
integrate_p_by_parts = true
variable = vel_y
pressure = p
component = 1
[]
[mass]
type = ADMassAdvection
variable = p
vel_x = vel_x
vel_y = vel_y
[]
[]
[BCs]
[u_in]
type = DirichletBC
boundary = bottom
variable = vel_x
value = 0
[]
[v_in]
type = FunctionDirichletBC
boundary = bottom
variable = vel_y
function = 'inlet_func'
[]
[u_axis_and_walls]
type = DirichletBC
boundary = 'left right'
variable = vel_x
value = 0
[]
[v_no_slip]
type = DirichletBC
boundary = 'right'
variable = vel_y
value = 0
[]
[]
[Materials]
[vel]
type = ADVectorFromComponentVariablesMaterial
vector_prop_name = 'velocity'
u = vel_x
v = vel_y
[]
[]
[Functions]
[inlet_func]
type = ParsedFunction
expression = '-4 * x^2 + 1'
[]
[]
[Executioner]
type = Transient
dt = 0.005
dtmin = 0.005
num_steps = 5
l_max_its = 100
petsc_options_iname = '-pc_type -sub_pc_type -sub_pc_factor_levels'
petsc_options_value = 'bjacobi ilu 4'
nl_rel_tol = 1e-12
nl_max_its = 6
[]
[Outputs]
exodus = true
[]
(modules/navier_stokes/test/tests/finite_element/ins/compatibility/hybrid-cg-dg.i)
mu = 1
rho = 1
sigma = 10
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 10
ymin = -1
ymax = 1
nx = 10
ny = 2
elem_type = TRI6
[]
[]
[Variables]
[u]
family = MONOMIAL
order = FIRST
[]
[v]
family = MONOMIAL
order = FIRST
[]
[pressure]
family = LAGRANGE
order = FIRST
[]
[temperature]
family = LAGRANGE
order = FIRST
[]
[]
[Kernels]
[momentum_x_convection]
type = ADConservativeAdvection
variable = u
velocity_material = velocity
advected_quantity = rhou
[]
[momentum_x_diffusion]
type = MatDiffusion
variable = u
diffusivity = mu
[]
[momentum_x_pressure]
type = PressureGradient
integrate_p_by_parts = true
variable = u
pressure = pressure
component = 0
[]
[momentum_y_convection]
type = ADConservativeAdvection
variable = v
velocity_material = velocity
advected_quantity = rhov
[]
[momentum_y_diffusion]
type = MatDiffusion
variable = v
diffusivity = mu
[]
[momentum_y_pressure]
type = PressureGradient
integrate_p_by_parts = true
variable = v
pressure = pressure
component = 1
[]
[mass]
type = ADConservativeAdvection
variable = pressure
velocity_material = velocity
advected_quantity = -1
[]
[temperature_convection]
type = ADConservativeAdvection
variable = temperature
velocity_material = velocity
[]
[temperature_diffusion]
type = MatDiffusion
variable = temperature
diffusivity = 1
[]
[]
[DGKernels]
[momentum_x_convection]
type = ADDGAdvection
variable = u
velocity = velocity
advected_quantity = rhou
[]
[momentum_y_convection]
type = ADDGAdvection
variable = v
velocity = velocity
advected_quantity = rhov
[]
[momentum_x_diffusion]
type = DGDiffusion
variable = u
sigma = ${sigma}
epsilon = -1
diff = mu
[]
[momentum_y_diffusion]
type = DGDiffusion
variable = v
sigma = ${sigma}
epsilon = -1
diff = mu
[]
[momentum_x_pressure]
type = INSPressureGradientDGKernel
variable = u
pressure = pressure
component = 0
[]
[momentum_y_pressure]
type = INSPressureGradientDGKernel
variable = v
pressure = pressure
component = 1
[]
[]
[Functions]
[u_inlet]
type = ParsedFunction
expression = '1.5*(1-y*y)'
[]
[v_inlet]
type = ParsedVectorFunction
expression_x = '1.5*(1-y*y)'
[]
[]
[BCs]
[u_in]
type = DGFunctionDiffusionDirichletBC
boundary = left
variable = u
sigma = ${sigma}
epsilon = -1
function = u_inlet
diff = mu
[]
[v_in]
type = DGFunctionDiffusionDirichletBC
boundary = left
variable = v
sigma = ${sigma}
epsilon = -1
function = 0
diff = mu
[]
[u_walls]
type = DGFunctionDiffusionDirichletBC
boundary = 'bottom top'
variable = u
sigma = ${sigma}
epsilon = -1
function = 0
diff = mu
[]
[v_walls]
type = DGFunctionDiffusionDirichletBC
boundary = 'bottom top'
variable = v
sigma = ${sigma}
epsilon = -1
function = 0
diff = mu
[]
[temperature_in]
type = DirichletBC
boundary = left
variable = temperature
value = 1
[]
[implicit_pressure_x_in]
type = INSPressureGradientBC
boundary = left
component = 0
pressure = pressure
variable = u
[]
[implicit_pressure_y_in_and_walls]
type = INSPressureGradientBC
boundary = 'left top bottom'
component = 1
pressure = pressure
variable = v
[]
[momentum_x_advection_in]
type = ADConservativeAdvectionBC
boundary = left
variable = u
velocity_function = v_inlet
primal_dirichlet_value = u_inlet
primal_coefficient = rho
[]
[momentum_y_advection_in]
type = ADConservativeAdvectionBC
boundary = left
variable = v
velocity_function = v_inlet
primal_dirichlet_value = 0
primal_coefficient = rho
[]
[mass_in]
type = ADConservativeAdvectionBC
boundary = left
variable = pressure
velocity_function = v_inlet
advected_quantity = -1
[]
[temperature_advection_in]
type = ADConservativeAdvectionBC
boundary = left
variable = temperature
velocity_function = v_inlet
primal_dirichlet_value = 1
[]
[momentum_x_advection_out]
type = ADConservativeAdvectionBC
boundary = right
variable = u
velocity_mat_prop = velocity
advected_quantity = rhou
[]
[momentum_y_advection_out]
type = ADConservativeAdvectionBC
boundary = right
variable = v
velocity_mat_prop = velocity
advected_quantity = rhov
[]
[mass_out]
type = ADConservativeAdvectionBC
boundary = right
variable = pressure
velocity_mat_prop = velocity
advected_quantity = -1
[]
[temperature_advection_out]
type = ADConservativeAdvectionBC
boundary = right
variable = temperature
velocity_mat_prop = velocity
[]
[]
[Materials]
[const]
type = ADGenericConstantMaterial
prop_names = rho
prop_values = ${rho}
[]
[const_reg]
type = GenericConstantMaterial
prop_names = mu
prop_values = ${mu}
[]
[velocity]
type = ADVectorFromComponentVariablesMaterial
vector_prop_name = velocity
u = u
v = v
[]
[rhou]
type = ADParsedMaterial
property_name = rhou
coupled_variables = u
material_property_names = rho
expression = 'rho*u'
[]
[rhov]
type = ADParsedMaterial
property_name = rhov
coupled_variables = v
material_property_names = rho
expression = 'rho*v'
[]
[]
[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 = u
[]
[outlet_temperature]
type = SideAverageValue
boundary = right
variable = temperature
[]
[]
[Outputs]
csv = true
[]
(modules/navier_stokes/test/tests/finite_element/ins/compatibility/cg.i)
mu = 1
rho = 1
penalty = 1e6
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 10
ymin = -1
ymax = 1
nx = 10
ny = 2
elem_type = TRI6
[]
[]
[Variables]
[u]
family = LAGRANGE
order = SECOND
[]
[v]
family = LAGRANGE
order = SECOND
[]
[pressure]
family = LAGRANGE
order = FIRST
[]
[temperature]
family = LAGRANGE
order = FIRST
[]
[]
[Kernels]
[momentum_x_convection]
type = ADConservativeAdvection
variable = u
velocity_material = velocity
advected_quantity = rhou
[]
[momentum_x_diffusion]
type = MatDiffusion
variable = u
diffusivity = mu
[]
[momentum_x_pressure]
type = PressureGradient
variable = u
pressure = pressure
component = 0
[]
[momentum_y_convection]
type = ADConservativeAdvection
variable = v
velocity_material = velocity
advected_quantity = rhov
[]
[momentum_y_diffusion]
type = MatDiffusion
variable = v
diffusivity = mu
[]
[momentum_y_pressure]
type = PressureGradient
variable = v
pressure = pressure
component = 1
[]
[mass]
type = ADConservativeAdvection
variable = pressure
velocity_material = velocity
advected_quantity = -1
[]
[temperature_convection]
type = ADConservativeAdvection
variable = temperature
velocity_material = velocity
[]
[temperature_diffusion]
type = MatDiffusion
variable = temperature
diffusivity = 1
[]
[]
[Functions]
[u_inlet]
type = ParsedFunction
expression = '1.5*(1-y*y)'
[]
[v_inlet]
type = ParsedVectorFunction
expression_x = '1.5*(1-y*y)'
[]
[]
[BCs]
[u_in]
type = ADFunctionPenaltyDirichletBC
boundary = left
variable = u
function = u_inlet
penalty = ${penalty}
[]
[v_in]
type = ADPenaltyDirichletBC
boundary = left
variable = v
value = 0
penalty = ${penalty}
[]
[u_walls]
type = ADPenaltyDirichletBC
boundary = 'bottom top'
variable = u
value = 0
penalty = ${penalty}
[]
[v_walls]
type = ADPenaltyDirichletBC
boundary = 'bottom top'
variable = v
value = 0
penalty = ${penalty}
[]
[temperature_in]
type = ADPenaltyDirichletBC
boundary = left
variable = temperature
value = 1
penalty = ${penalty}
[]
[momentum_x_advection_in]
type = ADConservativeAdvectionBC
boundary = left
variable = u
velocity_function = v_inlet
primal_dirichlet_value = u_inlet
primal_coefficient = rho
[]
[momentum_y_advection_in]
type = ADConservativeAdvectionBC
boundary = left
variable = v
velocity_function = v_inlet
primal_dirichlet_value = 0
primal_coefficient = rho
[]
[mass_in]
type = ADConservativeAdvectionBC
boundary = left
variable = pressure
velocity_function = v_inlet
advected_quantity = -1
[]
[temperature_advection_in]
type = ADConservativeAdvectionBC
boundary = left
variable = temperature
velocity_function = v_inlet
primal_dirichlet_value = 1
[]
[momentum_x_advection_out]
type = ADConservativeAdvectionBC
boundary = right
variable = u
velocity_mat_prop = velocity
advected_quantity = rhou
[]
[momentum_y_advection_out]
type = ADConservativeAdvectionBC
boundary = right
variable = v
velocity_mat_prop = velocity
advected_quantity = rhov
[]
[mass_out]
type = ADConservativeAdvectionBC
boundary = right
variable = pressure
velocity_mat_prop = velocity
advected_quantity = -1
[]
[temperature_advection_out]
type = ADConservativeAdvectionBC
boundary = right
variable = temperature
velocity_mat_prop = velocity
[]
[]
[Materials]
[const]
type = ADGenericConstantMaterial
prop_names = rho
prop_values = ${rho}
[]
[const_reg]
type = GenericConstantMaterial
prop_names = mu
prop_values = ${mu}
[]
[velocity]
type = ADVectorFromComponentVariablesMaterial
vector_prop_name = velocity
u = u
v = v
[]
[rhou]
type = ADParsedMaterial
property_name = rhou
coupled_variables = u
material_property_names = rho
expression = 'rho*u'
[]
[rhov]
type = ADParsedMaterial
property_name = rhov
coupled_variables = v
material_property_names = rho
expression = 'rho*v'
[]
[]
[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-14
[]
[Postprocessors]
[outlet_velocity]
type = SideAverageValue
boundary = right
variable = u
[]
[outlet_temperature]
type = SideAverageValue
boundary = right
variable = temperature
[]
[]
[Outputs]
csv = true
[]
(modules/navier_stokes/test/tests/finite_element/ins/cg-dg-hybrid/channel-flow/channel-hybrid.i)
mu = 1.1
rho = 1.1
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 10
ymin = -1
ymax = 1
nx = 100
ny = 20
[]
[]
[Variables]
[u]
family = MONOMIAL
[]
[v]
family = MONOMIAL
[]
[pressure][]
[]
[Kernels]
[momentum_x_convection]
type = ADConservativeAdvection
variable = u
velocity_material = 'velocity'
advected_quantity = 'rhou'
[]
[momentum_x_diffusion]
type = MatDiffusion
variable = u
diffusivity = 'mu'
[]
[momentum_x_pressure]
type = PressureGradient
integrate_p_by_parts = false
variable = u
pressure = pressure
component = 0
[]
[momentum_y_convection]
type = ADConservativeAdvection
variable = v
velocity_material = 'velocity'
advected_quantity = 'rhov'
[]
[momentum_y_diffusion]
type = MatDiffusion
variable = v
diffusivity = 'mu'
[]
[momentum_y_pressure]
type = PressureGradient
integrate_p_by_parts = false
variable = v
pressure = pressure
component = 1
[]
[mass]
type = ADConservativeAdvection
variable = pressure
velocity_material = velocity
advected_quantity = -1
[]
[]
[DGKernels]
[momentum_x_convection]
type = ADDGAdvection
variable = u
velocity = 'velocity'
advected_quantity = 'rhou'
[]
[momentum_x_diffusion]
type = DGDiffusion
variable = u
sigma = 6
epsilon = -1
diff = 'mu'
[]
[momentum_y_convection]
type = ADDGAdvection
variable = v
velocity = 'velocity'
advected_quantity = 'rhov'
[]
[momentum_y_diffusion]
type = DGDiffusion
variable = v
sigma = 6
epsilon = -1
diff = 'mu'
[]
[]
[Functions]
[v_inlet]
type = ParsedVectorFunction
expression_x = '1'
[]
[]
[BCs]
[u_walls]
type = DGFunctionDiffusionDirichletBC
boundary = 'bottom top'
variable = u
sigma = 6
epsilon = -1
function = '0'
diff = 'mu'
[]
[v_walls]
type = DGFunctionDiffusionDirichletBC
boundary = 'bottom top'
variable = v
sigma = 6
epsilon = -1
function = '0'
diff = 'mu'
[]
[u_in]
type = ADConservativeAdvectionBC
boundary = 'left'
variable = u
velocity_function = v_inlet
primal_dirichlet_value = 1
primal_coefficient = 'rho'
[]
[v_in]
type = ADConservativeAdvectionBC
boundary = 'left'
variable = v
velocity_function = v_inlet
primal_dirichlet_value = 0
primal_coefficient = 'rho'
[]
[p_in]
type = ADConservativeAdvectionBC
boundary = 'left'
variable = pressure
velocity_function = v_inlet
advected_quantity = -1
[]
[u_out]
type = ADConservativeAdvectionBC
boundary = 'right'
variable = u
velocity_mat_prop = 'velocity'
advected_quantity = 'rhou'
[]
[v_out]
type = ADConservativeAdvectionBC
boundary = 'right'
variable = v
velocity_mat_prop = 'velocity'
advected_quantity = 'rhov'
[]
[p_out]
type = DirichletBC
variable = pressure
boundary = 'right'
value = 0
[]
[]
[Materials]
[const]
type = ADGenericConstantMaterial
prop_names = 'rho'
prop_values = '${rho}'
[]
[const_reg]
type = GenericConstantMaterial
prop_names = 'mu'
prop_values = '${mu}'
[]
[vel]
type = ADVectorFromComponentVariablesMaterial
vector_prop_name = 'velocity'
u = u
v = v
[]
[rhou]
type = ADParsedMaterial
property_name = 'rhou'
coupled_variables = 'u'
material_property_names = 'rho'
expression = 'rho*u'
[]
[rhov]
type = ADParsedMaterial
property_name = 'rhov'
coupled_variables = 'v'
material_property_names = 'rho'
expression = 'rho*v'
[]
[]
[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]
exodus = true
[]
(modules/navier_stokes/test/tests/finite_element/ins/cg-dg-hybrid/lid-driven/hybrid-cg-dg.i)
mu = 1
rho = 1
l = 200
U = 1
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = ${l}
ymin = 0
ymax = ${l}
nx = 20
ny = 20
[]
[corner_node]
type = ExtraNodesetGenerator
new_boundary = 'pinned_node'
nodes = '0'
input = gen
[]
[]
[Variables]
[u]
family = MONOMIAL
[]
[v]
family = MONOMIAL
[]
[pressure][]
[]
[Kernels]
[momentum_x_convection]
type = ADConservativeAdvection
variable = u
velocity_material = 'velocity'
advected_quantity = 'rhou'
[]
[momentum_x_diffusion]
type = MatDiffusion
variable = u
diffusivity = 'mu'
[]
[momentum_x_pressure]
type = PressureGradient
integrate_p_by_parts = false
variable = u
pressure = pressure
component = 0
[]
[momentum_y_convection]
type = ADConservativeAdvection
variable = v
velocity_material = 'velocity'
advected_quantity = 'rhov'
[]
[momentum_y_diffusion]
type = MatDiffusion
variable = v
diffusivity = 'mu'
[]
[momentum_y_pressure]
type = PressureGradient
integrate_p_by_parts = false
variable = v
pressure = pressure
component = 1
[]
[mass]
type = ADConservativeAdvection
variable = pressure
velocity_material = velocity
advected_quantity = -1
[]
[]
[DGKernels]
[momentum_x_convection]
type = ADDGAdvection
variable = u
velocity = 'velocity'
advected_quantity = 'rhou'
[]
[momentum_x_diffusion]
type = DGDiffusion
variable = u
sigma = 6
epsilon = -1
diff = 'mu'
[]
[momentum_y_convection]
type = ADDGAdvection
variable = v
velocity = 'velocity'
advected_quantity = 'rhov'
[]
[momentum_y_diffusion]
type = DGDiffusion
variable = v
sigma = 6
epsilon = -1
diff = 'mu'
[]
[]
[BCs]
[u_walls]
type = DGFunctionDiffusionDirichletBC
boundary = 'left bottom right'
variable = u
sigma = 6
epsilon = -1
function = '0'
diff = 'mu'
[]
[v_walls]
type = DGFunctionDiffusionDirichletBC
boundary = 'left bottom right top'
variable = v
sigma = 6
epsilon = -1
function = '0'
diff = 'mu'
[]
[u_top]
type = DGFunctionDiffusionDirichletBC
boundary = 'top'
variable = u
sigma = 6
epsilon = -1
function = '${U}'
diff = 'mu'
[]
[pressure_pin]
type = DirichletBC
variable = pressure
boundary = 'pinned_node'
value = 0
[]
[]
[Materials]
[const]
type = ADGenericConstantMaterial
prop_names = 'rho'
prop_values = '${rho}'
[]
[const_reg]
type = GenericConstantMaterial
prop_names = 'mu'
prop_values = '${mu}'
[]
[vel]
type = ADVectorFromComponentVariablesMaterial
vector_prop_name = 'velocity'
u = u
v = v
[]
[rhou]
type = ADParsedMaterial
property_name = 'rhou'
coupled_variables = 'u'
material_property_names = 'rho'
expression = 'rho*u'
[]
[rhov]
type = ADParsedMaterial
property_name = 'rhov'
coupled_variables = 'v'
material_property_names = 'rho'
expression = 'rho*v'
[]
[]
[AuxVariables]
[vel_x]
family = MONOMIAL
order = CONSTANT
[]
[vel_y]
family = MONOMIAL
order = CONSTANT
[]
[p]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[vel_x]
type = ProjectionAux
variable = vel_x
v = u
[]
[vel_y]
type = ProjectionAux
variable = vel_y
v = v
[]
[p]
type = ProjectionAux
variable = p
v = pressure
[]
[]
[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]
exodus = true
[]
[Postprocessors]
[Re]
type = ParsedPostprocessor
expression = '${rho} * ${U} * ${l} / ${mu}'
[]
[]
(modules/navier_stokes/test/tests/finite_element/ins/compatibility/dg-stokes-rz.i)
mu = 1
sigma = 20
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 1
xmax = 2
ymin = 0
ymax = 1
nx = 4
ny = 4
elem_type = TRI3
[]
coord_type = RZ
rz_coord_axis = Y
[]
[Variables]
[vel_r]
family = MONOMIAL
order = FIRST
[]
[vel_z]
family = MONOMIAL
order = FIRST
[]
[pressure]
family = MONOMIAL
order = CONSTANT
[]
[lambda]
family = SCALAR
order = FIRST
[]
[]
[Kernels]
[momentum_r_diffusion]
type = MatDiffusion
variable = vel_r
diffusivity = mu
[]
[momentum_r_radial_viscous]
type = ADMatReaction
variable = vel_r
reaction_rate = negative_mu_over_r_squared
[]
[momentum_r_pressure]
type = PressureGradient
variable = vel_r
pressure = pressure
component = 0
integrate_p_by_parts = true
[]
[momentum_r_forcing]
type = BodyForce
variable = vel_r
function = forcing_r
[]
[momentum_z_diffusion]
type = MatDiffusion
variable = vel_z
diffusivity = mu
[]
[momentum_z_pressure]
type = PressureGradient
variable = vel_z
pressure = pressure
component = 1
integrate_p_by_parts = true
[]
[momentum_z_forcing]
type = BodyForce
variable = vel_z
function = forcing_z
[]
[mass]
type = ADConservativeAdvection
variable = pressure
velocity_material = velocity
advected_quantity = -1
[]
[mean_zero_pressure]
type = ScalarLagrangeMultiplier
variable = pressure
lambda = lambda
[]
[]
[ScalarKernels]
[mean_zero_pressure_lm]
type = AverageValueConstraint
variable = lambda
pp_name = pressure_integral
value = 0
[]
[]
[DGKernels]
[momentum_r_diffusion]
type = DGDiffusion
variable = vel_r
sigma = ${sigma}
epsilon = -1
diff = mu
[]
[momentum_z_diffusion]
type = DGDiffusion
variable = vel_z
sigma = ${sigma}
epsilon = -1
diff = mu
[]
[momentum_r_pressure]
type = INSPressureGradientDGKernel
variable = vel_r
pressure = pressure
component = 0
[]
[momentum_z_pressure]
type = INSPressureGradientDGKernel
variable = vel_z
pressure = pressure
component = 1
[]
[mass]
type = ADDGAdvection
variable = pressure
velocity = velocity
advected_quantity = -1
[]
[]
[BCs]
[momentum_r_diffusion]
type = DGFunctionDiffusionDirichletBC
boundary = 'left right bottom top'
variable = vel_r
sigma = ${sigma}
epsilon = -1
function = exact_vel_r
diff = mu
[]
[momentum_z_diffusion]
type = DGFunctionDiffusionDirichletBC
boundary = 'left right bottom top'
variable = vel_z
sigma = ${sigma}
epsilon = -1
function = exact_vel_z
diff = mu
[]
[momentum_r_pressure]
type = INSPressureGradientBC
boundary = 'left right bottom top'
variable = vel_r
pressure = pressure
component = 0
[]
[momentum_z_pressure]
type = INSPressureGradientBC
boundary = 'left right bottom top'
variable = vel_z
pressure = pressure
component = 1
[]
[mass]
type = ADConservativeAdvectionBC
boundary = 'left right bottom top'
variable = pressure
velocity_function = exact_velocity
advected_quantity = -1
[]
[]
[Functions]
[exact_vel_r]
type = ParsedFunction
expression = '-pi*x*sin(pi*(x-1))*cos(pi*y)'
[]
[exact_vel_z]
type = ParsedFunction
expression = '(2*sin(pi*(x-1))+pi*x*cos(pi*(x-1)))*sin(pi*y)'
[]
[exact_pressure]
type = ParsedFunction
expression = 'sin(pi*(x-1))*cos(2*pi*y)'
[]
[exact_velocity]
type = ParsedVectorFunction
expression_x = '-pi*x*sin(pi*(x-1))*cos(pi*y)'
expression_y = '(2*sin(pi*(x-1))+pi*x*cos(pi*(x-1)))*sin(pi*y)'
[]
[forcing_r]
type = ParsedFunction
symbol_names = mu
symbol_values = ${mu}
expression = 'mu*(-2*pi^3*x*sin(pi*(x-1))+3*pi^2*cos(pi*(x-1)))*cos(pi*y)+pi*cos(pi*(x-1))*cos(2*pi*y)'
[]
[forcing_z]
type = ParsedFunction
symbol_names = mu
symbol_values = ${mu}
expression = 'pi*(mu*(2*pi^2*x*cos(pi*(x-1))+7*pi*sin(pi*(x-1))-3*cos(pi*(x-1))/x)-4*sin(pi*(x-1))*cos(pi*y))*sin(pi*y)'
[]
[negative_mu_over_r_squared]
type = ParsedFunction
symbol_names = mu
symbol_values = ${mu}
expression = '-mu/(x*x)'
[]
[]
[Materials]
[diffusivity]
type = GenericConstantMaterial
prop_names = mu
prop_values = ${mu}
[]
[velocity]
type = ADVectorFromComponentVariablesMaterial
vector_prop_name = velocity
u = vel_r
v = vel_z
[]
[radial_reaction]
type = ADGenericFunctionMaterial
prop_names = negative_mu_over_r_squared
prop_values = negative_mu_over_r_squared
[]
[]
[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_abs_tol = 1e-11
nl_rel_tol = 1e-12
[]
[Postprocessors]
[pressure_integral]
type = ElementIntegralVariablePostprocessor
variable = pressure
execute_on = linear
[]
[h]
type = AverageElementSize
execute_on = timestep_end
[]
[L2_vel_r]
type = ElementL2Error
variable = vel_r
function = exact_vel_r
execute_on = timestep_end
[]
[L2_vel_z]
type = ElementL2Error
variable = vel_z
function = exact_vel_z
execute_on = timestep_end
[]
[L2_pressure]
type = ElementL2Error
variable = pressure
function = exact_pressure
execute_on = timestep_end
[]
[]
[Outputs]
csv = true
[]
(modules/navier_stokes/test/tests/finite_element/ins/cg-dg-hybrid/mms/lid-driven/hybrid-cg-dg-mms.i)
rho=1.1
mu=1.1
cp=1.1
k=1.1
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = -1
xmax = 1.0
ymin = -1
ymax = 1.0
nx = 2
ny = 2
[]
[corner_node]
type = ExtraNodesetGenerator
new_boundary = 'pinned_node'
nodes = '0'
input = gen
[]
[]
[Variables]
[u]
family = MONOMIAL
[]
[v]
family = MONOMIAL
[]
[pressure][]
[T]
family = MONOMIAL
[]
[]
[Kernels]
[momentum_x_convection]
type = ADConservativeAdvection
variable = u
velocity_material = 'velocity'
advected_quantity = 'rhou'
[]
[momentum_x_diffusion]
type = MatDiffusion
variable = u
diffusivity = 'mu'
[]
[momentum_x_pressure]
type = PressureGradient
integrate_p_by_parts = false
variable = u
pressure = pressure
component = 0
[]
[u_forcing]
type = BodyForce
variable = u
function = forcing_u
[]
[momentum_y_convection]
type = ADConservativeAdvection
variable = v
velocity_material = 'velocity'
advected_quantity = 'rhov'
[]
[momentum_y_diffusion]
type = MatDiffusion
variable = v
diffusivity = 'mu'
[]
[momentum_y_pressure]
type = PressureGradient
integrate_p_by_parts = false
variable = v
pressure = pressure
component = 1
[]
[v_forcing]
type = BodyForce
variable = v
function = forcing_v
[]
[mass]
type = ADConservativeAdvection
variable = pressure
velocity_material = velocity
advected_quantity = -1
[]
[p_forcing]
type = BodyForce
variable = pressure
function = forcing_p
[]
[T_convection]
type = ADConservativeAdvection
variable = T
velocity_material = 'velocity'
advected_quantity = 'rho_cp_temp'
[]
[T_diffusion]
type = MatDiffusion
variable = T
diffusivity = 'k'
[]
[T_forcing]
type = BodyForce
variable = T
function = forcing_T
[]
[]
[DGKernels]
[momentum_x_convection]
type = ADDGAdvection
variable = u
velocity = 'velocity'
advected_quantity = 'rhou'
[]
[momentum_x_diffusion]
type = DGDiffusion
variable = u
sigma = 6
epsilon = -1
diff = 'mu'
[]
[momentum_y_convection]
type = ADDGAdvection
variable = v
velocity = 'velocity'
advected_quantity = 'rhov'
[]
[momentum_y_diffusion]
type = DGDiffusion
variable = v
sigma = 6
epsilon = -1
diff = 'mu'
[]
[T_convection]
type = ADDGAdvection
variable = T
velocity = 'velocity'
advected_quantity = 'rho_cp_temp'
[]
[T_diffusion]
type = DGDiffusion
variable = T
sigma = 6
epsilon = -1
diff = 'k'
[]
[]
[BCs]
[u_walls]
type = DGFunctionDiffusionDirichletBC
boundary = 'left bottom right top'
variable = u
sigma = 6
epsilon = -1
function = exact_u
diff = 'mu'
[]
[v_walls]
type = DGFunctionDiffusionDirichletBC
boundary = 'left bottom right top'
variable = v
sigma = 6
epsilon = -1
function = exact_v
diff = 'mu'
[]
[pressure_pin]
type = FunctionDirichletBC
variable = pressure
boundary = 'pinned_node'
function = 'exact_p'
[]
[T_walls]
type = DGFunctionDiffusionDirichletBC
boundary = 'left bottom right top'
variable = T
sigma = 6
epsilon = -1
function = exact_T
diff = 'k'
[]
[]
[Materials]
[const]
type = ADGenericConstantMaterial
prop_names = 'rho cp'
prop_values = '${rho} ${cp}'
[]
[const_reg]
type = GenericConstantMaterial
prop_names = 'mu k'
prop_values = '${mu} ${k}'
[]
[vel]
type = ADVectorFromComponentVariablesMaterial
vector_prop_name = 'velocity'
u = u
v = v
[]
[rhou]
type = ADParsedMaterial
property_name = 'rhou'
coupled_variables = 'u'
material_property_names = 'rho'
expression = 'rho*u'
[]
[rhov]
type = ADParsedMaterial
property_name = 'rhov'
coupled_variables = 'v'
material_property_names = 'rho'
expression = 'rho*v'
[]
[rho_cp]
type = ADParsedMaterial
property_name = 'rho_cp'
material_property_names = 'rho cp'
expression = 'rho*cp'
[]
[rho_cp_temp]
type = ADParsedMaterial
property_name = 'rho_cp_temp'
material_property_names = 'rho cp'
coupled_variables = 'T'
expression = 'rho*cp*T'
[]
[]
[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*sin(x)*sin((1/2)*y*pi) + (1/2)*pi*sin(y)*sin((1/2)*x*pi)'
[]
[exact_T]
type = ParsedFunction
expression = 'cos(x)*cos(y)'
[]
[forcing_T]
type = ParsedFunction
expression = '-cp*rho*sin(x)*sin(y)*cos(x)*cos((1/2)*y*pi) - cp*rho*sin(x)*sin(y)*cos(y)*cos((1/2)*x*pi) - 1/2*pi*cp*rho*sin(x)*sin((1/2)*y*pi)*cos(x)*cos(y) - 1/2*pi*cp*rho*sin(y)*sin((1/2)*x*pi)*cos(x)*cos(y) + 2*k*cos(x)*cos(y)'
symbol_names = 'rho cp k'
symbol_values = '${rho} ${cp} ${k}'
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_mat_solver_type -mat_mumps_icntl_14'
petsc_options_value = 'lu NONZERO mumps 300'
nl_rel_tol = 1e-12
[]
[Outputs]
exodus = true
csv = true
[]
[Postprocessors]
[h]
type = AverageElementSize
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[L2u]
type = ElementL2Error
variable = u
function = exact_u
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[L2v]
variable = v
function = exact_v
type = ElementL2Error
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[L2T]
variable = T
function = exact_T
type = ElementL2Error
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[L2p]
variable = pressure
function = exact_p
type = ElementL2Error
outputs = 'console csv'
execute_on = 'timestep_end'
[]
[]