https://mooseframework.inl.gov
Loading...
Searching...
No Matches
NavierStokesLHDGVelocityDirichletBC.C
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
11
13
16{
17 auto params = IntegratedBC::validParams();
19 params.addClassDescription("Weakly imposes Dirichlet boundary conditions for the velocity for a "
20 "hybridized discretization of the Navier-Stokes equations");
21 params.addRequiredParam<MooseFunctorName>("dirichlet_u",
22 "The Dirichlet value for the x-component of velocity");
23 params.addRequiredParam<MooseFunctorName>("dirichlet_v",
24 "The Dirichlet value for the y-component of velocity");
25 params.addParam<MooseFunctorName>(
26 "dirichlet_w", 0, "The Dirichlet value for the z-component of velocity");
27 params.renameParam("variable", "u", "The x-component of velocity");
28 return params;
29}
30
32 const InputParameters & parameters)
33 : IntegratedBC(parameters),
34 NavierStokesLHDGAssemblyHelper(this, this, this, this, _fe_problem, _sys, _mesh, _tid),
35 _cached_side(libMesh::invalid_uint)
36{
37 if (_mesh.dimension() > 2 && !isParamSetByUser("dirichlet_w"))
38 paramError("dirichlet_w",
39 "For a 3D simulation, the Dirichlet value of the z-velocity must be supplied");
40
41 _dirichlet_vel[0] = &getFunctor<Real>("dirichlet_u");
42 _dirichlet_vel[1] = &getFunctor<Real>("dirichlet_v");
43 _dirichlet_vel[2] = &getFunctor<Real>("dirichlet_w");
44}
45
46void
48{
49 // This check must occur after FEProblemBase::init()
51}
52
53void
59
60void
70
71void
73{
81
82 // qu, u, lm_u
84 _JxW,
85 *_qrule,
92 _u_sol,
93 0,
95 _JxW,
96 *_qrule,
100 _q_point,
101 _u_vel_re);
102
103 // qv, v, lm_v
105 _JxW,
106 *_qrule,
107 _normals,
110 _q_point,
113 _v_sol,
114 1,
116 _JxW,
117 *_qrule,
118 _normals,
121 _q_point,
122 _v_vel_re);
123
124 // p
127
128 // Set the LMs on these Dirichlet boundary faces to 0
131
139}
140
141void
143{
152
153 // qu, u, lm_u
155
156 // qv, v, lm_v
158
159 // Set the LMs on these Dirichlet boundary faces to 0
162
173}
registerMooseObject("NavierStokesApp", NavierStokesLHDGVelocityDirichletBC)
const std::vector< dof_id_type > & _qu_dof_indices
void createIdentityResidual(const MooseArray< Real > &JxW, const libMesh::QBase &qrule, const MooseArray< std::vector< Real > > &phi, const MooseArray< Number > &sol, DenseVector< Number > &re)
const MooseVariableFE< Real > & _u_var
void createIdentityJacobian(const MooseArray< Real > &JxW, const libMesh::QBase &qrule, const MooseArray< std::vector< Real > > &phi, DenseMatrix< Number > &ke)
const MooseArray< Number > & _u_sol
const std::vector< dof_id_type > & _lm_u_dof_indices
const MooseArray< libMesh::Gradient > & _qu_sol
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)
const MooseArray< std::vector< Real > > & _lm_phi_face
const MooseArray< Number > & _lm_u_sol
const std::vector< dof_id_type > & _u_dof_indices
const MooseVariableFE< Real > & _u_face_var
const MooseVariableFE< RealVectorValue > & _grad_u_var
const unsigned int & _current_side
const QBase *const & _qrule
const MooseArray< Real > & _JxW
const Elem *const & _current_elem
const MooseArray< Point > & _q_point
static InputParameters validParams()
const MooseArray< Point > & _normals
void paramError(const std::string &param, Args... args) const
bool isParamSetByUser(const std::string &name) const
virtual unsigned int dimension() const
void scalingFactor(const std::vector< Real > &factor)
Implements all the methods for assembling a hybridized local discontinuous Galerkin (LDG-H),...
const std::vector< dof_id_type > & _lm_v_dof_indices
const std::vector< dof_id_type > & _qv_dof_indices
Containers for dof indices.
const MooseArray< Gradient > & _qv_sol
local solutions at quadrature points
const std::vector< dof_id_type > & _p_dof_indices
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)
const MooseVariableFE< Real > & _v_face_var
const MooseVariableFE< Real > & _pressure_var
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)
const MooseVariableFE< RealVectorValue > & _grad_v_var
const std::vector< dof_id_type > & _v_dof_indices
Weakly imposes Dirichlet boundary conditions for the velocity for a hybridized discretization of the ...
NavierStokesLHDGVelocityDirichletBC(const InputParameters &parameters)
unsigned int _cached_side
A cache variable to prevent multiple computations of Jacobians.
std::array< const Moose::Functor< Real > *, 3 > _dirichlet_vel
Dirichlet velocity.
virtual void computeOffDiagJacobian(unsigned int jvar) override
MooseMesh & _mesh
Assembly & _assembly
void addJacobian(Assembly &assembly, const Residuals &residuals, const Indices &dof_indices, Real scaling_factor)
void addResiduals(Assembly &assembly, const Residuals &residuals, const Indices &dof_indices, Real scaling_factor)
void resize(const unsigned int new_m, const unsigned int new_n)
void resize(const unsigned int n)
The following methods are specializations for using the Parallel::packed_range_* routines for a vecto...
const unsigned int invalid_uint