Line data Source code
1 : //* This file is part of the RACCOON application 2 : //* being developed at Dolbow lab at Duke University 3 : //* http://dolbow.pratt.duke.edu 4 : 5 : #include "KineticEnergy.h" 6 : 7 : registerMooseObject("raccoonApp", KineticEnergy); 8 : 9 : InputParameters 10 138 : KineticEnergy::validParams() 11 : { 12 138 : InputParameters params = ElementIntegralPostprocessor::validParams(); 13 138 : params += BaseNameInterface::validParams(); 14 138 : params.addClassDescription( 15 : "This class computes the total kinetic energy of the form $\\int_\\body " 16 : "0.5\\rho \\dot{u} \\cdot \\dot{u} \\diff{V}$."); 17 : 18 276 : params.addRequiredCoupledVar("displacements", 19 : "The string of displacements suitable for the problem statement"); 20 276 : params.addParam<MaterialPropertyName>( 21 : "density", "density", "Name of material property containing density"); 22 138 : return params; 23 0 : } 24 : 25 0 : KineticEnergy::KineticEnergy(const InputParameters & parameters) 26 : : ElementIntegralPostprocessor(parameters), 27 : BaseNameInterface(parameters), 28 0 : _rho(getADMaterialProperty<Real>(prependBaseName("density", true))), 29 0 : _ndisp(coupledComponents("displacements")), 30 0 : _u_dots(coupledDots("displacements")) 31 : { 32 0 : for (unsigned int i = _ndisp; i < 3; ++i) 33 0 : _u_dots.push_back(&_zero); 34 0 : } 35 : 36 : Real 37 0 : KineticEnergy::computeQpIntegral() 38 : { 39 0 : RealVectorValue u_dot((*_u_dots[0])[_qp], (*_u_dots[1])[_qp], (*_u_dots[2])[_qp]); 40 0 : return 0.5 * raw_value(_rho[_qp]) * u_dot * u_dot; 41 : }