https://mooseframework.inl.gov
DashpotBC.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 
10 #include "DashpotBC.h"
11 
12 registerMooseObject("SolidMechanicsApp", DashpotBC);
13 
16 {
18  params.addClassDescription(
19  "Model a dashpot boundary condition where the traction is proportional "
20  "to the normal velocity.");
21  params.addRequiredParam<unsigned int>(
22  "component", "The displacement component corresponding the variable this BC acts on.");
23  params.addRequiredCoupledVar("disp_x", "Displacement in the x direction");
24  params.addCoupledVar("disp_y", "Displacement in the y direction");
25  params.addCoupledVar("disp_z", "Displacement in the z direction");
26 
27  params.addParam<Real>("coefficient", 1.0, "The viscosity coefficient");
28 
29  return params;
30 }
31 
33  : IntegratedBC(parameters),
34  _component(getParam<unsigned int>("component")),
35  _coefficient(getParam<Real>("coefficient")),
36  _disp_x_var(coupled("disp_x")),
37  _disp_y_var(isCoupled("disp_y") ? coupled("disp_y") : 0),
38  _disp_z_var(isCoupled("disp_z") ? coupled("disp_z") : 0),
39 
40  _disp_x_dot(coupledDot("disp_x")),
41  _disp_y_dot(isCoupled("disp_y") ? coupledDot("disp_y") : _zero),
42  _disp_z_dot(isCoupled("disp_z") ? coupledDot("disp_z") : _zero)
43 {
44 }
45 
46 Real
48 {
50 
51  return _test[_i][_qp] * _coefficient * _normals[_qp] * velocity;
52 }
53 
54 Real
56 {
59 
60  return _test[_i][_qp] * _coefficient * _normals[_qp] * velocity;
61 }
62 
63 Real
65 {
67  unsigned int component = 0;
68 
69  if (jvar == _disp_x_var)
70  component = 0;
71  else if (jvar == _disp_y_var)
72  component = 1;
73  else if (jvar == _disp_z_var)
74  component = 2;
75 
77 
78  return -_test[_i][_qp] * _normals[_qp] * velocity;
79 }
const VariableTestValue & _test
registerMooseObject("SolidMechanicsApp", DashpotBC)
unsigned int _disp_z_var
Definition: DashpotBC.h:43
unsigned int _j
const MooseArray< Point > & _normals
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
static const std::string component
Definition: NS.h:153
unsigned int _component
Component of the velocity vector.
Definition: DashpotBC.h:38
static InputParameters validParams()
unsigned int _i
static InputParameters validParams()
Definition: DashpotBC.C:15
Real _coefficient
Definition: DashpotBC.h:39
const VariablePhiValue & _phi
void addRequiredParam(const std::string &name, const std::string &doc_string)
unsigned int _qp
const VariableValue & _disp_y_dot
Definition: DashpotBC.h:46
virtual Real computeQpJacobian()
Definition: DashpotBC.C:55
Implements a simple constant Dashpot BC where grad(u)=value on the boundary.
Definition: DashpotBC.h:20
void addCoupledVar(const std::string &name, const std::string &doc_string)
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
DashpotBC(const InputParameters &parameters)
Factory constructor, takes parameters so that all derived classes can be built using the same constru...
Definition: DashpotBC.C:32
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual Real computeQpOffDiagJacobian(unsigned int jvar)
Definition: DashpotBC.C:64
const VariableValue & _disp_z_dot
Definition: DashpotBC.h:47
void addClassDescription(const std::string &doc_string)
static const std::string velocity
Definition: NS.h:45
virtual Real computeQpResidual()
Definition: DashpotBC.C:47
unsigned int _disp_x_var
Definition: DashpotBC.h:41
void ErrorVector unsigned int
const VariableValue & _disp_x_dot
Definition: DashpotBC.h:45
unsigned int _disp_y_var
Definition: DashpotBC.h:42