Changeset 18282


Ignore:
Timestamp:
07/22/14 13:16:55 (11 years ago)
Author:
cborstad
Message:

NEW: updated damage solution can now be called as a Requested Output of a Stressbalance solution. Requires that the matdamageice class be used with two extra parameters specified (stress_threshold and c1, a ductility parameter).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/classes/Elements/Element.cpp

    r18277 r18282  
    8888      B_input=this->GetInput(MaterialsRheologyBEnum); _assert_(B_input);
    8989   }
    90         /* Get B and D inputs appropriate for the type of domain */
    91         /*n=this->material->GetN();*/
    92    /*if(domaintype==Domain2DhorizontalEnum){
    93                 B=this->material->GetBbar();
    94                 D=this->material->GetDbar();
    95    }
    96         else{
    97                 B=this->material->GetB();
    98                 D=this->material->GetD();
    99         }*/
    10090       
    10191        /* Start looping on the number of nodes: */
     
    121111      damage_input->GetInputValue(&D,gauss);
    122112
     113                /* Compute threshold strain rate from threshold stress */
     114                eps_0=pow(sigma_0/B,n);
     115                _assert_(eps_f>eps_0);
     116
    123117                /* Compute kappa (k) from pre-existing level of damage, using Newton-Raphson */
    124                 k1=exp(n*eps_0/(eps_f-eps_0)+n*log(1.-D)-log(eps_0)); /* initial guess */
    125                
     118                /* provide a reasonable initial guess */
     119                if(D==0){
     120                        k1=eps_0;
     121                }
     122                else{
     123                        k1=exp(n*eps_0/(eps_f-eps_0)-n*log(1.-D)+log(eps_0)); /* initial guess */
     124                }
     125       
     126                counter=0;
    126127                while(true){
    127128        /*Newton step k2=k1-f(k1)/f'(k1) */
    128         k2=k1-(1.-D-pow(eps_0/k1,1./n)*exp(-(k1-eps_0)/(eps_f-eps_0)))/(pow(eps_0/k1,1./n)*exp(-(k1-eps_0)/(eps_f-eps_0))*(-1./(eps_f-eps_0)-1./n/k1));
     129                        k2=k1-(k1+(eps_f-eps_0)/n*log(k1)-eps_0+(eps_f-eps_0)*(log(1.-D)-1./n*log(eps_0)))/(1.+(eps_f-eps_0)/n/k1);
    129130
    130131        if( fabs(k2-k1)/(fabs(k2))<threshold ){
     
    132133        }
    133134        else{
    134            k1=k2;
     135                                k1=k2;
    135136           counter++;
    136137        }
     
    139140        }
    140141
    141                 /* Compute threshold strain rate from threshold stress */
    142                 eps_0=pow(sigma_0/B,n);
    143                 _assert_(eps_f>eps_0);
    144 
    145142                if(eps_eff>k2){
    146                         newD[i]=1.-pow(eps_0/k2,1./n)*exp(-(k2-eps_0)/(eps_f-eps_0));
     143                        newD[i]=1.-pow(eps_0/eps_eff,1./n)*exp(-(eps_eff-eps_0)/(eps_f-eps_0));
    147144                }
    148145                else newD[i]=D;
Note: See TracChangeset for help on using the changeset viewer.