PressureDependent_Elastic.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, 
00028 // DATE:              Fall 2005
00029 // UPDATE HISTORY:    
00030 //
00032 //
00033 
00034 // This is based on E = E0*(p/p_ref)^m
00035 // 
00036 // Parameters:
00037 // 1: E0:    Young's modulus when p at p_ref;
00038 // 2: v:     Poissoin's ratio;
00039 // 3: m:     power factor, usually = 0.5;
00040 // 4: p_ref  rerefence pressure;
00041 // 5: k_cut  cut-off factor, when E = k_c *E0, E = k_c*E0;
00042 
00043 #ifndef PressureDependent_Elastic_CPP
00044 #define PressureDependent_Elastic_CPP
00045 
00046 #include "PressureDependent_Elastic.h"
00047 
00048 PressureDependent_Elastic::PressureDependent_Elastic(int E0_in, 
00049                                                      int v_in,
00050                                                      int m_in,
00051                                                      int p_ref_in,
00052                                                      int k_cut_in,
00053                                                      const stresstensor& initialStress,
00054                                                      const straintensor& initialStrain)
00055 : ElasticState(initialStress, initialStrain),
00056   E0_index(E0_in),
00057   v_index(v_in),
00058   m_index(m_in),
00059   p_ref_index(p_ref_in),
00060   k_cut_index(k_cut_in) 
00061 {
00062 
00063 }
00064 
00065 // Create a new 
00066 ElasticState* PressureDependent_Elastic::newObj() 
00067 {
00068         ElasticState * Els = new  PressureDependent_Elastic(this->E0_index, 
00069                                                             this->v_index,
00070                                                             this->m_index,
00071                                                             this->p_ref_index,
00072                                                             this->k_cut_index,
00073                                                             this->Stress,
00074                                                             this->Strain);
00075      return Els;
00076 }
00077 
00078 // Get Stiffness Tensor
00079 const BJtensor& PressureDependent_Elastic::getElasticStiffness (const MaterialParameter &MaterialParameter_in) const
00080 {
00081     // Kronecker delta tensor
00082     BJtensor I2("I", 2, def_dim_2);
00083 
00084     BJtensor I_ijkl = I2("ij")*I2("kl");
00085     I_ijkl.null_indices();
00086     BJtensor I_ikjl = I_ijkl.transpose0110();
00087     BJtensor I_iljk = I_ijkl.transpose0111();
00088     BJtensor I4s = (I_ikjl+I_iljk)*0.5;
00089     
00090     double E0 = getE0(MaterialParameter_in);
00091     double v = getv(MaterialParameter_in);
00092     if (v >= 0.5 || v < -1.0) {
00093             opserr << "Warning!! PressureDependent_Elastic: Invalid possoin's ratio. " << endln;
00094             exit (1);
00095     }
00096     double m = getm(MaterialParameter_in);
00097     double p_ref = getp_ref(MaterialParameter_in);
00098     if ( p_ref <= 0.0) {
00099             opserr << "Warning!! PressureDependent_Elastic: Invalid reference pressure. " << endln;
00100             exit (1);
00101     }   
00102     double k_cut = getk_cut(MaterialParameter_in);
00103         
00104     double p = this->getStress().p_hydrostatic();
00105     
00106     double E_cut = E0 * k_cut;
00107     double E_cal = E0 * pow((p/p_ref), m);
00108     double E = (E_cal > E_cut) ? E_cal : E_cut;
00109     
00110     double K = E / ( 3.0*(1.0-2.0*v) ) ;
00111     double G = E / ( 2.0*(1.0+v) );
00112        
00113     // Building elasticity tensor
00114     ElasticState::ElasticStiffness = I_ijkl *(K - 2.0*G/3.0) + I4s *(2.0*G);
00115 
00116     return ElasticState::ElasticStiffness;
00117 }
00118 
00119 // Get E0
00120 double PressureDependent_Elastic::getE0(const MaterialParameter &MaterialParameter_in) const
00121 {
00122         if ( E0_index > MaterialParameter_in.getNum_Material_Parameter() || E0_index < 2) { 
00123                 opserr << "PressureDependent_Elastic: Invalid Input. " << endln;
00124                 exit (1);
00125         }
00126         else
00127                 return MaterialParameter_in.getMaterial_Parameter(E0_index - 1);
00128 }
00129 
00130 // Get v
00131 double PressureDependent_Elastic::getv(const MaterialParameter &MaterialParameter_in) const
00132 {
00133         if ( v_index > MaterialParameter_in.getNum_Material_Parameter() || v_index < 2) { 
00134                 opserr << "PressureDependent_Elastic: Invalid Input. " << endln;
00135                 exit (1);
00136         }
00137         else
00138                 return MaterialParameter_in.getMaterial_Parameter(v_index - 1); 
00139 }
00140 
00141 // Get m
00142 double PressureDependent_Elastic::getm(const MaterialParameter &MaterialParameter_in) const
00143 {
00144         if ( m_index > MaterialParameter_in.getNum_Material_Parameter() || m_index < 2) { 
00145                 opserr << "PressureDependent_Elastic: Invalid Input. " << endln;
00146                 exit (1);
00147         }
00148         else
00149                 return MaterialParameter_in.getMaterial_Parameter(m_index - 1); 
00150 }
00151 
00152 // Get p_ref
00153 double PressureDependent_Elastic::getp_ref(const MaterialParameter &MaterialParameter_in) const
00154 {
00155         if ( p_ref_index > MaterialParameter_in.getNum_Material_Parameter() || p_ref_index < 2) { 
00156                 opserr << "PressureDependent_Elastic: Invalid Input. " << endln;
00157                 exit (1);
00158         }
00159         else
00160                 return MaterialParameter_in.getMaterial_Parameter(p_ref_index - 1); 
00161 }
00162 
00163 // Get p_cut
00164 double PressureDependent_Elastic::getk_cut(const MaterialParameter &MaterialParameter_in) const
00165 {
00166         if ( k_cut_index > MaterialParameter_in.getNum_Material_Parameter() || k_cut_index < 2) { 
00167                 opserr << "PressureDependent_Elastic: Invalid Input. " << endln;
00168                 exit (1);
00169         }
00170         else
00171                 return MaterialParameter_in.getMaterial_Parameter(k_cut_index - 1); 
00172 }
00173 
00174 #endif
00175 

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