www.mooseframework.org
DashpotBC.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 
8 #include "DashpotBC.h"
9 
10 template <>
11 InputParameters
13 {
14  InputParameters params = validParams<IntegratedBC>();
15  params.addRequiredParam<unsigned int>(
16  "component", "The displacement component corresponding the variable this BC acts on.");
17  params.addRequiredCoupledVar("disp_x", "Displacement in the x direction");
18  params.addCoupledVar("disp_y", "Displacement in the y direction");
19  params.addCoupledVar("disp_z", "Displacement in the z direction");
20 
21  params.addParam<Real>("coefficient", 1.0, "The viscosity coefficient");
22 
23  return params;
24 }
25 
26 DashpotBC::DashpotBC(const InputParameters & parameters)
27  : IntegratedBC(parameters),
28  _component(getParam<unsigned int>("component")),
29  _coefficient(getParam<Real>("coefficient")),
30  _disp_x_var(coupled("disp_x")),
31  _disp_y_var(isCoupled("disp_y") ? coupled("disp_y") : 0),
32  _disp_z_var(isCoupled("disp_z") ? coupled("disp_z") : 0),
33 
34  _disp_x_dot(coupledDot("disp_x")),
35  _disp_y_dot(isCoupled("disp_y") ? coupledDot("disp_y") : _zero),
36  _disp_z_dot(isCoupled("disp_z") ? coupledDot("disp_z") : _zero)
37 {
38 }
39 
40 Real
42 {
43  RealVectorValue velocity(_disp_x_dot[_qp], _disp_y_dot[_qp], _disp_z_dot[_qp]);
44 
45  return _test[_i][_qp] * _coefficient * _normals[_qp] * velocity;
46 }
47 
48 Real
50 {
51  RealVectorValue velocity;
52  velocity(_component) = _phi[_j][_qp] / _dt;
53 
54  return _test[_i][_qp] * _coefficient * _normals[_qp] * velocity;
55 }
56 
57 Real
59 {
60  RealVectorValue velocity;
61  unsigned int component = 0;
62 
63  if (jvar == _disp_x_var)
64  component = 0;
65  else if (jvar == _disp_y_var)
66  component = 1;
67  else if (jvar == _disp_z_var)
68  component = 2;
69 
70  velocity(component) = _phi[_j][_qp] / _dt;
71 
72  return -_test[_i][_qp] * _normals[_qp] * velocity;
73 }
unsigned int _disp_z_var
Definition: DashpotBC.h:43
unsigned int _component
Definition: DashpotBC.h:38
Real component(const SymmTensor &symm_tensor, unsigned int index)
Real _coefficient
Definition: DashpotBC.h:39
const VariableValue & _disp_y_dot
Definition: DashpotBC.h:46
virtual Real computeQpJacobian()
Definition: DashpotBC.C:49
DashpotBC(const InputParameters &parameters)
Factory constructor, takes parameters so that all derived classes can be built using the same constru...
Definition: DashpotBC.C:26
virtual Real computeQpOffDiagJacobian(unsigned int jvar)
Definition: DashpotBC.C:58
InputParameters validParams< DashpotBC >()
Definition: DashpotBC.C:12
const VariableValue & _disp_z_dot
Definition: DashpotBC.h:47
virtual Real computeQpResidual()
Definition: DashpotBC.C:41
unsigned int _disp_x_var
Definition: DashpotBC.h:41
const VariableValue & _disp_x_dot
Definition: DashpotBC.h:45
unsigned int _disp_y_var
Definition: DashpotBC.h:42