Changeset 5315


Ignore:
Timestamp:
May 13, 2008, 6:08:40 PM (16 years ago)
Author:
ole
Message:

Rolled back changes from changeset:5297 regarding ticket:262.
All tests and validations passes.

Location:
anuga_core
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/documentation/user_manual/demos/channel3.py

    r5173 r5315  
    7474# Evolve system through time
    7575#------------------------------------------------------------------------------
    76 for t in domain.evolve(yieldstep = 0.2, finaltime = 16.0):
     76for t in domain.evolve(yieldstep = 0.1, finaltime = 16.0):
    7777    print domain.timestepping_statistics()
    7878
  • anuga_core/source/anuga/config.py

    r5313 r5315  
    8888tight_slope_limiters = True
    8989
    90 # Use centroid velocities to reconstruct momentum at vertices in very shallow water
     90# Use centroid velocities to reconstruct momentum at vertices in
     91# very shallow water
    9192# This option has a first order flavour to it, but we still have second order
    92 # reconstruction of stage and this option only applies in balance_deep_and_shallow when
     93# reconstruction of stage and this option only applies in
     94# balance_deep_and_shallow when
    9395# alpha < 1 so in deeper water the full second order scheme is used.
    9496#
  • anuga_core/source/anuga/shallow_water/shallow_water_domain.py

    r5306 r5315  
    732732              Ymom.vertex_values,
    733733              Elevation.vertex_values,
    734               int(domain.optimise_dry_cells),
    735               int(domain.use_centroid_velocities))
     734              int(domain.optimise_dry_cells))
    736735
    737736
  • anuga_core/source/anuga/shallow_water/shallow_water_ext.c

    r5306 r5315  
    550550                              double H0,
    551551                              int tight_slope_limiters,
    552                               int use_centroid_velocities,                   
     552                              int use_centroid_velocities,
    553553                              double alpha_balance) {
    554554
    555   int k, k3, i; //, excessive_froude_number=0;
     555  int k, k3, i;
    556556
    557557  double dz, hmin, alpha, h_diff, hc_k;
    558558  double epsilon = 1.0e-6; // FIXME: Temporary measure
    559559  double hv[3]; // Depths at vertices
    560   //double Fx, Fy; // Froude numbers
    561560  double uc, vc; // Centroid speeds
    562561
     
    651650        alpha = 1.0;       
    652651      }
    653 
    654652    }
    655            
     653
    656654
    657655    //  Let
     
    684682
    685683        // Update momentum at vertices
    686         if (use_centroid_velocities == 0) {
     684        if (use_centroid_velocities == 1) {
     685          // This is a simple, efficient and robust option
     686          // It uses first order approximation of velocities, but retains
     687          // the order used by stage.
     688       
     689          // Speeds at centroids
     690          if (hc_k > epsilon) {
     691            uc = xmomc[k]/hc_k;
     692            vc = ymomc[k]/hc_k;
     693          } else {
     694            uc = 0.0;
     695            vc = 0.0;
     696          }
     697         
     698          // Vertex momenta guaranteed to be consistent with depth guaranteeing
     699          // controlled speed
     700          hv[i] = wv[k3+i] - zv[k3+i]; // Recompute (balanced) vertex depth
     701          xmomv[k3+i] = uc*hv[i];
     702          ymomv[k3+i] = vc*hv[i];
     703         
     704        } else {
    687705          // Update momentum as a linear combination of
    688706          // xmomc and ymomc (shallow) and momentum
     
    691709          // been established e.g. by the gradient limiter.
    692710
     711          // FIXME (Ole): I think this should be used with vertex momenta
     712          // computed above using centroid_velocities instead of xmomc
     713          // and ymomc as they'll be more representative first order
     714          // values.
    693715         
    694716          xmomv[k3+i] = (1-alpha)*xmomc[k] + alpha*xmomv[k3+i];
     
    697719        }
    698720      }
    699     } // If alpha == 1 use quantities as calculated by the gradient-limiter
    700    
    701     if (use_centroid_velocities == 1) {   
    702       // This is a simple, efficient and robust option in shallow water
    703       // It uses first order approximation of velocities, but retains
    704       // the order used by stage.
    705       // In this case the xmomv and ymomv calculations should be switched off
    706       // in the gradient limiter.
    707 
    708       for (i=0; i<3; i++) {   
    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        
    719         // Vertex momenta guaranteed to be consistent with depth guaranteeing
    720         // controlled speed
    721         hv[i] = wv[k3+i] - zv[k3+i]; // Recompute (balanced) vertex depth
    722         xmomv[k3+i] = uc*hv[i];
    723         ymomv[k3+i] = vc*hv[i];
    724       }
    725721    }
    726722  }
    727723  return 0;
    728724}
     725 
    729726
    730727
     
    10201017                                  double* ymom_vertex_values,
    10211018                                  double* elevation_vertex_values,
    1022                                   int optimise_dry_cells,
    1023                                   int use_centroid_velocities) {
     1019                                  int optimise_dry_cells) {
    10241020                                 
    10251021                                 
     
    10271023  // Local variables
    10281024  double a, b; // Gradient vector used to calculate vertex values from centroids
    1029   int k,k0,k1,k2,k3,k6,coord_index, i;
     1025  int k,k0,k1,k2,k3,k6,coord_index,i;
    10301026  double x,y,x0,y0,x1,y1,x2,y2,xv0,yv0,xv1,yv1,xv2,yv2; // Vertices of the auxiliary triangle
    10311027  double dx1,dx2,dy1,dy2,dxv0,dxv1,dxv2,dyv0,dyv1,dyv2,dq0,dq1,dq2,area2;
     
    11921188      for (i=0;i<3;i++)
    11931189        stage_vertex_values[k3+i]=stage_centroid_values[k]+dqv[i];
    1194      
    1195      
    1196       if (use_centroid_velocities == 1) {
    1197         // Use first order reconstruction using speeds only.
    1198        
    1199         // This happens in balance_deep_and_shallow so there
    1200         // is no need to do more here
    1201        
    1202         // FIXME (Ole): Optionally we could put the computation here but then
    1203         // it'd go into all other variants of the gradient limiter 
    1204         continue;
    1205       }
    12061190     
    12071191     
     
    15001484  double beta_w, beta_w_dry, beta_uh, beta_uh_dry, beta_vh, beta_vh_dry;   
    15011485  double minimum_allowed_height, epsilon;
    1502   int optimise_dry_cells, number_of_elements, e, use_centroid_velocities;
     1486  int optimise_dry_cells, number_of_elements, e;
    15031487 
    15041488  // Provisional jumps from centroids to v'tices and safety factor re limiting
    15051489  // by which these jumps are limited
    15061490  // Convert Python arguments to C
    1507   if (!PyArg_ParseTuple(args, "OOOOOOOOOOOOOii",
     1491  if (!PyArg_ParseTuple(args, "OOOOOOOOOOOOOi",
    15081492                        &domain,
    15091493                        &surrogate_neighbours,
     
    15191503                        &ymom_vertex_values,
    15201504                        &elevation_vertex_values,
    1521                         &optimise_dry_cells,
    1522                         &use_centroid_velocities)) {                   
     1505                        &optimise_dry_cells)) {                 
    15231506                       
    15241507    PyErr_SetString(PyExc_RuntimeError,
     
    15651548                                   (double*) ymom_vertex_values -> data,
    15661549                                   (double*) elevation_vertex_values -> data,
    1567                                    optimise_dry_cells,
    1568                                    use_centroid_velocities);
     1550                                   optimise_dry_cells);
    15691551  if (e == -1) {
    15701552    // Use error string set inside computational routine
Note: See TracChangeset for help on using the changeset viewer.