CG  Version 25
viscoPlasticMacrosCpp.h
Go to the documentation of this file.
1 // Define visco-plastic model for C++ files
2 
3 // ** NOTE: you should also change viscoPlasticMacros.h if you change this file ***
4 
5 // define the viscosity and it's derivatives with respect to esr^2 (used by ins.C, insp.C)
6 #define defineViscoPlasticCoefficients(esr) \
7  exp0 = exp(-exponentViscoPlastic*esr); \
8  nuT = (etaViscoPlastic + (yieldStressViscoPlastic/esr)*(1.-exp0)); \
9  nuTd = .5*( (-1./esr)*(1.-exp0) + exponentViscoPlastic*exp0 )*(yieldStressViscoPlastic/(esr*esr)); \
10  /* -- fake -- */ \
11  /* nuT = nu+ nuViscoPlastic*esr*esr; */ \
12  /* nuTd=nuViscoPlastic; */
13 
14 
15 // define the viscosity and it's derivatives with respect to esr^2 (used by insp.C)
16 #define defineViscoPlasticCoefficientsAndTwoDerivatives(esr) \
17  exp0 = exp(-exponentViscoPlastic*esr); \
18  nuT = (etaViscoPlastic + (yieldStressViscoPlastic/esr)*(1.-exp0)); \
19  nuTd = .5*( (-1./esr)*(1.-exp0) + exponentViscoPlastic*exp0 )*(yieldStressViscoPlastic/(esr*esr)); \
20  nuTdd= .25*( 3./(esr*esr)*(1.-exp0) -3./(esr)*exponentViscoPlastic*exp0 - exponentViscoPlastic*exponentViscoPlastic*exp0 )*(yieldStressViscoPlastic/(esr*esr*esr))
21 
22  /* -- fake -- */ \
23  /* nuT = nu+ nuViscoPlastic*esr*esr; */ \
24  /* nuTd=nuViscoPlastic; */ \
25  /* nuTdd=0. */
26 
27 
28 
29 // declare and lookup visco-plastic parameters (used by ins.C, insp.C)
30 #define declareViscoPlasticParameters \
31  /* visco-plastic parameters */ \
32  real nuViscoPlastic=1., etaViscoPlastic=1., yieldStressViscoPlastic=10., exponentViscoPlastic=10.; \
33  real epsViscoPlastic=1.e-10; /* small parameter used to offset the effective strain rate */ \
34  parameters.dbase.get<ListOfShowFileParameters>("pdeParameters").getParameter("nuViscoPlastic",nuViscoPlastic); \
35  parameters.dbase.get<ListOfShowFileParameters>("pdeParameters").getParameter("etaViscoPlastic",etaViscoPlastic); \
36  parameters.dbase.get<ListOfShowFileParameters>("pdeParameters").getParameter("yieldStressViscoPlastic",yieldStressViscoPlastic); \
37  parameters.dbase.get<ListOfShowFileParameters>("pdeParameters").getParameter("exponentViscoPlastic",exponentViscoPlastic); \
38  parameters.dbase.get<ListOfShowFileParameters>("pdeParameters").getParameter("epsViscoPlastic",epsViscoPlastic);
39 
40 // ===============================================================
41 // Here is effective strain rate (plus a small value)
42 // sqrt( (2/3)*eDot_ij eDot_ij ) + epsVP
43 // Also define the derivatives of the square of the effective strain rate
44 //
45 // ===============================================================
46 #define strainRate2d(u0x,u0y,v0x,v0y) (sqrt( (2./3.)*( SQR(u0x) + SQR(v0y) + .5*SQR( u0y + v0x ) ) )+epsViscoPlastic)
47 
48 #define strainRate3d(u0x,u0y,u0z, v0x,v0y,v0z, w0x,w0y,w0z) \
49  (sqrt( (2./3.)*( SQR(u0x) + SQR(v0y) + SQR(w0z) + .5*( SQR( u0y + v0x ) + SQR( u0z + w0x )+ SQR( v0z + w0y )) ) )+epsViscoPlastic)
50 
51 // #define strainRate2dSqx() \
52 // ( (2./3.)*( 2.*u0x*u0xx + 2.*v0y*v0xy + ( u0y + v0x )*( u0xy+v0xx ) ) )
53 // #define strainRate2dSqy() \
54 // ( (2./3.)*( 2.*u0x*u0xy + 2.*v0y*v0yy + ( u0y + v0x )*( u0yy+v0xy ) ) )
55 //
56 // #define strainRate2dSqxx() \
57 // ( (2./3.)*( 2.*(u0xx*u0xx+u0x*u0xxx) + 2.*(v0xy*v0xy+v0y*v0xxy) \
58 // + ( u0xy + v0xx )*( u0xy+v0xx ) + ( u0y + v0x )*( u0xxy+v0xxx ) ) )
59 //
60 // #define strainRate2dSqxy() \
61 // ( (2./3.)*( 2.*(u0xy*u0xx+u0x*u0xxy) + 2.*(v0yy*v0xy+v0y*v0xyy) \
62 // + ( u0yy + v0xy )*( u0xy+v0xx ) + ( u0y + v0x )*( u0xyy+v0xxy ) ) )
63 //
64 // #define strainRate2dSqyy() \
65 // ( (2./3.)*( 2.*(u0xy*u0xy+u0x*u0xyy) + 2.*(v0yy*v0yy+v0y*v0yyy) \
66 // + ( u0yy + v0xy )*( u0yy+v0xy ) + ( u0y + v0x )*( u0yyy+v0xyy ) ) )