[24307] | 1 | Index: ../trunk-jpl/src/c/classes/Loads/Channel.cpp
|
---|
| 2 | ===================================================================
|
---|
| 3 | --- ../trunk-jpl/src/c/classes/Loads/Channel.cpp (revision 24063)
|
---|
| 4 | +++ ../trunk-jpl/src/c/classes/Loads/Channel.cpp (revision 24064)
|
---|
| 5 | @@ -54,6 +54,13 @@
|
---|
| 6 | int e1 = iomodel->faces[4*index+2];
|
---|
| 7 | int e2 = iomodel->faces[4*index+3];
|
---|
| 8 |
|
---|
| 9 | + if(e2==-1){
|
---|
| 10 | + this->boundary = true;
|
---|
| 11 | + }
|
---|
| 12 | + else{
|
---|
| 13 | + this->boundary = false;
|
---|
| 14 | + }
|
---|
| 15 | +
|
---|
| 16 | /*Set Element hook (4th column may be -1 for boundary edges)*/
|
---|
| 17 | this->helement = new Hook(&e1,1);
|
---|
| 18 |
|
---|
| 19 | @@ -544,9 +551,8 @@
|
---|
| 20 | Ngrad = fabs(dphids);
|
---|
| 21 | if(Ngrad<1.e-12) Ngrad = 1.e-12;
|
---|
| 22 |
|
---|
| 23 | - /*Compute the effective conductivity Kc = k h^alpha |grad Phi|^{beta-2} (same for sheet)*/
|
---|
| 24 | - IssmDouble Kc = kc * pow(this->S,ALPHA_C) * pow(Ngrad,BETA_C-2.);
|
---|
| 25 | - IssmDouble Ks = ks * pow(h ,ALPHA_S) * pow(Ngrad,BETA_S-2.);
|
---|
| 26 | + /*Compute the effective conductivity Ks = k h^alpha |grad Phi|^{beta-2} (same for sheet)*/
|
---|
| 27 | + IssmDouble Ks = ks * pow(h,ALPHA_S) * pow(Ngrad,BETA_S-2.);
|
---|
| 28 |
|
---|
| 29 | /*Approx. discharge in the sheet flowing folwing in the direction of the channel ofver a width lc*/
|
---|
| 30 | qc = - Ks * dphids;
|
---|
| 31 | @@ -584,7 +590,7 @@
|
---|
| 32 |
|
---|
| 33 | /*Initialize Element matrix and return if necessary*/
|
---|
| 34 | Tria* tria=(Tria*)element;
|
---|
| 35 | - if(!tria->IsIceInElement()){
|
---|
| 36 | + if(!tria->IsIceInElement() || this->boundary){
|
---|
| 37 | this->S = 0.;
|
---|
| 38 | return;
|
---|
| 39 | }
|
---|
| 40 | @@ -673,8 +679,11 @@
|
---|
| 41 | IssmDouble beta = 1./(rho_ice*L)*( fabs(lc*qc*dphids) + C*fFactor*dPw );
|
---|
| 42 |
|
---|
| 43 | /*Solve ODE*/
|
---|
| 44 | - this->S = ODE1(alpha,beta,this->S,dt,0);
|
---|
| 45 | + this->S = ODE1(alpha,beta,this->S,dt,2);
|
---|
| 46 |
|
---|
| 47 | + /*Make sure Area > 0*/
|
---|
| 48 | + if(this->S<0.) this->S = 0.;
|
---|
| 49 | +
|
---|
| 50 | /*Clean up and return*/
|
---|
| 51 | delete gauss;
|
---|
| 52 | }
|
---|
| 53 | Index: ../trunk-jpl/src/c/classes/Loads/Channel.h
|
---|
| 54 | ===================================================================
|
---|
| 55 | --- ../trunk-jpl/src/c/classes/Loads/Channel.h (revision 24063)
|
---|
| 56 | +++ ../trunk-jpl/src/c/classes/Loads/Channel.h (revision 24064)
|
---|
| 57 | @@ -19,6 +19,7 @@
|
---|
| 58 |
|
---|
| 59 | private:
|
---|
| 60 | IssmDouble S;
|
---|
| 61 | + bool boundary;
|
---|
| 62 |
|
---|
| 63 | public:
|
---|
| 64 | int sid;
|
---|