Changeset 16545
- Timestamp:
- 10/25/13 04:29:40 (11 years ago)
- Location:
- issm/trunk-jpl
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/Elements/Penta.cpp
r16529 r16545 3824 3824 3825 3825 /*Conduction: */ 3826 /*Need to change that depending on enthalpy value -> cold or temperate ice: */3827 3826 GetBConduct(&B_conduct[0][0],&xyz_list[0][0],gauss); 3828 3827 … … 3873 3872 } 3874 3873 3875 /*Artif ficial diffusivity*/3874 /*Artificial diffusivity*/ 3876 3875 if(stabilization==1){ 3877 3876 /*Build K: */ … … 3879 3878 vel=sqrt(vx*vx + vy*vy + vz*vz)+1.e-14; 3880 3879 h=sqrt( pow(hx*vx/vel,2) + pow(hy*vy/vel,2) + pow(hz*vz/vel,2)); 3880 3881 3881 K[0][0]=h/(2*vel)*vx*vx; K[0][1]=h/(2*vel)*vx*vy; K[0][2]=h/(2*vel)*vx*vz; 3882 3882 K[1][0]=h/(2*vel)*vy*vx; K[1][1]=h/(2*vel)*vy*vy; K[1][2]=h/(2*vel)*vy*vz; 3883 3883 K[2][0]=h/(2*vel)*vz*vx; K[2][1]=h/(2*vel)*vz*vy; K[2][2]=h/(2*vel)*vz*vz; 3884 3884 3885 D_scalar_stab=gauss->weight*Jdet; 3885 3886 if(reCast<bool,IssmDouble>(dt)) D_scalar_stab=D_scalar_stab*dt; … … 4070 4071 4071 4072 /*Advection: */ 4072 4073 4073 GetBAdvec(&B_advec[0][0],&xyz_list[0][0],gauss); 4074 4074 GetBprimeAdvec(&Bprime_advec[0][0],&xyz_list[0][0],gauss); … … 4960 4960 IssmDouble vx[NUMVERTICES],vy[NUMVERTICES],vz[NUMVERTICES]; 4961 4961 IssmDouble geothermalflux[NUMVERTICES]; 4962 IssmDouble dt; 4963 IssmDouble meltingrate_enthalpy; 4962 IssmDouble dt, yts; 4963 IssmDouble melting_overshoot,meltingrate_enthalpy; 4964 IssmDouble lambda,heating; 4964 4965 Friction *friction = NULL; 4965 4966 … … 4998 4999 checkpositivethickness=true; 4999 5000 5001 _assert_(watercolumn[iv]>=0.); 5002 5000 5003 /*Calculate basal meltingrate after Fig.5 of A.Aschwanden 2012*/ 5001 5004 meltingrate_enthalpy=0.; 5005 heating=0.; 5002 5006 if((watercolumn[iv]>0.) && (enthalpy[iv]<matpar->PureIceEnthalpy(pressure[iv]))){ 5003 5007 /*ensure that no ice is at T<Tm(p), if water layer present*/ … … 5032 5036 matpar->EnthalpyToThermal(&temperature, &waterfraction, enthalpy[iv],pressure[iv]); 5033 5037 // -Mb= Fb-(q-q_geo)/((1-w)*L), cf Aschwanden 2012, eq.66 5034 meltingrate_enthalpy=(heatflux+basalfriction+geothermalflux[iv])/((1-waterfraction)*latentheat*rho_ice); // m/s water equivalent 5035 } 5038 heating=(heatflux+basalfriction+geothermalflux[iv]); 5039 meltingrate_enthalpy=heating/((1-waterfraction)*latentheat*rho_ice); // m/s water equivalent 5040 } 5041 5036 5042 /*Update water column, basal meltingrate*/ 5037 //basalmeltingrate[iv]+=meltingrate_enthalpy;5038 basalmeltingrate[iv]=meltingrate_enthalpy;5039 5043 this->parameters->FindParam(&dt,TimesteppingTimeStepEnum); 5040 if(reCast<bool,IssmDouble>(dt)) 5041 watercolumn[iv]+=dt*meltingrate_enthalpy; 5042 else 5044 if(reCast<bool,IssmDouble>(dt)){ 5045 if(watercolumn[iv]+meltingrate_enthalpy*dt<0.){ 5046 melting_overshoot=watercolumn[iv]+meltingrate_enthalpy*dt; 5047 lambda=melting_overshoot/(meltingrate_enthalpy*dt); _assert_(lambda>0); _assert_(lambda<1); 5048 basalmeltingrate[iv]=(1.-lambda)*meltingrate_enthalpy; 5049 watercolumn[iv]=0.; 5050 yts=365*24*60*60; 5051 enthalpy[iv]+=dt/yts*lambda*heating; 5052 } 5053 else{ 5054 basalmeltingrate[iv]=meltingrate_enthalpy; 5055 watercolumn[iv]+=dt*meltingrate_enthalpy; 5056 } 5057 } 5058 else{ 5059 basalmeltingrate[iv]=meltingrate_enthalpy; 5043 5060 watercolumn[iv]+=meltingrate_enthalpy; 5061 } 5044 5062 } 5045 5063 /*feed updated variables back into model*/ … … 5072 5090 pentabase=this->GetBasalElement(); 5073 5091 5074 GetInputListOnVertices(&enthalpy[0],EnthalpyEnum);5075 GetInputListOnVertices(&pressure[0],PressureEnum);5092 this->GetInputListOnVertices(&enthalpy[0],EnthalpyEnum); 5093 this->GetInputListOnVertices(&pressure[0],PressureEnum); 5076 5094 pentabase->GetInputListOnVertices(&watercolumnbase[0], WatercolumnEnum); 5077 5095 … … 5089 5107 watercolumnbase[iv%NUMVERTICES2D]+=dwc; 5090 5108 } 5109 5091 5110 /*feed updated results back into model*/ 5092 5111 this->inputs->AddInput(new PentaInput(EnthalpyEnum,enthalpy,P1Enum)); … … 5094 5113 pentabase->inputs->AddInput(new PentaInput(WatercolumnEnum, watercolumnbase,P1Enum)); 5095 5114 5096 delete pentabase;5097 5115 } 5098 5116 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Materials/Matpar.cpp
r16359 r16545 377 377 /*FUNCTION Matpar::GetEnthalpyDiffusionParameter{{{*/ 378 378 IssmDouble Matpar::GetEnthalpyDiffusionParameter(IssmDouble enthalpy,IssmDouble pressure){ 379 if(enthalpy<PureIceEnthalpy(pressure)){379 /*if (enthalpy<=PureIceEnthalpy(pressure)) 380 380 return thermalconductivity/heatcapacity; 381 } 382 else{ 383 return 1.045*1.e-4; // K0=1.045*1e-4 from Aschwanden 2012. TODO: fetch K0 from model 384 } 381 else 382 return thermalconductivity/heatcapacity*pow(10.,-5); 383 */ 384 385 IssmDouble eps=0.05*heatcapacity; 386 IssmDouble hpmp=PureIceEnthalpy(pressure); 387 IssmDouble kappa_c=thermalconductivity/heatcapacity; 388 IssmDouble kappa_t=thermalconductivity/heatcapacity*pow(10.,-1); 389 return 1./(1.+exp(-(enthalpy-(hpmp))/eps))*(kappa_t-kappa_c) + kappa_c; 385 390 } 386 391 /*}}}*/
Note:
See TracChangeset
for help on using the changeset viewer.