Changeset 9328


Ignore:
Timestamp:
Sep 9, 2014, 12:38:56 PM (11 years ago)
Author:
davies
Message:

Tweaks to riverwalls + minor changes to template script

Location:
trunk
Files:
4 edited

Legend:

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

    r9327 r9328  
    678678        if(fabs(edgeflux[0])>1.0e-100){
    679679            scaleFlux=newFlux/edgeflux[0];
    680 
     680        }else{
     681            scaleFlux = 0.;
     682        }
     683
     684        if(scaleFlux>0.){
     685            //if(fabs(scaleFlux) > 10.){
     686            //    printf("Very large scaleFlux %e, %e \n", scaleFlux, edgeflux[0]);
     687            //}
    681688            // FINAL ADJUSTED FLUX
    682689            edgeflux[0]*=scaleFlux;
    683             edgeflux[1]*=scaleFlux;
    684             edgeflux[2]*=scaleFlux;
     690
     691            // FIXME: Do this in a cleaner way
     692            // IDEA: Compute momentum flux implied by weir relations, and use
     693            //       those in a weighted average (rather than the rescaling trick here)
     694            // If we allow the scaling to momentum to be unbounded,
     695            // velocity spikes can arise for very-shallow-flooded walls
     696            edgeflux[1]*=min(scaleFlux,10.);
     697            edgeflux[2]*=min(scaleFlux,10.);
    685698        }else{
    686699            // Can't divide by edgeflux, so enforce 'newFlux' directly
     
    704717
    705718    // Adjust the max speed
    706     *max_speed_local = sqrt(g*maxhd) + abs(edgeflux[0])/(maxhd+1.0e-100);
     719    //*max_speed_local = sqrt(g*(maxhd)) + abs(edgeflux[0])/(maxhd+1.0e-100);
     720    *max_speed_local = sqrt(g*(maxhd+weir_height)) + abs(edgeflux[0])/(maxhd+1.0e-100);
    707721
    708722    return 0;
     
    856870                    }
    857871
    858                     //////////////////////////////////////////////////////////////////////////////////
    859                     // Get Qfactor index - multiply the idealised weir discharge by this constant factor
    860                     ii = D->riverwall_rowIndex[RiverWall_count-1] * D->ncol_riverwall_hydraulic_properties;
    861                     Qfactor = D->riverwall_hydraulic_properties[ii];
    862                     // Get s1, submergence ratio at which we start blending with the shallow water solution
    863                     ii+=1;
    864                     s1= D->riverwall_hydraulic_properties[ii];
    865                     // Get s2, submergence ratio at which we entirely use the shallow water solution
    866                     ii+=1;
    867                     s2= D->riverwall_hydraulic_properties[ii];
    868                     // Get h1, tailwater head / weir height at which we start blending with the shallow water solution
    869                     ii+=1;
    870                     h1= D->riverwall_hydraulic_properties[ii];
    871                     // Get h2, tailwater head / weir height at which we entirely use the shallow water solution
    872                     ii+=1;
    873                     h2= D->riverwall_hydraulic_properties[ii];
    874                    
    875                     // Weir flux adjustment
    876                     adjust_edgeflux_with_weir(edgeflux, h_left_tmp, h_right_tmp, D->g,
    877                                               weir_height, Qfactor,
    878                                               s1, s2, h1, h2, &max_speed_local);
     872                    if(h_left_tmp > 0. || h_right_tmp > 0.){
     873
     874                        //////////////////////////////////////////////////////////////////////////////////
     875                        // Get Qfactor index - multiply the idealised weir discharge by this constant factor
     876                        ii = D->riverwall_rowIndex[RiverWall_count-1] * D->ncol_riverwall_hydraulic_properties;
     877                        Qfactor = D->riverwall_hydraulic_properties[ii];
     878                        // Get s1, submergence ratio at which we start blending with the shallow water solution
     879                        ii+=1;
     880                        s1= D->riverwall_hydraulic_properties[ii];
     881                        // Get s2, submergence ratio at which we entirely use the shallow water solution
     882                        ii+=1;
     883                        s2= D->riverwall_hydraulic_properties[ii];
     884                        // Get h1, tailwater head / weir height at which we start blending with the shallow water solution
     885                        ii+=1;
     886                        h1= D->riverwall_hydraulic_properties[ii];
     887                        // Get h2, tailwater head / weir height at which we entirely use the shallow water solution
     888                        ii+=1;
     889                        h2= D->riverwall_hydraulic_properties[ii];
     890                       
     891                        // Weir flux adjustment
     892                        adjust_edgeflux_with_weir(edgeflux, h_left_tmp, h_right_tmp, D->g,
     893                                                  weir_height, Qfactor,
     894                                                  s1, s2, h1, h2, &max_speed_local);
     895                    }
    879896                }
    880897            }
  • trunk/anuga_work/development/gareth/template_scenarios/tsunami/tsunami1/scripts/project.py

    r9325 r9328  
    3434## Total model runtime in seconds (starts at time=0.)
    3535#
    36 finalTime=0.01*3600.0
     36finaltime=0.01*3600.0
    3737
    3838## Model time between output file timesteps in seconds
    3939#
    40 yieldStep=20.0
     40yieldstep=20.0
    4141
    4242## Spatial Information
  • trunk/anuga_work/development/gareth/template_scenarios/tsunami/tsunami1/scripts/run_model.py

    r9325 r9328  
    5555##################################################################################
    5656print 'Making initial conditions'
    57 domain=setup_initial_conditions.setup_initial_conditions(domain,project)
     57setup_initial_conditions.setup_initial_conditions(domain,project)
    5858
    5959####################################################################################
     
    9696
    9797barrier()
    98 for t in domain.evolve(yieldstep=project.yieldStep, finaltime=project.finalTime):
     98for t in domain.evolve(yieldstep=project.yieldstep, finaltime=project.finaltime):
    9999    if(myid==0): print domain.timestepping_statistics()
    100100   
  • trunk/anuga_work/development/gareth/template_scenarios/tsunami/tsunami1/scripts/setup_initial_conditions.py

    r9325 r9328  
    230230        domain.riverwallData.export_riverwalls_to_text(output_dir=project.output_dir+'/'+project.spatial_txt_outputDir)
    231231
    232     return(domain)
    233 
    234 
     232    return
     233
     234
Note: See TracChangeset for help on using the changeset viewer.