https://mooseframework.inl.gov
Loading...
Searching...
No Matches
SolidMechanicsPlasticModel.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// Plastic Model base class.
11//
13#include "RankFourTensor.h"
14
17{
19 params.addRequiredRangeCheckedParam<Real>("yield_function_tolerance",
20 "yield_function_tolerance>0",
21 "If the yield function is less than this amount, the "
22 "(stress, internal parameter) are deemed admissible.");
23 params.addRequiredRangeCheckedParam<Real>("internal_constraint_tolerance",
24 "internal_constraint_tolerance>0",
25 "The Newton-Raphson process is only deemed converged "
26 "if the internal constraint is less than this.");
28 "Plastic Model base class. Override the virtual functions in your class");
29 return params;
30}
31
33 : GeneralUserObject(parameters),
34 _f_tol(getParam<Real>("yield_function_tolerance")),
35 _ic_tol(getParam<Real>("internal_constraint_tolerance"))
36{
37}
38
39void
43
44void
48
49void
53
54unsigned
56{
57 return 1;
58}
59
60Real
61SolidMechanicsPlasticModel::yieldFunction(const RankTwoTensor & /*stress*/, Real /*intnl*/) const
62{
63 return 0.0;
64}
65
66void
68 Real intnl,
69 std::vector<Real> & f) const
70{
71 f.assign(1, yieldFunction(stress, intnl));
72}
73
76 Real /*intnl*/) const
77{
78 return RankTwoTensor();
79}
80
81void
83 Real intnl,
84 std::vector<RankTwoTensor> & df_dstress) const
85{
86 df_dstress.assign(1, dyieldFunction_dstress(stress, intnl));
87}
88
89Real
91 Real /*intnl*/) const
92{
93 return 0.0;
94}
95void
97 Real intnl,
98 std::vector<Real> & df_dintnl) const
99{
100 return df_dintnl.assign(1, dyieldFunction_dintnl(stress, intnl));
101}
102
104SolidMechanicsPlasticModel::flowPotential(const RankTwoTensor & /*stress*/, Real /*intnl*/) const
105{
106 return RankTwoTensor();
107}
108void
110 Real intnl,
111 std::vector<RankTwoTensor> & r) const
112{
113 return r.assign(1, flowPotential(stress, intnl));
114}
115
118 Real /*intnl*/) const
119{
120 return RankFourTensor();
121}
122void
124 Real intnl,
125 std::vector<RankFourTensor> & dr_dstress) const
126{
127 return dr_dstress.assign(1, dflowPotential_dstress(stress, intnl));
128}
129
132 Real /*intnl*/) const
133{
134 return RankTwoTensor();
135}
136void
138 Real intnl,
139 std::vector<RankTwoTensor> & dr_dintnl) const
140{
141 return dr_dintnl.assign(1, dflowPotential_dintnl(stress, intnl));
142}
143
144Real
145SolidMechanicsPlasticModel::hardPotential(const RankTwoTensor & /*stress*/, Real /*intnl*/) const
146{
147 return -1.0;
148}
149void
151 Real intnl,
152 std::vector<Real> & h) const
153{
154 h.assign(numberSurfaces(), hardPotential(stress, intnl));
155}
156
159 Real /*intnl*/) const
160{
161 return RankTwoTensor();
162}
163void
165 Real intnl,
166 std::vector<RankTwoTensor> & dh_dstress) const
167{
168 dh_dstress.assign(numberSurfaces(), dhardPotential_dstress(stress, intnl));
169}
170
171Real
173 Real /*intnl*/) const
174{
175 return 0.0;
176}
177void
179 Real intnl,
180 std::vector<Real> & dh_dintnl) const
181{
182 dh_dintnl.resize(numberSurfaces(), dhardPotential_dintnl(stress, intnl));
183}
184
185void
187 const RankTwoTensor & /*stress*/,
188 Real /*intnl*/,
189 const RankFourTensor & /*Eijkl*/,
190 std::vector<bool> & act,
191 RankTwoTensor & /*returned_stress*/) const
192{
193 mooseAssert(f.size() == numberSurfaces(),
194 "f incorrectly sized at " << f.size() << " in activeConstraints");
195 act.resize(numberSurfaces());
196 for (unsigned surface = 0; surface < numberSurfaces(); ++surface)
197 act[surface] = (f[surface] > _f_tol);
198}
199
200std::string
202{
203 return "None";
204}
205
206bool
208{
209 return false;
210}
211
212bool
214{
215 return false;
216}
217
218bool
220 Real intnl_old,
221 const RankFourTensor & /*E_ijkl*/,
222 Real /*ep_plastic_tolerance*/,
223 RankTwoTensor & /*returned_stress*/,
224 Real & /*returned_intnl*/,
225 std::vector<Real> & /*dpm*/,
226 RankTwoTensor & /*delta_dp*/,
227 std::vector<Real> & yf,
228 bool & trial_stress_inadmissible) const
229{
230 trial_stress_inadmissible = false;
231 yieldFunctionV(trial_stress, intnl_old, yf);
232
233 for (unsigned sf = 0; sf < numberSurfaces(); ++sf)
234 if (yf[sf] > _f_tol)
235 trial_stress_inadmissible = true;
236
237 // example of checking Kuhn-Tucker
238 std::vector<Real> dpm(numberSurfaces(), 0);
239 for (unsigned sf = 0; sf < numberSurfaces(); ++sf)
240 if (!KuhnTuckerSingleSurface(yf[sf], dpm[sf], 0))
241 return false;
242 return true;
243}
244
245bool
246SolidMechanicsPlasticModel::KuhnTuckerSingleSurface(Real yf, Real dpm, Real dpm_tol) const
247{
248 return (dpm == 0 && yf <= _f_tol) || (dpm > -dpm_tol && yf <= _f_tol && yf >= -_f_tol);
249}
250
253 const RankTwoTensor & /*trial_stress*/,
254 Real /*intnl_old*/,
255 const RankTwoTensor & /*stress*/,
256 Real /*intnl*/,
257 const RankFourTensor & E_ijkl,
258 const std::vector<Real> & /*cumulative_pm*/) const
259{
260 return E_ijkl;
261}
Real f(Real x)
Test function for Brents method.
static InputParameters validParams()
void addRequiredRangeCheckedParam(const std::string &name, const std::string &parsed_function, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
virtual RankTwoTensor flowPotential(const RankTwoTensor &stress, Real intnl) const
The flow potential.
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 Real dyieldFunction_dintnl(const RankTwoTensor &stress, Real intnl) const
The derivative of yield function with respect to the internal parameter.
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 RankTwoTensor dhardPotential_dstress(const RankTwoTensor &stress, Real intnl) const
The derivative of the hardening potential with respect to stress.
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 flowPotentialV(const RankTwoTensor &stress, Real intnl, std::vector< RankTwoTensor > &r) const
The flow potentials.
virtual bool useCustomCTO() const
Returns false. You will want to override this in your derived class if you write a custom consistent ...
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 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 std::string modelName() const =0
virtual void dyieldFunction_dstressV(const RankTwoTensor &stress, Real intnl, std::vector< RankTwoTensor > &df_dstress) const
The derivative of yield functions with respect to stress.
virtual bool useCustomReturnMap() const
Returns false. You will want to override this in your derived class if you write a custom returnMap f...
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 RankTwoTensor dyieldFunction_dstress(const RankTwoTensor &stress, Real intnl) const
The derivative of yield function with respect to stress.
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 hardPotentialV(const RankTwoTensor &stress, Real intnl, std::vector< Real > &h) const
The hardening potential.
virtual Real hardPotential(const RankTwoTensor &stress, Real intnl) const
The hardening potential.
bool KuhnTuckerSingleSurface(Real yf, Real dpm, Real dpm_tol) const
Returns true if the Kuhn-Tucker conditions for the single surface are satisfied.
virtual RankFourTensor dflowPotential_dstress(const RankTwoTensor &stress, Real intnl) const
The derivative of the flow potential with respect to stress.
SolidMechanicsPlasticModel(const InputParameters &parameters)
virtual unsigned int numberSurfaces() const
The number of yield surfaces for this plasticity model.
virtual RankTwoTensor dflowPotential_dintnl(const RankTwoTensor &stress, Real intnl) const
The derivative of the flow potential 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.
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 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.
static InputParameters validParams()