https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
12registerMooseObject("SolidMechanicsApp", DashpotBC);
13
16{
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
46Real
48{
49 RealVectorValue velocity(_disp_x_dot[_qp], _disp_y_dot[_qp], _disp_z_dot[_qp]);
50
51 return _test[_i][_qp] * _coefficient * _normals[_qp] * velocity;
52}
53
54Real
56{
57 RealVectorValue velocity;
58 velocity(_component) = _phi[_j][_qp] / _dt;
59
60 return _test[_i][_qp] * _coefficient * _normals[_qp] * velocity;
61}
62
63Real
65{
66 RealVectorValue velocity;
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
76 velocity(component) = _phi[_j][_qp] / _dt;
77
78 return -_test[_i][_qp] * _normals[_qp] * velocity;
79}
registerMooseObject("SolidMechanicsApp", DashpotBC)
void ErrorVector unsigned int
Implements a simple constant Dashpot BC where grad(u)=value on the boundary.
Definition DashpotBC.h:21
const VariableValue & _disp_z_dot
Definition DashpotBC.h:47
unsigned int _disp_z_var
Definition DashpotBC.h:43
unsigned int _component
Component of the velocity vector.
Definition DashpotBC.h:38
const VariableValue & _disp_x_dot
Definition DashpotBC.h:45
virtual Real computeQpResidual()
Definition DashpotBC.C:47
unsigned int _disp_y_var
Definition DashpotBC.h:42
Real _coefficient
Definition DashpotBC.h:39
virtual Real computeQpJacobian()
Definition DashpotBC.C:55
DashpotBC(const InputParameters &parameters)
Factory constructor, takes parameters so that all derived classes can be built using the same constru...
Definition DashpotBC.C:32
virtual Real computeQpOffDiagJacobian(unsigned int jvar)
Definition DashpotBC.C:64
unsigned int _disp_x_var
Definition DashpotBC.h:41
static InputParameters validParams()
Definition DashpotBC.C:15
const VariableValue & _disp_y_dot
Definition DashpotBC.h:46
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
void addCoupledVar(const std::string &name, const std::string &doc_string)
unsigned int _qp
unsigned int _i
unsigned int _j
static InputParameters validParams()
const VariablePhiValue & _phi
const MooseArray< Point > & _normals
const VariableTestValue & _test