source: issm/oecreview/Archive/23390-24306/ISSM-24063-24064.diff@ 24307

Last change on this file since 24307 was 24307, checked in by Mathieu Morlighem, 5 years ago

NEW: adding Archive/23390-24306

File size: 2.0 KB
  • ../trunk-jpl/src/c/classes/Loads/Channel.cpp

     
    5454        int e1 = iomodel->faces[4*index+2];
    5555        int e2 = iomodel->faces[4*index+3];
    5656
     57        if(e2==-1){
     58                this->boundary = true;
     59        }
     60        else{
     61                this->boundary = false;
     62        }
     63
    5764        /*Set Element hook (4th column may be -1 for boundary edges)*/
    5865        this->helement  = new Hook(&e1,1);
    5966
     
    544551                Ngrad   = fabs(dphids);
    545552                if(Ngrad<1.e-12) Ngrad = 1.e-12;
    546553
    547                 /*Compute the effective conductivity Kc = k h^alpha |grad Phi|^{beta-2} (same for sheet)*/
    548                 IssmDouble Kc = kc * pow(this->S,ALPHA_C) * pow(Ngrad,BETA_C-2.);
    549                 IssmDouble Ks = ks * pow(h      ,ALPHA_S) * pow(Ngrad,BETA_S-2.);
     554                /*Compute the effective conductivity Ks = k h^alpha |grad Phi|^{beta-2} (same for sheet)*/
     555                IssmDouble Ks = ks * pow(h,ALPHA_S) * pow(Ngrad,BETA_S-2.);
    550556
    551557                /*Approx. discharge in the sheet flowing folwing in the direction of the channel ofver a width lc*/
    552558                qc = - Ks * dphids;
     
    584590
    585591        /*Initialize Element matrix and return if necessary*/
    586592        Tria*  tria=(Tria*)element;
    587         if(!tria->IsIceInElement()){
     593        if(!tria->IsIceInElement() || this->boundary){
    588594                this->S = 0.;
    589595                return;
    590596        }
     
    673679        IssmDouble beta = 1./(rho_ice*L)*( fabs(lc*qc*dphids) + C*fFactor*dPw );
    674680
    675681        /*Solve ODE*/
    676         this->S = ODE1(alpha,beta,this->S,dt,0);
     682        this->S = ODE1(alpha,beta,this->S,dt,2);
    677683
     684        /*Make sure Area > 0*/
     685        if(this->S<0.) this->S = 0.;
     686
    678687        /*Clean up and return*/
    679688        delete gauss;
    680689}
  • ../trunk-jpl/src/c/classes/Loads/Channel.h

     
    1919
    2020        private:
    2121                IssmDouble S;
     22                bool       boundary;
    2223
    2324        public:
    2425                int sid;
Note: See TracBrowser for help on using the repository browser.