Changeset 9672
- Timestamp:
- Feb 13, 2015, 11:06:09 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/anuga/parallel/parallel_internal_boundary_operator.py
r9671 r9672 29 29 force_constant_inlet_elevations=True, 30 30 smoothing_timescale=0.0, 31 compute_discharge_implicitly=True, 31 32 description=None, 32 33 label=None, … … 84 85 self.use_velocity_head = use_velocity_head 85 86 self.zero_outflow_momentum = zero_outflow_momentum 87 88 self.compute_discharge_implicitly = compute_discharge_implicitly 86 89 87 90 #FIXME SR: Why is this hard coded! … … 129 132 130 133 131 132 def discharge_routine_old(self): 134 def discharge_routine(self): 135 """Both implicit and explicit methods available 136 The former seems more stable and more accurate (in at least some 137 cases). The latter will have less communication in parallel, and 138 for some simple internal_boundary_functions there is no benefit to 139 the implicit approach 140 141 """ 142 143 if self.compute_discharge_implicitly: 144 Q, barrel_velocity, outlet_culvert_depth = self.discharge_routine_implicit() 145 else: 146 Q, barrel_velocity, outlet_culvert_depth = self.discharge_routine_explicit() 147 148 return Q, barrel_velocity, outlet_culvert_depth 149 150 def discharge_routine_explicit(self): 133 151 134 152 import pypar … … 267 285 268 286 269 def discharge_routine (self):287 def discharge_routine_implicit(self): 270 288 """ 271 289 Uses semi-implicit discharge estimation: … … 392 410 sol = solve(lhs, rhs) 393 411 394 Q = 0.5*(Q0 + ( Q0 + sol[0]*dQ_dE0 + sol[1]*dQ_dE1)) 412 #Q = 0.5*(Q0 + ( Q0 + sol[0]*dQ_dE0 + sol[1]*dQ_dE1)) 413 Q1 = self.internal_boundary_function(E0 + sol[0], E1 + sol[1]) 414 Q = 0.5*(Q0 + Q1) 395 415 else: 396 416 Q = Q0 -
trunk/anuga_core/anuga/parallel/parallel_operator_factory.py
r9657 r9672 628 628 force_constant_inlet_elevations=True, 629 629 smoothing_timescale=0.0, 630 compute_discharge_implicitly=True, 630 631 description=None, 631 632 label=None, … … 656 657 force_constant_inlet_elevations=force_constant_inlet_elevations, 657 658 smoothing_timescale=smoothing_timescale, 659 compute_discharge_implicitly=compute_discharge_implicitly, 658 660 description=description, 659 661 label=label, … … 756 758 force_constant_inlet_elevations=force_constant_inlet_elevations, 757 759 smoothing_timescale=smoothing_timescale, 760 compute_discharge_implicitly=compute_discharge_implicitly, 758 761 description=description, 759 762 label=label, -
trunk/anuga_core/anuga/structures/internal_boundary_operator.py
r9671 r9672 43 43 force_constant_inlet_elevations=True, 44 44 smoothing_timescale=0.0, 45 compute_discharge_implicitly=True, 45 46 description=None, 46 47 label=None, … … 86 87 self.zero_outflow_momentum = zero_outflow_momentum 87 88 89 self.compute_discharge_implicitly = compute_discharge_implicitly 90 88 91 #FIXME SR: Why is this hard coded! 89 92 self.max_velocity = 99999999999.0 … … 123 126 124 127 # self.domain.timestep = original_timestep 125 126 def discharge_routine_old(self): 128 129 def discharge_routine(self): 130 """Both implicit and explicit methods available 131 The former seems more stable and more accurate (in at least some 132 cases). The latter will have less communication in parallel, and 133 for some simple internal_boundary_functions there is no benefit to 134 the implicit approach 135 136 """ 137 if self.compute_discharge_implicitly: 138 Q, barrel_velocity, outlet_culvert_depth = self.discharge_routine_implicit() 139 else: 140 Q, barrel_velocity, outlet_culvert_depth = self.discharge_routine_explicit() 141 142 return Q, barrel_velocity, outlet_culvert_depth 143 144 def discharge_routine_explicit(self): 127 145 """Procedure to determine the inflow and outflow inlets. 128 146 Then use self.internal_boundary_function to do the actual calculation … … 207 225 208 226 209 def discharge_routine (self):227 def discharge_routine_implicit(self): 210 228 """Uses semi-implicit discharge estimation: 211 229 Discharge = 0.5*(Q(H0, T0) + Q(H0 + delta_H, T0+delta_T)) … … 266 284 # sol contains delta_E0, delta_E1 267 285 sol = solve(lhs, rhs) 268 269 Q = 0.5*(Q0 + ( Q0 + sol[0]*dQ_dE0 + sol[1]*dQ_dE1)) 286 287 #Q = 0.5*(Q0 + ( Q0 + sol[0]*dQ_dE0 + sol[1]*dQ_dE1)) 288 Q1 = self.internal_boundary_function(E0 + sol[0], E1 + sol[1]) 289 Q = 0.5*(Q0 + Q1) 270 290 else: 271 291 Q = Q0 -
trunk/anuga_core/anuga/utilities/quantity_setting_functions.py
r9609 r9672 328 328 if(pi == 'Extent'): 329 329 # Here fi MUST be a gdal-compatible raster 330 if(not (type(fi) ==str)):330 if(not (type(fi) == str)): 331 331 msg = ' pi = "Extent" can only be used when fi is a' +\ 332 332 ' raster file name' … … 341 341 pi_path = su.getRasterExtent(fi,asPolygon=True) 342 342 343 elif( type(pi)==strand os.path.isfile(pi) ):343 elif( (type(pi) == str) and os.path.isfile(pi) ): 344 344 # pi is a file 345 345 pi_path = su.read_polygon(pi) -
trunk/anuga_core/validation_tests/behaviour_only/bridge_hecras2/results.tex
r9631 r9672 37 37 Figure~\ref{Reach} show stage timeseries at various stations downstream in each 38 38 model. The ANUGA and HECRAS results are qualitatively similar, but differ in 39 detail. In early stages of the simulation when discharges are lower, ANUGA 40 shows stages slightly below HECRAS. This reflects the fact that HECRAS models 41 side-wall friction while ANUGA does not, so there is more drag in the HECRAS 42 model. Another relevant factor may be that the models flux the momentum under 43 the bridge in different ways. ANUGA's method is to compute the average momentum 44 in each direction along the upstream bridge inflow, and assume that this is 45 advected by the discharge (as computed from the internal boundary rating 46 curves). HECRAS's method is based on the energy equation. 47 48 As the discharge increases, the models show more deviation around the 49 bridge and upstream, and ultimately approach different steady states. The main 50 reason for this is that they use different methods to model the bridge 51 overflow, which begins when station 525 exceeds -1m. Another cause of 52 differences is that in HECRAS, stage over all cross-sections is constant, 53 including just upstream and downstream of the bridge. On the other hand in 54 these locations ANUGA predicts some cross-channel variations in channel and 55 floodplain stage. This is caused by the flux of water under the centre of the 56 bridge. Just upstream of the bridge, ANUGA predicts the stage in the channel is 57 slightly lower than on the floodplains, whereas the reverse is true just 58 downstream, as would be expected from the bridge underflow. Combined with the 59 fact that ANUGA's enquiry points for the bridge underflow rating curves occur 60 in the centre of the channel, we cannot expect exact agreement with HECRAS. 61 HECRAS includes several other bridge models, and these would also give 62 different results particularly when the bridge deck is inundated. 39 detail. 63 40 64 41 \begin{figure} … … 70 47 \end{figure} 71 48 49 In early stages of the simulation when discharges are lower, ANUGA shows stages 50 slightly below HECRAS (particularly away from the bridge). This reflects the 51 fact that HECRAS models side-wall friction while ANUGA does not, so there is 52 more drag in the HECRAS model. 53 54 As the discharge increases, the models show more deviation around the bridge 55 and upstream, and ultimately approach different steady states. At high flows, 56 the main reason for this is that they use different methods to model the bridge 57 overflow, which begins when station 525 exceeds -1m. ANUGA uses the shallow 58 water equations, while HECRAS uses an energy method. Even before this, the 59 models show differences once the flow goes overbank (above -2.4m at station 60 525). Because the ANUGA model here has a fairly coarse mesh, numerical 61 diffusion causes additional drag for overbank flows. 62 63 Several additional factors will contribute to deviations between the models. ANUGA 64 models cross-channel variations in the water surface elevation, which is 65 assumed constant in HECRAS. The under-bridge flux in ANUGA is based on the 66 water elevations in the central channel up-and-down stream of the bridge, thus 67 the 2D representation will have an effect on the under-bridge flow. The models 68 also flux the momentum under the bridge in different ways. ANUGA's method is to 69 compute the average momentum in each direction along the upstream bridge 70 inflow, and assume that this is advected by the discharge (as computed from the 71 internal boundary rating curves). HECRAS's method is based on the energy 72 equation. 73 74 -
trunk/anuga_work/development/gareth/tests/ras_bridge/channel_floodplain1.py
r9671 r9672 187 187 hecras_discharge_function, 188 188 exchange_lines=[bridge_in, bridge_out], 189 enquiry_gap= 0.01,189 enquiry_gap=5.0, 190 190 zero_outflow_momentum=False, 191 191 smoothing_timescale=0.0,
Note: See TracChangeset
for help on using the changeset viewer.