www.mooseframework.org
TensorMechanicsPlasticModel.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 // Plastic Model base class.
11 //
13 #include "RankFourTensor.h"
14 
16 
17 InputParameters
19 {
20  InputParameters params = GeneralUserObject::validParams();
21  params.addRequiredRangeCheckedParam<Real>("yield_function_tolerance",
22  "yield_function_tolerance>0",
23  "If the yield function is less than this amount, the "
24  "(stress, internal parameter) are deemed admissible.");
25  params.addRequiredRangeCheckedParam<Real>("internal_constraint_tolerance",
26  "internal_constraint_tolerance>0",
27  "The Newton-Raphson process is only deemed converged "
28  "if the internal constraint is less than this.");
29  params.addClassDescription(
30  "Plastic Model base class. Override the virtual functions in your class");
31  return params;
32 }
33 
35  : GeneralUserObject(parameters),
36  _f_tol(getParam<Real>("yield_function_tolerance")),
37  _ic_tol(getParam<Real>("internal_constraint_tolerance"))
38 {
39 }
40 
41 void
43 {
44 }
45 
46 void
48 {
49 }
50 
51 void
53 {
54 }
55 
56 unsigned
58 {
59  return 1;
60 }
61 
62 Real
63 TensorMechanicsPlasticModel::yieldFunction(const RankTwoTensor & /*stress*/, Real /*intnl*/) const
64 {
65  return 0.0;
66 }
67 
68 void
70  Real intnl,
71  std::vector<Real> & f) const
72 {
73  f.assign(1, yieldFunction(stress, intnl));
74 }
75 
78  Real /*intnl*/) const
79 {
80  return RankTwoTensor();
81 }
82 
83 void
85  Real intnl,
86  std::vector<RankTwoTensor> & df_dstress) const
87 {
88  df_dstress.assign(1, dyieldFunction_dstress(stress, intnl));
89 }
90 
91 Real
93  Real /*intnl*/) const
94 {
95  return 0.0;
96 }
97 void
99  Real intnl,
100  std::vector<Real> & df_dintnl) const
101 {
102  return df_dintnl.assign(1, dyieldFunction_dintnl(stress, intnl));
103 }
104 
106 TensorMechanicsPlasticModel::flowPotential(const RankTwoTensor & /*stress*/, Real /*intnl*/) const
107 {
108  return RankTwoTensor();
109 }
110 void
112  Real intnl,
113  std::vector<RankTwoTensor> & r) const
114 {
115  return r.assign(1, flowPotential(stress, intnl));
116 }
117 
120  Real /*intnl*/) const
121 {
122  return RankFourTensor();
123 }
124 void
126  Real intnl,
127  std::vector<RankFourTensor> & dr_dstress) const
128 {
129  return dr_dstress.assign(1, dflowPotential_dstress(stress, intnl));
130 }
131 
134  Real /*intnl*/) const
135 {
136  return RankTwoTensor();
137 }
138 void
140  Real intnl,
141  std::vector<RankTwoTensor> & dr_dintnl) const
142 {
143  return dr_dintnl.assign(1, dflowPotential_dintnl(stress, intnl));
144 }
145 
146 Real
147 TensorMechanicsPlasticModel::hardPotential(const RankTwoTensor & /*stress*/, Real /*intnl*/) const
148 {
149  return -1.0;
150 }
151 void
153  Real intnl,
154  std::vector<Real> & h) const
155 {
156  h.assign(numberSurfaces(), hardPotential(stress, intnl));
157 }
158 
161  Real /*intnl*/) const
162 {
163  return RankTwoTensor();
164 }
165 void
167  Real intnl,
168  std::vector<RankTwoTensor> & dh_dstress) const
169 {
170  dh_dstress.assign(numberSurfaces(), dhardPotential_dstress(stress, intnl));
171 }
172 
173 Real
175  Real /*intnl*/) const
176 {
177  return 0.0;
178 }
179 void
181  Real intnl,
182  std::vector<Real> & dh_dintnl) const
183 {
184  dh_dintnl.resize(numberSurfaces(), dhardPotential_dintnl(stress, intnl));
185 }
186 
187 void
189  const RankTwoTensor & /*stress*/,
190  Real /*intnl*/,
191  const RankFourTensor & /*Eijkl*/,
192  std::vector<bool> & act,
193  RankTwoTensor & /*returned_stress*/) const
194 {
195  mooseAssert(f.size() == numberSurfaces(),
196  "f incorrectly sized at " << f.size() << " in activeConstraints");
197  act.resize(numberSurfaces());
198  for (unsigned surface = 0; surface < numberSurfaces(); ++surface)
199  act[surface] = (f[surface] > _f_tol);
200 }
201 
202 std::string
204 {
205  return "None";
206 }
207 
208 bool
210 {
211  return false;
212 }
213 
214 bool
216 {
217  return false;
218 }
219 
220 bool
222  Real intnl_old,
223  const RankFourTensor & /*E_ijkl*/,
224  Real /*ep_plastic_tolerance*/,
225  RankTwoTensor & /*returned_stress*/,
226  Real & /*returned_intnl*/,
227  std::vector<Real> & /*dpm*/,
228  RankTwoTensor & /*delta_dp*/,
229  std::vector<Real> & yf,
230  bool & trial_stress_inadmissible) const
231 {
232  trial_stress_inadmissible = false;
233  yieldFunctionV(trial_stress, intnl_old, yf);
234 
235  for (unsigned sf = 0; sf < numberSurfaces(); ++sf)
236  if (yf[sf] > _f_tol)
237  trial_stress_inadmissible = true;
238 
239  // example of checking Kuhn-Tucker
240  std::vector<Real> dpm(numberSurfaces(), 0);
241  for (unsigned sf = 0; sf < numberSurfaces(); ++sf)
242  if (!KuhnTuckerSingleSurface(yf[sf], dpm[sf], 0))
243  return false;
244  return true;
245 }
246 
247 bool
248 TensorMechanicsPlasticModel::KuhnTuckerSingleSurface(Real yf, Real dpm, Real dpm_tol) const
249 {
250  return (dpm == 0 && yf <= _f_tol) || (dpm > -dpm_tol && yf <= _f_tol && yf >= -_f_tol);
251 }
252 
255  const RankTwoTensor & /*trial_stress*/,
256  Real /*intnl_old*/,
257  const RankTwoTensor & /*stress*/,
258  Real /*intnl*/,
259  const RankFourTensor & E_ijkl,
260  const std::vector<Real> & /*cumulative_pm*/) const
261 {
262  return E_ijkl;
263 }
TensorMechanicsPlasticModel::numberSurfaces
virtual unsigned int numberSurfaces() const
The number of yield surfaces for this plasticity model.
Definition: TensorMechanicsPlasticModel.C:57
TensorMechanicsPlasticModel::hardPotentialV
virtual void hardPotentialV(const RankTwoTensor &stress, Real intnl, std::vector< Real > &h) const
The hardening potential.
Definition: TensorMechanicsPlasticModel.C:152
TensorMechanicsPlasticModel::useCustomCTO
virtual bool useCustomCTO() const
Returns false. You will want to override this in your derived class if you write a custom consistent ...
Definition: TensorMechanicsPlasticModel.C:215
TensorMechanicsPlasticModel::dflowPotential_dintnl
virtual RankTwoTensor dflowPotential_dintnl(const RankTwoTensor &stress, Real intnl) const
The derivative of the flow potential with respect to the internal parameter.
Definition: TensorMechanicsPlasticModel.C:133
TensorMechanicsPlasticModel::validParams
static InputParameters validParams()
Definition: TensorMechanicsPlasticModel.C:18
TensorMechanicsPlasticModel::useCustomReturnMap
virtual bool useCustomReturnMap() const
Returns false. You will want to override this in your derived class if you write a custom returnMap f...
Definition: TensorMechanicsPlasticModel.C:209
TensorMechanicsPlasticModel::dyieldFunction_dintnlV
virtual void dyieldFunction_dintnlV(const RankTwoTensor &stress, Real intnl, std::vector< Real > &df_dintnl) const
The derivative of yield functions with respect to the internal parameter.
Definition: TensorMechanicsPlasticModel.C:98
defineLegacyParams
defineLegacyParams(TensorMechanicsPlasticModel)
TensorMechanicsPlasticModel::dyieldFunction_dstress
virtual RankTwoTensor dyieldFunction_dstress(const RankTwoTensor &stress, Real intnl) const
The derivative of yield function with respect to stress.
Definition: TensorMechanicsPlasticModel.C:77
TensorMechanicsPlasticModel::dhardPotential_dintnl
virtual Real dhardPotential_dintnl(const RankTwoTensor &stress, Real intnl) const
The derivative of the hardening potential with respect to the internal parameter.
Definition: TensorMechanicsPlasticModel.C:174
TensorMechanicsPlasticModel::dflowPotential_dintnlV
virtual void dflowPotential_dintnlV(const RankTwoTensor &stress, Real intnl, std::vector< RankTwoTensor > &dr_dintnl) const
The derivative of the flow potential with respect to the internal parameter.
Definition: TensorMechanicsPlasticModel.C:139
TensorMechanicsPlasticModel::KuhnTuckerSingleSurface
bool KuhnTuckerSingleSurface(Real yf, Real dpm, Real dpm_tol) const
Returns true if the Kuhn-Tucker conditions for the single surface are satisfied.
Definition: TensorMechanicsPlasticModel.C:248
TensorMechanicsPlasticModel::dhardPotential_dstressV
virtual void dhardPotential_dstressV(const RankTwoTensor &stress, Real intnl, std::vector< RankTwoTensor > &dh_dstress) const
The derivative of the hardening potential with respect to stress.
Definition: TensorMechanicsPlasticModel.C:166
TensorMechanicsPlasticModel::dhardPotential_dintnlV
virtual void dhardPotential_dintnlV(const RankTwoTensor &stress, Real intnl, std::vector< Real > &dh_dintnl) const
The derivative of the hardening potential with respect to the internal parameter.
Definition: TensorMechanicsPlasticModel.C:180
TensorMechanicsPlasticModel::initialize
void initialize()
Definition: TensorMechanicsPlasticModel.C:42
TensorMechanicsPlasticModel.h
TensorMechanicsPlasticModel::finalize
void finalize()
Definition: TensorMechanicsPlasticModel.C:52
TensorMechanicsPlasticModel::_f_tol
const Real _f_tol
Tolerance on yield function.
Definition: TensorMechanicsPlasticModel.h:175
TensorMechanicsPlasticModel::TensorMechanicsPlasticModel
TensorMechanicsPlasticModel(const InputParameters &parameters)
Definition: TensorMechanicsPlasticModel.C:34
TensorMechanicsPlasticModel::dflowPotential_dstressV
virtual void dflowPotential_dstressV(const RankTwoTensor &stress, Real intnl, std::vector< RankFourTensor > &dr_dstress) const
The derivative of the flow potential with respect to stress.
Definition: TensorMechanicsPlasticModel.C:125
TensorMechanicsPlasticModel::hardPotential
virtual Real hardPotential(const RankTwoTensor &stress, Real intnl) const
The hardening potential.
Definition: TensorMechanicsPlasticModel.C:147
TensorMechanicsPlasticModel::yieldFunctionV
virtual void yieldFunctionV(const RankTwoTensor &stress, Real intnl, std::vector< Real > &f) const
Calculates the yield functions.
Definition: TensorMechanicsPlasticModel.C:69
validParams
InputParameters validParams()
TensorMechanicsPlasticModel::returnMap
virtual bool returnMap(const RankTwoTensor &trial_stress, Real intnl_old, const RankFourTensor &E_ijkl, Real ep_plastic_tolerance, RankTwoTensor &returned_stress, Real &returned_intnl, std::vector< Real > &dpm, RankTwoTensor &delta_dp, std::vector< Real > &yf, bool &trial_stress_inadmissible) const
Performs a custom return-map.
Definition: TensorMechanicsPlasticModel.C:221
RankTwoTensor
RankTwoTensorTempl< Real > RankTwoTensor
Definition: ACGrGrElasticDrivingForce.h:17
TensorMechanicsPlasticModel::consistentTangentOperator
virtual RankFourTensor consistentTangentOperator(const RankTwoTensor &trial_stress, Real intnl_old, const RankTwoTensor &stress, Real intnl, const RankFourTensor &E_ijkl, const std::vector< Real > &cumulative_pm) const
Calculates a custom consistent tangent operator.
Definition: TensorMechanicsPlasticModel.C:254
TensorMechanicsPlasticModel::execute
void execute()
Definition: TensorMechanicsPlasticModel.C:47
RankFourTensorTempl
Definition: ACGrGrElasticDrivingForce.h:20
TensorMechanicsPlasticModel
Plastic Model base class The virtual functions written below must be over-ridden in derived classes t...
Definition: TensorMechanicsPlasticModel.h:42
TensorMechanicsPlasticModel::dflowPotential_dstress
virtual RankFourTensor dflowPotential_dstress(const RankTwoTensor &stress, Real intnl) const
The derivative of the flow potential with respect to stress.
Definition: TensorMechanicsPlasticModel.C:119
TensorMechanicsPlasticModel::modelName
virtual std::string modelName() const =0
Definition: TensorMechanicsPlasticModel.C:203
TensorMechanicsPlasticModel::yieldFunction
virtual Real yieldFunction(const RankTwoTensor &stress, Real intnl) const
The following functions are what you should override when building single-plasticity models.
Definition: TensorMechanicsPlasticModel.C:63
TensorMechanicsPlasticModel::flowPotential
virtual RankTwoTensor flowPotential(const RankTwoTensor &stress, Real intnl) const
The flow potential.
Definition: TensorMechanicsPlasticModel.C:106
RankTwoTensorTempl< Real >
TensorMechanicsPlasticModel::dhardPotential_dstress
virtual RankTwoTensor dhardPotential_dstress(const RankTwoTensor &stress, Real intnl) const
The derivative of the hardening potential with respect to stress.
Definition: TensorMechanicsPlasticModel.C:160
TensorMechanicsPlasticModel::flowPotentialV
virtual void flowPotentialV(const RankTwoTensor &stress, Real intnl, std::vector< RankTwoTensor > &r) const
The flow potentials.
Definition: TensorMechanicsPlasticModel.C:111
TensorMechanicsPlasticModel::dyieldFunction_dstressV
virtual void dyieldFunction_dstressV(const RankTwoTensor &stress, Real intnl, std::vector< RankTwoTensor > &df_dstress) const
The derivative of yield functions with respect to stress.
Definition: TensorMechanicsPlasticModel.C:84
RankFourTensor
RankFourTensorTempl< Real > RankFourTensor
Definition: ACGrGrElasticDrivingForce.h:20
TensorMechanicsPlasticModel::activeConstraints
virtual void activeConstraints(const std::vector< Real > &f, const RankTwoTensor &stress, Real intnl, const RankFourTensor &Eijkl, std::vector< bool > &act, RankTwoTensor &returned_stress) const
The active yield surfaces, given a vector of yield functions.
Definition: TensorMechanicsPlasticModel.C:188
TensorMechanicsPlasticModel::dyieldFunction_dintnl
virtual Real dyieldFunction_dintnl(const RankTwoTensor &stress, Real intnl) const
The derivative of yield function with respect to the internal parameter.
Definition: TensorMechanicsPlasticModel.C:92