GRINS-0.6.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-2015 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  {
46  return;
47  }
48 
49  template <typename StrainEnergy>
56  {
57  // We're treating a_* and A_* as 2x2, but we're cheating to pick up lambda^2
58  libMesh::Real lambda_sq = A_cov(2,2);
59 
60  libMesh::Real A_over_a = 1.0/lambda_sq; // We're incompressible
61 
62  libMesh::Real I1, I2;
63  this->compute_I1_I2(a_contra,a_cov,A_contra,A_cov,lambda_sq,A_over_a,I1,I2);
64 
65  libMesh::Real a_term, A_term;
66  this->compute_stress_terms( lambda_sq, A_over_a, I1, I2, a_term, A_term );
67 
68  // Now compute stress
69  stress.zero();
70  for( unsigned int alpha = 0; alpha < 2; alpha++ )
71  {
72  for( unsigned int beta = 0; beta < 2; beta++ )
73  {
74  stress(alpha,beta) = a_contra(alpha,beta)*a_term + A_contra(alpha,beta)*A_term;
75  }
76  }
77 
78  return;
79  }
80 
81  template <typename StrainEnergy>
89  {
90  // We're treating a_* and A_* as 2x2, but we're cheating to pick up lambda^2
91  libMesh::Real lambda_sq = A_cov(2,2);
92 
93  libMesh::Real A_over_a = 1.0/lambda_sq; // We're incompressible
94 
95  libMesh::Real I1, I2;
96  this->compute_I1_I2(a_contra,a_cov,A_contra,A_cov,lambda_sq,A_over_a,I1,I2);
97 
98  libMesh::Real a_term, A_term;
99  this->compute_stress_terms( lambda_sq, A_over_a, I1, I2, a_term, A_term );
100 
101  libMesh::TensorValue<libMesh::Real> daterm_dstrain, dAterm_dstrain;
102  this->compute_stress_deriv_terms( lambda_sq, A_over_a, I1, I2, a_contra, A_contra, daterm_dstrain, dAterm_dstrain );
103 
104  ElasticityTensor dAcontra_dstrain;
105  this->compute_Acontra_deriv( A_contra, dAcontra_dstrain );
106 
107  // Now compute stress
108  stress.zero();
109  for( unsigned int alpha = 0; alpha < 2; alpha++ )
110  {
111  for( unsigned int beta = 0; beta < 2; beta++ )
112  {
113  stress(alpha,beta) = a_contra(alpha,beta)*a_term + A_contra(alpha,beta)*A_term;
114 
115  for( unsigned int lambda = 0; lambda < 2; lambda++ )
116  {
117  for( unsigned int mu = 0; mu < 2; mu++ )
118  {
119  C(alpha,beta,lambda,mu) = a_contra(alpha,beta)*daterm_dstrain(lambda,mu)
120  + dAcontra_dstrain(alpha,beta,lambda,mu)*A_term
121  + A_contra(alpha,beta)*dAterm_dstrain(lambda,mu);
122  }
123  }
124  }
125  }
126 
127  return;
128  }
129 
130  template <typename StrainEnergy>
133  const libMesh::TensorValue<libMesh::Real>& A_contra,
135  libMesh::Real lambda_sq, libMesh::Real A_over_a,
136  libMesh::Real& I1, libMesh::Real& I2 ) const
137  {
138  I1 = 0.0;
139  I2 = 0.0;
140  for( unsigned int alpha = 0; alpha < 2; alpha++ )
141  {
142  for( unsigned int beta = 0; beta < 2; beta++ )
143  {
144  I1 += a_contra(alpha,beta)*A_cov(alpha,beta);
145  I2 += a_cov(alpha,beta)*A_contra(alpha,beta);
146  }
147  }
148 
149  I1 += lambda_sq;
150  I2 += A_over_a;
151 
152  return;
153  }
154 
155  template <typename StrainEnergy>
156  void IncompressiblePlaneStressHyperelasticity<StrainEnergy>::compute_stress_terms( libMesh::Real lambda_sq, libMesh::Real A_over_a,
157  libMesh::Real I1, libMesh::Real I2,
158  libMesh::Real& a_term, libMesh::Real& A_term ) const
159  {
160  libMesh::Real dWdI1 = _W.dI1(I1,I2,1.0); // We're incompressible
161  libMesh::Real dWdI2 = _W.dI2(I1,I2,1.0);
162 
163  // Notation used in Green/Adkins
164  // Comes from enforcing plane stress
165  libMesh::Real p = -2.0*lambda_sq*( dWdI1 + dWdI2*(I1-lambda_sq) );
166 
167  a_term = 2.0*(dWdI1 + dWdI2*lambda_sq);
168  A_term = 2.0*dWdI2*A_over_a + p;
169 
170  return;
171  }
172 
173  template <typename StrainEnergy>
174  void IncompressiblePlaneStressHyperelasticity<StrainEnergy>::compute_stress_deriv_terms( libMesh::Real lambda_sq, libMesh::Real A_over_a,
175  libMesh::Real I1, libMesh::Real I2,
176  const libMesh::TensorValue<libMesh::Real>& a_contra,
177  const libMesh::TensorValue<libMesh::Real>& A_contra,
178  libMesh::TensorValue<libMesh::Real>& daterm_dstrain,
179  libMesh::TensorValue<libMesh::Real>& dAterm_dstrain) const
180  {
181  daterm_dstrain.zero();
182  dAterm_dstrain.zero();
183 
184  libMesh::Real dWdI1 = _W.dI1(I1,I2,1.0); // We're incompressible
185  libMesh::Real dWdI2 = _W.dI2(I1,I2,1.0);
186 
187  // A = det(A_cov) = 1/det(A_contra)
188  //libMesh::Real A = 1.0/( A_contra(0,0)*A_contra(1,1) - A_contra(0,1)*A_contra(1,0) );
189 
190  for( unsigned int alpha = 0; alpha < 2; alpha++ )
191  {
192  for( unsigned int beta = 0; beta < 2; beta++ )
193  {
194  // a_term = 2.0*(dWdI1 + dWdI2*lambda^2);
195  // => da_dstrain = 2.0*dWdI2*dlambda^2_dstrain
196  // dlambda_sq_dstrain = -2*lambda^2 A^{alpha,beta}
197  const libMesh::Real dlamsq_dstrain = -2.0*lambda_sq*A_contra(alpha,beta);
198 
199  daterm_dstrain(alpha,beta) = 2.0*dWdI2*dlamsq_dstrain;
200 
201  // A_term = 2.0*dWdI2*A_over_a + p;
202  // A = det(A_cov) ==> dA_dstrain = 2*A*A_contra(alpha,beta)
203  // p = -2.0*lambda_sq*( dWdI1 + dWdI2*(I1-lambda_sq) );
204  const libMesh::Real dI1_dstrain = 2.0*a_contra(alpha,beta) + dlamsq_dstrain;
205 
206  const libMesh::Real dp_dstrain = -2.0*dlamsq_dstrain*( dWdI1 + dWdI2*(I1-lambda_sq) )
207  -2.0*lambda_sq*dWdI2*(dI1_dstrain - dlamsq_dstrain);
208 
209  dAterm_dstrain(alpha,beta) = 2.0*dWdI2*A_over_a*(2.0*A_contra(alpha,beta)) + dp_dstrain;
210  }
211  }
212 
213  return;
214  }
215 
216  template <typename StrainEnergy>
218  ElasticityTensor& dAcontra_dstrain ) const
219  {
220  for( unsigned int alpha = 0; alpha < 2; alpha++ )
221  {
222  for( unsigned int beta = 0; beta < 2; beta++ )
223  {
224  for( unsigned int lambda = 0; lambda < 2; lambda++ )
225  {
226  for( unsigned int mu = 0; mu < 2; mu++ )
227  {
228  dAcontra_dstrain(alpha,beta,lambda,mu) = -( A_contra(alpha,lambda)*A_contra(beta,mu)
229  + A_contra(alpha,mu)*A_contra(beta,lambda) );
230  }
231  }
232  }
233  }
234 
235  return;
236  }
237 
238  template <typename StrainEnergy>
240  const libMesh::TensorValue<libMesh::Real>& /*g_cov*/,
241  const libMesh::TensorValue<libMesh::Real>& /*G_contra*/,
242  const libMesh::TensorValue<libMesh::Real>& /*G_cov*/ )
243  {
244  std::cerr << "Error: compute_33_stress shouldn't be called for incompressible materials." << std::endl;
245  libmesh_error();
246  return 0.0;
247  }
248 
249 } // 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 Mon Jun 22 2015 21:32:20 for GRINS-0.6.0 by  doxygen 1.8.9.1