Ignore:
Timestamp:
Feb 17, 2005, 5:36:29 PM (20 years ago)
Author:
ole
Message:

Addressed problem with artificial momentum generated by discontinuous water depths in the presence of steep slopes.
Now very shallow water is limited with a separate h-limiter controlled by beta_h
(see config.py) for details.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • inundation/ga/storm_surge/pyvolution/quantity_ext.h

    r258 r907  
    1 
    2 void _limit(int N, double beta, double* qc, double* qv,
    3             double* qmin, double* qmax) {
    4 
    5   int k, i, k3;
    6   double dq, dqa[3], phi, r;
    7  
    8   for (k=0; k<N; k++) {
    9     k3 = k*3;
    10    
    11     //Find the gradient limiter (phi) across vertices 
    12     phi = 1.0;
    13     for (i=0; i<3; i++) {   
    14       r = 1.0;
    15      
    16       dq = qv[k3+i] - qc[k];    //Delta between vertex and centroid values
    17       dqa[i] = dq;              //Save dq for use in the next loop
    18      
    19       if (dq > 0.0) r = (qmax[k] - qc[k])/dq;
    20       if (dq < 0.0) r = (qmin[k] - qc[k])/dq;     
    21  
    22  
    23       phi = min( min(r*beta, 1.0), phi);   
    24     }
    25    
    26     //Then update using phi limiter
    27     for (i=0; i<3; i++) {   
    28       qv[k3+i] = qc[k] + phi*dqa[i];
    29     }
    30   }
    31 }
Note: See TracChangeset for help on using the changeset viewer.