CompressibleExponentialLaw.cpp

00001 /*
00002 
00003 Copyright (C) University of Oxford, 2005-2011
00004 
00005 University of Oxford means the Chancellor, Masters and Scholars of the
00006 University of Oxford, having an administrative office at Wellington
00007 Square, Oxford OX1 2JD, UK.
00008 
00009 This file is part of Chaste.
00010 
00011 Chaste is free software: you can redistribute it and/or modify it
00012 under the terms of the GNU Lesser General Public License as published
00013 by the Free Software Foundation, either version 2.1 of the License, or
00014 (at your option) any later version.
00015 
00016 Chaste is distributed in the hope that it will be useful, but WITHOUT
00017 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
00019 License for more details. The offer of Chaste under the terms of the
00020 License is subject to the License being interpreted in accordance with
00021 English Law and subject to any action against the University of Oxford
00022 being under the jurisdiction of the English Courts.
00023 
00024 You should have received a copy of the GNU Lesser General Public License
00025 along with Chaste. If not, see <http://www.gnu.org/licenses/>.
00026 
00027 */
00028 
00029 
00030 #include "CompressibleExponentialLaw.hpp"
00031 
00032 
00033 template<unsigned DIM>
00034 CompressibleExponentialLaw<DIM>::CompressibleExponentialLaw()
00035 {
00036     mA = 0.88;  // kPa
00037 
00038     double bff = 15.5; // dimensionless
00039     double bss = 3.58; // dimensionless
00040     double bnn = 3.58; // dimensionless
00041     double bfn = 2.8;  // etc
00042     double bfs = 2.8;
00043     double bsn = 2.8;
00044 
00045     mCompressibilityParam = 100.0;
00046 
00047     mB.resize(DIM);
00048     for(unsigned i=0; i<DIM; i++)
00049     {
00050         mB[i].resize(DIM);
00051     }
00052 
00053     mB[0][0] = bff;
00054     mB[0][1] = mB[1][0] = bfs;
00055     mB[1][1] = bss;
00056 
00057     if(DIM>2)
00058     {
00059         mB[2][2] = bnn;
00060         mB[0][2] = mB[2][0] = bfn;
00061         mB[2][1] = mB[1][2] = bsn;
00062     }
00063 
00064     for (unsigned M=0; M<DIM; M++)
00065     {
00066         for (unsigned N=0; N<DIM; N++)
00067         {
00068             mIdentity(M,N) = M==N ? 1.0 : 0.0;
00069         }
00070     }
00071 }
00072 
00073 
00074 
00075 template<unsigned DIM>
00076 void CompressibleExponentialLaw<DIM>::ComputeStressAndStressDerivative(c_matrix<double,DIM,DIM>& rC,
00077                                                                        c_matrix<double,DIM,DIM>& rInvC,
00078                                                                        double                pressure /* not used */,
00079                                                                        c_matrix<double,DIM,DIM>& rT,
00080                                                                        FourthOrderTensor<DIM,DIM,DIM,DIM>& rDTdE,
00081                                                                        bool                  computeDTdE)
00082 {
00083     static c_matrix<double,DIM,DIM> C_transformed;
00084     static c_matrix<double,DIM,DIM> invC_transformed;
00085 
00086     // The material law parameters are set up assuming the fibre direction is (1,0,0)
00087     // and sheet direction is (0,1,0), so we have to transform C,inv(C),and T.
00088     // Let P be the change-of-basis matrix P = (\mathbf{m}_f, \mathbf{m}_s, \mathbf{m}_n).
00089     // The transformed C for the fibre/sheet basis is C* = P^T C P.
00090     // We then compute T* = T*(C*), and then compute T = P T* P^T.
00091 
00092     ComputeTransformedDeformationTensor(rC, rInvC, C_transformed, invC_transformed);
00093 
00094     // compute T*
00095 
00096     c_matrix<double,DIM,DIM> E = 0.5*(C_transformed - mIdentity);
00097 
00098     double Q = 0;
00099     for (unsigned M=0; M<DIM; M++)
00100     {
00101         for (unsigned N=0; N<DIM; N++)
00102         {
00103             Q += mB[M][N]*E(M,N)*E(M,N);
00104         }
00105     }
00106 
00107     double multiplier = mA*exp(Q)/2;
00108     rDTdE.Zero();
00109 
00110     double I3 = Determinant(rC);
00111     double w3 =  mCompressibilityParam * 0.5 * (1.0/I3  - 1.0/sqrt(I3));
00112     double w33 = mCompressibilityParam * 0.5 * (-1.0/(I3*I3) + 0.5*pow(I3,-1.5) );
00113 
00114 
00115     for (unsigned M=0; M<DIM; M++)
00116     {
00117         for (unsigned N=0; N<DIM; N++)
00118         {
00119             rT(M,N) = multiplier*mB[M][N]*E(M,N) + 2*w3*I3*invC_transformed(M,N);
00120 
00121             if (computeDTdE)
00122             {
00123                 for (unsigned P=0; P<DIM; P++)
00124                 {
00125                     for (unsigned Q=0; Q<DIM; Q++)
00126                     {
00127                         rDTdE(M,N,P,Q) =    multiplier * mB[M][N] * (M==P)*(N==Q)
00128                                          +  2*multiplier*mB[M][N]*mB[P][Q]*E(M,N)*E(P,Q)
00129                                          +  4 * (w33 * I3 + w3) * I3 * invC_transformed(M,N) * invC_transformed(P,Q)
00130                                          -  4 * w3  * I3    * invC_transformed(M,P) * invC_transformed(Q,N);
00131                     }
00132                 }
00133             }
00134         }
00135     }
00136 
00137     // now do:   T = P T* P^T   and   dTdE_{MNPQ}  =  P_{Mm}P_{Nn}P_{Pp}P_{Qq} dT*dE*_{mnpq}
00138     this->TransformStressAndStressDerivative(rT, rDTdE, computeDTdE);
00139 }
00140 
00141 
00142 
00144 // Explicit instantiation
00146 
00147 template class CompressibleExponentialLaw<2>;
00148 template class CompressibleExponentialLaw<3>;

Generated on Tue May 31 14:31:48 2011 for Chaste by  doxygen 1.5.5