33 #ifndef PRANDTL_REUSS_IMPL_H_
34 #define PRANDTL_REUSS_IMPL_H_
38 #define PROFILE_PRANDTL_REUSS
39 #ifdef PROFILE_PRANDTL_REUSS
40 #define PRANDTL_REUSS_PROFILE_FUNC() PROFILE_FUNC_GROUP("Prandtl Reuss")
41 #define PRANDTL_REUSS_PROFILE_BEGIN(name) PROFILE_BEGIN_GROUP(name, "Prandtl Reuss")
42 #define PRANDTL_REUSS_PROFILE_END() PROFILE_END()
44 #define PRANDTL_REUSS_PROFILE_FUNC()
45 #define PRANDTL_REUSS_PROFILE_BEGIN(name)
46 #define PRANDTL_REUSS_PROFILE_END()
50 namespace SmallStrainMechanics{
52 template <
typename TDomain>
55 m_MaxHardIter(100), m_HardAccuracy(0.0), m_tangentAccur(1e-08),
56 m_bHardModulus(false), m_bHardExp(false)
69 ss <<
"Prandtl Reuss Plasticity: \n";
75 template <
typename TDomain>
84 case 0: m_hardening = 0;
85 ss << m_materialConfiguration <<
"perfect hardening \n";
86 m_materialConfiguration = ss.str();
90 case 1: m_hardening = 1;
91 ss << m_materialConfiguration <<
"linear hardening \n";
92 m_materialConfiguration = ss.str();
96 case 2: m_hardening = 2;
98 m_HardAccuracy = 1e-10;
99 ss << m_materialConfiguration <<
"exponential hardening \n"
100 <<
" max. hardening iterations = " << m_MaxHardIter <<
"\n"
101 <<
" hardening accuracy = " << m_HardAccuracy <<
"\n";
102 m_materialConfiguration = ss.str();
105 default:
UG_THROW(hard <<
" is not a valid hardening behavior! "
106 "Choose 0 (perfect), 1 (linear) or 2 (exponential) ! \n");
110 template <
typename TDomain>
116 if (m_hardening == 1){
118 UG_THROW(
"No hardening modulus set! This is necessary for a "
119 "linear hardening law in PrandtlReuss::init() \n");
122 if (m_hardening == 2){
124 UG_THROW(
"No hardening modulus set! This is necessary for an "
125 "exponential hardening law in PrandtlReuss::init() \n");
127 UG_THROW(
"No hardening exponent set! This is necessary for an "
128 "exponential hardening law in PrandtlReuss::init() \n");
132 template <
typename TDomain>
141 Flowrule(strain_p_new, strain, gamma, strial,
normal, GradU, strain_p_old_t, alpha);
142 ConstLaw(stressTens, strain, strial, gamma,
normal);
145 template <
typename TDomain>
155 number alpha = m_pElemData->internalVars[ip].alpha;
157 StressTensor(stressTens, GradU, strain_p_old_t, alpha);
161 template <
typename TDomain>
170 number alpha = m_pElemData->internalVars[ip].alpha;
179 StressTensor(stressT, GradU, strain_p_old_t, alpha);
181 for (
size_t i = 0; i < (size_t)
dim; ++i)
182 for (
size_t j = 0; j < (size_t)
dim; ++j)
184 GradU[i][j] += m_tangentAccur;
186 StressTensor(stressTT, GradU, strain_p_old_t, alpha);
188 for (
size_t k = 0; k < (size_t)
dim; ++k)
189 for (
size_t l = 0; l < (size_t)
dim; ++l)
190 elastTens[i][j][k][l] = 1.0/ m_tangentAccur * (stressTT[k][l] - stressT[k][l]);
192 GradU[i][j] -= m_tangentAccur;
202 if (k_tan > m_max_k_tan)
204 if (k_tan < m_min_k_tan)
214 template <
typename TDomain>
219 m_aaElemData[elem].internalVars.resize(numIP);
223 for (
size_t ip = 0; ip < numIP; ++ip)
225 m_aaElemData[elem].internalVars[ip].strain_p_old_t = 0.0;
226 m_aaElemData[elem].internalVars[ip].alpha = 0.0;
229 if (!base_type::m_bInit)
230 base_type::m_bInit =
true;
233 template <
typename TDomain>
239 m_pElemData = &m_aaElemData[elem];
242 template <
typename TDomain>
249 number alpha = m_pElemData->internalVars[ip].alpha;
253 Update_internal_vars(strain_p_old_t, alpha, GradU, strain_p_old_t);
254 m_pElemData->internalVars[ip].alpha = alpha;
257 template <
typename TDomain>
267 for(
size_t i = 0; i < (size_t)
dim; ++i)
268 for(
size_t j = 0; j < (size_t)
dim; ++j)
269 strainTensTrial[i][j] = 0.5 * (GradU[i][j] + GradU[j][i]) - strain_p_old_t[i][j];
275 for(
size_t i = 0; i < (size_t)
dim; ++i)
276 for(
size_t j = 0; j < (size_t)
dim; ++j)
277 strial[i][j] = 2.0 * matConsts.mu * dev_strainTrial[i][j];
280 number flowcondtrial = strialnorm - sqrt(2.0 / 3.0) * Hardening(alpha);
282 if (flowcondtrial <= 0){
283 strain_p_new = strain_p_old_t;
return;
290 UG_ASSERT(strialnorm > 0.0,
"norm of strial needs to be > 0.0");
295 case 0: gamma = PerfectPlasticity(flowcondtrial);
break;
296 case 1: gamma = LinearHardening(flowcondtrial);
break;
297 case 2: gamma = ExponentialHardening(strialnorm, alpha);
break;
299 UG_THROW(m_hardening <<
" in 'Update' is not a valid hardening behavior! \n");
303 MatScale(normaltrial, 1.0 / strialnorm, strial);
305 UG_ASSERT(gamma > 0.0,
"gamma needs to be > 0.0");
308 MatScale(d_strain_p, gamma, normaltrial);
309 MatAdd(strain_p_new, strain_p_old_t, d_strain_p);
311 alpha += sqrt(2.0 / 3.0) * gamma;
314 template <
typename TDomain>
320 for(
size_t i = 0; i < (size_t)
dim; ++i)
321 for(
size_t j = 0; j < (size_t)
dim; ++j)
322 strainTens[i][j] = 0.5 * (GradU[i][j] + GradU[j][i]);
325 template <
typename TDomain>
339 for(
size_t i = 0; i < (size_t)
dim; ++i)
340 for(
size_t j = 0; j < (size_t)
dim; ++j)
342 strain[i][j] = 0.5 * (GradU[i][j] + GradU[j][i]);
344 strain_trial[i][j] = strain[i][j] - strain_p_old_t[i][j];
351 MatScale(strial, 2.0 * matConsts.mu, dev_strain_trial);
354 number flowcondtrial = strialnorm - sqrt(2.0 / 3.0) * Hardening(alpha);
360 if (flowcondtrial <= 0){
361 strain_p_new = strain_p_old_t; gamma = 0.0;
369 UG_ASSERT(strialnorm > 0.0,
"norm of strial needs to be > 0.0");
375 case 0: gamma = PerfectPlasticity(flowcondtrial);
break;
376 case 1: gamma = LinearHardening(flowcondtrial);
break;
377 case 2: gamma = ExponentialHardening(strialnorm, alpha);
break;
379 UG_THROW(m_hardening <<
" in 'Flowrule' is not a valid hardening behavior! \n");
382 UG_ASSERT(gamma > 0.0,
"gamma needs to be > 0.0");
388 MatAdd(strain_p_new, strain_p_old_t, d_strain_p);
391 template <
typename TDomain>
401 for(
size_t i = 0; i < (size_t)
dim; ++i)
403 for(
size_t j = 0; j < (size_t)
dim; ++j)
404 stressTens[i][j] = strial[i][j] - 2.0 * matConsts.mu * gamma *
normal[i][j];
406 stressTens[i][i] += matConsts.kappa * trStrain;
411 template <
typename TDomain>
418 number alpha = m_pElemData->internalVars[ip].alpha;
427 for(
size_t i = 0; i < (size_t)
dim; ++i)
428 for(
size_t j = 0; j < (size_t)
dim; ++j)
431 strain_trial[i][j] = 0.5 * (GradU[i][j] + GradU[j][i]) - strain_p_old_t[i][j];
439 MatScale(strial, 2.0 * matConsts.mu, dev_strain_trial);
442 number flowcondtrial = strialnorm - sqrt(2.0 / 3.0) * Hardening(alpha);
448 if (flowcondtrial <= 0){
456 UG_ASSERT(strialnorm > 0.0,
"norm of strial needs to be > 0.0");
464 case 0: gamma = PerfectPlasticity(flowcondtrial);
break;
465 case 1: gamma = LinearHardening(flowcondtrial);
break;
466 case 2: gamma = ExponentialHardening(strialnorm, alpha);
break;
468 UG_THROW(m_hardening <<
" in 'Flowrule' is not a valid hardening behavior! \n");
471 UG_ASSERT(gamma > 0.0,
"gamma needs to be > 0.0");
476 template <
typename TDomain>
482 return (matConsts.K_0 + matConsts.Hard * alpha +
483 (matConsts.K_inf - matConsts.K_0) * (1.0 - exp(-matConsts.omega * alpha)));
487 template <
typename TDomain>
493 return (matConsts.Hard + (matConsts.K_inf - matConsts.K_0) * matConsts.omega
494 * exp(-matConsts.omega * alpha));
497 template <
typename TDomain>
503 return flowcondtrial / (2.0 * matConsts.mu);
506 template <
typename TDomain>
512 return flowcondtrial / (2.0 * (matConsts.mu + matConsts.Hard/3.0));
515 template <
typename TDomain>
522 for (
size_t i = 0; i < m_MaxHardIter; ++i) {
524 number f_cap = strialnorm - 2.0 * gamma * matConsts.mu - sqrt(2.0 / 3.0) * Hardening(
525 alpha + sqrt(2.0 / 3.0) * gamma);
528 if (f_cap < m_HardAccuracy * strialnorm){
break;}
530 gamma += f_cap / (2.0 * matConsts.mu * (1.0 + Hardening_d(
531 alpha + sqrt(2.0 / 3.0) * gamma) / (3.0 * matConsts.mu)));
537 template <
typename TDomain>
542 UG_LOG(
"maximal k_tan:" << m_max_k_tan <<
"\n");
543 UG_LOG(
"minimal k_tan:" << m_min_k_tan <<
"\n");
546 UG_LOG(
"# of plastic IPs in this timestep:" << m_plasticIPs <<
"\n");
Definition: mat_law_interface.h:44
virtual SmartPtr< MathTensor4< dim, dim, dim, dim > > elasticityTensor()
Definition: mat_law_interface.h:84
bool m_bConstElastTens
flag indicating, if elasticity tensor is constant
Definition: mat_law_interface.h:131
std::string m_materialConfiguration
Definition: mat_law_interface.h:124
matrix_t::value_type MatDeviatorTrace(const matrix_t &m, matrix_t &dev)
void MatSubtract(matrix_t &mOut, const matrix_t &m, typename matrix_t::value_type s)
MathMatrix< 1, 1, T >::value_type Trace(const MathMatrix< 1, 1, T > &m)
void MatAdd(matrix_t &mOut, const matrix_t &m, typename matrix_t::value_type s)
void MatScale(matrix_t &mOut, typename matrix_t::value_type s, const matrix_t &m)
matrix_t::value_type MatFrobeniusNorm(matrix_t &m)
PrandtlReuss()
constructor
Definition: prandtl_reuss_impl.h:53
number K_0
Definition: prandtl_reuss.h:251
number m_min_k_tan
Definition: prandtl_reuss.h:266
number Hardening(const number alpha)
Definition: prandtl_reuss_impl.h:480
void strainTensor(MathMatrix< dim, dim > &strainTens, const MathMatrix< dim, dim > &GradU)
Definition: prandtl_reuss_impl.h:318
void ConstLaw(MathMatrix< dim, dim > &stressTens, const MathMatrix< dim, dim > &strainTens, const MathMatrix< dim, dim > &strial, const number &gamma, const MathMatrix< dim, dim > &normal)
Definition: prandtl_reuss_impl.h:394
void set_hardening_behavior(int hard)
Definition: prandtl_reuss_impl.h:78
number Hard
Definition: prandtl_reuss.h:253
number omega
Definition: prandtl_reuss.h:254
void StressTensor(MathMatrix< dim, dim > &stressTens, const MathMatrix< dim, dim > &GradU, const MathMatrix< dim, dim > &strain_p_old_t, const number alpha)
Definition: prandtl_reuss_impl.h:135
struct ug::SmallStrainMechanics::PrandtlReuss::MaterialConstants matConsts
virtual void update_internal_vars(const size_t ip, const MathMatrix< dim, dim > &GradU)
Definition: prandtl_reuss_impl.h:245
void Flowrule(MathMatrix< dim, dim > &strain_p_new, MathMatrix< dim, dim > &strain, number &gamma, MathMatrix< dim, dim > &strial, MathMatrix< dim, dim > &normal, const MathMatrix< dim, dim > &GradU, const MathMatrix< dim, dim > &strain_p_old_t, const number alpha)
Definition: prandtl_reuss_impl.h:328
number ExponentialHardening(const number strialnorm, const number alpha)
Definition: prandtl_reuss_impl.h:518
number PerfectPlasticity(const number flowcondtrial)
Definition: prandtl_reuss_impl.h:501
virtual void write_data_to_console(const number t)
Definition: prandtl_reuss_impl.h:540
base_type::TBaseElem TBaseElem
base element type
Definition: prandtl_reuss.h:83
void stressTensor(MathMatrix< dim, dim > &stressTens, const size_t ip, const MathMatrix< dim, dim > &GradU)
computes the cauchy stress tensor sigma at an integration point 'ip'
Definition: prandtl_reuss_impl.h:148
number Hardening_d(const number alpha)
Definition: prandtl_reuss_impl.h:491
number kappa
Definition: prandtl_reuss.h:250
number K_inf
Definition: prandtl_reuss.h:252
number m_max_k_tan
max condition number for numerical approximated matrix
Definition: prandtl_reuss.h:265
virtual void internal_vars(TBaseElem *elem)
Definition: prandtl_reuss_impl.h:237
number mu
Definition: prandtl_reuss.h:249
virtual number plastic_multiplier(const size_t ip, const MathMatrix< dim, dim > &GradU)
Definition: prandtl_reuss_impl.h:414
number LinearHardening(const number flowcondtrial)
Definition: prandtl_reuss_impl.h:510
int m_hardening
hardening behavior
Definition: prandtl_reuss.h:244
virtual void init_internal_vars(TBaseElem *elem, const size_t numIP)
Definition: prandtl_reuss_impl.h:217
void init()
Definition: prandtl_reuss_impl.h:113
size_t m_plasticIPs
Definition: prandtl_reuss.h:267
void Update_internal_vars(MathMatrix< dim, dim > &strain_p_new, number &alpha, const MathMatrix< dim, dim > &GradU, const MathMatrix< dim, dim > &strain_p_old_t)
Definition: prandtl_reuss_impl.h:260
#define UG_ASSERT(expr, msg)
#define PRANDTL_REUSS_PROFILE_BEGIN(name)
Definition: prandtl_reuss_impl.h:41