GRINS-0.8.0
incompressible_plane_stress_hyperelasticity.C
Go to the documentation of this file.
1 //-----------------------------------------------------------------------bl-
2 //--------------------------------------------------------------------------
3 //
4 // GRINS - General Reacting Incompressible Navier-Stokes
5 //
6 // Copyright (C) 2014-2017 Paul T. Bauman, Roy H. Stogner
7 // Copyright (C) 2010-2013 The PECOS Development Team
8 //
9 // This library is free software; you can redistribute it and/or
10 // modify it under the terms of the Version 2.1 GNU Lesser General
11 // Public License as published by the Free Software Foundation.
12 //
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Lesser General Public License for more details.
17 //
18 // You should have received a copy of the GNU Lesser General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc. 51 Franklin Street, Fifth Floor,
21 // Boston, MA 02110-1301 USA
22 //
23 //-----------------------------------------------------------------------el-
24 
25 // This class
27 
28 // GRINS
30 
31 // libMesh
32 #include "libmesh/tensor_value.h"
33 
34 namespace GRINS
35 {
36  template <typename StrainEnergy>
38  : _W(input)
39  {
40  return;
41  }
42 
43  template <typename StrainEnergy>
45  const std::string& material )
46  : _W(input,material)
47  {
48  return;
49  }
50 
51  template <typename StrainEnergy>
53  {
54  return;
55  }
56 
57  template <typename StrainEnergy>
64  {
65  // We're treating a_* and A_* as 2x2, but we're cheating to pick up lambda^2
66  libMesh::Real lambda_sq = A_cov(2,2);
67 
68  libMesh::Real A_over_a = 1.0/lambda_sq; // We're incompressible
69 
70  libMesh::Real I1, I2;
71  this->compute_I1_I2(a_contra,a_cov,A_contra,A_cov,lambda_sq,A_over_a,I1,I2);
72 
73  libMesh::Real a_term, A_term;
74  this->compute_stress_terms( lambda_sq, A_over_a, I1, I2, a_term, A_term );
75 
76  // Now compute stress
77  stress.zero();
78  for( unsigned int alpha = 0; alpha < 2; alpha++ )
79  {
80  for( unsigned int beta = 0; beta < 2; beta++ )
81  {
82  stress(alpha,beta) = a_contra(alpha,beta)*a_term + A_contra(alpha,beta)*A_term;
83  }
84  }
85 
86  return;
87  }
88 
89  template <typename StrainEnergy>
97  {
98  // We're treating a_* and A_* as 2x2, but we're cheating to pick up lambda^2
99  libMesh::Real lambda_sq = A_cov(2,2);
100 
101  libMesh::Real A_over_a = 1.0/lambda_sq; // We're incompressible
102 
103  libMesh::Real I1, I2;
104  this->compute_I1_I2(a_contra,a_cov,A_contra,A_cov,lambda_sq,A_over_a,I1,I2);
105 
106  libMesh::Real a_term, A_term;
107  this->compute_stress_terms( lambda_sq, A_over_a, I1, I2, a_term, A_term );
108 
109  libMesh::TensorValue<libMesh::Real> daterm_dstrain, dAterm_dstrain;
110  this->compute_stress_deriv_terms( lambda_sq, A_over_a, I1, I2, a_contra, A_contra, daterm_dstrain, dAterm_dstrain );
111 
112  ElasticityTensor dAcontra_dstrain;
113  this->compute_Acontra_deriv( A_contra, dAcontra_dstrain );
114 
115  // Now compute stress
116  stress.zero();
117  for( unsigned int alpha = 0; alpha < 2; alpha++ )
118  {
119  for( unsigned int beta = 0; beta < 2; beta++ )
120  {
121  stress(alpha,beta) = a_contra(alpha,beta)*a_term + A_contra(alpha,beta)*A_term;
122 
123  for( unsigned int lambda = 0; lambda < 2; lambda++ )
124  {
125  for( unsigned int mu = 0; mu < 2; mu++ )
126  {
127  C(alpha,beta,lambda,mu) = a_contra(alpha,beta)*daterm_dstrain(lambda,mu)
128  + dAcontra_dstrain(alpha,beta,lambda,mu)*A_term
129  + A_contra(alpha,beta)*dAterm_dstrain(lambda,mu);
130  }
131  }
132  }
133  }
134 
135  return;
136  }
137 
138  template <typename StrainEnergy>
141  const libMesh::TensorValue<libMesh::Real>& A_contra,
143  libMesh::Real lambda_sq, libMesh::Real A_over_a,
144  libMesh::Real& I1, libMesh::Real& I2 ) const
145  {
146  I1 = 0.0;
147  I2 = 0.0;
148  for( unsigned int alpha = 0; alpha < 2; alpha++ )
149  {
150  for( unsigned int beta = 0; beta < 2; beta++ )
151  {
152  I1 += a_contra(alpha,beta)*A_cov(alpha,beta);
153  I2 += a_cov(alpha,beta)*A_contra(alpha,beta);
154  }
155  }
156 
157  I1 += lambda_sq;
158  I2 += A_over_a;
159 
160  return;
161  }
162 
163  template <typename StrainEnergy>
164  void IncompressiblePlaneStressHyperelasticity<StrainEnergy>::compute_stress_terms( libMesh::Real lambda_sq, libMesh::Real A_over_a,
165  libMesh::Real I1, libMesh::Real I2,
166  libMesh::Real& a_term, libMesh::Real& A_term ) const
167  {
168  libMesh::Real dWdI1 = _W.dI1(I1,I2,1.0); // We're incompressible
169  libMesh::Real dWdI2 = _W.dI2(I1,I2,1.0);
170 
171  // Notation used in Green/Adkins
172  // Comes from enforcing plane stress
173  libMesh::Real p = -2.0*lambda_sq*( dWdI1 + dWdI2*(I1-lambda_sq) );
174 
175  a_term = 2.0*(dWdI1 + dWdI2*lambda_sq);
176  A_term = 2.0*dWdI2*A_over_a + p;
177 
178  return;
179  }
180 
181  template <typename StrainEnergy>
182  void IncompressiblePlaneStressHyperelasticity<StrainEnergy>::compute_stress_deriv_terms( libMesh::Real lambda_sq, libMesh::Real A_over_a,
183  libMesh::Real I1, libMesh::Real I2,
184  const libMesh::TensorValue<libMesh::Real>& a_contra,
185  const libMesh::TensorValue<libMesh::Real>& A_contra,
186  libMesh::TensorValue<libMesh::Real>& daterm_dstrain,
187  libMesh::TensorValue<libMesh::Real>& dAterm_dstrain) const
188  {
189  daterm_dstrain.zero();
190  dAterm_dstrain.zero();
191 
192  libMesh::Real dWdI1 = _W.dI1(I1,I2,1.0); // We're incompressible
193  libMesh::Real dWdI2 = _W.dI2(I1,I2,1.0);
194 
195  // A = det(A_cov) = 1/det(A_contra)
196  //libMesh::Real A = 1.0/( A_contra(0,0)*A_contra(1,1) - A_contra(0,1)*A_contra(1,0) );
197 
198  for( unsigned int alpha = 0; alpha < 2; alpha++ )
199  {
200  for( unsigned int beta = 0; beta < 2; beta++ )
201  {
202  // a_term = 2.0*(dWdI1 + dWdI2*lambda^2);
203  // => da_dstrain = 2.0*dWdI2*dlambda^2_dstrain
204  // dlambda_sq_dstrain = -2*lambda^2 A^{alpha,beta}
205  const libMesh::Real dlamsq_dstrain = -2.0*lambda_sq*A_contra(alpha,beta);
206 
207  daterm_dstrain(alpha,beta) = 2.0*dWdI2*dlamsq_dstrain;
208 
209  // A_term = 2.0*dWdI2*A_over_a + p;
210  // A = det(A_cov) ==> dA_dstrain = 2*A*A_contra(alpha,beta)
211  // p = -2.0*lambda_sq*( dWdI1 + dWdI2*(I1-lambda_sq) );
212  const libMesh::Real dI1_dstrain = 2.0*a_contra(alpha,beta) + dlamsq_dstrain;
213 
214  const libMesh::Real dp_dstrain = -2.0*dlamsq_dstrain*( dWdI1 + dWdI2*(I1-lambda_sq) )
215  -2.0*lambda_sq*dWdI2*(dI1_dstrain - dlamsq_dstrain);
216 
217  dAterm_dstrain(alpha,beta) = 2.0*dWdI2*A_over_a*(2.0*A_contra(alpha,beta)) + dp_dstrain;
218  }
219  }
220 
221  return;
222  }
223 
224  template <typename StrainEnergy>
226  ElasticityTensor& dAcontra_dstrain ) const
227  {
228  for( unsigned int alpha = 0; alpha < 2; alpha++ )
229  {
230  for( unsigned int beta = 0; beta < 2; beta++ )
231  {
232  for( unsigned int lambda = 0; lambda < 2; lambda++ )
233  {
234  for( unsigned int mu = 0; mu < 2; mu++ )
235  {
236  dAcontra_dstrain(alpha,beta,lambda,mu) = -( A_contra(alpha,lambda)*A_contra(beta,mu)
237  + A_contra(alpha,mu)*A_contra(beta,lambda) );
238  }
239  }
240  }
241  }
242 
243  return;
244  }
245 
246  template <typename StrainEnergy>
248  const libMesh::TensorValue<libMesh::Real>& /*g_cov*/,
249  const libMesh::TensorValue<libMesh::Real>& /*G_contra*/,
250  const libMesh::TensorValue<libMesh::Real>& /*G_cov*/ )
251  {
252  std::cerr << "Error: compute_33_stress shouldn't be called for incompressible materials." << std::endl;
253  libmesh_error();
254  return 0.0;
255  }
256 
257 } // end namespace GRINS
void compute_Acontra_deriv(const libMesh::TensorValue< libMesh::Real > &A_contra, ElasticityTensor &dAcontra_dstrain) const
void compute_stress_deriv_terms(libMesh::Real lambda_sq, libMesh::Real A_over_a, libMesh::Real I1, libMesh::Real I2, const libMesh::TensorValue< libMesh::Real > &a_contra, const libMesh::TensorValue< libMesh::Real > &A_contra, libMesh::TensorValue< libMesh::Real > &daterm_dstrain, libMesh::TensorValue< libMesh::Real > &dAterm_dstrain) const
void compute_stress_imp(unsigned int dim, const libMesh::TensorValue< libMesh::Real > &a_contra, const libMesh::TensorValue< libMesh::Real > &a_cov, const libMesh::TensorValue< libMesh::Real > &A_contra, const libMesh::TensorValue< libMesh::Real > &A_cov, libMesh::TensorValue< libMesh::Real > &stress)
void compute_stress_terms(libMesh::Real lambda_sq, libMesh::Real A_over_a, libMesh::Real I1, libMesh::Real I2, libMesh::Real &a_term, libMesh::Real &A_term) const
GRINS namespace.
libMesh::Real compute_33_stress_imp(const libMesh::TensorValue< libMesh::Real > &g_contra, const libMesh::TensorValue< libMesh::Real > &g_cov, const libMesh::TensorValue< libMesh::Real > &G_contra, const libMesh::TensorValue< libMesh::Real > &G_cov)
void compute_I1_I2(const libMesh::TensorValue< libMesh::Real > &a_contra, const libMesh::TensorValue< libMesh::Real > &a_cov, const libMesh::TensorValue< libMesh::Real > &A_contra, const libMesh::TensorValue< libMesh::Real > &A_cov, libMesh::Real lambda_sq, libMesh::Real A_over_a, libMesh::Real &I1, libMesh::Real &I2) const
void compute_stress_and_elasticity_imp(unsigned int dim, const libMesh::TensorValue< libMesh::Real > &a_contra, const libMesh::TensorValue< libMesh::Real > &a_cov, const libMesh::TensorValue< libMesh::Real > &A_contra, const libMesh::TensorValue< libMesh::Real > &A_cov, libMesh::TensorValue< libMesh::Real > &stress, ElasticityTensor &C)

Generated on Tue Dec 19 2017 12:47:28 for GRINS-0.8.0 by  doxygen 1.8.9.1