DM04_PF.cpp

Go to the documentation of this file.
00001 
00002 //   COPYLEFT (C): Woody's viral GPL-like license (by BJ):
00003 //                 ``This    source  code is Copyrighted in
00004 //                 U.S.,  for  an  indefinite  period,  and anybody
00005 //                 caught  using it without our permission, will be
00006 //                 mighty good friends of ourn, cause we don't give
00007 //                 a  darn.  Hack it. Compile it. Debug it. Run it.
00008 //                 Yodel  it.  Enjoy it. We wrote it, that's all we
00009 //                 wanted to do.''
00010 //
00011 //
00012 // COPYRIGHT (C):     :-))
00013 // PROJECT:           Object Oriented Finite Element Program
00014 // FILE:              
00015 // CLASS:             
00016 // MEMBER FUNCTIONS:
00017 //
00018 // MEMBER VARIABLES
00019 //
00020 // PURPOSE:           
00021 //
00022 // RETURN:
00023 // VERSION:
00024 // LANGUAGE:          C++
00025 // TARGET OS:         
00026 // DESIGNER:          Zhao Cheng, Boris Jeremic
00027 // PROGRAMMER:        Zhao Cheng, Mahdi Taiebat
00028 // DATE:              Fall 2005
00029 // UPDATE HISTORY:    
00030 //
00032 //
00033 
00034 // Ref: Dafalias and Manzari 2004: J. Eng. Mech. 130(6), pp 622-634
00035 // Parameters:
00036 //  1-e0:         initial void ratio at zero strain;
00037 //  2- e_r:       reference void for critical state line, ec = e_r - lambda_c*(pc/Pat)^xi;
00038 //  3- lambda_c:  parameter for critical state line, ec = e_r - lambda_c*(pc/Pat)^xi;
00039 //  4- xi:        parameter for critical state line, ec = e_r - lambda_c*(pc/Pat)^xi;
00040 //  5- Pat:       atmospherics pressure for critical state line, ec = e0 - lambda_c*(pc/Pat)^xi;
00041 //  6- m:         parameter in the yield function;
00042 //  7- M:         critical state stress ration;
00043 //  8- cc:        tension-compression strength ratio;
00044 //  9- A0:        parameter;
00045 // 10- nd         parameter;
00046 // 11- alpha:     "back-stress" tensor in yield function; (the 1st tensorial internal variable);
00047 // 12- z:         fabric dilation internal tensor (the 2nd tensorial internal variable); 
00048 
00049 #ifndef DM04_PF_CPP
00050 #define DM04_PF_CPP
00051 
00052 #include "DM04_PF.h"
00053 
00054 straintensor DM04_PF::DM04m;
00055 stresstensor DM04_PF::DM04temp;
00056 
00057 //================================================================================
00058 DM04_PF::DM04_PF(int e0_which_in, int index_e0_in,
00059                  int e_r_which_in, int index_e_r_in, 
00060                  int lambda_c_which_in, int index_lambda_c_in,
00061                  int xi_which_in, int index_xi_in,
00062                  int Pat_which_in, int index_Pat_in,
00063                  int m_which_in, int index_m_in,
00064                  int M_cal_which_in, int index_M_cal_in,
00065                  int cc_which_in, int index_cc_in,
00066                  int A0_which_in, int index_A0_in,
00067                  int nd_which_in, int index_nd_in,
00068                  int alpha_which_in, int index_alpha_in,
00069                  int z_which_in, int index_z_in)
00070 : e0_which(e0_which_in), index_e0(index_e0_in), 
00071   e_r_which(e_r_which_in), index_e_r(index_e_r_in), 
00072   lambda_c_which(lambda_c_which_in), index_lambda_c(index_lambda_c_in),
00073   xi_which(xi_which_in), index_xi(index_xi_in),
00074   Pat_which(Pat_which_in), index_Pat(index_Pat_in),
00075   m_which(m_which_in), index_m(index_m_in),
00076   M_cal_which(M_cal_which_in), index_M_cal(index_M_cal_in),
00077   cc_which(cc_which_in), index_cc(index_cc_in),
00078   A0_which(A0_which_in), index_A0(index_A0_in),
00079   nd_which(nd_which_in), index_nd(index_nd_in),
00080   alpha_which(alpha_which_in), index_alpha(index_alpha_in),
00081   z_which(z_which_in), index_z(index_z_in)
00082 {
00083 
00084 }
00085 
00086 //================================================================================
00087 DM04_PF::~DM04_PF() 
00088 {  
00089 
00090 }
00091 
00092 //================================================================================
00093 PlasticFlow* DM04_PF::newObj() 
00094 {  
00095      PlasticFlow  *new_PF = new DM04_PF(e0_which, index_e0,
00096                                         e_r_which, index_e_r,
00097                                         lambda_c_which, index_lambda_c,
00098                                         xi_which, index_xi,
00099                                         Pat_which, index_Pat,
00100                                         m_which, index_m,
00101                                         M_cal_which, index_M_cal,
00102                                         cc_which, index_cc,
00103                                         A0_which, index_A0,
00104                                         nd_which, index_nd,
00105                                         alpha_which, index_alpha,
00106                                         z_which, index_z);
00107      
00108      return new_PF;
00109 }
00110 
00111 //================================================================================
00112 const straintensor& DM04_PF::PlasticFlowTensor(const stresstensor& Stre, 
00113                                                const straintensor& Stra, 
00114                                                const MaterialParameter &MaterialParameter_in) const
00115 {
00116         BJtensor KroneckerI("I", 2, def_dim_2);
00117 
00118     double e0 = gete0(MaterialParameter_in);
00119     double e_r = gete_r(MaterialParameter_in);
00120     double lambda_c = getlambda_c(MaterialParameter_in);
00121     double xi = getxi(MaterialParameter_in);
00122     double Pat = getPat(MaterialParameter_in);
00123     //double m = getm(MaterialParameter_in);
00124     double M_cal = getM_cal(MaterialParameter_in);
00125     double cc = getcc(MaterialParameter_in);
00126     double A0 = getA0(MaterialParameter_in);
00127     double nd = getnd(MaterialParameter_in);    
00128 
00129     stresstensor alpha = getalpha(MaterialParameter_in);
00130     stresstensor z = getz(MaterialParameter_in);
00131 
00132     double p = Stre.p_hydrostatic();
00133     stresstensor s = Stre.deviator();
00134 
00135     stresstensor n;
00136     stresstensor alpha_d;
00137     stresstensor alpha_d_alpha;
00138     double g = 0.0;
00139     double ec = e_r;
00140     double stateParameter = 0.0;
00141     double expnd = 1.0;
00142     double ad = 0.0;
00143     double z_n = 0.0;
00144     double A_d = 0.0;
00145     double B_cal = 1.0;
00146     double C_cal = 0.0;
00147     double D_cal = 0.0;
00148     stresstensor s_bar;
00149     double lls_barll = 0.0;
00150     double epsilon_v = 0.0;
00151     double e = e0;
00152     double J3D;
00153     double cos3theta = 0.0;
00154             
00155     s_bar = s - (alpha *p);
00156     lls_barll = sqrt( (s_bar("ij")*s_bar("ij")).trace() );
00157     if (p > 0.0 && lls_barll > 0.0)
00158         n = s_bar * (1.0/lls_barll);
00159        
00160     J3D = n.Jinvariant3();
00161     cos3theta = -3.0*sqrt(6.0) *J3D;
00162 
00163     if (p <= 0.0)
00164       cos3theta = 1.0;
00165     
00166     if (cos3theta > 1.0) 
00167       cos3theta = 1.0;
00168 
00169     if (cos3theta < -1.0) 
00170       cos3theta = -1.0;
00171     
00172     g = getg(cc, cos3theta);
00173 
00174     if ( (p/Pat) >= 0.0 )
00175       ec = getec(e_r, lambda_c, xi, Pat, p);
00176     
00177     epsilon_v = Stra.Iinvariant1();
00178     e = e0 + (1 + e0) *epsilon_v;
00179     
00180     stateParameter = e - ec;
00181     
00182     expnd = exp( nd *stateParameter );
00183     
00184     // Just using another way
00185     //ad = sqrt(2.0/3.0) * ( g *M_cal *expnd - m);
00186     //D_cal = ad - (alpha("ij")*n("ij")).trace();
00187 
00188     // Replacing the above
00189     ad = sqrt(2.0/3.0) * g *M_cal *expnd;  
00190     D_cal = ad - (s("ij")*n("ij")).trace() / p;
00191 
00192     z_n = (z("ij")*n("ij")).trace();
00193     if (z_n < 0.0) 
00194       z_n = 0.0;
00195     A_d = A0 * (1.0 + z_n);
00196      
00197     D_cal *= (-A_d);
00198 
00199     B_cal = 1.0 + 1.5 *((1.0-cc)/cc) *g *cos3theta;
00200     C_cal = 3.0 *sqrt(1.5) *((1.0-cc)/cc) *g;
00201     
00202     stresstensor n_n = n("ik")*n("kj");
00203         n_n.null_indices();
00204 
00205     // note different 'positive-negative' since we assume extension (dilation) positive 
00206     // which is different from the Ref. 
00207     DM04m = (n *B_cal) + (n_n *C_cal) + (KroneckerI *(( - C_cal + D_cal)/3.0));
00208     
00209                        
00210     return DM04m;
00211 }
00212 
00213 // to get e0
00214 //================================================================================
00215 double DM04_PF::gete0(const MaterialParameter &MaterialParameter_in) const
00216 {
00217     return getParameters(MaterialParameter_in, e0_which, index_e0);
00218 }
00219 
00220 // to get e_r
00221 //================================================================================
00222 double DM04_PF::gete_r(const MaterialParameter &MaterialParameter_in) const
00223 {
00224     return getParameters(MaterialParameter_in, e_r_which, index_e_r);
00225 }
00226 
00227 // to get lambda_c
00228 //================================================================================
00229 double DM04_PF::getlambda_c(const MaterialParameter &MaterialParameter_in) const
00230 {
00231     return getParameters(MaterialParameter_in, lambda_c_which, index_lambda_c);
00232 }
00233 
00234 // to get xi
00235 //================================================================================
00236 double DM04_PF::getxi(const MaterialParameter &MaterialParameter_in) const
00237 {
00238     return getParameters(MaterialParameter_in, xi_which, index_xi);
00239 
00240 }
00241 
00242 // to get Pat
00243 //================================================================================
00244 double DM04_PF::getPat(const MaterialParameter &MaterialParameter_in) const
00245 {
00246     return getParameters(MaterialParameter_in, Pat_which, index_Pat);
00247 }
00248 
00249 // to get m
00250 //================================================================================
00251 double DM04_PF::getm(const MaterialParameter &MaterialParameter_in) const
00252 {
00253     return getParameters(MaterialParameter_in, m_which, index_m);
00254 }
00255 
00256 // to get M
00257 //================================================================================
00258 double DM04_PF::getM_cal(const MaterialParameter &MaterialParameter_in) const
00259 {
00260     return getParameters(MaterialParameter_in, M_cal_which, index_M_cal);
00261 }
00262 
00263 // to get c
00264 //================================================================================
00265 double DM04_PF::getcc(const MaterialParameter &MaterialParameter_in) const
00266 {
00267     return getParameters(MaterialParameter_in, cc_which, index_cc);
00268 }
00269 
00270 // to get A0
00271 //================================================================================
00272 double DM04_PF::getA0(const MaterialParameter &MaterialParameter_in) const
00273 {
00274     return getParameters(MaterialParameter_in, A0_which, index_A0);
00275 
00276 }
00277 
00278 // to get n_d
00279 //================================================================================
00280 double DM04_PF::getnd(const MaterialParameter &MaterialParameter_in) const
00281 {
00282     return getParameters(MaterialParameter_in, nd_which, index_nd);
00283 }
00284 
00285 // to get alpha
00286 //================================================================================
00287 const stresstensor& DM04_PF::getalpha(const MaterialParameter &MaterialParameter_in) const
00288 {
00289         if ( alpha_which == 2 && index_alpha <= MaterialParameter_in.getNum_Internal_Tensor() && index_alpha > 0) {
00290                 DM04_PF::DM04temp = MaterialParameter_in.getInternal_Tensor(index_alpha-1);
00291                 return DM04_PF::DM04temp;
00292         }
00293         else {
00294                 opserr << "DM04_PF: Invalid Input. " << endln;
00295                 exit (1);
00296         }
00297 }
00298 
00299 // to get z
00300 //================================================================================
00301 const stresstensor& DM04_PF::getz(const MaterialParameter &MaterialParameter_in) const
00302 {
00303         if ( z_which == 2 && index_z <= MaterialParameter_in.getNum_Internal_Tensor() && index_z > 0) {
00304                 DM04_PF::DM04temp = MaterialParameter_in.getInternal_Tensor(index_z-1);
00305                 return DM04_PF::DM04temp;
00306         }
00307         else {
00308                 opserr << "DM04_PF: Invalid Input. " << endln;
00309                 exit (1);
00310         }
00311 }
00312 
00313 
00314 //================================================================================
00315 double DM04_PF::getParameters(const MaterialParameter &MaterialParameter_in, int parIndex, int which) const
00316 {
00317         if ( parIndex == 0 && which <= MaterialParameter_in.getNum_Material_Parameter() && which > 0)
00318                 return MaterialParameter_in.getMaterial_Parameter(which-1);
00319         else if ( parIndex == 1 && which <= MaterialParameter_in.getNum_Internal_Scalar() && which > 0)
00320                 return MaterialParameter_in.getInternal_Scalar(which-1);
00321         else {
00322                 opserr << "DM04_PF: Invalid Input. " << parIndex << " and " << which << endln;
00323                 exit (1);
00324         }
00325 } 
00326 
00327 
00328 //================================================================================
00329 double DM04_PF::getec(double e_r, double lambda_c, double xi, double Pat, double p_c) const
00330 {
00331     double ee = e_r; 
00332     
00333     if ( p_c/Pat >= 0.0 )
00334       ee = e_r - lambda_c * pow(p_c/Pat, xi);
00335     else 
00336       opserr << "Warning: DM04_PF - 'p_c/Pat' less than zero! " << endln;
00337 
00338     return ee;
00339 }
00340 
00341 //================================================================================
00342 double DM04_PF::getg(double c, double cos3theta) const
00343 {
00344     return 2.0 * c / ( (1.0+c) - (1.0-c)*cos3theta );
00345 }
00346 
00347 
00348 #endif
00349 
00350 
00351 
00352 

Generated on Mon Oct 23 15:05:14 2006 for OpenSees by doxygen 1.5.0