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

Member Function Documentation

◆ computeQpJacobian()

Real InertialForce::computeQpJacobian ( )
protectedvirtual

Definition at line 96 of file InertialForce.C.

97 {
98  if (_dt == 0)
99  return 0;
100  else if (_has_beta)
101  return _test[_i][_qp] * _density[_qp] / (_beta * _dt * _dt) * _phi[_j][_qp] +
102  _eta[_qp] * (1 + _alpha) * _test[_i][_qp] * _density[_qp] * _gamma / _beta / _dt *
103  _phi[_j][_qp];
104  else
105  return _test[_i][_qp] * _density[_qp] * (*_du_dotdot_du)[_qp] * _phi[_j][_qp] +
106  _eta[_qp] * (1 + _alpha) * _test[_i][_qp] * _density[_qp] * (*_du_dot_du)[_qp] *
107  _phi[_j][_qp];
108 }
const bool _has_beta
Definition: InertialForce.h:37
const Real _beta
Definition: InertialForce.h:39
const MaterialProperty< Real > & _density
Definition: InertialForce.h:33
const VariableValue * _du_dot_du
Definition: InertialForce.h:50
const MaterialProperty< Real > & _eta
Definition: InertialForce.h:43
const Real _gamma
Definition: InertialForce.h:40
const Real _alpha
Definition: InertialForce.h:44

◆ computeQpResidual()

Real InertialForce::computeQpResidual ( )
protectedvirtual

Definition at line 76 of file InertialForce.C.

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

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 44 of file InertialForce.h.

Referenced by computeQpJacobian(), and computeQpResidual().

◆ _beta

const Real InertialForce::_beta
private

Definition at line 39 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 50 of file InertialForce.h.

Referenced by computeQpJacobian(), and InertialForce().

◆ _du_dotdot_du

const VariableValue* InertialForce::_du_dotdot_du
private

Definition at line 51 of file InertialForce.h.

Referenced by InertialForce().

◆ _eta

const MaterialProperty<Real>& InertialForce::_eta
private

Definition at line 43 of file InertialForce.h.

Referenced by computeQpJacobian(), and computeQpResidual().

◆ _gamma

const Real InertialForce::_gamma
private

Definition at line 40 of file InertialForce.h.

Referenced by computeQpJacobian(), and computeQpResidual().

◆ _has_acceleration

const bool InertialForce::_has_acceleration
private

Definition at line 42 of file InertialForce.h.

Referenced by InertialForce().

◆ _has_beta

const bool InertialForce::_has_beta
private

Definition at line 37 of file InertialForce.h.

Referenced by computeQpJacobian(), computeQpResidual(), and InertialForce().

◆ _has_gamma

const bool InertialForce::_has_gamma
private

Definition at line 38 of file InertialForce.h.

Referenced by InertialForce().

◆ _has_velocity

const bool InertialForce::_has_velocity
private

Definition at line 41 of file InertialForce.h.

Referenced by InertialForce().

◆ _u_dot

const VariableValue* InertialForce::_u_dot
private

Definition at line 47 of file InertialForce.h.

Referenced by InertialForce().

◆ _u_dot_old

const VariableValue* InertialForce::_u_dot_old
private

Definition at line 49 of file InertialForce.h.

Referenced by computeQpResidual(), and InertialForce().

◆ _u_dotdot

const VariableValue* InertialForce::_u_dotdot
private

Definition at line 48 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: