MenetreyWillam.h
Go to the documentation of this file.
1 /* ---------------------------------------------------------------------
2  * _
3  * _ __ ___ __ _ _ __ _ __ ___ ___ | |_
4  * | '_ ` _ \ / _` | '__| '_ ` _ \ / _ \| __|
5  * | | | | | | (_| | | | | | | | | (_) | |_
6  * |_| |_| |_|\__,_|_| |_| |_| |_|\___/ \__|
7  *
8  * Unit of Strength of Materials and Structural Analysis
9  * University of Innsbruck,
10  * 2020 - today
11  *
12  * festigkeitslehre@uibk.ac.at
13  *
14  * Matthias Neuner matthias.neuner@uibk.ac.at
15  * Magdalena Schreter magdalena.schreter@uibk.ac.at
16  *
17  * This file is part of the MAteRialMOdellingToolbox (marmot).
18  *
19  * This library is free software; you can redistribute it and/or
20  * modify it under the terms of the GNU Lesser General Public
21  * License as published by the Free Software Foundation; either
22  * version 2.1 of the License, or (at your option) any later version.
23  *
24  * The full text of the license can be found in the file LICENSE.md at
25  * the top level directory of marmot.
26  * ---------------------------------------------------------------------
27  */
28 
29 #pragma once
31 #include <utility>
32 
33 namespace Marmot {
34  namespace ContinuumMechanics::CommonConstitutiveModels {
35 
57  // clang-format off
78  // clang-format on
80  public:
86  double Af;
88  double Bf;
90  double Cf;
92  double m;
93  double e;
96  } param;
97 
98  // Reduction of the generalized failure criterion to a specific type.
99  enum class MenetreyWillamType {
100  Mises,
102  Rankine,
105  DruckerPrager,
108  MohrCoulomb
112  };
113 
120  MenetreyWillam( const double ft,
122  const double fc = 0 );
123 
129  void setParameters( const double ft, const double fc, const MenetreyWillamType& type );
130 
135  template < typename T >
136  T polarRadius( const double& theta ) const
137  {
138  return polarRadius( theta, param.e );
139  }
140 
146  template < typename T >
147  static T polarRadius( const T& theta, const double& e )
148  {
149  // computes the deviatoric shape roundness for a given eccentricity (e) at a certain
150  // position (theta) the numerator and denominator are stored for performance reasons, as
151  // they are also needed for the derivative dRdTheta
152  if ( e >= 1.0 )
153  return 1;
154 
155  const double e2 = e * e;
156  const T cosTheta = cos( theta );
157  const T cos2Theta = cosTheta * cosTheta;
158 
159  const T numerator = ( 4. * ( 1. - e2 ) * cos2Theta + ( 2. * e - 1. ) * ( 2. * e - 1. ) );
160  const T denominator = ( 2. * ( 1. - e2 ) * cosTheta +
161  ( 2. * e - 1. ) * sqrt( 4. * ( 1. - e2 ) * cos2Theta + 5. * e2 - 4. * e ) );
162 
163  const T r = numerator / denominator;
164 
165  return r;
166  }
172  template < typename T >
173  std::pair< T, T > dPolarRadius_dTheta( const T& theta ) const
174  {
175  return dPolarRadius_dTheta( theta, param.e );
176  }
177 
183  template < typename T >
184  static std::pair< T, T > dPolarRadius_dTheta( const T& theta, const double& e )
185  {
186  //
187  // computes the deviatoric shape roundness for a given eccentricity (e) at a certain
188  // position (theta) the numerator and denominator are stored for performance reasons, as
189  // they are also needed for the derivative dRdTheta
190  T r, dRdTheta;
191 
192  if ( e >= 1.0 ) {
193  r = 1;
194  dRdTheta = 0;
195  return std::make_pair( r, dRdTheta );
196  }
197 
198  const double e2 = e * e;
199  const T cosTheta = cos( theta );
200  const T cos2Theta = cosTheta * cosTheta;
201 
202  T numerator = ( 4. * ( 1. - e2 ) * cos2Theta + ( 2. * e - 1. ) * ( 2. * e - 1. ) );
203  T denominator = ( 2. * ( 1. - e2 ) * cosTheta +
204  ( 2. * e - 1. ) * sqrt( 4. * ( 1. - e2 ) * cos2Theta + 5. * e2 - 4. * e ) );
205 
206  r = numerator / denominator;
207 
208  // compute the derivative
209  const T sinTheta = sin( theta );
210 
211  const T a = numerator;
212  const T b = 1. / denominator;
213  const T aux = 4. * ( 1. - e2 ) * cos2Theta + 5. * e2 - 4. * e;
214  const T dAuxdTheta = 4. * ( 1. - e2 ) * 2. * cosTheta * -sinTheta;
215  const T dadTheta = 2. * cosTheta * ( -sinTheta ) * 4. * ( 1. - e2 );
216  const T dbdTheta = -pow( denominator, -2. ) * ( 2. * ( 1. - e2 ) * -sinTheta +
217  ( 2. * e - 1 ) * 1. / 2 * pow( aux, -1. / 2 ) * dAuxdTheta );
218  dRdTheta = b * dadTheta + a * dbdTheta;
219 
220  return { r, dRdTheta };
221  }
222 
223  template < typename T >
224  static std::tuple< T, T, T > d2PolarRadius_dTheta2( const T& theta, const double& e )
225  {
226 
227  const auto [r, dr_dTheta] = dPolarRadius_dTheta< T >( theta, e );
228  if ( e >= 1.0 ) {
229  return { r, dr_dTheta, 0 };
230  }
231 
232  const double e2 = pow( e, 2 );
233  const double e2m1 = e2 - 1;
234  const double tem1 = 2 * e - 1;
235 
236  const T cos_theta = cos( theta );
237  const T sin_theta = sin( theta );
238  const T cos_2_theta = cos_theta * cos_theta;
239  const T sin_2_theta = sin_theta * sin_theta;
240 
241  const T x = 5. * e2 - 4. * e - 4. * e2m1 * cos_2_theta;
242  const T sqrt_x = sqrt( x );
243 
244  const T one_over_sqrt_x = 1. / sqrt_x;
245 
246  const T d2r_dTheta2 = e2m1 *
247  ( -16. * e2m1 * ( 4.0 * tem1 * one_over_sqrt_x * cos_theta + 2. ) * sin_2_theta *
248  cos_theta / ( tem1 * sqrt_x - 2 * e2m1 * cos_theta ) -
249  8. * sin_2_theta + 8. * cos_2_theta +
250  ( pow( 2. * e - 1., 2 ) - 4 * e2m1 * cos_2_theta ) *
251  ( 16.0 * tem1 * e2m1 * pow( x, -1.5 ) * sin_2_theta * cos_2_theta +
252  4.0 * tem1 * one_over_sqrt_x * sin_2_theta -
253  4.0 * tem1 * one_over_sqrt_x * cos_2_theta +
254  e2m1 * ( 4.0 * tem1 * one_over_sqrt_x * cos_theta + 2. ) *
255  ( 8.0 * tem1 * one_over_sqrt_x * cos_theta + 4. ) * sin_2_theta /
256  ( tem1 * sqrt_x - 2. * e2m1 * cos_theta ) -
257  2. * cos_theta ) /
258  ( tem1 * sqrt_x - 2. * e2m1 * cos_theta ) ) /
259  ( tem1 * sqrt_x - 2. * e2m1 * cos_theta );
260 
261  return { r, dr_dTheta, d2r_dTheta2 };
262  }
263 
272  template < typename T >
274  const double varEps = 0.0 ) const
275  {
276  const T r_ = polarRadius( hw.theta, param.e );
277  if ( varEps == 0 )
278  return ( param.Af * hw.rho ) * ( param.Af * hw.rho ) +
279  param.m * ( param.Bf * hw.rho * r_ + param.Cf * hw.xi ) - 1.;
280  else
281  return param.Af * param.Af * hw.rho * hw.rho +
282  param.m * ( std::sqrt( param.Bf * hw.rho * r_ * param.Bf * hw.rho * r_ + varEps * varEps ) +
283  param.Cf * hw.xi ) -
284  1.;
285  }
286 
294  template < typename T >
295  std::tuple< T, T, T > dYieldFunction_dHaighWestergaard(
297  const double varEps = 0.0 ) const
298  {
299  const auto [r_, dRdTheta_] = dPolarRadius_dTheta( hw.theta, param.e );
300 
301  T dFdXi, dFdRho, dFdTheta;
302  dFdXi = param.m * param.Cf;
303 
304  if ( varEps == 0.0 ) {
305  dFdRho = 2. * param.Af * hw.rho * param.Af + param.m * param.Bf * r_;
306  dFdTheta = param.m * param.Bf * hw.rho * dRdTheta_;
307  }
308  else {
309  const T auxTerm1 = param.m * 0.5 *
310  pow( param.Bf * param.Bf * hw.rho * hw.rho * r_ * r_ + varEps * varEps, -0.5 ) * 2 *
311  param.Bf * hw.rho * r_ * param.Bf;
312 
313  dFdRho = param.Af * param.Af * 2. * hw.rho + auxTerm1 * r_;
314  dFdTheta = auxTerm1 * hw.rho * dRdTheta_;
315  }
316 
317  return { dFdXi, dFdRho, dFdTheta };
318  }
319 
326  static inline double abaqusMohrCoulombPotentialVarEpsToMenetreyWillam( const double varEps, const double psi )
327  {
328  return varEps * 2 * std::sin( psi );
329  }
330 
335  static inline double e( const double fc, const double ft ) { return ( fc + 2 * ft ) / ( 2 * fc + ft ); }
336 
341  static inline double c( const double fc, const double ft )
342  {
343  const double phi_ = phi( fc, ft );
344  return ft * ( 1 + std::sin( phi_ ) ) / ( 2 + std::cos( phi_ ) );
345  }
346 
351  static inline double phi( const double fc, const double ft ) { return std::asin( ( fc - ft ) / ( fc + ft ) ); }
352 
356  static inline double ft( const double c, const double phi )
357  {
358  return 2 * c * std::cos( phi ) / ( 1 + std::sin( phi ) );
359  }
360 
364  static inline double fc( const double c, const double phi )
365  {
366  return 2 * c * std::cos( phi ) / ( 1 - std::sin( phi ) );
367  }
368  };
369 
370  } // namespace ContinuumMechanics::CommonConstitutiveModels
371 } // namespace Marmot
Marmot::ContinuumMechanics::CommonConstitutiveModels::MenetreyWillam::MenetreyWillamParameters::Af
double Af
Definition: MenetreyWillam.h:86
HaighWestergaard.h
Marmot::ContinuumMechanics::CommonConstitutiveModels::MenetreyWillam::MenetreyWillamType::Mises
@ Mises
Marmot::ContinuumMechanics::CommonConstitutiveModels::MenetreyWillam::e
static double e(const double fc, const double ft)
Definition: MenetreyWillam.h:335
Marmot::ContinuumMechanics::CommonConstitutiveModels::MenetreyWillam::d2PolarRadius_dTheta2
static std::tuple< T, T, T > d2PolarRadius_dTheta2(const T &theta, const double &e)
Definition: MenetreyWillam.h:224
Marmot::ContinuumMechanics::CommonConstitutiveModels::MenetreyWillam::phi
static double phi(const double fc, const double ft)
Definition: MenetreyWillam.h:351
Marmot::ContinuumMechanics::CommonConstitutiveModels::MenetreyWillam::fc
static double fc(const double c, const double phi)
Definition: MenetreyWillam.h:364
Marmot::ContinuumMechanics::CommonConstitutiveModels::MenetreyWillam::abaqusMohrCoulombPotentialVarEpsToMenetreyWillam
static double abaqusMohrCoulombPotentialVarEpsToMenetreyWillam(const double varEps, const double psi)
Definition: MenetreyWillam.h:326
Marmot::ContinuumMechanics::CommonConstitutiveModels::MenetreyWillam::polarRadius
T polarRadius(const double &theta) const
Definition: MenetreyWillam.h:136
Marmot::ContinuumMechanics::CommonConstitutiveModels::MenetreyWillam::dYieldFunction_dHaighWestergaard
std::tuple< T, T, T > dYieldFunction_dHaighWestergaard(const ContinuumMechanics::HaighWestergaard::HaighWestergaardCoordinates< T > &hw, const double varEps=0.0) const
Definition: MenetreyWillam.h:295
Marmot::ContinuumMechanics::CommonConstitutiveModels::MenetreyWillam::MenetreyWillamParameters::Bf
double Bf
Definition: MenetreyWillam.h:88
Marmot::ContinuumMechanics::CommonConstitutiveModels::MenetreyWillam::MenetreyWillamType
MenetreyWillamType
Definition: MenetreyWillam.h:99
Marmot::ContinuumMechanics::CommonConstitutiveModels::MenetreyWillam::MenetreyWillam
MenetreyWillam(const double ft, const MenetreyWillamType &type=MenetreyWillamType::Rankine, const double fc=0)
Definition: MenetreyWillam.cpp:11
Marmot::ContinuumMechanics::CommonConstitutiveModels::MenetreyWillam::c
static double c(const double fc, const double ft)
Definition: MenetreyWillam.h:341
Marmot::ContinuumMechanics::HaighWestergaard::HaighWestergaardCoordinates
Definition: HaighWestergaard.h:43
Marmot::ContinuumMechanics::CommonConstitutiveModels::MenetreyWillam::polarRadius
static T polarRadius(const T &theta, const double &e)
Definition: MenetreyWillam.h:147
Marmot::ContinuumMechanics::CommonConstitutiveModels::MenetreyWillam::setParameters
void setParameters(const double ft, const double fc, const MenetreyWillamType &type)
Definition: MenetreyWillam.cpp:16
Marmot::ContinuumMechanics::HaighWestergaard::HaighWestergaardCoordinates::xi
T xi
Hydrostatic component .
Definition: HaighWestergaard.h:46
Marmot::ContinuumMechanics::CommonConstitutiveModels::MenetreyWillam::yieldFunction
T yieldFunction(const ContinuumMechanics::HaighWestergaard::HaighWestergaardCoordinates< T > &hw, const double varEps=0.0) const
Definition: MenetreyWillam.h:273
Marmot::ContinuumMechanics::CommonConstitutiveModels::MenetreyWillam::param
struct Marmot::ContinuumMechanics::CommonConstitutiveModels::MenetreyWillam::MenetreyWillamParameters param
Marmot::ContinuumMechanics::CommonConstitutiveModels::MenetreyWillam::MenetreyWillamParameters::e
double e
Definition: MenetreyWillam.h:93
Marmot
This file includes functions needed for calculations with stress and strain tensors written in voigt ...
Definition: MarmotTesting.h:30
Marmot::ContinuumMechanics::CommonConstitutiveModels::MenetreyWillam::MenetreyWillamType::MohrCoulomb
@ MohrCoulomb
Marmot::ContinuumMechanics::CommonConstitutiveModels::MenetreyWillam::MenetreyWillamType::Rankine
@ Rankine
Marmot::ContinuumMechanics::HaighWestergaard::HaighWestergaardCoordinates::rho
T rho
Deviatoric radius .
Definition: HaighWestergaard.h:48
Marmot::ContinuumMechanics::CommonConstitutiveModels::MenetreyWillam::MenetreyWillamParameters::Cf
double Cf
Definition: MenetreyWillam.h:90
Marmot::ContinuumMechanics::CommonConstitutiveModels::MenetreyWillam::MenetreyWillamParameters
Definition: MenetreyWillam.h:85
Marmot::ContinuumMechanics::HaighWestergaard::HaighWestergaardCoordinates::theta
T theta
Lode angle specified in radian.
Definition: HaighWestergaard.h:50
Marmot::ContinuumMechanics::CommonConstitutiveModels::MenetreyWillam::MenetreyWillamType::DruckerPrager
@ DruckerPrager
Marmot::ContinuumMechanics::CommonConstitutiveModels::MenetreyWillam::dPolarRadius_dTheta
std::pair< T, T > dPolarRadius_dTheta(const T &theta) const
Definition: MenetreyWillam.h:173
Marmot::ContinuumMechanics::CommonConstitutiveModels::MenetreyWillam
Generalized failure criterion proposed by Menétrey and Willam.
Definition: MenetreyWillam.h:79
Marmot::ContinuumMechanics::CommonConstitutiveModels::MenetreyWillam::dPolarRadius_dTheta
static std::pair< T, T > dPolarRadius_dTheta(const T &theta, const double &e)
Definition: MenetreyWillam.h:184
Marmot::ContinuumMechanics::CommonConstitutiveModels::MenetreyWillam::ft
static double ft(const double c, const double phi)
Definition: MenetreyWillam.h:356
Marmot::ContinuumMechanics::CommonConstitutiveModels::MenetreyWillam::MenetreyWillamParameters::m
double m
Definition: MenetreyWillam.h:92