Changeset 9032


Ignore:
Timestamp:
Dec 3, 2013, 10:06:36 AM (11 years ago)
Author:
davies
Message:

Editing hfactor treatment

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_work/development/gareth/experimental/bal_and/swb2_domain_ext.c

    r9031 r9032  
    181181  soundspeed_left  = sqrt(g*h_left);
    182182  soundspeed_right = sqrt(g*h_right); 
     183  //soundspeed_left  = sqrt(g*hle);
     184  //soundspeed_right = sqrt(g*hre); 
    183185 
    184186  s_max = max(u_left + soundspeed_left, u_right + soundspeed_right);
     
    235237      // Standard smoothing term
    236238      // edgeflux[i] += 1.0*(s_max*s_min)*(q_right_rotated[i] - q_left_rotated[i]);
    237       // Smoothing by stage can cause high velocities / slow draining for nearly dry cells
     239      // Smoothing by stage alone can cause high velocities / slow draining for nearly dry cells
    238240      if(i==0) edgeflux[i] += (s_max*s_min)*(max(q_right_rotated[i],ze) - max(q_left_rotated[i],ze));
    239241      if(i==1) edgeflux[i] += (s_max*s_min)*(uh_right - uh_left);
     
    753755  double dqv[3], qmin, qmax, hmin, hmax, bedmax,bedmin, stagemin;
    754756  double hc, h0, h1, h2, beta_tmp, hfactor, xtmp, ytmp, weight, tmp;
    755   double dk, dv0, dv1, dv2, de[3], demin, dcmax, r0scale, vel_norm, l1, l2, a_bs, b_bs, area_e, inv_area_e;
     757  double dk, dv0, dv1, dv2, de[3], demin, dcmax, r0scale, vel_norm, l1, l2, a_tmp, b_tmp, c_tmp,d_tmp;
    756758 
    757759  double *xmom_centroid_store, *ymom_centroid_store; // , *min_elevation_edgevalue, *max_elevation_edgevalue;
     
    10331035      hmax = max(max(h0, max(h1, h2)), hc);
    10341036
    1035       // Look for strong changes in cell depth, or shallow cell depths, as an indicator of near-wet-dry
    1036       // Reduce beta linearly from 1-0 between depth ratio (hmin/hc) of 0.3-0.1
    1037       hfactor= max(0., min(5.0*max(hmin,0.0)/max(hc,1.0e-06)-0.5,
    1038                            min(5.0*max(hc,0.)/max(hmax,1.0e-06)-0.5, 1.0))
     1037      // Look for strong changes in cell depth as an indicator of near-wet-dry
     1038      // Reduce beta linearly from 1-0 between depth ratio (hmin/hc) of [a_tmp , b_tmp]
     1039      // NOTE: If we have a more 'second order' treatment in near dry areas (e.g. with b_tmp being negative), then
     1040      //       the water tends to dry more rapidly (which is in agreement with analytical results),
     1041      //       but is also more 'artefacty' in important cases (tendency for high velocities, etc).
     1042      //       
     1043      //hfactor=1.0;
     1044      a_tmp=0.2; // Highest depth ratio with hfactor=1
     1045      b_tmp=0.01; // Highest depth ratio with hfactor=0
     1046      c_tmp=1.0/(a_tmp-b_tmp);
     1047      d_tmp= 1.0-(c_tmp*a_tmp);
     1048      hfactor= max(0., min(c_tmp*max(hmin,0.0)/max(hc,1.0e-06)+d_tmp,
     1049                           min(c_tmp*max(hc,0.)/max(hmax,1.0e-06)+d_tmp, 1.0))
    10391050                  );
     1051      //printf("%e, %e, \n", c_tmp, d_tmp);
    10401052      //hfactor= max(0., min(5.0*max(hmin,0.0)/max(hmax,1.0e-06)-0.5, 1.0)
    10411053      //            );
    10421054      //hfactor=1.0;
    1043       hfactor=min( max(hmin,0.)/(max(hmin,0.)+1.*minimum_allowed_height), hfactor);
     1055     
     1056      //hfactor=min( 1.2*max(hmin,0.)/(max(hmin,0.)+1.*minimum_allowed_height), hfactor);
    10441057
    10451058      //-----------------------------------
     
    10891102      // height
    10901103      //-----------------------------------
     1104      //hfactor=1.0;
     1105      //hfactor= max(0., min(5.0*max(hmin,0.0)/max(hc,1.0e-06)-0.5,
     1106      //                     min(5.0*max(hc,0.)/max(hmax,1.0e-06)-0.5, 1.0))
     1107      //            );
    10911108       
    10921109      // Calculate the difference between vertex 0 of the auxiliary
     
    11341151      //                      1.0));
    11351152      //hfactor=min( max(hmin,0.)/(max(hmin,0.)+10.*minimum_allowed_height), hfactor);
     1153      //hfactor=1.0;
    11361154     
    11371155      //-----------------------------------
Note: See TracChangeset for help on using the changeset viewer.