MarmotEnergyDensityFunctions.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  * Alexander Dummer alexander.dummer@uibk.ac.at
15  *
16  * This file is part of the MAteRialMOdellingToolbox (marmot).
17  *
18  * This library is free software; you can redistribute it and/or
19  * modify it under the terms of the GNU Lesser General Public
20  * License as published by the Free Software Foundation; either
21  * version 2.1 of the License, or (at your option) any later version.
22  *
23  * The full text of the license can be found in the file LICENSE.md at
24  * the top level directory of marmot.
25  * ---------------------------------------------------------------------
26  */
27 
28 #pragma once
29 #include "Fastor/Fastor.h"
31 
33 
34  namespace EnergyDensityFunctions {
35 
36  using namespace Fastor;
37  using namespace FastorStandardTensors;
38 
39  template < typename T >
40  // \brief Hyperelastic Energy Density Function Wa acc. Pence & Gou (2015), Eq. (2.11)
41  T PenceGouPotentialA( const Tensor33t< T >& C, const double K, const double G )
42  {
43 
44  const T J = sqrt( determinant( C ) );
45  const T I1 = trace( C );
46 
47  T res = G / 2. * ( I1 - 3. ) + ( K / 2. - G / 3. ) * pow( J - 1, 2 ) - G * log( J );
48 
49  return res;
50  }
51 
52  template < typename T >
53  // \brief Hyperelastic Energy Density Function Wb acc. Pence & Gou (2015), Eq. (2.12)
54  T PenceGouPotentialB( const Tensor33t< T >& C, const double K, const double G )
55  {
56 
57  const T J = sqrt( determinant( C ) );
58  const T I1 = trace( C );
59 
60  T res = K / 8. * pow( J - 1. / J, 2. ) + G / 2. * ( I1 * pow( J, -2. / 3 ) - 3. );
61 
62  return res;
63  }
64 
65  template < typename T >
66  // \brief Hyperelastic Energy Density Function Wc acc. Pence & Gou (2015), Eq. (2.13)
67  T PenceGouPotentialC( const Tensor33t< T >& C, const double K, const double G )
68  {
69 
70  const T J = sqrt( determinant( C ) );
71  const T I1 = trace( C );
72 
73  T res = G / 2. * ( I1 - 3. ) + 3. * G * G / ( 3. * K - 2. * G ) * ( pow( J, 2. / 3 - K / G ) - 1 );
74 
75  return res;
76  }
77 
78  namespace FirstOrderDerived {
79 
80  template < typename T >
81  std::tuple< T, Tensor33t< T > > PenceGouPotentialB( const Tensor33t< T >& C, const double K, const double G )
82  {
83  using namespace FastorIndices;
84 
85  const T J = sqrt( determinant( C ) );
86  const T I1 = trace( C );
87  // energy density
88  T psi = K / 8. * pow( J - 1. / J, 2. ) + G / 2. * ( I1 * pow( J, -2. / 3 ) - 3. );
89 
90  // first derivative w.r.t. C
91  const T dPsi_dJ = K / 4. * ( J - 1. / J ) * ( 1. + 1. / ( J * J ) ) - G / 3. * I1 * pow( J, -5. / 3. );
92  const T dPsi_dI1 = G / 2. * pow( J, -2. / 3. );
93 
94  const Tensor33t< T > CInv = inverse( C );
95  const Tensor33t< T > dJ_dC = multiplyFastorTensorWithScalar( transpose( CInv ), T( J / 2. ) );
96  const Tensor33t< T > dI1_dC = fastorTensorFromDoubleTensor< T >( Spatial3D::I );
97 
98  Tensor33t< T > dPsi_dC = multiplyFastorTensorWithScalar( dJ_dC, dPsi_dJ ) +
99  multiplyFastorTensorWithScalar( dI1_dC, dPsi_dI1 );
100 
101  return { psi, dPsi_dC };
102  }
103  } // namespace FirstOrderDerived
104 
105  namespace SecondOrderDerived {
106 
107  template < typename T >
108  std::tuple< T, Tensor33t< T >, Tensor3333t< T > > PenceGouPotentialB( const Tensor33t< T >& C,
109  const double K,
110  const double G )
111  {
112  using namespace FastorIndices;
113 
114  const T J = sqrt( determinant( C ) );
115  const T I1 = trace( C );
116  // energy density
117  T psi = K / 8. * pow( J - 1. / J, 2. ) + G / 2. * ( I1 * pow( J, -2. / 3 ) - 3. );
118 
119  // first derivative w.r.t. C
120  const T dPsi_dJ = K / 4. * ( J - 1. / J ) * ( 1 + 1. / ( J * J ) ) - G / 3. * I1 * pow( J, -5. / 3. );
121  const T dPsi_dI1 = G / 2. * pow( J, -2. / 3. );
122 
123  const Tensor33t< T > CInv = inverse( C );
124  const Tensor33t< T > dJ_dC = 0.5 * J * transpose( CInv );
125  const Tensor33t< T > dI1_dC = Spatial3D::I;
126 
127  Tensor33t< T > dPsi_dC = dPsi_dJ * dJ_dC + dPsi_dI1 * dI1_dC;
128 
129  // second derivative w.r.t. C
130  const T d2Psi_dJdJ = K / 4. * ( 1. + 3. / ( J * J * J * J ) ) + 5. / 9. * G * I1 * pow( J, -8. / 3. );
131  const T d2Psi_dJdI1 = -G / 3. * pow( J, -5. / 3. );
132  Tensor3333t< T > d2J_dCdC = J / 4. * einsum< JI, LK, to_IJKL >( CInv, CInv ) -
133  J / 2. * einsum< JK, LI, to_IJKL >( CInv, CInv );
134 
135  Tensor3333t< T > d2Psi_dCdC = d2Psi_dJdJ * einsum< IJ, KL >( dJ_dC, dJ_dC ) + dPsi_dJ * d2J_dCdC +
136  d2Psi_dJdI1 *
137  ( einsum< IJ, KL >( dJ_dC, dI1_dC ) + einsum< IJ, KL >( dI1_dC, dJ_dC ) );
138 
139  return { psi, dPsi_dC, d2Psi_dCdC };
140  }
141 
142  } // namespace SecondOrderDerived
143 
144  } // namespace EnergyDensityFunctions
145 
146 } // namespace Marmot::ContinuumMechanics
MarmotFastorTensorBasics.h
Marmot::multiplyFastorTensorWithScalar
Fastor::Tensor< T, Rest... > multiplyFastorTensorWithScalar(Fastor::Tensor< T, Rest... > tensor, T scalar)
Definition: MarmotFastorTensorBasics.h:338
Marmot::FastorStandardTensors::Tensor3333t
Fastor::Tensor< T, 3, 3, 3, 3 > Tensor3333t
Definition: MarmotFastorTensorBasics.h:49
Marmot::FastorStandardTensors::Spatial3D::I
const Tensor33d I
Definition: MarmotFastorTensorBasics.h:57
Marmot::ContinuumMechanics::VoigtNotation::Invariants::I1
T I1(const Eigen::Matrix< T, 6, 1 > &stress)
Definition: MarmotVoigt.h:404
Marmot::ContinuumMechanics
Definition: MarmotDeformationMeasures.h:31
Marmot::ContinuumMechanics::EnergyDensityFunctions::PenceGouPotentialB
T PenceGouPotentialB(const Tensor33t< T > &C, const double K, const double G)
Definition: MarmotEnergyDensityFunctions.h:54
Marmot::ContinuumMechanics::EnergyDensityFunctions::PenceGouPotentialC
T PenceGouPotentialC(const Tensor33t< T > &C, const double K, const double G)
Definition: MarmotEnergyDensityFunctions.h:67
Marmot::FastorStandardTensors::Tensor33t
Fastor::Tensor< T, 3, 3 > Tensor33t
Definition: MarmotFastorTensorBasics.h:45
Marmot::ContinuumMechanics::EnergyDensityFunctions::PenceGouPotentialA
T PenceGouPotentialA(const Tensor33t< T > &C, const double K, const double G)
Definition: MarmotEnergyDensityFunctions.h:41