www.mooseframework.org
INSMomentumNoBCBCBase.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
7 
9 #include "MooseMesh.h"
10 
11 template <>
12 InputParameters
14 {
15  InputParameters params = validParams<IntegratedBC>();
16 
17  params.addClassDescription("Base class for the 'No BC' boundary condition.");
18  // Coupled variables
19  params.addRequiredCoupledVar("u", "x-velocity");
20  params.addCoupledVar("v", "y-velocity"); // only required in 2D and 3D
21  params.addCoupledVar("w", "z-velocity"); // only required in 3D
22  params.addRequiredCoupledVar("p", "pressure");
23 
24  // Required parameters
25  params.addRequiredParam<RealVectorValue>("gravity", "Direction of the gravity vector");
26  params.addRequiredParam<unsigned>(
27  "component",
28  "0,1,2 depending on if we are solving the x,y,z component of the momentum equation");
29  params.addParam<bool>("integrate_p_by_parts",
30  true,
31  "Allows simulations to be run with pressure BC if set to false");
32 
33  // Optional parameters
34  params.addParam<MaterialPropertyName>("mu_name", "mu", "The name of the dynamic viscosity");
35  params.addParam<MaterialPropertyName>("rho_name", "rho", "The name of the density");
36 
37  return params;
38 }
39 
40 INSMomentumNoBCBCBase::INSMomentumNoBCBCBase(const InputParameters & parameters)
41  : IntegratedBC(parameters),
42 
43  // Coupled variables
44  _u_vel(coupledValue("u")),
45  _v_vel(_mesh.dimension() >= 2 ? coupledValue("v") : _zero),
46  _w_vel(_mesh.dimension() == 3 ? coupledValue("w") : _zero),
47  _p(coupledValue("p")),
48 
49  // Gradients
50  _grad_u_vel(coupledGradient("u")),
51  _grad_v_vel(_mesh.dimension() >= 2 ? coupledGradient("v") : _grad_zero),
52  _grad_w_vel(_mesh.dimension() == 3 ? coupledGradient("w") : _grad_zero),
53 
54  // Variable numberings
55  _u_vel_var_number(coupled("u")),
56  _v_vel_var_number(_mesh.dimension() >= 2 ? coupled("v") : libMesh::invalid_uint),
57  _w_vel_var_number(_mesh.dimension() == 3 ? coupled("w") : libMesh::invalid_uint),
58  _p_var_number(coupled("p")),
59 
60  // Required parameters
61  _gravity(getParam<RealVectorValue>("gravity")),
62  _component(getParam<unsigned>("component")),
63  _integrate_p_by_parts(getParam<bool>("integrate_p_by_parts")),
64 
65  // Material properties
66  _mu(getMaterialProperty<Real>("mu_name")),
67  _rho(getMaterialProperty<Real>("rho_name"))
68 {
69 }
INSMomentumNoBCBCBase(const InputParameters &parameters)
InputParameters validParams< INSMomentumNoBCBCBase >()