Changeset 9328
- Timestamp:
- Sep 9, 2014, 12:38:56 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/source/anuga/shallow_water/swDE1_domain_ext.c
r9327 r9328 678 678 if(fabs(edgeflux[0])>1.0e-100){ 679 679 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 //} 681 688 // FINAL ADJUSTED FLUX 682 689 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.); 685 698 }else{ 686 699 // Can't divide by edgeflux, so enforce 'newFlux' directly … … 704 717 705 718 // 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); 707 721 708 722 return 0; … … 856 870 } 857 871 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 } 879 896 } 880 897 } -
trunk/anuga_work/development/gareth/template_scenarios/tsunami/tsunami1/scripts/project.py
r9325 r9328 34 34 ## Total model runtime in seconds (starts at time=0.) 35 35 # 36 final Time=0.01*3600.036 finaltime=0.01*3600.0 37 37 38 38 ## Model time between output file timesteps in seconds 39 39 # 40 yield Step=20.040 yieldstep=20.0 41 41 42 42 ## Spatial Information -
trunk/anuga_work/development/gareth/template_scenarios/tsunami/tsunami1/scripts/run_model.py
r9325 r9328 55 55 ################################################################################## 56 56 print 'Making initial conditions' 57 domain=setup_initial_conditions.setup_initial_conditions(domain,project)57 setup_initial_conditions.setup_initial_conditions(domain,project) 58 58 59 59 #################################################################################### … … 96 96 97 97 barrier() 98 for t in domain.evolve(yieldstep=project.yield Step, finaltime=project.finalTime):98 for t in domain.evolve(yieldstep=project.yieldstep, finaltime=project.finaltime): 99 99 if(myid==0): print domain.timestepping_statistics() 100 100 -
trunk/anuga_work/development/gareth/template_scenarios/tsunami/tsunami1/scripts/setup_initial_conditions.py
r9325 r9328 230 230 domain.riverwallData.export_riverwalls_to_text(output_dir=project.output_dir+'/'+project.spatial_txt_outputDir) 231 231 232 return (domain)233 234 232 return 233 234
Note: See TracChangeset
for help on using the changeset viewer.