Changeset 16360
- Timestamp:
- 10/10/13 07:29:57 (11 years ago)
- Location:
- issm/trunk-jpl
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/modules/PostprocessingEnthalpyx/PostprocessingEnthalpyx.cpp
r16322 r16360 19 19 20 20 /*drain excess water fraction: */ 21 for (i=0;i<femmodel->elements->Size();i++){21 /*for (i=0;i<femmodel->elements->Size();i++){ 22 22 element=dynamic_cast<Element*>(femmodel->elements->GetObjectByOffset(i)); 23 23 element->DrainWaterfraction(); 24 24 } 25 */ 25 26 26 27 /*Update basal dirichlet BCs for enthalpy: */ -
issm/trunk-jpl/src/c/shared/Elements/DrainageFunctionWaterfraction.cpp
r16359 r16360 9 9 /*FUNCTION IssmDouble DrainageFunctionWaterfraction()*/ 10 10 IssmDouble DrainageFunctionWaterfraction(IssmDouble waterfraction, IssmDouble dt=0.){ 11 12 13 11 /* DrainageFunctionWaterfraction returns how much of the waterfraction is drained per year */ 12 _assert_(waterfraction>=0.); 13 _assert_(dt>=0.); 14 14 15 16 17 18 15 IssmDouble w0=0.01, w1=0.02, w2=0.03; 16 IssmDouble Dret, D0=0, D1=0.005, D2=0.05; 17 IssmDouble yts=365*24*60*60; 18 dt/=yts; 19 19 20 21 22 23 24 25 26 27 28 29 30 20 /*get drainage function value*/ 21 if((w0==w1)||(w1==w2)||(w0==w2)) 22 _error_("Error: equal ordinates in DrainageFunctionWaterfraction -> division by zero. Abort"); 23 if(waterfraction<=w0) 24 Dret=D0; 25 if((waterfraction>w0) && (waterfraction<=w1)) 26 Dret=(D1-D0)/(w1-w0)*(waterfraction-w0)+D0; 27 if((waterfraction>w1) && (waterfraction<=w2)) 28 Dret=(D2-D1)/(w2-w1)*(waterfraction-w1)+D1; 29 else 30 Dret=D2; 31 31 32 33 34 35 36 37 38 39 40 41 42 43 44 32 /*check if dt*Dret>waterfraction. If so, drain whole waterfraction*/ 33 if(dt==0.){ 34 if(Dret>waterfraction) 35 return waterfraction; 36 else 37 return Dret; 38 } 39 else{ 40 if(dt*Dret>waterfraction) 41 return waterfraction; 42 else 43 return dt*Dret; 44 } 45 45 }
Note:
See TracChangeset
for help on using the changeset viewer.