www.mooseframework.org
DashpotBC.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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.addRequiredParam<unsigned int>(
19  "component", "The displacement component corresponding the variable this BC acts on.");
20  params.addRequiredCoupledVar("disp_x", "Displacement in the x direction");
21  params.addCoupledVar("disp_y", "Displacement in the y direction");
22  params.addCoupledVar("disp_z", "Displacement in the z direction");
23 
24  params.addParam<Real>("coefficient", 1.0, "The viscosity coefficient");
25 
26  return params;
27 }
28 
30  : IntegratedBC(parameters),
31  _component(getParam<unsigned int>("component")),
32  _coefficient(getParam<Real>("coefficient")),
33  _disp_x_var(coupled("disp_x")),
34  _disp_y_var(isCoupled("disp_y") ? coupled("disp_y") : 0),
35  _disp_z_var(isCoupled("disp_z") ? coupled("disp_z") : 0),
36 
37  _disp_x_dot(coupledDot("disp_x")),
38  _disp_y_dot(isCoupled("disp_y") ? coupledDot("disp_y") : _zero),
39  _disp_z_dot(isCoupled("disp_z") ? coupledDot("disp_z") : _zero)
40 {
41 }
42 
43 Real
45 {
47 
48  return _test[_i][_qp] * _coefficient * _normals[_qp] * velocity;
49 }
50 
51 Real
53 {
56 
57  return _test[_i][_qp] * _coefficient * _normals[_qp] * velocity;
58 }
59 
60 Real
62 {
64  unsigned int component = 0;
65 
66  if (jvar == _disp_x_var)
67  component = 0;
68  else if (jvar == _disp_y_var)
69  component = 1;
70  else if (jvar == _disp_z_var)
71  component = 2;
72 
74 
75  return -_test[_i][_qp] * _normals[_qp] * velocity;
76 }
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:138
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:52
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:29
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual Real computeQpOffDiagJacobian(unsigned int jvar)
Definition: DashpotBC.C:61
const VariableValue & _disp_z_dot
Definition: DashpotBC.h:47
static const std::string velocity
Definition: NS.h:45
virtual Real computeQpResidual()
Definition: DashpotBC.C:44
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