Changeset 23961


Ignore:
Timestamp:
05/30/19 09:54:32 (6 years ago)
Author:
Mathieu Morlighem
Message:

CHG: in non linear iteration, do not refer to N but use its linearization on phi

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/analyses/HydrologyGlaDSAnalysis.cpp

    r23960 r23961  
    169169        /*Intermediaries */
    170170        IssmDouble  Jdet,dphi[3],h,k;
     171        IssmDouble  A,B,n,phi_old,phi,phi_0,H,b,v1;
    171172        IssmDouble* xyz_list = NULL;
    172173
     
    189190        IssmDouble dt        = element->FindParam(TimesteppingTimeStepEnum);
    190191        IssmDouble rho_water = element->FindParam(MaterialsRhoFreshwaterEnum);
     192        IssmDouble rho_ice   = element->FindParam(MaterialsRhoIceEnum);
    191193        IssmDouble g         = element->FindParam(ConstantsGEnum);
    192194        IssmDouble e_v       = element->FindParam(HydrologyEnglacialVoidRatioEnum);
     
    194196        Input* phi_input = element->GetInput(HydraulicPotentialEnum);      _assert_(phi_input);
    195197        Input* h_input   = element->GetInput(HydrologySheetThicknessEnum); _assert_(h_input);
     198        Input* H_input      = element->GetInput(ThicknessEnum); _assert_(H_input);
     199        Input* b_input      = element->GetInput(BedEnum); _assert_(b_input);
     200        Input* B_input      = element->GetInput(MaterialsRheologyBEnum);         _assert_(B_input);
     201        Input* n_input      = element->GetInput(MaterialsRheologyNEnum);         _assert_(n_input);
    196202
    197203        /* Start  looping on the number of gaussian points: */
     
    205211
    206212                phi_input->GetInputDerivativeValue(&dphi[0],xyz_list,gauss);
     213                phi_input->GetInputValue(&phi,gauss);
    207214                h_input->GetInputValue(&h,gauss);
    208215                k_input->GetInputValue(&k,gauss);
     216                B_input->GetInputValue(&B,gauss);
     217                n_input->GetInputValue(&n,gauss);
     218                b_input->GetInputValue(&b,gauss);
     219                H_input->GetInputValue(&H,gauss);
    209220
    210221                /*Get norm of gradient of hydraulic potential and make sure it is >0*/
     
    220231                                                        coeff*dbasis[0*numnodes+i]*dbasis[0*numnodes+j]
    221232                                                        + coeff*dbasis[1*numnodes+i]*dbasis[1*numnodes+j]);
     233                        }
     234                }
     235
     236                /*Closing rate term, see Gagliardini and Werder 2018 eq. A2 (v = v1*phi_i + v2(phi_{i+1}))*/
     237                phi_0 = rho_water*g*b + rho_ice*g*H;
     238                A=pow(B,-n);
     239                v1 = 2./pow(n,n)*A*h*(pow(fabs(phi_0 - phi),n-1.)*( - n));
     240                for(int i=0;i<numnodes;i++){
     241                        for(int j=0;j<numnodes;j++){
     242                                Ke->values[i*numnodes+j] += gauss->weight*Jdet*(-v1)*basis[i]*basis[j];
    222243                        }
    223244                }
     
    248269
    249270        /*Intermediaries */
    250         IssmDouble  Jdet,w,v,vx,vy,ub,h,N,h_r;
     271        IssmDouble  Jdet,w,v2,vx,vy,ub,h,h_r;
    251272        IssmDouble  G,m,frictionheat,alpha2;
    252         IssmDouble  A,B,n,phi_old;
     273        IssmDouble  A,B,n,phi_old,phi,phi_0;
     274        IssmDouble  H,b;
    253275        IssmDouble* xyz_list = NULL;
    254276
     
    272294        Input* vx_input     = element->GetInput(VxEnum);_assert_(vx_input);
    273295        Input* vy_input     = element->GetInput(VyEnum);_assert_(vy_input);
    274         Input* N_input      = element->GetInput(EffectivePressureEnum); _assert_(N_input);
    275296        Input* h_input      = element->GetInput(HydrologySheetThicknessEnum);_assert_(h_input);
     297        Input* H_input      = element->GetInput(ThicknessEnum); _assert_(H_input);
     298        Input* b_input      = element->GetInput(BedEnum); _assert_(b_input);
    276299        Input* G_input      = element->GetInput(BasalforcingsGeothermalfluxEnum);_assert_(G_input);
    277300        Input* B_input      = element->GetInput(MaterialsRheologyBEnum);         _assert_(B_input);
    278301        Input* n_input      = element->GetInput(MaterialsRheologyNEnum);         _assert_(n_input);
    279302        Input* phiold_input = element->GetInput(HydraulicPotentialOldEnum);      _assert_(phiold_input);
     303        Input* phi_input    = element->GetInput(HydraulicPotentialEnum);         _assert_(phi_input);
    280304
    281305        /*Build friction element, needed later: */
     
    297321                B_input->GetInputValue(&B,gauss);
    298322                n_input->GetInputValue(&n,gauss);
    299                 N_input->GetInputValue(&N,gauss);
    300323                hr_input->GetInputValue(&h_r,gauss);
     324                phi_input->GetInputValue(&phi,gauss);
     325                b_input->GetInputValue(&b,gauss);
     326                H_input->GetInputValue(&H,gauss);
    301327
    302328                /*Get basal velocity*/
     
    315341
    316342                /*Compute closing rate*/
     343                /*See Gagliardini and Werder 2018 eq. A2 (v = v2(phi_i) + v1*phi_{i+1})*/
     344                phi_0 = rho_water*g*b + rho_ice*g*H;
    317345                A=pow(B,-n);
    318                 v = 2./pow(n,n)*A*h*pow(fabs(N),n-1.)*N;
    319 
    320                 for(int i=0;i<numnodes;i++) pe->values[i]+= - Jdet*gauss->weight*(w-v-m)*basis[i];
     346                v2 = 2./pow(n,n)*A*h*(pow(fabs(phi_0 - phi),n-1.)*(phi_0 +(n-1.)*phi));
     347
     348                for(int i=0;i<numnodes;i++) pe->values[i]+= - Jdet*gauss->weight*(w-v2-m)*basis[i];
    321349
    322350                /*Transient term if dt>0*/
     
    413441                /*Get new sheet thickness*/
    414442                h_new[iv] = h_old + dt*(w-v);
     443                if(h_new[iv]<1.e-12) h_new[iv] = 1.e-12;
    415444        }
    416445
Note: See TracChangeset for help on using the changeset viewer.