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