Changeset 24063


Ignore:
Timestamp:
07/04/19 02:11:46 (6 years ago)
Author:
Mathieu Morlighem
Message:

CHG: do not use effective pressure in thickness update, recompute it instead, and use implicit scheme for sheet thickness update

File:
1 edited

Legend:

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

    r24061 r24063  
    3333                CreateFaces(iomodel);
    3434                for(int i=0;i<iomodel->numberoffaces;i++){
     35
    3536                        /*Get left and right elements*/
    3637                        int element=iomodel->faces[4*i+2]-1; //faces are [node1 node2 elem1 elem2]
     
    303304
    304305        /*Intermediaries */
     306        bool        meltflag;
    305307        IssmDouble  Jdet,w,v2,vx,vy,ub,h,h_r;
    306308        IssmDouble  G,m,frictionheat,alpha2;
     
    317319
    318320        /*Retrieve all inputs and parameters*/
    319         bool meltflag;
     321        element->GetVerticesCoordinates(&xyz_list);
    320322        element->FindParam(&meltflag,HydrologyMeltFlagEnum);
    321         element->GetVerticesCoordinates(&xyz_list);
    322323        IssmDouble L         = element->FindParam(MaterialsLatentheatEnum);
    323324        IssmDouble rho_ice   = element->FindParam(MaterialsRhoIceEnum);
     
    362363                b_input->GetInputValue(&b,gauss);
    363364                H_input->GetInputValue(&H,gauss);
    364                 m_input->GetInputValue(&m,gauss);
    365365
    366366                /*Get basal velocity*/
     
    375375                frictionheat=alpha2*ub*ub;
    376376
    377                 /*Compute melt*/
     377                /*Compute melt (if necessary)*/
    378378                if(!meltflag){
    379379                        m = (G + frictionheat)/(rho_ice*L);
    380380                }
     381                else{
     382                        m_input->GetInputValue(&m,gauss);
     383                }
    381384
    382385                /*Compute closing rate*/
    383                 /*See Gagliardini and Werder 2018 eq. A2 (v = v2(phi_i) + v1*phi_{i+1})*/
    384386                phi_0 = rho_water*g*b + rho_ice*g*H;
    385387                A=pow(B,-n);
     
    433435
    434436        /*Intermediaries */
    435         IssmDouble  Jdet,vx,vy,ub,h_old,N,h_r;
    436         IssmDouble  A,B,n;
     437        IssmDouble  Jdet,vx,vy,ub,h_old,N,h_r,H,b;
     438        IssmDouble  A,B,n,phi,phi_0;
    437439        IssmDouble  alpha,beta;
    438440
     
    444446
    445447        /*Retrieve all inputs and parameters*/
    446         IssmDouble  dt  = element->FindParam(TimesteppingTimeStepEnum);
    447         IssmDouble  l_r = element->FindParam(HydrologyCavitySpacingEnum);
     448        IssmDouble  dt       = element->FindParam(TimesteppingTimeStepEnum);
     449        IssmDouble  l_r      = element->FindParam(HydrologyCavitySpacingEnum);
     450        IssmDouble rho_ice   = element->FindParam(MaterialsRhoIceEnum);
     451        IssmDouble rho_water = element->FindParam(MaterialsRhoFreshwaterEnum);
     452        IssmDouble g         = element->FindParam(ConstantsGEnum);
    448453        Input* hr_input = element->GetInput(HydrologyBumpHeightEnum);_assert_(hr_input);
    449454        Input* vx_input = element->GetInput(VxEnum);_assert_(vx_input);
    450455        Input* vy_input = element->GetInput(VyEnum);_assert_(vy_input);
    451         Input*  N_input = element->GetInput(EffectivePressureEnum); _assert_(N_input);
    452         Input*  h_input = element->GetInput(HydrologySheetThicknessEnum);_assert_(h_input);
     456        Input* H_input  = element->GetInput(ThicknessEnum); _assert_(H_input);
     457        Input* b_input  = element->GetInput(BedEnum); _assert_(b_input);
     458        Input* h_input  = element->GetInput(HydrologySheetThicknessEnum);_assert_(h_input);
    453459        Input* B_input  = element->GetInput(MaterialsRheologyBEnum);         _assert_(B_input);
    454460        Input* n_input  = element->GetInput(MaterialsRheologyNEnum);         _assert_(n_input);
     461        Input* phi_input = element->GetInput(HydraulicPotentialEnum);         _assert_(phi_input);
    455462
    456463        /* Start  looping on the number of gaussian points: */
     
    460467
    461468                /*Get input values at gauss points*/
     469                phi_input->GetInputValue(&phi,gauss);
    462470                vx_input->GetInputValue(&vx,gauss);
    463471                vy_input->GetInputValue(&vy,gauss);
     
    465473                B_input->GetInputValue(&B,gauss);
    466474                n_input->GetInputValue(&n,gauss);
    467                 N_input->GetInputValue(&N,gauss);
    468475                hr_input->GetInputValue(&h_r,gauss);
     476                b_input->GetInputValue(&b,gauss);
     477                H_input->GetInputValue(&H,gauss);
     478
     479                /*Get values for a few potentials*/
     480                phi_0 = rho_water*g*b + rho_ice*g*H;
     481                N = phi_0 - phi;
    469482
    470483                /*Get basal velocity*/
     
    485498
    486499                /*Get new sheet thickness*/
    487                 h_new[iv] = ODE1(alpha,beta,h_old,dt,0);
     500                h_new[iv] = ODE1(alpha,beta,h_old,dt,1);
    488501
    489502                /*Make sure it is positive*/
Note: See TracChangeset for help on using the changeset viewer.