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

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

NEW: adding Archive/23390-24306

File size: 2.0 KB
RevLine 
[24307]1Index: ../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 }
53Index: ../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;
Note: See TracBrowser for help on using the repository browser.