www.mooseframework.org
PlasticHeatEnergy.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
7 
8 #include "PlasticHeatEnergy.h"
9 #include "MooseMesh.h"
10 #include "MooseVariable.h"
11 
12 template <>
13 InputParameters
15 {
16  InputParameters params = validParams<Kernel>();
17  params.addClassDescription("Plastic heat energy density = coeff * stress * plastic_strain_rate");
18  params.addRequiredCoupledVar("displacements",
19  "The string of displacements suitable for the problem statement");
20  params.addParam<std::string>("base_name", "Material property base name");
21  params.addParam<Real>("coeff", 1.0, "Heat energy density = coeff * stress * plastic_strain_rate");
22  return params;
23 }
24 
25 PlasticHeatEnergy::PlasticHeatEnergy(const InputParameters & parameters)
26  : Kernel(parameters),
27  _coeff(getParam<Real>("coeff")),
28  _base_name(isParamValid("base_name") ? getParam<std::string>("base_name") + "_" : ""),
29  _plastic_heat(getMaterialProperty<Real>(_base_name + "plastic_heat")),
30  _dplastic_heat_dstrain(
31  getMaterialProperty<RankTwoTensor>(_base_name + "dplastic_heat_dstrain")),
32  _ndisp(coupledComponents("displacements")),
33  _disp_var(_ndisp)
34 {
35  for (unsigned int i = 0; i < _ndisp; ++i)
36  _disp_var[i] = coupled("displacements", i);
37 
38  // Checking for consistency between mesh size and length of the provided displacements vector
39  if (_ndisp != _mesh.dimension())
40  mooseError("PlasticHeatEnergy: The number of displacement variables supplied must match the "
41  "mesh dimension.");
42 }
43 
44 Real
46 {
47  return -_test[_i][_qp] * _coeff * _plastic_heat[_qp];
48 }
49 
50 Real
52 {
53  return computeQpOffDiagJacobian(_var.number());
54 }
55 
56 Real
58 {
59  for (unsigned int i = 0; i < _ndisp; ++i)
60  if (jvar == _disp_var[i])
61  return -_test[_i][_qp] * _coeff * (_dplastic_heat_dstrain[_qp] * _grad_phi[_j][_qp])(i);
62 
63  return 0.0;
64 }
const MaterialProperty< Real > & _plastic_heat
stress * plastic_strain_rate
virtual Real computeQpOffDiagJacobian(unsigned int jvar) override
InputParameters validParams< PlasticHeatEnergy >()
virtual Real computeQpResidual() override
Real _coeff
coefficient of stress * plastic_strain_rate
PlasticHeatEnergy(const InputParameters &parameters)
const MaterialProperty< RankTwoTensor > & _dplastic_heat_dstrain
d(plastic_heat)/d(total_strain)
unsigned int _ndisp
umber of coupled displacement variables
std::vector< unsigned int > _disp_var
MOOSE variable number for the displacement variables.
virtual Real computeQpJacobian() override