Changeset 89


Ignore:
Timestamp:
04/28/09 15:15:45 (16 years ago)
Author:
Eric.Larour
Message:

New viscosity 3d for Pattyn elements

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/objects/Matice.cpp

    r8 r89  
    240240        *pviscosity2=viscosity2;
    241241}
     242
     243#undef __FUNCT__
     244#define __FUNCT__ "MatIce::GetViscosity3d"
     245void  Matice::GetViscosity3d(double* pviscosity3d, double* epsilon){
     246
     247        /*Return viscosity accounting for steady state power law creep [Thomas and MacAyeal, 1982]:
     248         *
     249         *                                 2*B
     250         * viscosity3d= -------------------------------------------------------------------
     251         *     2[ exx^2+eyy^2+exx*eyy+exy^2+exz^2+eyz^2 ]^[(n-1)/2n]
     252         *
     253         *     where mu is the viscotiy, B the flow law parameter , (u,v) the velocity
     254         *     vector, and n the flow law exponent.
     255         *
     256         * If epsilon is NULL, it means this is the first time Emg is being run, and we
     257         * return g, initial viscosity.
     258         */
     259       
     260        /*output: */
     261        double viscosity3d;
     262
     263        /*input strain rate: */
     264        double exx,eyy,exy,exz,eyz;
     265
     266        /*Intermediary value A and exponent e: */
     267        double A,e;
     268
     269        if (n==1){
     270                /*Viscous behaviour! viscosity3d=B: */
     271                viscosity3d=B;
     272        }
     273        else{
     274                if((epsilon[0]==0) && (epsilon[1]==0) && (epsilon[2]==0) &&
     275                                (epsilon[3]==0) && (epsilon[4]==0)){
     276                        viscosity3d=pow(10,14);
     277                }
     278                else{
     279
     280                        /*Retrive strain rate components: */
     281                        exx=*(epsilon+0);
     282                        eyy=*(epsilon+1);
     283                        exy=*(epsilon+2);
     284                        exz=*(epsilon+3);
     285                        eyz=*(epsilon+4);
     286
     287                        /*Build viscosity: viscosity3d=2*B/(2*A^e) */
     288                        A=pow(exx,2)+pow(eyy,2)+pow(exy,2)+pow(exz,2)+pow(eyz,2)+exx*eyy;
     289                        if(A==0){
     290                                /*Maxiviscosity3dm viscosity for 0 shear areas: */
     291                                viscosity3d=4.5*pow(10,17);
     292                        }
     293                        else{
     294                                e=(n-1)/2/n;
     295                       
     296                                viscosity3d=2*B/(2*pow(A,e));
     297                        }
     298                }
     299        }
     300        #ifdef _DEBUG_
     301        _printf_("Viscosity %lf\n",viscosity3d);
     302        #endif
     303
     304        /*Assign output pointers:*/
     305        *pviscosity3d=viscosity3d;
     306}
Note: See TracChangeset for help on using the changeset viewer.