Changeset 16545


Ignore:
Timestamp:
10/25/13 04:29:40 (11 years ago)
Author:
jbondzio
Message:

CHG: enthalpydiffusion parameter smoothed
BUG: water column stays nonnegative now, minor in drainage function

Location:
issm/trunk-jpl
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/classes/Elements/Penta.cpp

    r16529 r16545  
    38243824
    38253825                /*Conduction: */ 
    3826                 /*Need to change that depending on enthalpy value -> cold or temperate ice: */ 
    38273826                GetBConduct(&B_conduct[0][0],&xyz_list[0][0],gauss);
    38283827
     
    38733872                }
    38743873
    3875                 /*Artifficial diffusivity*/
     3874                /*Artificial diffusivity*/
    38763875                if(stabilization==1){
    38773876                        /*Build K: */
     
    38793878                        vel=sqrt(vx*vx + vy*vy + vz*vz)+1.e-14;
    38803879                        h=sqrt( pow(hx*vx/vel,2) + pow(hy*vy/vel,2) + pow(hz*vz/vel,2));
     3880
    38813881                        K[0][0]=h/(2*vel)*vx*vx;  K[0][1]=h/(2*vel)*vx*vy; K[0][2]=h/(2*vel)*vx*vz;
    38823882                        K[1][0]=h/(2*vel)*vy*vx;  K[1][1]=h/(2*vel)*vy*vy; K[1][2]=h/(2*vel)*vy*vz;
    38833883                        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
    38843885                        D_scalar_stab=gauss->weight*Jdet;
    38853886                        if(reCast<bool,IssmDouble>(dt)) D_scalar_stab=D_scalar_stab*dt;
     
    40704071
    40714072                /*Advection: */
    4072 
    40734073                GetBAdvec(&B_advec[0][0],&xyz_list[0][0],gauss);
    40744074                GetBprimeAdvec(&Bprime_advec[0][0],&xyz_list[0][0],gauss);
     
    49604960        IssmDouble  vx[NUMVERTICES],vy[NUMVERTICES],vz[NUMVERTICES];
    49614961        IssmDouble  geothermalflux[NUMVERTICES];
    4962         IssmDouble  dt;
    4963         IssmDouble  meltingrate_enthalpy;
     4962        IssmDouble  dt, yts;
     4963        IssmDouble  melting_overshoot,meltingrate_enthalpy;
     4964        IssmDouble  lambda,heating;
    49644965        Friction   *friction  = NULL;
    49654966
     
    49984999                checkpositivethickness=true;
    49995000
     5001                _assert_(watercolumn[iv]>=0.);
     5002
    50005003                /*Calculate basal meltingrate after Fig.5 of A.Aschwanden 2012*/
    50015004                meltingrate_enthalpy=0.;
     5005                heating=0.;
    50025006                if((watercolumn[iv]>0.) && (enthalpy[iv]<matpar->PureIceEnthalpy(pressure[iv]))){
    50035007                        /*ensure that no ice is at T<Tm(p), if water layer present*/
     
    50325036                        matpar->EnthalpyToThermal(&temperature, &waterfraction, enthalpy[iv],pressure[iv]);
    50335037                        // -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
    50365042                /*Update water column, basal meltingrate*/
    5037                 //basalmeltingrate[iv]+=meltingrate_enthalpy;
    5038                 basalmeltingrate[iv]=meltingrate_enthalpy;
    50395043                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;
    50435060                        watercolumn[iv]+=meltingrate_enthalpy;
     5061                }         
    50445062        } 
    50455063        /*feed updated variables back into model*/
     
    50725090        pentabase=this->GetBasalElement();
    50735091       
    5074         GetInputListOnVertices(&enthalpy[0],EnthalpyEnum);
    5075         GetInputListOnVertices(&pressure[0],PressureEnum);
     5092        this->GetInputListOnVertices(&enthalpy[0],EnthalpyEnum);
     5093        this->GetInputListOnVertices(&pressure[0],PressureEnum);
    50765094        pentabase->GetInputListOnVertices(&watercolumnbase[0], WatercolumnEnum);
    50775095
     
    50895107                watercolumnbase[iv%NUMVERTICES2D]+=dwc;
    50905108        }
     5109
    50915110        /*feed updated results back into model*/
    50925111        this->inputs->AddInput(new PentaInput(EnthalpyEnum,enthalpy,P1Enum));
     
    50945113        pentabase->inputs->AddInput(new PentaInput(WatercolumnEnum, watercolumnbase,P1Enum));
    50955114
    5096         delete pentabase;
    50975115}
    50985116/*}}}*/
  • issm/trunk-jpl/src/c/classes/Materials/Matpar.cpp

    r16359 r16545  
    377377/*FUNCTION Matpar::GetEnthalpyDiffusionParameter{{{*/
    378378IssmDouble Matpar::GetEnthalpyDiffusionParameter(IssmDouble enthalpy,IssmDouble pressure){
    379         if(enthalpy<PureIceEnthalpy(pressure)){
     379        /*if (enthalpy<=PureIceEnthalpy(pressure))
    380380                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;
    385390}
    386391/*}}}*/
Note: See TracChangeset for help on using the changeset viewer.