Changeset 4825


Ignore:
Timestamp:
Nov 17, 2007, 5:58:06 AM (17 years ago)
Author:
ole
Message:

Really simple and attractive way of controlling vertex momenta. This came to me in the early hours Saturday morning and has yet to be tested properly.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/shallow_water/shallow_water_ext.c

    r4823 r4825  
    558558  double hv[3], h; // Depths at vertices
    559559  double Fx, Fy; // Froude numbers
     560  double uc, vc; // Centroid speeds
    560561
    561562  // Compute linear combination between w-limited stages and
     
    702703        }
    703704
    704         // Update momentum as a linear combination of
    705         // xmomc and ymomc (shallow) and momentum
    706         // from extrapolator xmomv and ymomv (deep).
    707         // FIXME (Ole): Is this really needed?
    708         xmomv[k3+i] = (1-alpha)*xmomc[k] + alpha*xmomv[k3+i];
    709         ymomv[k3+i] = (1-alpha)*ymomc[k] + alpha*ymomv[k3+i];
     705        // Update momentum at vertices
     706        if (tight_slope_limiters == 1) {       
     707          // FIXME(Ole): Here's what I think (as of 17 Nov 2007)
     708          // we need to do. Simple and efficient:
     709       
     710          // Speeds at centroids
     711          if (hc_k > epsilon) {
     712            uc = xmomc[k]/hc_k;
     713            vc = ymomc[k]/hc_k;
     714          } else {
     715            uc = 0.0;
     716            vc = 0.0;
     717          }
     718          // Vertex momenta guaranteed to be consistent with depth guaranteeing
     719          // controlled speed
     720          xmomv[k3+i] = uc*hv[i];
     721          ymomv[k3+i] = vc*hv[i];       
     722        } else {
     723          // Update momentum as a linear combination of
     724          // xmomc and ymomc (shallow) and momentum
     725          // from extrapolator xmomv and ymomv (deep).
     726          // FIXME (Ole): Is this really needed?
     727         
     728          xmomv[k3+i] = (1-alpha)*xmomc[k] + alpha*xmomv[k3+i];
     729          ymomv[k3+i] = (1-alpha)*ymomc[k] + alpha*ymomv[k3+i];
     730       
     731        }
    710732      }
    711733    }
     
    722744     
    723745      // FIXME (Ole): currently only used with tights_SL
     746     
     747      // FIXME (Ole): may not be necessary now
    724748
    725749      excessive_froude_number=0;   
Note: See TracChangeset for help on using the changeset viewer.