Changeset 232 for inundation/ga/storm_surge/pyvolution/shallow_water.py
- Timestamp:
- Aug 27, 2004, 1:35:01 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/ga/storm_surge/pyvolution/shallow_water.py
r229 r232 98 98 """ 99 99 100 from config import g 100 from config import g, epsilon 101 101 from math import sqrt 102 102 from Numeric import array … … 114 114 uh_left = q_left[1] 115 115 116 try: 116 if h_left < epsilon: 117 u_left = 0.0 #Could have been negative 118 h_left = 0.0 119 else: 117 120 u_left = uh_left/h_left 118 except:119 u_left = 0.0120 h_left = 0.0121 121 122 122 … … 126 126 127 127 128 try: 128 if h_right < epsilon: 129 u_right = 0.0 #Could have been negative 130 h_right = 0.0 131 else: 129 132 u_right = uh_right/h_right 130 except: 131 u_right = 0.0 132 h_right = 0.0 133 134 133 135 134 vh_left = q_left[2] 136 135 vh_right = q_right[2] … … 146 145 147 146 #Flux computation 148 flux_left = array([u h_left,149 u_left* *2*h_left + 0.5*g*h_left**2,150 vh_left*u_left])151 flux_right = array([u h_right,152 u_right* *2*h_right + 0.5*g*h_right**2,153 vh_right*u_right])147 flux_left = array([u_left*h_left, 148 u_left*uh_left + 0.5*g*h_left**2, 149 u_left*vh_left]) 150 flux_right = array([u_right*h_right, 151 u_right*uh_right + 0.5*g*h_right**2, 152 u_right*vh_right]) 154 153 155 154 denom = s_max-s_min 156 155 if denom == 0.0: 157 flux = array([0.0, 0.0, 0.0])156 edgeflux = array([0.0, 0.0, 0.0]) 158 157 max_speed = 0.0 159 158 else: 160 flux = (s_max*flux_left - s_min*flux_right)/denom161 flux += s_max*s_min*(q_right-q_left)/denom162 163 flux = rotate(flux, normal, direction=-1)159 edgeflux = (s_max*flux_left - s_min*flux_right)/denom 160 edgeflux += s_max*s_min*(q_right-q_left)/denom 161 162 edgeflux = rotate(edgeflux, normal, direction=-1) 164 163 max_speed = max(abs(s_max), abs(s_min)) 165 164 166 return flux, max_speed165 return edgeflux, max_speed 167 166 168 167
Note: See TracChangeset
for help on using the changeset viewer.