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