CG  Version 25
viscoPlasticMacros.h
Go to the documentation of this file.
1 c *****************************************
2 c ** Macros for the Visco-plastic Model ***
3 c *****************************************
4 
5 c ** NOTE: you should also change viscoPlasticMacrosCpp.h if you change this file ***
6 
7 c ===============================================================
8 c Here is effective strain rate (plus a small value)
9 c sqrt( (2/3)*eDot_ij eDot_ij ) + epsVP
10 c Also define the derivatives of the square of the effective strain rate
11 c
12 c ===============================================================
13 #defineMacro strainRate2d() (sqrt( (2./3.)*( u0x**2 + v0y**2 + .5*( u0y + v0x )**2 ) )+epsVP)
14 
15 #defineMacro strainRate2dSqx() \
16  ( (2./3.)*( 2.*u0x*u0xx + 2.*v0y*v0xy + ( u0y + v0x )*( u0xy+v0xx ) ) )
17 #defineMacro strainRate2dSqy() \
18  ( (2./3.)*( 2.*u0x*u0xy + 2.*v0y*v0yy + ( u0y + v0x )*( u0yy+v0xy ) ) )
19 
20 #defineMacro strainRate2dSqxx() \
21  ( (2./3.)*( 2.*(u0xx*u0xx+u0x*u0xxx) + 2.*(v0xy*v0xy+v0y*v0xxy) \
22  + ( u0xy + v0xx )*( u0xy+v0xx ) + ( u0y + v0x )*( u0xxy+v0xxx ) ) )
23 
24 #defineMacro strainRate2dSqxy() \
25  ( (2./3.)*( 2.*(u0xy*u0xx+u0x*u0xxy) + 2.*(v0yy*v0xy+v0y*v0xyy) \
26  + ( u0yy + v0xy )*( u0xy+v0xx ) + ( u0y + v0x )*( u0xyy+v0xxy ) ) )
27 
28 #defineMacro strainRate2dSqyy() \
29  ( (2./3.)*( 2.*(u0xy*u0xy+u0x*u0xyy) + 2.*(v0yy*v0yy+v0y*v0yyy) \
30  + ( u0yy + v0xy )*( u0yy+v0xy ) + ( u0y + v0x )*( u0yyy+v0xyy ) ) )
31 
32 c =====================================================================================
33 c Here is the coefficient of viscosity for the visco plastic model
34 c
35 c esr = effective strain rate = || (2/3)*eDot_ij ||
36 c
37 c nuT = etaVP + (yieldStressVP/esr)*(1.-exp(-exponentVP*esr))
38 c
39 c =====================================================================================
40 #beginMacro getViscoPlasticViscosity(nuT,esr)
41 
42  exp0 = exp(-exponentVP*esr)
43  nuT = (etaVP + (yieldStressVP/esr)*(1.-exp0))
44 
45 #endMacro
46 
47 c =====================================================================================
48 c Here is the coefficient of viscosity for the visco plastic model and its first derivative
49 c esr = effective strain rate = || (2/3)*eDot_ij ||
50 c
51 c nuT = etaVP + (yieldStressVP/esr)*(1.-exp(-exponentVP*esr))
52 c
53 c nuTd = D( nuT )/D( esr**2) = D( nuT )/D( esr ) * ( 1 / (2*esr ) )
54 c =====================================================================================
55 #beginMacro getViscoPlasticViscosityAndFirstDerivative(esr)
56 
57  getViscoPlasticViscosity(nuT,esr)
58  nuTd = .5*( (-1./esr)*(1.-exp0) + exponentVP*exp0 )*(yieldStressVP/esr**2)
59 
60 #endMacro
61 
62 #beginMacro getViscoPlasticViscosityAndTwoDerivative(esr)
63 
64  getViscoPlasticViscosityAndFirstDerivative(esr)
65 ! nuTdd= .25*( 3./(esr**2)*(1.-exp0) -2./(esr)*exponentVP*exp0 + exponentVP**2*exp0 )*(yieldStressVP/esr**2)
66  nuTdd= .25*( 3./(esr**2)*(1.-exp0) -3./(esr)*exponentVP*exp0 - exponentVP**2*exp0 )*(yieldStressVP/esr**3)
67 
68 #endMacro
69 
70 
71 c =============================================================================
72 c Evaluate the coefficients of the visco-plastic model
73 c This macro assumes u0x,u0y,u0z, v0x,v0y,v0z, w0x,w0y,w0z are defined
74 c Used in insdt.bf
75 c ============================================================================
76 #beginMacro getViscoPlasticCoefficients(DIM)
77  u0xx = UXX(uc)
78  u0xy = UXY(uc)
79  u0yy = UYY(uc)
80  v0xx = UXX(vc)
81  v0xy = UXY(vc)
82  v0yy = UYY(vc)
83 #If #DIM == "2"
84 
85  eDotNorm = strainRate2d()
86  getViscoPlasticViscosityAndFirstDerivative(eDotNorm)
87 
88  nuTx = nuTd*strainRate2dSqx()
89  nuTy = nuTd*strainRate2dSqy()
90 
91 #Else
92 
93  ! this needs to be finished
94  nuT=nu
95  nuTx=0.
96  nuTy=0.
97  nuTz=0.
98 
99  stop 7744
100 
101 #End
102 
103 ! write(*,9000) i1,i2,nuT,nuTx,nuTy,nuTxx,nuTxy,nuTyy
104 ! 9000 format("insp: i1,i2=",2i3," nuT,nuTx,nuTy,nuTxx,nuTxy,nuTyy=",
105 ! & 6e10.2)
106 
107 #endMacro
108 
109 
110 c ============================================================================
111 c Define the visco-plastic viscosity and first derivatives
112 c Used in inspf.bf
113 c ============================================================================
114 #beginMacro getViscoPlasticViscosityAndFirstDerivatives(DIM)
115  u0x = UX(uc)
116  u0y = UY(uc)
117  v0x = UX(vc)
118  v0y = UY(vc)
119 
120  u0xx = UXX(uc)
121  u0xy = UXY(uc)
122  u0yy = UYY(uc)
123  v0xx = UXX(vc)
124  v0xy = UXY(vc)
125  v0yy = UYY(vc)
126 #If #DIM == "2"
127 
128  eDotNorm = strainRate2d()
129 
130  getViscoPlasticViscosityAndFirstDerivative(eDotNorm)
131 
132  nuTx = nuTd*strainRate2dSqx()
133  nuTy = nuTd*strainRate2dSqy()
134 
135 #Else
136 
137  ! FINISH THIS
138 
139  nuT=nu
140  nuTx=0.
141  nuTy=0.
142  nuTz=0.
143 
144  stop 7755
145 
146 #End
147 
148 #endMacro
149 
150 c ============================================================================
151 c Define the visco-plastic viscosity and first two derivatives
152 c Used in inspf.bf
153 c ============================================================================
154 #beginMacro defineVP_Derivatives(DIM)
155  u0x = UX(uc)
156  u0y = UY(uc)
157  v0x = UX(vc)
158  v0y = UY(vc)
159 
160  u0xx = UXX(uc)
161  u0xy = UXY(uc)
162  u0yy = UYY(uc)
163  v0xx = UXX(vc)
164  v0xy = UXY(vc)
165  v0yy = UYY(vc)
166 
167 
168 #If #DIM == "2"
169 
170  u0Lap=u0xx+u0yy
171  v0Lap=v0xx+v0yy
172 
173  ! still need to define 3d 3rd derivatives
174  u0xxx=UXXX(uc)
175  u0xxy=UXXY(uc)
176  u0xyy=UXYY(uc)
177  u0yyy=UYYY(uc)
178 
179  v0xxx=UXXX(vc)
180  v0xxy=UXXY(vc)
181  v0xyy=UXYY(vc)
182  v0yyy=UYYY(vc)
183 
184 
185  eDotNorm = strainRate2d()
186  getViscoPlasticViscosityAndTwoDerivative(eDotNorm)
187 
188  eDotNormSqx =strainRate2dSqx()
189  eDotNormSqy =strainRate2dSqy()
190  eDotNormSqxx=strainRate2dSqxx()
191  eDotNormSqxy=strainRate2dSqxy()
192  eDotNormSqyy=strainRate2dSqyy()
193 
194  nuTx=nuTd*eDotNormSqx
195  nuTy=nuTd*eDotNormSqy
196  nuTxx=nuTd*eDotNormSqxx + nuTdd*eDotNormSqx**2
197  nuTxy=nuTd*eDotNormSqxy + nuTdd*eDotNormSqx*eDotNormSqy
198  nuTyy=nuTd*eDotNormSqyy + nuTdd*eDotNormSqy**2
199 
200 #Else
201 
202  u0zz = UZZ(uc)
203  v0zz = UZZ(vc)
204 
205  u0Lap=u0xx+u0yy+u0zz
206  v0Lap=v0xx+v0yy+v0zz
207 
208  nuT=nu
209  nuTx=0.
210  nuTy=0.
211  nuTz=0.
212  nuTxx=0.
213  nuTxy=0.
214  nuTyy=0.
215  nuTxz=0.
216  nuTyz=0.
217  nuTzz=0.
218 
219  ! FINISH ME
220  stop 7766
221 
222 #End
223 
224 #endMacro
225 
226 
227