https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
NavierStokesLHDGAssemblyHelper Class Reference

Implements all the methods for assembling a hybridized local discontinuous Galerkin (LDG-H), which is a type of HDG method, discretization of the incompressible Navier-Stokes equations. More...

#include <NavierStokesLHDGAssemblyHelper.h>

Inheritance diagram for NavierStokesLHDGAssemblyHelper:
[legend]

Public Member Functions

 NavierStokesLHDGAssemblyHelper (const MooseObject *moose_obj, MaterialPropertyInterface *mpi, MooseVariableDependencyInterface *mvdi, const TransientInterface *const ti, const FEProblemBase &fe_problem, SystemBase &sys, const MooseMesh &mesh, const THREAD_ID tid)
 
void checkCoupling ()
 
const Moose::Functor< Real > * defaultFunctor (const std::string &name)
 
const Moose::Functor< ADReal > * defaultFunctor (const std::string &name)
 

Static Public Member Functions

static InputParameters validParams ()
 
static std::string deduceFunctorName (const std::string &name, const InputParameters &params)
 

Protected Member Functions

RealVectorValue rhoVelCrossVelResidual (const MooseArray< Number > &u_sol, const MooseArray< Number > &v_sol, const unsigned int qp, const unsigned int vel_component)
 
RealVectorValue rhoVelCrossVelJacobian (const MooseArray< Number > &u_sol, const MooseArray< Number > &v_sol, const unsigned int qp, const unsigned int vel_component, const unsigned int vel_j_component, const MooseArray< std::vector< Real > > &phi, const unsigned int j)
 
void scalarVolumeResidual (const MooseArray< Gradient > &vel_gradient, const unsigned int vel_component, const Moose::Functor< Real > &body_force, const MooseArray< Real > &JxW, const libMesh::QBase &qrule, const Elem *const current_elem, const MooseArray< Point > &q_point, DenseVector< Number > &scalar_re)
 Compute the volumetric contributions to a velocity residual for a provided velocity gradient and stress.
 
void scalarVolumeJacobian (const unsigned int vel_component, const MooseArray< Real > &JxW, const libMesh::QBase &qrule, DenseMatrix< Number > &scalar_vector_jac, DenseMatrix< Number > &scalar_u_vel_jac, DenseMatrix< Number > &scalar_v_vel_jac, DenseMatrix< Number > &scalar_p_jac)
 Compute the volumetric contributions to a velocity Jacobian.
 
void pressureVolumeResidual (const Moose::Functor< Real > &pressure_mms_forcing_function, const MooseArray< Real > &JxW, const libMesh::QBase &qrule, const Elem *const current_elem, const MooseArray< Point > &q_point, DenseVector< Number > &pressure_re, DenseVector< Number > &global_lm_re)
 Compute the volumetric contributions to the pressure residual, e.g.
 
void pressureVolumeJacobian (const MooseArray< Real > &JxW, const libMesh::QBase &qrule, DenseMatrix< Number > &p_u_vel_jac, DenseMatrix< Number > &p_v_vel_jac, DenseMatrix< Number > &p_global_lm_jac, DenseMatrix< Number > &global_lm_p_jac)
 Compute the volumetric contributions to the pressure Jacobian, e.g.
 
void pressureFaceResidual (const MooseArray< Real > &JxW_face, const libMesh::QBase &qrule_face, const MooseArray< Point > &normals, DenseVector< Number > &pressure_re)
 
void pressureFaceJacobian (const MooseArray< Real > &JxW_face, const libMesh::QBase &qrule_face, const MooseArray< Point > &normals, DenseMatrix< Number > &p_lm_u_vel_jac, DenseMatrix< Number > &p_lm_v_vel_jac)
 
void scalarFaceResidual (const MooseArray< Gradient > &vector_sol, const MooseArray< Number > &scalar_sol, const MooseArray< Number > &lm_sol, const unsigned int vel_component, const MooseArray< Real > &JxW_face, const libMesh::QBase &qrule_face, const MooseArray< Point > &normals, DenseVector< Number > &scalar_re)
 
void scalarFaceJacobian (const unsigned int vel_component, const MooseArray< Real > &JxW_face, const libMesh::QBase &qrule_face, const MooseArray< Point > &normals, DenseMatrix< Number > &scalar_vector_jac, DenseMatrix< Number > &scalar_scalar_jac, DenseMatrix< Number > &scalar_lm_jac, DenseMatrix< Number > &scalar_p_jac, DenseMatrix< Number > &scalar_lm_u_vel_jac, DenseMatrix< Number > &scalar_lm_v_vel_jac)
 
void lmFaceResidual (const MooseArray< Gradient > &vector_sol, const MooseArray< Number > &scalar_sol, const MooseArray< Number > &lm_sol, const unsigned int vel_component, const MooseArray< Real > &JxW_face, const libMesh::QBase &qrule_face, const MooseArray< Point > &normals, const Elem *const neigh, DenseVector< Number > &lm_re)
 
void lmFaceJacobian (const unsigned int vel_component, const MooseArray< Real > &JxW_face, const libMesh::QBase &qrule_face, const MooseArray< Point > &normals, const Elem *const neigh, DenseMatrix< Number > &lm_vec_jac, DenseMatrix< Number > &lm_scalar_jac, DenseMatrix< Number > &lm_lm_jac, DenseMatrix< Number > &lm_p_jac, DenseMatrix< Number > &lm_lm_u_vel_jac, DenseMatrix< Number > &lm_lm_v_vel_jac)
 
void pressureDirichletResidual (const std::array< const Moose::Functor< Real > *, 3 > &dirichlet_vel, const MooseArray< Real > &JxW_face, const libMesh::QBase &qrule_face, const MooseArray< Point > &normals, const Elem *const current_elem, const unsigned int current_side, const MooseArray< Point > &q_point_face, DenseVector< Number > &pressure_re)
 
void scalarDirichletResidual (const MooseArray< Gradient > &vector_sol, const MooseArray< Number > &scalar_sol, const unsigned int vel_component, const std::array< const Moose::Functor< Real > *, 3 > &dirichlet_vel, const MooseArray< Real > &JxW_face, const libMesh::QBase &qrule_face, const MooseArray< Point > &normals, const Elem *const current_elem, const unsigned int current_side, const MooseArray< Point > &q_point_face, DenseVector< Number > &scalar_re)
 
void scalarDirichletJacobian (const unsigned int vel_component, const MooseArray< Real > &JxW_face, const libMesh::QBase &qrule_face, const MooseArray< Point > &normals, DenseMatrix< Number > &scalar_vector_jac, DenseMatrix< Number > &scalar_scalar_jac, DenseMatrix< Number > &scalar_pressure_jac)
 
std::string deduceFunctorName (const std::string &name) const
 
void vectorVolumeResidual (const MooseArray< Gradient > &vector_sol, const MooseArray< Number > &scalar_sol, const MooseArray< Real > &JxW, const libMesh::QBase &qrule, DenseVector< Number > &vector_re)
 
void vectorVolumeJacobian (const MooseArray< Real > &JxW, const libMesh::QBase &qrule, DenseMatrix< Number > &vector_vector_jac, DenseMatrix< Number > &vector_scalar_jac)
 
void scalarVolumeResidual (const MooseArray< Gradient > &vector_field, const Moose::Functor< Real > &source, const MooseArray< Real > &JxW, const libMesh::QBase &qrule, const Elem *const current_elem, const MooseArray< Point > &q_point, DenseVector< Number > &scalar_re)
 
void scalarVolumeJacobian (const MooseArray< Real > &JxW, const libMesh::QBase &qrule, DenseMatrix< Number > &scalar_vector_jac)
 
void vectorFaceResidual (const MooseArray< Number > &lm_sol, const MooseArray< Real > &JxW_face, const libMesh::QBase &qrule_face, const MooseArray< Point > &normals, DenseVector< Number > &vector_re)
 
void vectorFaceJacobian (const MooseArray< Real > &JxW_face, const libMesh::QBase &qrule_face, const MooseArray< Point > &normals, DenseMatrix< Number > &vector_lm_jac)
 
void scalarFaceResidual (const MooseArray< Gradient > &vector_sol, const MooseArray< Number > &scalar_sol, const MooseArray< Number > &lm_sol, const MooseArray< Real > &JxW_face, const libMesh::QBase &qrule_face, const MooseArray< Point > &normals, DenseVector< Number > &scalar_re)
 
void scalarFaceJacobian (const MooseArray< Real > &JxW_face, const libMesh::QBase &qrule_face, const MooseArray< Point > &normals, DenseMatrix< Number > &scalar_vector_jac, DenseMatrix< Number > &scalar_scalar_jac, DenseMatrix< Number > &scalar_lm_jac)
 
void lmFaceResidual (const MooseArray< Gradient > &vector_sol, const MooseArray< Number > &scalar_sol, const MooseArray< Number > &lm_sol, const MooseArray< Real > &JxW_face, const libMesh::QBase &qrule_face, const MooseArray< Point > &normals, DenseVector< Number > &lm_re)
 
void lmFaceJacobian (const MooseArray< Real > &JxW_face, const libMesh::QBase &qrule_face, const MooseArray< Point > &normals, DenseMatrix< Number > &lm_vec_jac, DenseMatrix< Number > &lm_scalar_jac, DenseMatrix< Number > &lm_lm_jac)
 
void vectorDirichletResidual (const Moose::Functor< Real > &dirichlet_value, const MooseArray< Real > &JxW_face, const libMesh::QBase &qrule_face, const MooseArray< Point > &normals, const Elem *const current_elem, const unsigned int current_side, const MooseArray< Point > &q_point_face, DenseVector< Number > &vector_re)
 
void scalarDirichletResidual (const MooseArray< Gradient > &vector_sol, const MooseArray< Number > &scalar_sol, const Moose::Functor< Real > &dirichlet_value, const MooseArray< Real > &JxW_face, const libMesh::QBase &qrule_face, const MooseArray< Point > &normals, const Elem *const current_elem, const unsigned int current_side, const MooseArray< Point > &q_point_face, DenseVector< Number > &scalar_re)
 
void scalarDirichletJacobian (const MooseArray< Real > &JxW_face, const libMesh::QBase &qrule_face, const MooseArray< Point > &normals, DenseMatrix< Number > &scalar_vector_jac, DenseMatrix< Number > &scalar_scalar_jac)
 
void createIdentityResidual (const MooseArray< Real > &JxW, const libMesh::QBase &qrule, const MooseArray< std::vector< Real > > &phi, const MooseArray< Number > &sol, DenseVector< Number > &re)
 
void createIdentityJacobian (const MooseArray< Real > &JxW, const libMesh::QBase &qrule, const MooseArray< std::vector< Real > > &phi, DenseMatrix< Number > &ke)
 
const Moose::Functor< T > & getFunctor (const std::string &name)
 
const Moose::Functor< T > & getFunctor (const std::string &name, THREAD_ID tid)
 
const Moose::Functor< T > & getFunctor (const std::string &name, SubProblem &subproblem)
 
const Moose::Functor< T > & getFunctor (const std::string &name, SubProblem &subproblem, THREAD_ID tid)
 
bool isFunctor (const std::string &name) const
 
bool isFunctor (const std::string &name, const SubProblem &subproblem) const
 
Moose::ElemArg makeElemArg (const Elem *elem, bool correct_skewnewss=false) const
 
void checkFunctorSupportsSideIntegration (const std::string &name, bool qp_integration)
 
const Moose::Functor< T > & getFunctorByName (const std::string &name)
 

Protected Attributes

const MooseVariableFE< Real > & _v_var
 
const MooseVariableFE< Real > *const _w_var
 
const MooseVariableFE< RealVectorValue > & _grad_v_var
 
const MooseVariableFE< RealVectorValue > *const _grad_w_var
 
const MooseVariableFE< Real > & _v_face_var
 
const MooseVariableFE< Real > *const _w_face_var
 
const MooseVariableFE< Real > & _pressure_var
 
const MooseVariableScalar *const _enclosure_lm_var
 
const std::vector< dof_id_type > & _qv_dof_indices
 Containers for dof indices.
 
const std::vector< dof_id_type > & _v_dof_indices
 
const std::vector< dof_id_type > & _lm_v_dof_indices
 
const std::vector< dof_id_type > *const _qw_dof_indices
 
const std::vector< dof_id_type > *const _w_dof_indices
 
const std::vector< dof_id_type > *const _lm_w_dof_indices
 
const std::vector< dof_id_type > & _p_dof_indices
 
const std::vector< dof_id_type > *const _global_lm_dof_indices
 
const MooseArray< Gradient > & _qv_sol
 local solutions at quadrature points
 
const MooseArray< Number > & _v_sol
 
const MooseArray< Number > & _lm_v_sol
 
const MooseArray< Gradient > *const _qw_sol
 
const MooseArray< Number > *const _w_sol
 
const MooseArray< Number > *const _lm_w_sol
 
const MooseArray< Number > & _p_sol
 
const MooseArray< Number > *const _global_lm_dof_value
 
const Real _rho
 The density.
 
DenseVector< Number > _grad_u_vel_re
 
DenseVector< Number > _grad_v_vel_re
 
DenseVector< Number > _u_vel_re
 
DenseVector< Number > _v_vel_re
 
DenseVector< Number > _lm_u_vel_re
 
DenseVector< Number > _lm_v_vel_re
 
DenseVector< Number > _p_re
 
DenseVector< Number > _global_lm_re
 
DenseMatrix< Number > _grad_u_grad_u_jac
 
DenseMatrix< Number > _grad_u_u_jac
 
DenseMatrix< Number > _grad_v_grad_v_jac
 
DenseMatrix< Number > _grad_v_v_jac
 
DenseMatrix< Number > _u_grad_u_jac
 
DenseMatrix< Number > _v_grad_v_jac
 
DenseMatrix< Number > _u_u_jac
 
DenseMatrix< Number > _u_v_jac
 
DenseMatrix< Number > _v_u_jac
 
DenseMatrix< Number > _v_v_jac
 
DenseMatrix< Number > _u_p_jac
 
DenseMatrix< Number > _v_p_jac
 
DenseMatrix< Number > _p_u_jac
 
DenseMatrix< Number > _p_v_jac
 
DenseMatrix< Number > _p_global_lm_jac
 
DenseMatrix< Number > _global_lm_p_jac
 
DenseMatrix< Number > _grad_u_lm_u_jac
 
DenseMatrix< Number > _grad_v_lm_v_jac
 
DenseMatrix< Number > _u_lm_u_jac
 
DenseMatrix< Number > _v_lm_v_jac
 
DenseMatrix< Number > _u_lm_v_jac
 
DenseMatrix< Number > _v_lm_u_jac
 
DenseMatrix< Number > _lm_u_grad_u_jac
 
DenseMatrix< Number > _lm_v_grad_v_jac
 
DenseMatrix< Number > _lm_u_u_jac
 
DenseMatrix< Number > _lm_v_v_jac
 
DenseMatrix< Number > _lm_u_lm_u_jac
 
DenseMatrix< Number > _lm_v_lm_v_jac
 
DenseMatrix< Number > _lm_u_p_jac
 
DenseMatrix< Number > _lm_v_p_jac
 
DenseMatrix< Number > _lm_u_lm_v_jac
 
DenseMatrix< Number > _lm_v_lm_u_jac
 
DenseMatrix< Number > _p_lm_u_jac
 
DenseMatrix< Number > _p_lm_v_jac
 
const MooseVariableFE< Real > & _u_var
 
const MooseVariableFE< RealVectorValue > & _grad_u_var
 
const MooseVariableFE< Real > & _u_face_var
 
const std::vector< dof_id_type > & _qu_dof_indices
 
const std::vector< dof_id_type > & _u_dof_indices
 
const std::vector< dof_id_type > & _lm_u_dof_indices
 
const MooseArray< libMesh::Gradient > & _qu_sol
 
const MooseArray< Number > & _u_sol
 
const MooseArray< Number > & _lm_u_sol
 
const MooseArray< std::vector< RealVectorValue > > & _vector_phi
 
const MooseArray< std::vector< Real > > & _scalar_phi
 
const MooseArray< std::vector< RealVectorValue > > & _grad_scalar_phi
 
const MooseArray< std::vector< Real > > & _div_vector_phi
 
const MooseArray< std::vector< RealVectorValue > > & _vector_phi_face
 
const MooseArray< std::vector< Real > > & _scalar_phi_face
 
const MooseArray< std::vector< Real > > & _lm_phi_face
 
const MaterialProperty< Real > & _diff
 
const TransientInterface_ti
 
const Real _tau
 
const Elem * _cached_elem
 
DenseVector< Number > _vector_re
 
DenseVector< Number > _scalar_re
 
DenseVector< Number > _lm_re
 
DenseMatrix< Number > _vector_vector_jac
 
DenseMatrix< Number > _vector_scalar_jac
 
DenseMatrix< Number > _scalar_vector_jac
 
DenseMatrix< Number > _scalar_scalar_jac
 
DenseMatrix< Number > _scalar_lm_jac
 
DenseMatrix< Number > _lm_scalar_jac
 
DenseMatrix< Number > _lm_lm_jac
 
DenseMatrix< Number > _vector_lm_jac
 
DenseMatrix< Number > _lm_vector_jac
 

Private Member Functions

const Moose::Functor< T > * defaultFunctor (const std::string &name)
 
const Moose::Functor< Real > * defaultFunctor (const std::string &name)
 
const Moose::Functor< ADReal > * defaultFunctor (const std::string &name)
 
const Moose::Functor< T > & getFunctorByName (const std::string &name, SubProblem &subproblem, THREAD_ID tid)
 
virtual bool isADObject () const override
 

Private Attributes

const MooseObject_moose_obj
 
const FEProblemBase_dhah_fe_problem
 
const SystemBase_dhah_sys
 
const InputParameters_fi_params
 
const std::string _fi_name
 
SubProblem *const _fi_subproblem
 
const THREAD_ID _fi_tid
 
std::vector< std::unique_ptr< Moose::Functor< Real > > > _default_real_functors
 
std::vector< std::unique_ptr< Moose::Functor< ADReal > > > _default_ad_real_functors
 

Detailed Description

Implements all the methods for assembling a hybridized local discontinuous Galerkin (LDG-H), which is a type of HDG method, discretization of the incompressible Navier-Stokes equations.

These routines may be called by both HDG kernels and integrated boundary conditions. The implementation here is based on "An implicit high-order hybridizable discontinuous Galerkin method for the incompressible Navier-Stokes equations" by Nguyen and Cockburn

Definition at line 21 of file NavierStokesLHDGAssemblyHelper.h.

Constructor & Destructor Documentation

◆ NavierStokesLHDGAssemblyHelper()

NavierStokesLHDGAssemblyHelper::NavierStokesLHDGAssemblyHelper ( const MooseObject moose_obj,
MaterialPropertyInterface mpi,
MooseVariableDependencyInterface mvdi,
const TransientInterface *const  ti,
const FEProblemBase fe_problem,
SystemBase sys,
const MooseMesh mesh,
const THREAD_ID  tid 
)

Definition at line 42 of file NavierStokesLHDGAssemblyHelper.C.

51 : DiffusionLHDGAssemblyHelper(moose_obj, mpi, mvdi, ti, fe_problem, sys, tid),
52 // vars
53 _v_var(sys.getFieldVariable<Real>(tid, moose_obj->getParam<NonlinearVariableName>("v"))),
54 _w_var(mesh.dimension() > 2
55 ? &sys.getFieldVariable<Real>(tid, moose_obj->getParam<NonlinearVariableName>("w"))
56 : nullptr),
57 _grad_v_var(sys.getFieldVariable<RealVectorValue>(
58 tid, moose_obj->getParam<NonlinearVariableName>("grad_v"))),
59 _grad_w_var(mesh.dimension() > 2
60 ? &sys.getFieldVariable<RealVectorValue>(
61 tid, moose_obj->getParam<NonlinearVariableName>("grad_w"))
62 : nullptr),
64 sys.getFieldVariable<Real>(tid, moose_obj->getParam<NonlinearVariableName>("face_v"))),
66 mesh.dimension() > 2
67 ? &sys.getFieldVariable<Real>(tid, moose_obj->getParam<NonlinearVariableName>("face_w"))
68 : nullptr),
70 sys.getFieldVariable<Real>(tid, moose_obj->getParam<NonlinearVariableName>(NS::pressure))),
71 _enclosure_lm_var(moose_obj->isParamValid("enclosure_lm")
72 ? &sys.getScalarVariable(
73 tid, moose_obj->getParam<NonlinearVariableName>("enclosure_lm"))
74 : nullptr),
75 // dof indices
76 _qv_dof_indices(_grad_v_var.dofIndices()),
77 _v_dof_indices(_v_var.dofIndices()),
78 _lm_v_dof_indices(_v_face_var.dofIndices()),
79 _qw_dof_indices(_grad_w_var ? &_grad_w_var->dofIndices() : nullptr),
80 _w_dof_indices(_w_var ? &_w_var->dofIndices() : nullptr),
81 _lm_w_dof_indices(_w_face_var ? &_w_face_var->dofIndices() : nullptr),
82 _p_dof_indices(_pressure_var.dofIndices()),
84 // solutions
85 _qv_sol(_grad_v_var.sln()),
86 _v_sol(_v_var.sln()),
88 _qw_sol(_grad_w_var ? &_grad_w_var->sln() : nullptr),
89 _w_sol(_w_var ? &_w_var->sln() : nullptr),
90 _lm_w_sol(_w_face_var ? &_w_face_var->sln() : nullptr),
91 _p_sol(_pressure_var.sln()),
93 _rho(moose_obj->getParam<Real>(NS::density))
94{
95 if (mesh.dimension() > 2)
96 mooseError("3D not yet implemented");
97
102
103 const auto vel_type = _u_var.feType();
104 auto check_type = [&vel_type](const auto & var)
105 {
106 if (vel_type != var.feType())
108 var.name(),
109 " does not have the same finite element type as the x-component velocity. All scalar "
110 "field finite element types must be the same for the Navier-Stokes L-HDG implementation");
111 };
112 check_type(_v_var);
113 if (_w_var)
114 check_type(*_w_var);
115 check_type(_pressure_var);
116
117 const auto grad_type = _grad_u_var.feType();
118 auto check_grad_type = [&grad_type](const auto & var)
119 {
120 if (grad_type != var.feType())
122 var.name(),
123 "does not have the same finite element type as the x-component velocity gradient. All "
124 "vector field finite element types must be the same for the Navier-Stokes L-HDG "
125 "implementation");
126 };
127 check_grad_type(_grad_v_var);
128 if (_grad_w_var)
129 check_grad_type(*_grad_w_var);
130
131 const auto lm_type = _u_face_var.feType();
132 auto check_lm_type = [&lm_type](const auto & var)
133 {
134 if (lm_type != var.feType())
135 mooseError(var.name(),
136 "does not have the same finite element type as the x-component face variable. All "
137 "face variable finite element types must be the same for the Navier-Stokes L-HDG "
138 "implementation");
139 };
140 check_lm_type(_v_face_var);
141 if (_w_face_var)
142 check_lm_type(*_w_face_var);
143}
void mooseError(Args &&... args)
const MooseVariableFE< Real > & _u_var
const MooseVariableFE< Real > & _u_face_var
const MooseVariableFE< RealVectorValue > & _grad_u_var
const T & getParam(const std::string &name) const
const libMesh::FEType & feType() const
void addMooseVariableDependency(MooseVariableFieldBase *var)
const std::vector< dof_id_type > & _lm_v_dof_indices
const std::vector< dof_id_type > & _qv_dof_indices
Containers for dof indices.
const MooseVariableFE< Real > *const _w_var
const std::vector< dof_id_type > *const _w_dof_indices
const MooseArray< Gradient > & _qv_sol
local solutions at quadrature points
const MooseArray< Number > *const _lm_w_sol
const std::vector< dof_id_type > & _p_dof_indices
const MooseVariableFE< Real > & _v_face_var
const MooseVariableFE< Real > & _pressure_var
const MooseVariableFE< RealVectorValue > *const _grad_w_var
const std::vector< dof_id_type > *const _global_lm_dof_indices
const MooseArray< Number > *const _w_sol
const MooseArray< Gradient > *const _qw_sol
const MooseVariableFE< RealVectorValue > & _grad_v_var
const std::vector< dof_id_type > *const _qw_dof_indices
const MooseArray< Number > *const _global_lm_dof_value
const std::vector< dof_id_type > *const _lm_w_dof_indices
const MooseVariableFE< Real > *const _w_face_var
const MooseVariableScalar *const _enclosure_lm_var
const std::vector< dof_id_type > & _v_dof_indices
MooseVariableFE< T > & getFieldVariable(THREAD_ID tid, const std::string &var_name)
MeshBase & mesh
VectorValue< Real > RealVectorValue
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

Member Function Documentation

◆ lmFaceJacobian()

void NavierStokesLHDGAssemblyHelper::lmFaceJacobian ( const unsigned int  vel_component,
const MooseArray< Real > &  JxW_face,
const libMesh::QBase qrule_face,
const MooseArray< Point > &  normals,
const Elem *const  neigh,
DenseMatrix< Number > &  lm_vec_jac,
DenseMatrix< Number > &  lm_scalar_jac,
DenseMatrix< Number > &  lm_lm_jac,
DenseMatrix< Number > &  lm_p_jac,
DenseMatrix< Number > &  lm_lm_u_vel_jac,
DenseMatrix< Number > &  lm_lm_v_vel_jac 
)
protected

Definition at line 476 of file NavierStokesLHDGAssemblyHelper.C.

487{
489 JxW_face, qrule_face, normals, lm_vec_jac, lm_scalar_jac, lm_lm_jac);
490
491 for (const auto i : make_range(lm_p_jac.m()))
492 for (const auto qp : make_range(qrule_face.n_points()))
493 {
494 for (const auto j : make_range(lm_p_jac.n()))
495 {
496 Gradient p_phi;
497 p_phi(vel_component) = _scalar_phi_face[j][qp];
498 lm_p_jac(i, j) += JxW_face[qp] * _lm_phi_face[i][qp] * (p_phi * normals[qp]);
499 }
500
501 for (const auto j : make_range(lm_lm_u_vel_jac.n()))
502 if (neigh)
503 {
504 // derivatives wrt 0th component of velocity
505 {
506 const auto rho_vel_cross_vel =
507 rhoVelCrossVelJacobian(_lm_u_sol, _lm_v_sol, qp, vel_component, 0, _lm_phi_face, j);
508 lm_lm_u_vel_jac(i, j) +=
509 JxW_face[qp] * _lm_phi_face[i][qp] * rho_vel_cross_vel * normals[qp];
510 }
511 // derivatives wrt 1th component of velocity
512 {
513 const auto rho_vel_cross_vel =
514 rhoVelCrossVelJacobian(_lm_u_sol, _lm_v_sol, qp, vel_component, 1, _lm_phi_face, j);
515 lm_lm_v_vel_jac(i, j) +=
516 JxW_face[qp] * _lm_phi_face[i][qp] * rho_vel_cross_vel * normals[qp];
517 }
518 }
519 }
520}
for(PetscInt i=0;i< nvars;++i)
void lmFaceJacobian(const MooseArray< Real > &JxW_face, const libMesh::QBase &qrule_face, const MooseArray< Point > &normals, DenseMatrix< Number > &lm_vec_jac, DenseMatrix< Number > &lm_scalar_jac, DenseMatrix< Number > &lm_lm_jac)
const MooseArray< std::vector< Real > > & _lm_phi_face
const MooseArray< Number > & _lm_u_sol
const MooseArray< std::vector< Real > > & _scalar_phi_face
RealVectorValue rhoVelCrossVelJacobian(const MooseArray< Number > &u_sol, const MooseArray< Number > &v_sol, const unsigned int qp, const unsigned int vel_component, const unsigned int vel_j_component, const MooseArray< std::vector< Real > > &phi, const unsigned int j)
NumberVectorValue Gradient
if(subdm)
IntRange< T > make_range(T beg, T end)

Referenced by NavierStokesLHDGOutflowBC::computeJacobian(), and NavierStokesLHDGKernel::computeJacobianOnSide().

◆ lmFaceResidual()

void NavierStokesLHDGAssemblyHelper::lmFaceResidual ( const MooseArray< Gradient > &  vector_sol,
const MooseArray< Number > &  scalar_sol,
const MooseArray< Number > &  lm_sol,
const unsigned int  vel_component,
const MooseArray< Real > &  JxW_face,
const libMesh::QBase qrule_face,
const MooseArray< Point > &  normals,
const Elem *const  neigh,
DenseVector< Number > &  lm_re 
)
protected

Definition at line 442 of file NavierStokesLHDGAssemblyHelper.C.

451{
453 vector_sol, scalar_sol, lm_sol, JxW_face, qrule_face, normals, lm_re);
454
455 for (const auto qp : make_range(qrule_face.n_points()))
456 {
457 Gradient qp_p;
458 qp_p(vel_component) = _p_sol[qp];
459 const auto rho_vel_cross_vel = rhoVelCrossVelResidual(_lm_u_sol, _lm_v_sol, qp, vel_component);
460
461 for (const auto i : make_range(lm_re.size()))
462 {
463 // pressure
464 lm_re(i) += JxW_face[qp] * _lm_phi_face[i][qp] * (qp_p * normals[qp]);
465
466 // If we are an internal face we add the convective term. On the outflow boundary we do not
467 // zero out the convection term, e.g. we are going to set q + p + tau * (u - u_hat) to zero
468 if (neigh)
469 // lm from convection term
470 lm_re(i) += JxW_face[qp] * _lm_phi_face[i][qp] * rho_vel_cross_vel * normals[qp];
471 }
472 }
473}
void lmFaceResidual(const MooseArray< Gradient > &vector_sol, const MooseArray< Number > &scalar_sol, const MooseArray< Number > &lm_sol, const MooseArray< Real > &JxW_face, const libMesh::QBase &qrule_face, const MooseArray< Point > &normals, DenseVector< Number > &lm_re)
RealVectorValue rhoVelCrossVelResidual(const MooseArray< Number > &u_sol, const MooseArray< Number > &v_sol, const unsigned int qp, const unsigned int vel_component)

Referenced by NavierStokesLHDGOutflowBC::computeResidual(), and NavierStokesLHDGKernel::computeResidualOnSide().

◆ pressureDirichletResidual()

void NavierStokesLHDGAssemblyHelper::pressureDirichletResidual ( const std::array< const Moose::Functor< Real > *, 3 > &  dirichlet_vel,
const MooseArray< Real > &  JxW_face,
const libMesh::QBase qrule_face,
const MooseArray< Point > &  normals,
const Elem *const  current_elem,
const unsigned int  current_side,
const MooseArray< Point > &  q_point_face,
DenseVector< Number > &  pressure_re 
)
protected

Definition at line 523 of file NavierStokesLHDGAssemblyHelper.C.

532{
533 for (const auto qp : make_range(qrule_face.n_points()))
534 {
535 const Moose::ElemSideQpArg elem_side_qp_arg{
536 current_elem, current_side, qp, &qrule_face, q_point_face[qp]};
537 const auto time_arg = _ti.determineState();
538 const RealVectorValue dirichlet_velocity((*dirichlet_vel[0])(elem_side_qp_arg, time_arg),
539 (*dirichlet_vel[1])(elem_side_qp_arg, time_arg),
540 (*dirichlet_vel[2])(elem_side_qp_arg, time_arg));
541 const auto vdotn = dirichlet_velocity * normals[qp];
542 for (const auto i : make_range(pressure_re.size()))
543 pressure_re(i) += JxW_face[qp] * vdotn * _scalar_phi_face[i][qp];
544 }
545}
const TransientInterface & _ti
Moose::StateArg determineState() const

Referenced by NavierStokesLHDGVelocityDirichletBC::computeResidual().

◆ pressureFaceJacobian()

void NavierStokesLHDGAssemblyHelper::pressureFaceJacobian ( const MooseArray< Real > &  JxW_face,
const libMesh::QBase qrule_face,
const MooseArray< Point > &  normals,
DenseMatrix< Number > &  p_lm_u_vel_jac,
DenseMatrix< Number > &  p_lm_v_vel_jac 
)
protected

Definition at line 335 of file NavierStokesLHDGAssemblyHelper.C.

340{
341 mooseAssert((p_lm_u_vel_jac.m() == p_lm_v_vel_jac.m()) &&
342 (p_lm_u_vel_jac.n() == p_lm_v_vel_jac.n()),
343 "We already checked that lm finite element types are the same, so these matrices "
344 "should be the same size");
345 for (const auto i : make_range(p_lm_u_vel_jac.m()))
346 for (const auto j : make_range(p_lm_u_vel_jac.n()))
347 for (const auto qp : make_range(qrule_face.n_points()))
348 {
349 {
350 const Gradient phi(_lm_phi_face[j][qp], 0);
351 p_lm_u_vel_jac(i, j) += JxW_face[qp] * phi * normals[qp] * _scalar_phi_face[i][qp];
352 }
353 {
354 const Gradient phi(0, _lm_phi_face[j][qp]);
355 p_lm_v_vel_jac(i, j) += JxW_face[qp] * phi * normals[qp] * _scalar_phi_face[i][qp];
356 }
357 }
358}
unsigned int n() const
unsigned int m() const

Referenced by NavierStokesLHDGOutflowBC::computeJacobian(), and NavierStokesLHDGKernel::computeJacobianOnSide().

◆ pressureFaceResidual()

void NavierStokesLHDGAssemblyHelper::pressureFaceResidual ( const MooseArray< Real > &  JxW_face,
const libMesh::QBase qrule_face,
const MooseArray< Point > &  normals,
DenseVector< Number > &  pressure_re 
)
protected

Definition at line 320 of file NavierStokesLHDGAssemblyHelper.C.

324{
325 for (const auto qp : make_range(qrule_face.n_points()))
326 {
327 const Gradient vel(_lm_u_sol[qp], _lm_v_sol[qp]);
328 const auto vdotn = vel * normals[qp];
329 for (const auto i : make_range(pressure_re.size()))
330 pressure_re(i) += JxW_face[qp] * vdotn * _scalar_phi_face[i][qp];
331 }
332}

Referenced by NavierStokesLHDGOutflowBC::computeResidual(), and NavierStokesLHDGKernel::computeResidualOnSide().

◆ pressureVolumeJacobian()

void NavierStokesLHDGAssemblyHelper::pressureVolumeJacobian ( const MooseArray< Real > &  JxW,
const libMesh::QBase qrule,
DenseMatrix< Number > &  p_u_vel_jac,
DenseMatrix< Number > &  p_v_vel_jac,
DenseMatrix< Number > &  p_global_lm_jac,
DenseMatrix< Number > &  global_lm_p_jac 
)
protected

Compute the volumetric contributions to the pressure Jacobian, e.g.

the conservation of mass equation

Parameters
i_offsetThe local degree of freedom offset for the pressure
u_j_offsetThe local degree of freedom offset for the x-component of velocity
v_j_offsetThe local degree of freedom offset for the y-component of velocity
p_j_offsetThe local degree of freedom offset for the pressure
global_lm_i_offsetThe local degree of freedom offset for the global Lagrange multiplier that removes the pressure nullspace

Definition at line 256 of file NavierStokesLHDGAssemblyHelper.C.

262{
263 for (const auto qp : make_range(qrule.n_points()))
264 {
265 for (const auto i : make_range(p_u_vel_jac.m()))
266 {
267 for (const auto j : make_range(p_u_vel_jac.n()))
268 {
269 {
270 const Gradient phi(_scalar_phi[j][qp], 0);
271 p_u_vel_jac(i, j) -= JxW[qp] * (_grad_scalar_phi[i][qp] * phi);
272 }
273 {
274 const Gradient phi(0, _scalar_phi[j][qp]);
275 p_v_vel_jac(i, j) -= JxW[qp] * (_grad_scalar_phi[i][qp] * phi);
276 }
277 }
279 p_global_lm_jac(i, 0) -= JxW[qp] * _scalar_phi[i][qp];
280 }
281
283 {
284 for (const auto j : make_range(global_lm_p_jac.n()))
285 global_lm_p_jac(0, j) -= JxW[qp] * _scalar_phi[j][qp];
286 }
287 }
288}
const MooseArray< std::vector< Real > > & _scalar_phi
const MooseArray< std::vector< RealVectorValue > > & _grad_scalar_phi

Referenced by NavierStokesLHDGKernel::computeJacobian().

◆ pressureVolumeResidual()

void NavierStokesLHDGAssemblyHelper::pressureVolumeResidual ( const Moose::Functor< Real > &  pressure_mms_forcing_function,
const MooseArray< Real > &  JxW,
const libMesh::QBase qrule,
const Elem *const  current_elem,
const MooseArray< Point > &  q_point,
DenseVector< Number > &  pressure_re,
DenseVector< Number > &  global_lm_re 
)
protected

Compute the volumetric contributions to the pressure residual, e.g.

the conservation of mass equation

Parameters
i_offsetThe local degree of freedom offset for the pressure
global_lm_i_offsetThe local degree of freedom offset for the global Lagrange multiplier that removes the pressure nullspace

Definition at line 218 of file NavierStokesLHDGAssemblyHelper.C.

226{
227 for (const auto qp : make_range(qrule.n_points()))
228 {
229 // Prepare forcing function
230 const auto f = pressure_mms_forcing_function(
231 Moose::ElemQpArg{current_elem, qp, &qrule, q_point[qp]}, _ti.determineState());
232
233 const Gradient vel(_u_sol[qp], _v_sol[qp]);
234 for (const auto i : make_range(pressure_re.size()))
235 {
236 pressure_re(i) -= JxW[qp] * (_grad_scalar_phi[i][qp] * vel);
237
238 // Pressure equation forcing function RHS
239 pressure_re(i) -= JxW[qp] * _scalar_phi[i][qp] * f;
240
242 {
243 mooseAssert(
245 "There should only be one degree of freedom for removing the pressure nullspace");
246 pressure_re(i) -= JxW[qp] * _scalar_phi[i][qp] * (*_global_lm_dof_value)[0];
247 }
248 }
249
251 global_lm_re(0) -= JxW[qp] * _p_sol[qp];
252 }
253}
Real f(Real x)
Test function for Brents method.
const MooseArray< Number > & _u_sol
unsigned int size() const

Referenced by NavierStokesLHDGKernel::computeResidual().

◆ rhoVelCrossVelJacobian()

RealVectorValue NavierStokesLHDGAssemblyHelper::rhoVelCrossVelJacobian ( const MooseArray< Number > &  u_sol,
const MooseArray< Number > &  v_sol,
const unsigned int  qp,
const unsigned int  vel_component,
const unsigned int  vel_j_component,
const MooseArray< std::vector< Real > > &  phi,
const unsigned int  j 
)
protected
Parameters
u_solThe x-velocity solution, can correspond to either the volumetric or face velocity
v_solThe y-velocity solution, can correspond to either the volumetric or face velocity

Definition at line 301 of file NavierStokesLHDGAssemblyHelper.C.

308{
309 const RealVectorValue U(u_sol[qp], v_sol[qp]);
310 RealVectorValue vector_phi;
311 vector_phi(vel_j_component) = phi[j][qp];
312 auto ret = vector_phi * U(vel_component);
313 if (vel_component == vel_j_component)
314 ret += U * phi[j][qp];
315 ret *= _rho;
316 return ret;
317}

Referenced by lmFaceJacobian(), scalarFaceJacobian(), and scalarVolumeJacobian().

◆ rhoVelCrossVelResidual()

RealVectorValue NavierStokesLHDGAssemblyHelper::rhoVelCrossVelResidual ( const MooseArray< Number > &  u_sol,
const MooseArray< Number > &  v_sol,
const unsigned int  qp,
const unsigned int  vel_component 
)
protected
Parameters
u_solThe x-velocity solution, can correspond to either the volumetric or face velocity
v_solThe y-velocity solution, can correspond to either the volumetric or face velocity

Definition at line 291 of file NavierStokesLHDGAssemblyHelper.C.

295{
296 const RealVectorValue U(u_sol[qp], v_sol[qp]);
297 return _rho * U * U(vel_component);
298}

Referenced by lmFaceResidual(), scalarFaceResidual(), and scalarVolumeResidual().

◆ scalarDirichletJacobian()

void NavierStokesLHDGAssemblyHelper::scalarDirichletJacobian ( const unsigned int  vel_component,
const MooseArray< Real > &  JxW_face,
const libMesh::QBase qrule_face,
const MooseArray< Point > &  normals,
DenseMatrix< Number > &  scalar_vector_jac,
DenseMatrix< Number > &  scalar_scalar_jac,
DenseMatrix< Number > &  scalar_pressure_jac 
)
protected

Definition at line 598 of file NavierStokesLHDGAssemblyHelper.C.

605{
607 JxW_face, qrule_face, normals, scalar_vector_jac, scalar_scalar_jac);
608
609 for (const auto i : make_range(scalar_pressure_jac.m()))
610 for (const auto j : make_range(scalar_pressure_jac.n()))
611 for (const auto qp : make_range(qrule_face.n_points()))
612 {
613 Gradient p_phi;
614 p_phi(vel_component) = _scalar_phi_face[j][qp];
615 // pressure
616 scalar_pressure_jac(i, j) += JxW_face[qp] * _scalar_phi_face[i][qp] * (p_phi * normals[qp]);
617 }
618}
void scalarDirichletJacobian(const MooseArray< Real > &JxW_face, const libMesh::QBase &qrule_face, const MooseArray< Point > &normals, DenseMatrix< Number > &scalar_vector_jac, DenseMatrix< Number > &scalar_scalar_jac)

Referenced by NavierStokesLHDGVelocityDirichletBC::computeJacobian().

◆ scalarDirichletResidual()

void NavierStokesLHDGAssemblyHelper::scalarDirichletResidual ( const MooseArray< Gradient > &  vector_sol,
const MooseArray< Number > &  scalar_sol,
const unsigned int  vel_component,
const std::array< const Moose::Functor< Real > *, 3 > &  dirichlet_vel,
const MooseArray< Real > &  JxW_face,
const libMesh::QBase qrule_face,
const MooseArray< Point > &  normals,
const Elem *const  current_elem,
const unsigned int  current_side,
const MooseArray< Point > &  q_point_face,
DenseVector< Number > &  scalar_re 
)
protected

Definition at line 548 of file NavierStokesLHDGAssemblyHelper.C.

560{
562 scalar_sol,
563 *dirichlet_vel[vel_component],
564 JxW_face,
565 qrule_face,
566 normals,
567 current_elem,
568 current_side,
569 q_point_face,
570 scalar_re);
571
572 for (const auto qp : make_range(qrule_face.n_points()))
573 {
574 Gradient qp_p;
575 qp_p(vel_component) = _p_sol[qp];
576
577 const Moose::ElemSideQpArg elem_side_qp_arg{
578 current_elem, current_side, qp, &qrule_face, q_point_face[qp]};
579 const auto time_arg = _ti.determineState();
580 const RealVectorValue dirichlet_velocity((*dirichlet_vel[0])(elem_side_qp_arg, time_arg),
581 (*dirichlet_vel[1])(elem_side_qp_arg, time_arg),
582 (*dirichlet_vel[2])(elem_side_qp_arg, time_arg));
583 const auto scalar_value = dirichlet_velocity(vel_component);
584
585 for (const auto i : make_range(scalar_re.size()))
586 {
587 // pressure
588 scalar_re(i) += JxW_face[qp] * _scalar_phi_face[i][qp] * (qp_p * normals[qp]);
589
590 // dirichlet lm from advection term
591 scalar_re(i) += JxW_face[qp] * _scalar_phi_face[i][qp] *
592 (_rho * dirichlet_velocity * normals[qp]) * scalar_value;
593 }
594 }
595}
void scalarDirichletResidual(const MooseArray< Gradient > &vector_sol, const MooseArray< Number > &scalar_sol, const Moose::Functor< Real > &dirichlet_value, const MooseArray< Real > &JxW_face, const libMesh::QBase &qrule_face, const MooseArray< Point > &normals, const Elem *const current_elem, const unsigned int current_side, const MooseArray< Point > &q_point_face, DenseVector< Number > &scalar_re)

Referenced by NavierStokesLHDGVelocityDirichletBC::computeResidual().

◆ scalarFaceJacobian()

void NavierStokesLHDGAssemblyHelper::scalarFaceJacobian ( const unsigned int  vel_component,
const MooseArray< Real > &  JxW_face,
const libMesh::QBase qrule_face,
const MooseArray< Point > &  normals,
DenseMatrix< Number > &  scalar_vector_jac,
DenseMatrix< Number > &  scalar_scalar_jac,
DenseMatrix< Number > &  scalar_lm_jac,
DenseMatrix< Number > &  scalar_p_jac,
DenseMatrix< Number > &  scalar_lm_u_vel_jac,
DenseMatrix< Number > &  scalar_lm_v_vel_jac 
)
protected

Definition at line 391 of file NavierStokesLHDGAssemblyHelper.C.

402{
404 JxW_face, qrule_face, normals, scalar_vector_jac, scalar_scalar_jac, scalar_lm_jac);
405
406 for (const auto i : make_range(scalar_lm_u_vel_jac.m()))
407 for (const auto qp : make_range(qrule_face.n_points()))
408 {
409 for (const auto j : make_range(scalar_p_jac.n()))
410 {
411 Gradient p_phi;
412 p_phi(vel_component) = _scalar_phi_face[j][qp];
413 // pressure
414 scalar_p_jac(i, j) += JxW_face[qp] * _scalar_phi_face[i][qp] * (p_phi * normals[qp]);
415 }
416
417 for (const auto j : make_range(scalar_lm_u_vel_jac.n()))
418 {
419 //
420 // from convection term
421 //
422
423 // derivatives wrt 0th component of velocity
424 {
425 const auto rho_vel_cross_vel =
426 rhoVelCrossVelJacobian(_lm_u_sol, _lm_v_sol, qp, vel_component, 0, _lm_phi_face, j);
427 scalar_lm_u_vel_jac(i, j) +=
428 JxW_face[qp] * _scalar_phi_face[i][qp] * rho_vel_cross_vel * normals[qp];
429 }
430 // derivatives wrt 1th component of velocity
431 {
432 const auto rho_vel_cross_vel =
433 rhoVelCrossVelJacobian(_lm_u_sol, _lm_v_sol, qp, vel_component, 1, _lm_phi_face, j);
434 scalar_lm_v_vel_jac(i, j) +=
435 JxW_face[qp] * _scalar_phi_face[i][qp] * rho_vel_cross_vel * normals[qp];
436 }
437 }
438 }
439}
void scalarFaceJacobian(const MooseArray< Real > &JxW_face, const libMesh::QBase &qrule_face, const MooseArray< Point > &normals, DenseMatrix< Number > &scalar_vector_jac, DenseMatrix< Number > &scalar_scalar_jac, DenseMatrix< Number > &scalar_lm_jac)

Referenced by NavierStokesLHDGOutflowBC::computeJacobian(), and NavierStokesLHDGKernel::computeJacobianOnSide().

◆ scalarFaceResidual()

void NavierStokesLHDGAssemblyHelper::scalarFaceResidual ( const MooseArray< Gradient > &  vector_sol,
const MooseArray< Number > &  scalar_sol,
const MooseArray< Number > &  lm_sol,
const unsigned int  vel_component,
const MooseArray< Real > &  JxW_face,
const libMesh::QBase qrule_face,
const MooseArray< Point > &  normals,
DenseVector< Number > &  scalar_re 
)
protected

Definition at line 361 of file NavierStokesLHDGAssemblyHelper.C.

369{
371 vector_sol, scalar_sol, lm_sol, JxW_face, qrule_face, normals, scalar_re);
372
373 for (const auto qp : make_range(qrule_face.n_points()))
374 {
375 Gradient qp_p;
376 qp_p(vel_component) = _p_sol[qp];
377 const auto rho_vel_cross_vel = rhoVelCrossVelResidual(_lm_u_sol, _lm_v_sol, qp, vel_component);
378
379 for (const auto i : make_range(scalar_re.size()))
380 {
381 // pressure
382 scalar_re(i) += JxW_face[qp] * _scalar_phi_face[i][qp] * (qp_p * normals[qp]);
383
384 // lm from convection term
385 scalar_re(i) += JxW_face[qp] * _scalar_phi_face[i][qp] * rho_vel_cross_vel * normals[qp];
386 }
387 }
388}
void scalarFaceResidual(const MooseArray< Gradient > &vector_sol, const MooseArray< Number > &scalar_sol, const MooseArray< Number > &lm_sol, const MooseArray< Real > &JxW_face, const libMesh::QBase &qrule_face, const MooseArray< Point > &normals, DenseVector< Number > &scalar_re)

Referenced by NavierStokesLHDGOutflowBC::computeResidual(), and NavierStokesLHDGKernel::computeResidualOnSide().

◆ scalarVolumeJacobian()

void NavierStokesLHDGAssemblyHelper::scalarVolumeJacobian ( const unsigned int  vel_component,
const MooseArray< Real > &  JxW,
const libMesh::QBase qrule,
DenseMatrix< Number > &  scalar_vector_jac,
DenseMatrix< Number > &  scalar_u_vel_jac,
DenseMatrix< Number > &  scalar_v_vel_jac,
DenseMatrix< Number > &  scalar_p_jac 
)
protected

Compute the volumetric contributions to a velocity Jacobian.

Parameters
i_offsetThe local degree of freedom offset for the velocity component
vel_gradient_j_offsetThe local degree of freedom offset for the associated velocity gradient
p_j_offsetThe local degree of freedom offset for the pressure
vel_componentThe velocity component
u_j_offsetThe local degree of freedom offset for the x-component velocity
v_j_offsetThe local degree of freedom offset for the y-component velocity

Definition at line 176 of file NavierStokesLHDGAssemblyHelper.C.

183{
184 DiffusionLHDGAssemblyHelper::scalarVolumeJacobian(JxW, qrule, scalar_vector_jac);
185
186 for (const auto i : make_range(scalar_vector_jac.m()))
187 for (const auto qp : make_range(qrule.n_points()))
188 {
189 // Scalar equation dependence on pressure dofs
190 for (const auto j : make_range(scalar_p_jac.n()))
191 {
192 Gradient p_phi;
193 p_phi(vel_component) = _scalar_phi[j][qp];
194 scalar_p_jac(i, j) -= JxW[qp] * (_grad_scalar_phi[i][qp] * p_phi);
195 }
196
197 // Scalar equation dependence on scalar dofs
198 mooseAssert(scalar_u_vel_jac.n() == scalar_v_vel_jac.n(), "These must be the same size");
199 for (const auto j : make_range(scalar_u_vel_jac.n()))
200 {
201 // derivatives wrt 0th component of velocity
202 {
203 const auto rho_vel_cross_vel =
204 rhoVelCrossVelJacobian(_u_sol, _v_sol, qp, vel_component, 0, _scalar_phi, j);
205 scalar_u_vel_jac(i, j) -= JxW[qp] * (_grad_scalar_phi[i][qp] * rho_vel_cross_vel);
206 }
207 // derivatives wrt 1th component of velocity
208 {
209 const auto rho_vel_cross_vel =
210 rhoVelCrossVelJacobian(_u_sol, _v_sol, qp, vel_component, 1, _scalar_phi, j);
211 scalar_v_vel_jac(i, j) -= JxW[qp] * (_grad_scalar_phi[i][qp] * rho_vel_cross_vel);
212 }
213 }
214 }
215}
void scalarVolumeJacobian(const MooseArray< Real > &JxW, const libMesh::QBase &qrule, DenseMatrix< Number > &scalar_vector_jac)

Referenced by NavierStokesLHDGKernel::computeJacobian().

◆ scalarVolumeResidual()

void NavierStokesLHDGAssemblyHelper::scalarVolumeResidual ( const MooseArray< Gradient > &  vel_gradient,
const unsigned int  vel_component,
const Moose::Functor< Real > &  body_force,
const MooseArray< Real > &  JxW,
const libMesh::QBase qrule,
const Elem *const  current_elem,
const MooseArray< Point > &  q_point,
DenseVector< Number > &  scalar_re 
)
protected

Compute the volumetric contributions to a velocity residual for a provided velocity gradient and stress.

Parameters
i_offsetThe local degree of freedom offset for the velocity component
vel_gradientThe velocity gradient component
vel_componentThe velocity component

Definition at line 146 of file NavierStokesLHDGAssemblyHelper.C.

154{
156 vel_gradient, body_force, JxW, qrule, current_elem, q_point, scalar_re);
157
158 for (const auto qp : make_range(qrule.n_points()))
159 {
160 const auto rho_vel_cross_vel = rhoVelCrossVelResidual(_u_sol, _v_sol, qp, vel_component);
161 Gradient qp_p;
162 qp_p(vel_component) = _p_sol[qp];
163
164 for (const auto i : index_range(scalar_re))
165 {
166 // Scalar equation dependence on pressure dofs
167 scalar_re(i) -= JxW[qp] * (_grad_scalar_phi[i][qp] * qp_p);
168
169 // Scalar equation dependence on scalar dofs
170 scalar_re(i) -= JxW[qp] * (_grad_scalar_phi[i][qp] * rho_vel_cross_vel);
171 }
172 }
173}
void scalarVolumeResidual(const MooseArray< Gradient > &vector_field, const Moose::Functor< Real > &source, const MooseArray< Real > &JxW, const libMesh::QBase &qrule, const Elem *const current_elem, const MooseArray< Point > &q_point, DenseVector< Number > &scalar_re)
auto index_range(const T &sizable)

Referenced by NavierStokesLHDGKernel::computeResidual().

◆ validParams()

InputParameters NavierStokesLHDGAssemblyHelper::validParams ( )
static

Definition at line 20 of file NavierStokesLHDGAssemblyHelper.C.

21{
23 params.addRequiredParam<NonlinearVariableName>(NS::pressure, "The pressure variable.");
24 params.addRequiredParam<NonlinearVariableName>("v", "The y-component of velocity");
25 params.addParam<NonlinearVariableName>("w", "The z-component of velocity");
26 params.renameParam("gradient_variable", "grad_u", "The gradient of the x-component of velocity");
27 params.addRequiredParam<NonlinearVariableName>("grad_v",
28 "The gradient of the y-component of velocity");
29 params.addParam<NonlinearVariableName>("grad_w", "The gradient of the z-component of velocity");
30 params.renameParam("face_variable", "face_u", "The x-component of the face velocity");
31 params.addRequiredParam<NonlinearVariableName>("face_v", "The y-component of the face velocity");
32 params.addParam<NonlinearVariableName>("face_w", "The z-component of the face velocity");
33 params.addParam<NonlinearVariableName>(
34 "enclosure_lm",
35 "For enclosed problems like the lid driven cavity this variable can be provided to remove "
36 "the pressure nullspace");
37 params.renameParam("diffusivity", NS::mu, "The dynamic viscosity");
38 params.addRequiredParam<Real>(NS::density, "The density");
39 return params;
40}
static InputParameters validParams()
static const std::string density
Definition NS.h:34
static const std::string mu
Definition NS.h:127
static const std::string pressure
Definition NS.h:57

Referenced by NavierStokesLHDGOutflowBC::validParams(), NavierStokesLHDGVelocityDirichletBC::validParams(), and NavierStokesLHDGKernel::validParams().

Member Data Documentation

◆ _enclosure_lm_var

const MooseVariableScalar* const NavierStokesLHDGAssemblyHelper::_enclosure_lm_var
protected

◆ _global_lm_dof_indices

const std::vector<dof_id_type>* const NavierStokesLHDGAssemblyHelper::_global_lm_dof_indices
protected

◆ _global_lm_dof_value

const MooseArray<Number>* const NavierStokesLHDGAssemblyHelper::_global_lm_dof_value
protected

Definition at line 236 of file NavierStokesLHDGAssemblyHelper.h.

Referenced by pressureVolumeResidual().

◆ _global_lm_p_jac

DenseMatrix<Number> NavierStokesLHDGAssemblyHelper::_global_lm_p_jac
protected

◆ _global_lm_re

DenseVector<Number> NavierStokesLHDGAssemblyHelper::_global_lm_re
protected

◆ _grad_u_grad_u_jac

DenseMatrix<Number> NavierStokesLHDGAssemblyHelper::_grad_u_grad_u_jac
protected

◆ _grad_u_lm_u_jac

DenseMatrix<Number> NavierStokesLHDGAssemblyHelper::_grad_u_lm_u_jac
protected

◆ _grad_u_u_jac

DenseMatrix<Number> NavierStokesLHDGAssemblyHelper::_grad_u_u_jac
protected

◆ _grad_u_vel_re

DenseVector<Number> NavierStokesLHDGAssemblyHelper::_grad_u_vel_re
protected

◆ _grad_v_grad_v_jac

DenseMatrix<Number> NavierStokesLHDGAssemblyHelper::_grad_v_grad_v_jac
protected

◆ _grad_v_lm_v_jac

DenseMatrix<Number> NavierStokesLHDGAssemblyHelper::_grad_v_lm_v_jac
protected

◆ _grad_v_v_jac

DenseMatrix<Number> NavierStokesLHDGAssemblyHelper::_grad_v_v_jac
protected

◆ _grad_v_var

const MooseVariableFE<RealVectorValue>& NavierStokesLHDGAssemblyHelper::_grad_v_var
protected

◆ _grad_v_vel_re

DenseVector<Number> NavierStokesLHDGAssemblyHelper::_grad_v_vel_re
protected

◆ _grad_w_var

const MooseVariableFE<RealVectorValue>* const NavierStokesLHDGAssemblyHelper::_grad_w_var
protected

Definition at line 212 of file NavierStokesLHDGAssemblyHelper.h.

Referenced by NavierStokesLHDGAssemblyHelper().

◆ _lm_u_grad_u_jac

DenseMatrix<Number> NavierStokesLHDGAssemblyHelper::_lm_u_grad_u_jac
protected

◆ _lm_u_lm_u_jac

DenseMatrix<Number> NavierStokesLHDGAssemblyHelper::_lm_u_lm_u_jac
protected

◆ _lm_u_lm_v_jac

DenseMatrix<Number> NavierStokesLHDGAssemblyHelper::_lm_u_lm_v_jac
protected

◆ _lm_u_p_jac

DenseMatrix<Number> NavierStokesLHDGAssemblyHelper::_lm_u_p_jac
protected

◆ _lm_u_u_jac

DenseMatrix<Number> NavierStokesLHDGAssemblyHelper::_lm_u_u_jac
protected

◆ _lm_u_vel_re

DenseVector<Number> NavierStokesLHDGAssemblyHelper::_lm_u_vel_re
protected

◆ _lm_v_dof_indices

const std::vector<dof_id_type>& NavierStokesLHDGAssemblyHelper::_lm_v_dof_indices
protected

◆ _lm_v_grad_v_jac

DenseMatrix<Number> NavierStokesLHDGAssemblyHelper::_lm_v_grad_v_jac
protected

◆ _lm_v_lm_u_jac

DenseMatrix<Number> NavierStokesLHDGAssemblyHelper::_lm_v_lm_u_jac
protected

◆ _lm_v_lm_v_jac

DenseMatrix<Number> NavierStokesLHDGAssemblyHelper::_lm_v_lm_v_jac
protected

◆ _lm_v_p_jac

DenseMatrix<Number> NavierStokesLHDGAssemblyHelper::_lm_v_p_jac
protected

◆ _lm_v_sol

const MooseArray<Number>& NavierStokesLHDGAssemblyHelper::_lm_v_sol
protected

◆ _lm_v_v_jac

DenseMatrix<Number> NavierStokesLHDGAssemblyHelper::_lm_v_v_jac
protected

◆ _lm_v_vel_re

DenseVector<Number> NavierStokesLHDGAssemblyHelper::_lm_v_vel_re
protected

◆ _lm_w_dof_indices

const std::vector<dof_id_type>* const NavierStokesLHDGAssemblyHelper::_lm_w_dof_indices
protected

Definition at line 224 of file NavierStokesLHDGAssemblyHelper.h.

◆ _lm_w_sol

const MooseArray<Number>* const NavierStokesLHDGAssemblyHelper::_lm_w_sol
protected

Definition at line 234 of file NavierStokesLHDGAssemblyHelper.h.

◆ _p_dof_indices

const std::vector<dof_id_type>& NavierStokesLHDGAssemblyHelper::_p_dof_indices
protected

◆ _p_global_lm_jac

DenseMatrix<Number> NavierStokesLHDGAssemblyHelper::_p_global_lm_jac
protected

◆ _p_lm_u_jac

DenseMatrix<Number> NavierStokesLHDGAssemblyHelper::_p_lm_u_jac
protected

◆ _p_lm_v_jac

DenseMatrix<Number> NavierStokesLHDGAssemblyHelper::_p_lm_v_jac
protected

◆ _p_re

DenseVector<Number> NavierStokesLHDGAssemblyHelper::_p_re
protected

◆ _p_sol

const MooseArray<Number>& NavierStokesLHDGAssemblyHelper::_p_sol
protected

◆ _p_u_jac

DenseMatrix<Number> NavierStokesLHDGAssemblyHelper::_p_u_jac
protected

◆ _p_v_jac

DenseMatrix<Number> NavierStokesLHDGAssemblyHelper::_p_v_jac
protected

◆ _pressure_var

const MooseVariableFE<Real>& NavierStokesLHDGAssemblyHelper::_pressure_var
protected

◆ _qv_dof_indices

const std::vector<dof_id_type>& NavierStokesLHDGAssemblyHelper::_qv_dof_indices
protected

◆ _qv_sol

const MooseArray<Gradient>& NavierStokesLHDGAssemblyHelper::_qv_sol
protected

◆ _qw_dof_indices

const std::vector<dof_id_type>* const NavierStokesLHDGAssemblyHelper::_qw_dof_indices
protected

Definition at line 222 of file NavierStokesLHDGAssemblyHelper.h.

◆ _qw_sol

const MooseArray<Gradient>* const NavierStokesLHDGAssemblyHelper::_qw_sol
protected

Definition at line 232 of file NavierStokesLHDGAssemblyHelper.h.

◆ _rho

const Real NavierStokesLHDGAssemblyHelper::_rho
protected

◆ _u_grad_u_jac

DenseMatrix<Number> NavierStokesLHDGAssemblyHelper::_u_grad_u_jac
protected

◆ _u_lm_u_jac

DenseMatrix<Number> NavierStokesLHDGAssemblyHelper::_u_lm_u_jac
protected

◆ _u_lm_v_jac

DenseMatrix<Number> NavierStokesLHDGAssemblyHelper::_u_lm_v_jac
protected

◆ _u_p_jac

DenseMatrix<Number> NavierStokesLHDGAssemblyHelper::_u_p_jac
protected

◆ _u_u_jac

DenseMatrix<Number> NavierStokesLHDGAssemblyHelper::_u_u_jac
protected

◆ _u_v_jac

DenseMatrix<Number> NavierStokesLHDGAssemblyHelper::_u_v_jac
protected

◆ _u_vel_re

DenseVector<Number> NavierStokesLHDGAssemblyHelper::_u_vel_re
protected

◆ _v_dof_indices

const std::vector<dof_id_type>& NavierStokesLHDGAssemblyHelper::_v_dof_indices
protected

◆ _v_face_var

const MooseVariableFE<Real>& NavierStokesLHDGAssemblyHelper::_v_face_var
protected

◆ _v_grad_v_jac

DenseMatrix<Number> NavierStokesLHDGAssemblyHelper::_v_grad_v_jac
protected

◆ _v_lm_u_jac

DenseMatrix<Number> NavierStokesLHDGAssemblyHelper::_v_lm_u_jac
protected

◆ _v_lm_v_jac

DenseMatrix<Number> NavierStokesLHDGAssemblyHelper::_v_lm_v_jac
protected

◆ _v_p_jac

DenseMatrix<Number> NavierStokesLHDGAssemblyHelper::_v_p_jac
protected

◆ _v_sol

const MooseArray<Number>& NavierStokesLHDGAssemblyHelper::_v_sol
protected

◆ _v_u_jac

DenseMatrix<Number> NavierStokesLHDGAssemblyHelper::_v_u_jac
protected

◆ _v_v_jac

DenseMatrix<Number> NavierStokesLHDGAssemblyHelper::_v_v_jac
protected

◆ _v_var

const MooseVariableFE<Real>& NavierStokesLHDGAssemblyHelper::_v_var
protected

◆ _v_vel_re

DenseVector<Number> NavierStokesLHDGAssemblyHelper::_v_vel_re
protected

◆ _w_dof_indices

const std::vector<dof_id_type>* const NavierStokesLHDGAssemblyHelper::_w_dof_indices
protected

Definition at line 223 of file NavierStokesLHDGAssemblyHelper.h.

◆ _w_face_var

const MooseVariableFE<Real>* const NavierStokesLHDGAssemblyHelper::_w_face_var
protected

Definition at line 214 of file NavierStokesLHDGAssemblyHelper.h.

Referenced by NavierStokesLHDGAssemblyHelper().

◆ _w_sol

const MooseArray<Number>* const NavierStokesLHDGAssemblyHelper::_w_sol
protected

Definition at line 233 of file NavierStokesLHDGAssemblyHelper.h.

◆ _w_var

const MooseVariableFE<Real>* const NavierStokesLHDGAssemblyHelper::_w_var
protected

Definition at line 210 of file NavierStokesLHDGAssemblyHelper.h.

Referenced by NavierStokesLHDGAssemblyHelper().


The documentation for this class was generated from the following files: