Changeset 9232


Ignore:
Timestamp:
Jul 2, 2014, 10:16:31 AM (11 years ago)
Author:
davies
Message:

Adjustment to riverwall implementation which seems to give better stability

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_core/source/anuga/shallow_water/swDE1_domain_ext.c

    r9225 r9232  
    505505        }else{
    506506            // Can't divide by edgeflux
     507            // FIXME: This is fluxing mass but not momentum
     508            //        It might be ok, but,.........
     509            //        it has potential be a problem in the
     510            //        case that there was zero edgeflux but non-zero weir flux
     511            //        [which can occur because the edgeflux is computed from
     512            //        edge quantities, whereas weir-flux is computed from
     513            //        centroid info]. Then if we remove mass but not momentum
     514            //        from the headwater, velocity gets faster.
     515            //       
     516            //        However, that situation would usually occur for a short time with a small flux,
     517            //        so it might never actually create a problem.       
    507518            edgeflux[0] = newFlux;
    508519            edgeflux[1]*=0.;
     
    576587    double hle, hre, zc, zc_n, Qfactor, s1, s2, h1, h2;
    577588    double stage_edge_lim, outgoing_mass_edges, bedtop, bedbot, pressure_flux, hc, hc_n, tmp, tmp2;
     589    double h_left_tmp, h_right_tmp;
    578590    static long call = 1; // Static local variable flagging already computed flux
    579591    double speed_max_last, vol, smooth, local_speed, weir_height;
     
    657669            z_half=max(zl,zr);
    658670
    659             // Account for riverwalls
     671            //// Account for riverwalls
    660672            if(edge_flux_type[ki]==1){
    661673                // Update counter of riverwall edges == index of
     
    664676               
    665677                // Set central bed to riverwall elevation
    666                 z_half=max(riverwall_elevation[RiverWall_count-1], max(zl, zr)) ;
    667 
    668                 if(min(ql[0], qr[0]) < z_half){
    669                     // Since there is a wall blocking the flow connection, use first order extrapolation for this edge
    670                     ql[0]=stage_centroid_values[k];
    671                     ql[1]=xmom_centroid_values[k];
    672                     ql[2]=ymom_centroid_values[k];
    673                     hle=hc;
    674                     zl=zc;
    675 
    676                     if(n>=0){
    677                       qr[0]=stage_centroid_values[n];
    678                       qr[1]=xmom_centroid_values[n];
    679                       qr[2]=ymom_centroid_values[n];
    680                       hre=hc_n;
    681                       zr = zc_n;
    682                     }else{
    683                       hre=hc;
    684                       zr = zc;
    685                     }
    686                     // Re-set central bed to riverwall elevation
    687                     z_half=max(riverwall_elevation[RiverWall_count-1], max(zl, zr)) ;
    688                 }
    689                
     678                z_half=max(riverwall_elevation[RiverWall_count-1], z_half) ;
     679
     680                //if(min(ql[0], qr[0]) < z_half){
     681                //    // Since there is a wall blocking the flow connection, use first order extrapolation for this edge
     682                //    ql[0]=stage_centroid_values[k];
     683                //    ql[1]=xmom_centroid_values[k];
     684                //    ql[2]=ymom_centroid_values[k];
     685                //    hle=hc;
     686                //    zl=zc;
     687
     688                //    if(n>=0){
     689                //      qr[0]=stage_centroid_values[n];
     690                //      qr[1]=xmom_centroid_values[n];
     691                //      qr[2]=ymom_centroid_values[n];
     692                //      hre=hc_n;
     693                //      zr = zc_n;
     694                //    }else{
     695                //      hre=hc;
     696                //      zr = zc;
     697                //    }
     698                //    // Re-set central bed to riverwall elevation
     699                //    z_half=max(riverwall_elevation[RiverWall_count-1], max(zl, zr)) ;
     700                //}
    690701
    691702            }
     
    728739                    ii+=1;
    729740                    h2=riverwall_hydraulic_properties[ii];
    730 
    731                     //printf("%e, %e, %e, %e, %e \n", Qfactor, s1, s2, h1, h2);
    732 
    733                     adjust_edgeflux_with_weir(edgeflux, h_left, h_right, g,
     741                   
     742                    //adjust_edgeflux_with_weir(edgeflux, h_left, h_right, g,
     743                    //                          weir_height, Qfactor,
     744                    //                          s1, s2, h1, h2);
     745
     746                    // Use first-order h's for weir -- as the 'upstream/downstream' heads are
     747                    //  measured away from the weir itself
     748                    h_left_tmp= max(stage_centroid_values[k]-z_half,0.);
     749                    if(n>=0){
     750                        h_right_tmp= max(stage_centroid_values[n]-z_half,0.);
     751                    }else{
     752                        h_right_tmp= max(hc_n+zr-z_half,0.);
     753                    }
     754
     755                    adjust_edgeflux_with_weir(edgeflux, h_left_tmp, h_right_tmp, g,
    734756                                              weir_height, Qfactor,
    735757                                              s1, s2, h1, h2);
  • trunk/anuga_core/validation_tests/behaviour_only/weir_1/plot_results.py

    r9224 r9232  
    7676#C=C*(ft_to_m)**0.5 # Convert to m^0.5/s
    7777C=2./3.*(9.81*2./3.)**0.5 # Another standard coefficient.
    78 L1=9.0 # In the model, the L1 region is 8m with two 1m rises at each edge, leading to the equivalent of 9m width on average
     78L1=9.0 # Lengths of the w1/w2 regions
    7979L2=91.
    8080def simple_weir(H, C, L):
  • trunk/anuga_core/validation_tests/behaviour_only/weir_1/results.tex

    r9121 r9232  
    44In this problem water runs up a broad sloping floodplain, which is split into 2 by a thin weir (riverwall). The landward side of the floodplain is initially dry but becomes wet as the water overtops the weir. We use the change in mass on the landward side of the weir to compute the flux over the weir according to \anuga{}, and compare with direct computation of the weir equation.
    55
    6 \anuga{} allows computation of flow over a weir using the riverwall structure (supported for DE1 only as of 19/05/2014). The default method adjusts the edge flux over the weir to satisfy a basic weir relation with Villemonte's submergence correction. However at high submergence ratios, or when the depth of flow over the weir is large compared with the weir height, \anuga{} smoothly reverts to the shallow water solution (because the weir relations are not sensible in these situations). This is required so that e.g. a weir of 1cm height covered by flow of 1m is basically no different from the shallow water solution - weir relations by themselves will not achieve this. See the documentation of riverwalls for more information.
     6\anuga{} allows computation of flow over a weir using the riverwall structure (supported for Discontinuous Elevation Algorithms only as of 01/07/2014). The default method adjusts the edge flux over the weir to satisfy a basic weir relation with Villemonte's submergence correction. However at high submergence ratios, or when the depth of flow over the weir is large compared with the weir height, \anuga{} smoothly reverts to the shallow water solution (because the weir relations are not sensible in these situations). This is required so that e.g. a weir of 1cm height covered by flow of 1m is basically no different from the shallow water solution - weir relations by themselves will not achieve this. See the documentation of riverwalls for more information.
    77
    88\subsection{Results}
  • trunk/anuga_core/validation_tests/behaviour_only/weir_1/runup.py

    r9225 r9232  
    2222higherResPolygon=[ [40., 40.], [40., 60.], [60., 60.], [60., 40.]]
    2323# Riverwall = list of lists, each with a set of x,y,z (and optional QFactor) values
    24 riverWall={ 'centralWall':
     24#riverWall={ 'centralWall':
     25#                [ [50., 0.0, -0.0],
     26#                  [50., 45., -0.0],
     27#                  [50., 46., -0.2],
     28#                  [50., 54., -0.2],
     29#                  [50., 55., -0.0],
     30#                  [50., 100.0, -0.0]]
     31#          }
     32riverWall={ 'leftWall':
    2533                [ [50., 0.0, -0.0],
    26                   [50., 45., -0.0],
    27                   [50., 46., -0.2],
    28                   [50., 54., -0.2],
    29                   [50., 55., -0.0],
     34                  [50., 45.5, -0.0]],
     35             'centralWall':
     36                [[50., 45.5, -0.2],
     37                 [50., 54.5, -0.2]],
     38             'rightWall':
     39                [ [50., 54.5, -0.0],
    3040                  [50., 100.0, -0.0]]
    3141          }
    3242
    33 riverWall_Par={'centralWall':{'Qfactor':1.0}}
     43#riverWall_Par={'centralWall':{'Qfactor':1.0}}
    3444# Try to avoid any shallow-water type solution -- becomes unstable
    3545#riverWall_Par={'centralWall':{'Qfactor':1.0, 's1': 0.999, 's2':0.9999, 'h1':100, 'h2':150}}
     
    98108domain = distribute(domain)
    99109
    100 domain.riverwallData.create_riverwalls(riverWall, riverWall_Par)
     110domain.riverwallData.create_riverwalls(riverWall)
    101111
    102112#--------------------------
  • trunk/anuga_work/development/gareth/tests/levee2/runup.py

    r9121 r9232  
    1717higherResPolygon=[ [40., 40.], [40., 60.], [60., 60.], [60., 40.]]
    1818# Riverwall = list of lists, each with a set of x,y,z (and optional QFactor) values
    19 riverWall={ 'centralWall':
     19riverWall={ 'leftWall':
    2020                [ [50., 0.0, -0.0],
    21                   [50., 45., -0.0],
    22                   [50., 46., -0.2],
    23                   [50., 54., -0.2],
    24                   [50., 55., -0.0],
     21                  [50., 45.5, -0.0]],
     22             'centralWall':
     23                [[50., 45.5, -0.2],
     24                 [50., 54.5, -0.2]],
     25             'rightWall':
     26                [ [50., 54.5, -0.0],
    2527                  [50., 100.0, -0.0]]
    2628          }
     
    5961domain.set_datadir('.')                         
    6062domain.set_flow_algorithm('DE1')
    61 domain.set_store_vertices_uniquely()
     63domain.set_store_vertices_uniquely(True)
    6264domain.riverwallData.create_riverwalls(riverWall, riverWall_Par)
    6365
  • trunk/anuga_work/development/gareth/tests/levee2/runuplot.py

    r9121 r9232  
    4646
    4747## Get reference stage points
    48 seaLev=(abs(p.x-51.)+abs(p.y-50.)).argmin() # Index near levee on sea side
    49 landLev=(abs(p.x-49.)+abs(p.y-50.)).argmin() # Index near levee on land side
     48seaLev=(abs(p.x-50.7)+abs(p.y-50.)).argmin() # Index near levee on sea side
     49landLev=(abs(p.x-49.3)+abs(p.y-50.)).argmin() # Index near levee on land side
    5050heightDiff=p.stage[:,seaLev]-p.stage[:,landLev]
    5151## Get indices on 'landward' side of riverwall
Note: See TracChangeset for help on using the changeset viewer.