Chaste Commit::ca8ccdedf819b6e02855bc0e8e6f50bdecbc5208
CompressibleExponentialLaw.cpp
1/*
2
3Copyright (c) 2005-2024, University of Oxford.
4All rights reserved.
5
6University of Oxford means the Chancellor, Masters and Scholars of the
7University of Oxford, having an administrative office at Wellington
8Square, Oxford OX1 2JD, UK.
9
10This file is part of Chaste.
11
12Redistribution and use in source and binary forms, with or without
13modification, are permitted provided that the following conditions are met:
14 * Redistributions of source code must retain the above copyright notice,
15 this list of conditions and the following disclaimer.
16 * Redistributions in binary form must reproduce the above copyright notice,
17 this list of conditions and the following disclaimer in the documentation
18 and/or other materials provided with the distribution.
19 * Neither the name of the University of Oxford nor the names of its
20 contributors may be used to endorse or promote products derived from this
21 software without specific prior written permission.
22
23THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
27LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
29GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
32OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33
34*/
35
36#include "CompressibleExponentialLaw.hpp"
37
38template<unsigned DIM>
40{
41 mA = 0.88; // kPa
42
43 double bff = 18.5; // dimensionless
44 double bss = 3.58; // dimensionless
45 double bnn = 3.58; // dimensionless
46 double bfn = 2.8; // etc
47 double bfs = 2.8;
48 double bsn = 2.8;
49
50 mCompressibilityParam = 100.0;
51
52 mB.resize(DIM);
53 for (unsigned i=0; i<DIM; i++)
54 {
55 mB[i].resize(DIM);
56 }
57
58 mB[0][0] = bff;
59 mB[0][1] = mB[1][0] = bfs;
60 mB[1][1] = bss;
61
62 if (DIM > 2)
63 {
64 mB[2][2] = bnn;
65 mB[0][2] = mB[2][0] = bfn;
66 mB[2][1] = mB[1][2] = bsn;
67 }
68
69 for (unsigned M=0; M<DIM; M++)
70 {
71 for (unsigned N=0; N<DIM; N++)
72 {
73 mIdentity(M,N) = M==N ? 1.0 : 0.0;
74 }
75 }
76}
77
78template<unsigned DIM>
80 c_matrix<double,DIM,DIM>& rInvC,
81 double pressure /* not used */,
82 c_matrix<double,DIM,DIM>& rT,
84 bool computeDTdE)
85{
86 static c_matrix<double,DIM,DIM> C_transformed;
87 static c_matrix<double,DIM,DIM> invC_transformed;
88
89 // The material law parameters are set up assuming the fibre direction is (1,0,0)
90 // and sheet direction is (0,1,0), so we have to transform C,inv(C),and T.
91 // Let P be the change-of-basis matrix P = (\mathbf{m}_f, \mathbf{m}_s, \mathbf{m}_n).
92 // The transformed C for the fibre/sheet basis is C* = P^T C P.
93 // We then compute T* = T*(C*), and then compute T = P T* P^T.
94
95 this->ComputeTransformedDeformationTensor(rC, rInvC, C_transformed, invC_transformed);
96
97 // Compute T*
98
99 c_matrix<double,DIM,DIM> E = 0.5*(C_transformed - mIdentity);
100
101 double QQ = 0;
102 for (unsigned M=0; M<DIM; M++)
103 {
104 for (unsigned N=0; N<DIM; N++)
105 {
106 QQ += mB[M][N]*E(M,N)*E(M,N);
107 }
108 }
109 assert(QQ < 10.0);
110 double multiplier = mA*exp(QQ);
111 rDTdE.Zero();
112
113 double J = sqrt(Determinant(rC));
114
115 for (unsigned M=0; M<DIM; M++)
116 {
117 for (unsigned N=0; N<DIM; N++)
118 {
119 rT(M,N) = multiplier*mB[M][N]*E(M,N) + mCompressibilityParam * J*log(J)*invC_transformed(M,N);
120
121 if (computeDTdE)
122 {
123 for (unsigned P=0; P<DIM; P++)
124 {
125 for (unsigned Q=0; Q<DIM; Q++)
126 {
127 rDTdE(M,N,P,Q) = multiplier * mB[M][N] * (M==P)*(N==Q)
128 + 2*multiplier*mB[M][N]*mB[P][Q]*E(M,N)*E(P,Q)
129 + mCompressibilityParam * (J*log(J) + J) * invC_transformed(M,N) * invC_transformed(P,Q)
130 - mCompressibilityParam * 2*J*log(J) * invC_transformed(M,P) * invC_transformed(Q,N);
131 }
132 }
133 }
134 }
135 }
136
137 // Now do: T = P T* P^T and dTdE_{MNPQ} = P_{Mm}P_{Nn}P_{Pp}P_{Qq} dT*dE*_{mnpq}
138 this->TransformStressAndStressDerivative(rT, rDTdE, computeDTdE);
139}
140
141// Explicit instantiation
142template class CompressibleExponentialLaw<2>;
143template class CompressibleExponentialLaw<3>;
T Determinant(const boost::numeric::ublas::c_matrix< T, 1, 1 > &rM)
void ComputeStressAndStressDerivative(c_matrix< double, DIM, DIM > &rC, c_matrix< double, DIM, DIM > &rInvC, double pressure, c_matrix< double, DIM, DIM > &rT, FourthOrderTensor< DIM, DIM, DIM, DIM > &rDTdE, bool computeDTdE)