Changeset 18484


Ignore:
Timestamp:
09/08/14 01:03:45 (11 years ago)
Author:
jbondzio
Message:

CHG: Use absolute values for artificial diffusion, as negative entries in diffusion matrix might lead to destabilizing contraction effect. Constrain watercolumn to nonnegative values only.

Location:
issm/trunk-jpl
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/analyses/EnthalpyAnalysis.cpp

    r18311 r18484  
    315315                        vel=sqrt(vx*vx + vy*vy + vz*vz)+1.e-14;
    316316                        h=sqrt( pow(hx*vx/vel,2) + pow(hy*vy/vel,2) + pow(hz*vz/vel,2));
    317                         K[0][0]=h/(2.*vel)*vx*vx;  K[0][1]=h/(2.*vel)*vx*vy; K[0][2]=h/(2.*vel)*vx*vz;
    318                         K[1][0]=h/(2.*vel)*vy*vx;  K[1][1]=h/(2.*vel)*vy*vy; K[1][2]=h/(2.*vel)*vy*vz;
    319                         K[2][0]=h/(2.*vel)*vz*vx;  K[2][1]=h/(2.*vel)*vz*vy; K[2][2]=h/(2.*vel)*vz*vz;
     317                        K[0][0]=h/(2.*vel)*fabs(vx*vx);  K[0][1]=h/(2.*vel)*fabs(vx*vy); K[0][2]=h/(2.*vel)*fabs(vx*vz);
     318                        K[1][0]=h/(2.*vel)*fabs(vy*vx);  K[1][1]=h/(2.*vel)*fabs(vy*vy); K[1][2]=h/(2.*vel)*fabs(vy*vz);
     319                        K[2][0]=h/(2.*vel)*fabs(vz*vx);  K[2][1]=h/(2.*vel)*fabs(vz*vy); K[2][2]=h/(2.*vel)*fabs(vz*vz);
    320320                        for(int i=0;i<3;i++) for(int j=0;j<3;j++) K[i][j] = D_scalar*K[i][j];
    321321
     
    10281028                else{
    10291029                        basalmeltingrate[vertexdown]=meltingrate_enthalpy[is];
    1030                         watercolumn[vertexdown]+=meltingrate_enthalpy[is];
     1030                        if(watercolumn[vertexdown]+meltingrate_enthalpy[is]<0.)
     1031                                watercolumn[vertexdown]=0.;
     1032                        else
     1033                                watercolumn[vertexdown]+=meltingrate_enthalpy[is];
    10311034                }       
    10321035                basalmeltingrate[vertexdown]*=rho_water/rho_ice; // convert meltingrate from water to ice equivalent
Note: See TracChangeset for help on using the changeset viewer.