https://mooseframework.inl.gov
Loading...
Searching...
No Matches
PlasticHeatEnergy.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 "PlasticHeatEnergy.h"
11#include "MooseMesh.h"
12#include "MooseVariable.h"
13
15
18{
20 params.addClassDescription("Plastic heat energy density = coeff * stress * plastic_strain_rate");
21 params.addRequiredCoupledVar("displacements",
22 "The string of displacements suitable for the problem statement");
23 params.addParam<std::string>("base_name", "Material property base name");
24 params.addParam<Real>("coeff", 1.0, "Heat energy density = coeff * stress * plastic_strain_rate");
25 return params;
26}
27
29 : Kernel(parameters),
30 _coeff(getParam<Real>("coeff")),
31 _base_name(isParamValid("base_name") ? getParam<std::string>("base_name") + "_" : ""),
32 _plastic_heat(getMaterialProperty<Real>(_base_name + "plastic_heat")),
33 _dplastic_heat_dstrain(
34 getMaterialProperty<RankTwoTensor>(_base_name + "dplastic_heat_dstrain")),
35 _ndisp(coupledComponents("displacements")),
36 _disp_var(_ndisp)
37{
38 for (unsigned int i = 0; i < _ndisp; ++i)
39 _disp_var[i] = coupled("displacements", i);
40
41 // Checking for consistency between mesh size and length of the provided displacements vector
42 if (_ndisp != _mesh.dimension())
43 mooseError("PlasticHeatEnergy: The number of displacement variables supplied must match the "
44 "mesh dimension.");
45}
46
47Real
52
53Real
58
59Real
61{
62 for (unsigned int i = 0; i < _ndisp; ++i)
63 if (jvar == _disp_var[i])
64 return -_test[_i][_qp] * _coeff * (_dplastic_heat_dstrain[_qp] * _grad_phi[_j][_qp])(i);
65
66 return 0.0;
67}
registerMooseObject("SolidMechanicsApp", PlasticHeatEnergy)
virtual unsigned int coupled(const std::string &var_name, unsigned int comp=0) const
void addRequiredCoupledVar(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)
unsigned int _qp
unsigned int _j
unsigned int _i
MooseVariable & _var
const VariableTestValue & _test
static InputParameters validParams()
const VariablePhiGradient & _grad_phi
void mooseError(Args &&... args) const
virtual unsigned int dimension() const
unsigned int number() const
Provides a heat source from plastic deformation: coeff * stress * plastic_strain_rate.
PlasticHeatEnergy(const InputParameters &parameters)
virtual Real computeQpJacobian() override
virtual Real computeQpOffDiagJacobian(unsigned int jvar) override
Real _coeff
coefficient of stress * plastic_strain_rate
const MaterialProperty< RankTwoTensor > & _dplastic_heat_dstrain
d(plastic_heat)/d(total_strain)
const MaterialProperty< Real > & _plastic_heat
stress * plastic_strain_rate
std::vector< unsigned int > _disp_var
MOOSE variable number for the displacement variables.
unsigned int _ndisp
umber of coupled displacement variables
virtual Real computeQpResidual() override
static InputParameters validParams()
MooseMesh & _mesh