www.mooseframework.org
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
InertialForce Class Reference

#include <InertialForce.h>

Inheritance diagram for InertialForce:
[legend]

Public Member Functions

 InertialForce (const InputParameters &parameters)
 

Protected Member Functions

virtual Real computeQpResidual ()
 
virtual Real computeQpJacobian ()
 

Private Attributes

const MaterialProperty< Real > & _density
 
const VariableValue * _u_old
 
const VariableValue * _vel_old
 
const VariableValue * _accel_old
 
const Real _beta
 
const Real _gamma
 
const MaterialProperty< Real > & _eta
 
const Real _alpha
 
const VariableValue * _u_dot
 
const VariableValue * _u_dotdot
 
const VariableValue * _u_dot_old
 
const VariableValue * _du_dot_du
 
const VariableValue * _du_dotdot_du
 

Detailed Description

Definition at line 22 of file InertialForce.h.

Constructor & Destructor Documentation

◆ InertialForce()

InertialForce::InertialForce ( const InputParameters &  parameters)

Definition at line 44 of file InertialForce.C.

45  : TimeKernel(parameters),
46  _density(getMaterialProperty<Real>("density")),
47  _beta(isParamValid("beta") ? getParam<Real>("beta") : 0.1),
48  _gamma(isParamValid("gamma") ? getParam<Real>("gamma") : 0.1),
49  _eta(getMaterialProperty<Real>("eta")),
50  _alpha(getParam<Real>("alpha"))
51 {
52  if (isParamValid("beta") && isParamValid("gamma") && isParamValid("velocity") &&
53  isParamValid("acceleration"))
54  {
55  _vel_old = &coupledValueOld("velocity");
56  _accel_old = &coupledValueOld("acceleration");
57  _u_old = &valueOld();
58  }
59  else if (!isParamValid("beta") && !isParamValid("gamma") && !isParamValid("velocity") &&
60  !isParamValid("acceleration"))
61  {
62  _u_dot = &(_var.uDot());
63  _u_dotdot = &(_var.uDotDot());
64  _u_dot_old = &(_var.uDotOld());
65  _du_dot_du = &(_var.duDotDu());
66  _du_dotdot_du = &(_var.duDotDotDu());
67  }
68  else
69  mooseError("InertialForce: Either all or none of `beta`, `gamma`, `velocity`and `acceleration` "
70  "should be provided as input.");
71 }
const VariableValue * _u_dot
Definition: InertialForce.h:43
const VariableValue * _du_dotdot_du
Definition: InertialForce.h:47
const VariableValue * _accel_old
Definition: InertialForce.h:36
const VariableValue * _u_old
Definition: InertialForce.h:34
const Real _beta
Definition: InertialForce.h:37
const MaterialProperty< Real > & _density
Definition: InertialForce.h:33
const VariableValue * _du_dot_du
Definition: InertialForce.h:46
const VariableValue * _u_dot_old
Definition: InertialForce.h:45
const VariableValue * _u_dotdot
Definition: InertialForce.h:44
const MaterialProperty< Real > & _eta
Definition: InertialForce.h:39
const VariableValue * _vel_old
Definition: InertialForce.h:35
const Real _gamma
Definition: InertialForce.h:38
const Real _alpha
Definition: InertialForce.h:40

Member Function Documentation

◆ computeQpJacobian()

Real InertialForce::computeQpJacobian ( )
protectedvirtual

Definition at line 94 of file InertialForce.C.

95 {
96  if (_dt == 0)
97  return 0;
98  else if (isParamValid("beta"))
99  return _test[_i][_qp] * _density[_qp] / (_beta * _dt * _dt) * _phi[_j][_qp] +
100  _eta[_qp] * (1 + _alpha) * _test[_i][_qp] * _density[_qp] * _gamma / _beta / _dt *
101  _phi[_j][_qp];
102  else
103  return _test[_i][_qp] * _density[_qp] * (*_du_dotdot_du)[_qp] * _phi[_j][_qp] +
104  _eta[_qp] * (1 + _alpha) * _test[_i][_qp] * _density[_qp] * (*_du_dot_du)[_qp] *
105  _phi[_j][_qp];
106 }
const Real _beta
Definition: InertialForce.h:37
const MaterialProperty< Real > & _density
Definition: InertialForce.h:33
const VariableValue * _du_dot_du
Definition: InertialForce.h:46
const MaterialProperty< Real > & _eta
Definition: InertialForce.h:39
const Real _gamma
Definition: InertialForce.h:38
const Real _alpha
Definition: InertialForce.h:40

◆ computeQpResidual()

Real InertialForce::computeQpResidual ( )
protectedvirtual

Definition at line 74 of file InertialForce.C.

75 {
76  if (_dt == 0)
77  return 0;
78  else if (isParamValid("beta"))
79  {
80  Real accel = 1. / _beta *
81  (((_u[_qp] - (*_u_old)[_qp]) / (_dt * _dt)) - (*_vel_old)[_qp] / _dt -
82  (*_accel_old)[_qp] * (0.5 - _beta));
83  Real vel = (*_vel_old)[_qp] + (_dt * (1 - _gamma)) * (*_accel_old)[_qp] + _gamma * _dt * accel;
84  return _test[_i][_qp] * _density[_qp] *
85  (accel + vel * _eta[_qp] * (1 + _alpha) - _alpha * _eta[_qp] * (*_vel_old)[_qp]);
86  }
87  else
88  return _test[_i][_qp] * _density[_qp] *
89  ((*_u_dotdot)[_qp] + (*_u_dot)[_qp] * _eta[_qp] * (1.0 + _alpha) -
90  _alpha * _eta[_qp] * (*_u_dot_old)[_qp]);
91 }
const Real _beta
Definition: InertialForce.h:37
const MaterialProperty< Real > & _density
Definition: InertialForce.h:33
const VariableValue * _u_dot_old
Definition: InertialForce.h:45
const MaterialProperty< Real > & _eta
Definition: InertialForce.h:39
const VariableValue * _vel_old
Definition: InertialForce.h:35
const Real _gamma
Definition: InertialForce.h:38
const Real _alpha
Definition: InertialForce.h:40

Member Data Documentation

◆ _accel_old

const VariableValue* InertialForce::_accel_old
private

Definition at line 36 of file InertialForce.h.

Referenced by InertialForce().

◆ _alpha

const Real InertialForce::_alpha
private

Definition at line 40 of file InertialForce.h.

Referenced by computeQpJacobian(), and computeQpResidual().

◆ _beta

const Real InertialForce::_beta
private

Definition at line 37 of file InertialForce.h.

Referenced by computeQpJacobian(), and computeQpResidual().

◆ _density

const MaterialProperty<Real>& InertialForce::_density
private

Definition at line 33 of file InertialForce.h.

Referenced by computeQpJacobian(), and computeQpResidual().

◆ _du_dot_du

const VariableValue* InertialForce::_du_dot_du
private

Definition at line 46 of file InertialForce.h.

Referenced by computeQpJacobian(), and InertialForce().

◆ _du_dotdot_du

const VariableValue* InertialForce::_du_dotdot_du
private

Definition at line 47 of file InertialForce.h.

Referenced by InertialForce().

◆ _eta

const MaterialProperty<Real>& InertialForce::_eta
private

Definition at line 39 of file InertialForce.h.

Referenced by computeQpJacobian(), and computeQpResidual().

◆ _gamma

const Real InertialForce::_gamma
private

Definition at line 38 of file InertialForce.h.

Referenced by computeQpJacobian(), and computeQpResidual().

◆ _u_dot

const VariableValue* InertialForce::_u_dot
private

Definition at line 43 of file InertialForce.h.

Referenced by InertialForce().

◆ _u_dot_old

const VariableValue* InertialForce::_u_dot_old
private

Definition at line 45 of file InertialForce.h.

Referenced by computeQpResidual(), and InertialForce().

◆ _u_dotdot

const VariableValue* InertialForce::_u_dotdot
private

Definition at line 44 of file InertialForce.h.

Referenced by InertialForce().

◆ _u_old

const VariableValue* InertialForce::_u_old
private

Definition at line 34 of file InertialForce.h.

Referenced by InertialForce().

◆ _vel_old

const VariableValue* InertialForce::_vel_old
private

Definition at line 35 of file InertialForce.h.

Referenced by computeQpResidual(), and InertialForce().


The documentation for this class was generated from the following files: