wolfhece 2.2.28__py3-none-any.whl → 2.2.30__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,36 @@
1
+ # be_ign_README.txt
2
+
3
+ The files in this section result from the conversion of datasets originating
4
+ from [IGN Belgium](http://www.ngi.be)
5
+
6
+ ## Included grids
7
+
8
+ ### Belgium: BD72 -> ETRS89
9
+
10
+ Grid transformation from Belgium Datum 72 to ETRS89 in Belgium.
11
+
12
+ *Source*: [IGN](http://www.ngi.be/Common/Lambert2008/NTv2.zip)
13
+ *Format*: GeoTIFF converted from NTv2
14
+ *License*: [Creative Commons Attribution 4.0](https://creativecommons.org/licenses/by/4.0/)
15
+ *Credit*: (c)2014-2016 Grid created by Nicolas SIMON.
16
+
17
+ It provides an accuracy better than 5mm in 99.6% of validation points and a
18
+ worst case of 1.3 cm outside the border.
19
+ Recommended to transform from Belgian Lambert 72 (EPSG:31370) to Belgian Lambert 2008 (EPSG:3812)
20
+ Documentation in French: (http://www.ngi.be/FR/FR2-1-7.shtm)
21
+ Documentation in Dutch: (http://www.ngi.be/NL/NL2-1-7.shtm)
22
+
23
+ * be_ign_bd72lb72_etrs89lb08.tif
24
+
25
+ ### Belgium vertical grid:
26
+
27
+ *Source*: [IGN](https://www.ngi.be/website/wp-content/uploads/2020/07/hBG18_fr.zip)
28
+ *Format*: GeoTIFF converted from 'XYZ ASCII Grid'
29
+ *License*: [Creative Commons Attribution 4.0](https://creativecommons.org/licenses/by/4.0/)
30
+ *Credit*: C. Slobbe, R. Klees, H.H. Farahani, L. Huisman, B. Alberts, P. Voet, F. De Doncker (2018). The Belgian hybrid quasi-geoid: hBG18. V. 1.0. GFZ Data Services. http://doi.org/10.5880/isg.2018.003
31
+ *Horizontal CRS*: EPSG:4937 (ETRS89)
32
+
33
+ Vertical transformation for Geoid model hGB18. Used to make the transitions
34
+ from heights in vertical CRS (EPSG:5710 - Ostend height) to heights above the ellipsoid in ETRS89 (EPSG:4937).
35
+
36
+ * be_ign_hBG18.tif
Binary file
wolfhece/mesh2d/gpu_2d.py CHANGED
@@ -88,8 +88,17 @@ class Sim_2D_GPU():
88
88
  self.magnetic_grid:header_wolf = None
89
89
 
90
90
  if (self.dir /'parameters.json').exists():
91
- self._sim = SimpleSimulation.load(self.dir)
92
- self.infiltration = infiltration_GPU(self)
91
+ try:
92
+ self._sim = SimpleSimulation.load(self.dir)
93
+ except Exception as e:
94
+ logging.error(_("Error loading simulation from directory {dir}: {error}").format(dir=self.dir, error=str(e)))
95
+ logging.error(_("Please check your files and try again."))
96
+ return
97
+
98
+ try:
99
+ self.infiltration = infiltration_GPU(self)
100
+ except Exception as e:
101
+ logging.error(_("Error initializing infiltration GPU: {error}").format(error=str(e)))
93
102
 
94
103
  # Fine arrays with type
95
104
  self.files_array={'Characteristics':[
wolfhece/pyshields.py CHANGED
@@ -19,6 +19,7 @@ from .friction_law import f_barr_bathurst, f_colebrook, f_colebrook_pure
19
19
 
20
20
  RHO_PUREWATER = 1000. # kg/m3
21
21
  RHO_SEAWATER = 1025. # kg/m3
22
+ RHO_SEDIMENT = 2650. # kg/m3
22
23
  KIN_VISCOSITY = 1.e-6 # m2/s
23
24
  GRAVITY = 9.81 # m/s2
24
25
 
@@ -90,7 +91,7 @@ Autres :
90
91
 
91
92
  """
92
93
 
93
- def get_sadim(d:float, rhom:float =2650., rho:float =RHO_PUREWATER) -> float:
94
+ def get_sadim(d:float, rhom:float = RHO_SEDIMENT, rho:float =RHO_PUREWATER) -> float:
94
95
  """
95
96
  s_adim = d**(3/2) * ((s-1) * g)**.5 / (4 * nu)
96
97
 
@@ -99,7 +100,7 @@ def get_sadim(d:float, rhom:float =2650., rho:float =RHO_PUREWATER) -> float:
99
100
  s=rhom/rho
100
101
  return d**(3./2.) * ((s-1) * GRAVITY)**.5 / (4 * KIN_VISCOSITY)
101
102
 
102
- def get_dstar(d:float, rhom:float =2650., rho:float=RHO_PUREWATER) -> float:
103
+ def get_dstar(d:float, rhom:float = RHO_SEDIMENT, rho:float=RHO_PUREWATER) -> float:
103
104
  """ compute d* """
104
105
  s = rhom/rho
105
106
  return d*(GRAVITY*(s-1)/KIN_VISCOSITY**2)**(1./3.) #VanRijn Formula
@@ -110,7 +111,7 @@ def sadim2dstar(sadim:float) -> float:
110
111
  def dstar2sadim(dstar:float) -> float:
111
112
  return dstar**(3./2.) / 4
112
113
 
113
- def get_d_from_sadim(sadim:float, rhom:float=2650., rho:float=RHO_PUREWATER) -> float:
114
+ def get_d_from_sadim(sadim:float, rhom:float= RHO_SEDIMENT, rho:float=RHO_PUREWATER) -> float:
114
115
  """
115
116
  s_adim = d**(3/2) * ((s-1) * g)**.5 / (4 * nu)
116
117
 
@@ -119,7 +120,7 @@ def get_d_from_sadim(sadim:float, rhom:float=2650., rho:float=RHO_PUREWATER) ->
119
120
  s=rhom/rho
120
121
  return (sadim*(4*KIN_VISCOSITY)/math.sqrt((s-1)*GRAVITY))**(2/3)
121
122
 
122
- def get_d_from_dstar(dstar:float, rhom:float=2650., rho:float=RHO_PUREWATER) -> float:
123
+ def get_d_from_dstar(dstar:float, rhom:float= RHO_SEDIMENT, rho:float=RHO_PUREWATER) -> float:
123
124
  """
124
125
  d_star = d * (g * (s-1) / nu**2)**(1/3)
125
126
 
@@ -166,26 +167,38 @@ def get_psi_cr3(dstar:float) -> float:
166
167
  psicr = 0.13*dstar**-0.392*math.exp(-0.015*dstar**2.)+0.045*(1-math.exp(-0.068*dstar))
167
168
  return psicr
168
169
 
169
- # def get_shields_cr(d, rhom=2650., rho=RHO_PUREWATER, which=2):
170
- # """
171
- # Example:
172
- # [critical_shear_velocity, tau_cr,xadim_val, psicr] = get_shields_cr(0.2E-3, 2650)
173
- # """
170
+ def get_shields_cr(d, rhom = RHO_SEDIMENT, rho = RHO_PUREWATER, which=2):
171
+ """
172
+ :param d: grain diameter [m]
173
+ :param rhom: sediment density [kg/m3]
174
+ :param rho: water density [kg/m3]
175
+ :param which: which formula to use (default 2) -- see funcs = [(get_sadim, get_psi_cr), (get_dstar, get_psi_cr2), (get_dstar, get_psi_cr3)]
176
+
177
+ :return: [critical_shear_velocity, tau_cr, xadim_val, psicr]
178
+
179
+ Example:
180
+ [critical_shear_velocity, tau_cr, xadim_val, psicr] = get_shields_cr(0.2E-3, 2650)
181
+ """
182
+
183
+ assert which in [0, 1, 2], "which must be 0, 1 or 2"
174
184
 
175
- # funcs = [(get_sadim,get_psi_cr),(get_dstar,get_psi_cr2),(get_dstar,get_psi_cr3)]
176
- # # % Getting the sediment-fluid parameter
177
- # s = rhom/rho # [-]
178
- # denom_shields= (s-1)*GRAVITY*d # [m²/s²] en réalité denom/rho
185
+ funcs = [(get_sadim,get_psi_cr),
186
+ (get_dstar,get_psi_cr2),
187
+ (get_dstar,get_psi_cr3)]
179
188
 
180
- # xadim_val = funcs[which][0](d,rhom,rho)
181
- # psicr = funcs[which][1](xadim_val)
189
+ # % Getting the sediment-fluid parameter
190
+ s = rhom/rho # [-]
191
+ denom_shields= (s-1)*GRAVITY*d # [m²/s²] en réalité denom/rho
182
192
 
183
- # # Using the critical value of Shields parameter
184
- # # Knowing the maximum bottom shear stress
185
- # tau_cr = rho * denom_shields * psicr # Pa
186
- # critical_shear_velocity = math.sqrt(denom_shields * psicr) # m/s
193
+ xadim_val = funcs[which][0](d,rhom,rho)
194
+ psicr = funcs[which][1](xadim_val)
187
195
 
188
- # return [critical_shear_velocity, tau_cr,xadim_val, psicr]
196
+ # Using the critical value of Shields parameter
197
+ # Knowing the maximum bottom shear stress
198
+ tau_cr = rho * denom_shields * psicr # Pa
199
+ critical_shear_velocity = math.sqrt(denom_shields * psicr) # m/s
200
+
201
+ return [critical_shear_velocity, tau_cr, xadim_val, psicr]
189
202
 
190
203
  def _poly(x:float) -> float:
191
204
  return ((0.002235*x**5)-(0.06043*x**4)+(0.20307*x**3)+ \
@@ -204,7 +217,7 @@ def get_tau_from_psiadim(psiadim, d:float, rhom:float=2650, rho:float=RHO_PUREWA
204
217
  denom_shields= (s-1)*GRAVITY*d ## en réalité denom/rho
205
218
  return rho * denom_shields * psiadim
206
219
 
207
- def get_d_min(rhom:float=2650., rho:float=RHO_PUREWATER) -> float:
220
+ def get_d_min(rhom:float = RHO_SEDIMENT, rho:float=RHO_PUREWATER) -> float:
208
221
  return get_d_from_sadim(get_sadim_min(),rhom,rho)
209
222
 
210
223
  def _d_cr(x:float, tau_obj:float, rhom:float, rho:float, xadim:float, yadim:float) -> float:
@@ -215,66 +228,91 @@ def _d_cr(x:float, tau_obj:float, rhom:float, rho:float, xadim:float, yadim:floa
215
228
  psi_cr=yadim(xadim(x,rhom,rho))
216
229
  return psi_obj-psi_cr
217
230
 
218
- # def _get_d_cr(tau_cr,rhom=2650,rho=RHO_PUREWATER):
231
+ def _get_d_cr(tau_cr, rhom = RHO_SEDIMENT, rho=RHO_PUREWATER, which=2) -> float:
232
+ """ Critical diameter d_cr for Shields criterion
233
+
234
+ :param tau_cr: critical shear stress [Pa]
235
+ :param rhom: sediment density [kg/m3]
236
+ :param rho: water density [kg/m3]
237
+ :param which: which formula to use (default 2) -- see funcs = [(get_sadim, get_psi_cr), (get_dstar, get_psi_cr2), (get_dstar, get_psi_cr3)]
238
+ """
239
+
240
+ assert which in [0, 1, 2], "which must be 0, 1 or 2"
241
+
242
+ dminabs = 1.e-100
243
+ dmaxabs = 20
244
+ funcs = [(get_sadim, get_psi_cr),
245
+ (get_dstar, get_psi_cr2),
246
+ (get_dstar, get_psi_cr3)]
219
247
 
220
- # dminabs = 1.e-6
221
- # dmaxabs = .5
222
- # d_cr = root_scalar(_d_cr,(tau_cr,rhom,rho,get_sadim,get_psi_cr),'bisect',bracket=[dminabs, dmaxabs])
248
+ d_cr = root_scalar(_d_cr,(tau_cr, rhom, rho, funcs[which][0],funcs[which][1]), 'bisect', bracket=[dminabs, dmaxabs])
223
249
 
224
- # return d_cr
250
+ return d_cr.root
225
251
 
226
- def get_d_cr(q:float, h:float, K:float, rhom:float=2650., rho:float=RHO_PUREWATER, method='brenth', which=2) -> list[float]:
252
+ def get_d_cr(q:float, h:float, K:float,
253
+ rhom:float = RHO_SEDIMENT, rho:float=RHO_PUREWATER,
254
+ method='brenth', which=2,
255
+ friction_law:Literal['Strickler', 'Colebrook'] = 'Strickler') -> list[float]:
227
256
  """
228
257
  Diamètre critique d'emportement par :
229
258
  - Shields
230
259
  - Izbach
231
260
 
232
- :param q : discharge [m3/s]
233
- :param h : water depth [m]
234
- :param K : Strickler friction coefficient [m1/3/s]
235
- :param rhom : sediment density [kg/m3]
236
- :param rho : water density [kg/m3]
237
- :param method : method to solve the equation (default 'brenth')
238
- :param which : which formula to use (default 2) -- see funcs = [(get_sadim,get_psi_cr),(get_dstar,get_psi_cr2),(get_dstar,get_psi_cr3)]
261
+ :param q: discharge [m3/s]
262
+ :param h: water depth [m]
263
+ :param K: Strickler friction coefficient [m1/3/s]
264
+ :param rhom: sediment density [kg/m3]
265
+ :param rho: water density [kg/m3]
266
+ :param method: method to solve the equation (default 'brenth')
267
+ :param which: which formula to use (default 2) -- see funcs = [(get_sadim,get_psi_cr),(get_dstar,get_psi_cr2),(get_dstar,get_psi_cr3)]
239
268
  """
269
+
270
+ assert which in [0, 1, 2], "which must be 0, 1 or 2"
271
+ assert friction_law in ['Strickler', 'Colebrook'], "friction_law must be 'Strickler' or 'Colebrook'"
272
+
240
273
  if q==0.:
241
274
  return 0.,0.
242
275
 
243
- tau_cr = (q/K)**2 / h**(7/3) * rho * GRAVITY # rho*g*h*J
276
+ # tau_cr = (q/K)**2 / h**(7/3) * rho * GRAVITY # rho*g*h*J
277
+ if friction_law == 'Strickler':
278
+ tau_cr = get_friction_slope_2D_Manning(q, h, 1/K) * rho * GRAVITY * h # rho*g*h*J
279
+ elif friction_law == 'Colebrook':
280
+ tau_cr = get_friction_slope_2D_Colebrook(q, h, K) * rho * GRAVITY * h
281
+
244
282
  dminabs = 1.e-100
245
283
  dmaxabs = 20
246
284
 
247
285
  funcs = [(get_sadim, get_psi_cr),(get_dstar, get_psi_cr2),(get_dstar, get_psi_cr3)]
248
286
 
249
287
  try:
250
- d_cr = root_scalar(_d_cr,(tau_cr,rhom,rho,funcs[which][0],funcs[which][1]),method,bracket=[dminabs, dmaxabs],rtol = 1e-2)
288
+ d_cr = root_scalar(_d_cr,(tau_cr,rhom,rho,funcs[which][0],funcs[which][1]), method, bracket=[dminabs, dmaxabs], rtol = 1e-2)
251
289
  return d_cr.root, izbach_d_cr(q,h,rhom,rho)
252
290
  except:
253
291
  izbach = izbach_d_cr(q,h,rhom,rho)
254
292
  return izbach,izbach
255
293
 
256
- def get_settling_vel(d:float, rhom:float=2650., rho:float=RHO_PUREWATER) -> float:
294
+ def get_settling_vel(d:float, rhom:float= RHO_SEDIMENT, rho:float=RHO_PUREWATER) -> float:
257
295
  """
258
296
  Vitesse de chute
259
297
 
260
- :param d : grain diameter [m]
261
- :param rhom : sediment density [kg/m3]
262
- :param rho : water density [kg/m3]
298
+ :param d: grain diameter [m]
299
+ :param rhom: sediment density [kg/m3]
300
+ :param rho: water density [kg/m3]
263
301
  """
264
302
  dstar = get_dstar(d,rhom,rho)
265
303
  ws = KIN_VISCOSITY/d*(math.sqrt(25+1.2*dstar**2.)-5)**(3./2.)
266
304
  return ws
267
305
 
268
- def get_Rouse(d:float, q:float, h:float, K:float, rhom:float=2650., rho:float=RHO_PUREWATER) -> float:
306
+ def get_Rouse(d:float, q:float, h:float, K:float, rhom:float= RHO_SEDIMENT, rho:float=RHO_PUREWATER) -> float:
269
307
  """
270
308
  Vitesse de chute
271
309
 
272
- :param d : grain diameter [m]
273
- :param q : discharge [m3/s]
274
- :param h : water depth [m]
275
- :param K : Strickler friction coefficient [m1/3/s]
276
- :param rhom : sediment density [kg/m3]
277
- :param rho : water density [kg/m3]
310
+ :param d: grain diameter [m]
311
+ :param q: discharge [m3/s]
312
+ :param h: water depth [m]
313
+ :param K: Strickler friction coefficient [m1/3/s]
314
+ :param rhom: sediment density [kg/m3]
315
+ :param rho: water density [kg/m3]
278
316
  """
279
317
  # tau_cr = (q/K)**2 / h**(7/3) * rho * GRAVITY
280
318
  # shear_vel = math.sqrt(tau_cr/rho)
@@ -285,16 +323,16 @@ def get_Rouse(d:float, q:float, h:float, K:float, rhom:float=2650., rho:float=RH
285
323
 
286
324
  return ws/(k*shear_vel)
287
325
 
288
- def _get_Rouse(d:float, q:float, h:float, K:float, rhom:float=2650., rho:float=RHO_PUREWATER, frac:float=50) -> float:
326
+ def _get_Rouse(d:float, q:float, h:float, K:float, rhom:float= RHO_SEDIMENT, rho:float=RHO_PUREWATER, frac:float=50) -> float:
289
327
  """
290
328
  Settling velocity function -- used in root_scalar
291
329
 
292
- :param d : grain diameter [m]
293
- :param q : discharge [m3/s]
294
- :param h : water depth [m]
295
- :param K : Strickler friction coefficient [m1/3/s]
296
- :param rhom : sediment density [kg/m3]
297
- :param rho : water density [kg/m3]
330
+ :param d: grain diameter [m]
331
+ :param q: discharge [m3/s]
332
+ :param h: water depth [m]
333
+ :param K: Strickler friction coefficient [m1/3/s]
334
+ :param rhom: sediment density [kg/m3]
335
+ :param rho: water density [kg/m3]
298
336
  """
299
337
  # tau_cr = (q/K)**2 / h**(7/3) * rho * GRAVITY
300
338
  # shear_vel = math.sqrt(tau_cr/rho)
@@ -313,18 +351,18 @@ def _get_Rouse(d:float, q:float, h:float, K:float, rhom:float=2650., rho:float=R
313
351
  elif frac==100:
314
352
  return rouse-1.2
315
353
 
316
- def get_transport_mode(d:float, q:float, h:float, K:float, rhom:float=2650., rho:float=RHO_PUREWATER): # -> BED_LOAD | SUSPENDED_LOAD_50 | SUSPENDED_LOAD_100 | WASH_LOAD:
354
+ def get_transport_mode(d:float, q:float, h:float, K:float, rhom:float= RHO_SEDIMENT, rho:float=RHO_PUREWATER): # -> BED_LOAD | SUSPENDED_LOAD_50 | SUSPENDED_LOAD_100 | WASH_LOAD:
317
355
  """
318
356
  Transport mode
319
357
 
320
358
  return in [BED_LOAD, SUSPENDED_LOAD_50, SUSPENDED_LOAD_100, WASH_LOAD]
321
359
 
322
- :param d : grain diameter [m]
323
- :param q : discharge [m3/s]
324
- :param h : water depth [m]
325
- :param K : Strickler friction coefficient [m1/3/s]
326
- :param rhom : sediment density [kg/m3]
327
- :param rho : water density [kg/m3]
360
+ :param d: grain diameter [m]
361
+ :param q: discharge [m3/s]
362
+ :param h: water depth [m]
363
+ :param K: Strickler friction coefficient [m1/3/s]
364
+ :param rhom: sediment density [kg/m3]
365
+ :param rho: water density [kg/m3]
328
366
 
329
367
  """
330
368
 
@@ -338,15 +376,15 @@ def get_transport_mode(d:float, q:float, h:float, K:float, rhom:float=2650., rho
338
376
  else:
339
377
  return WASH_LOAD
340
378
 
341
- def get_d_cr_susp(q:float, h:float, K:float, rhom:float=2650., rho:float=RHO_PUREWATER, method='brenth', which=50) -> float:
379
+ def get_d_cr_susp(q:float, h:float, K:float, rhom:float= RHO_SEDIMENT, rho:float=RHO_PUREWATER, method='brenth', which=50) -> float:
342
380
  """
343
381
  Diamètre critique d'emportement par suspension à 50% --> cf Rouse 1.2
344
382
 
345
- :param q : discharge [m3/s]
346
- :param h : water depth [m]
347
- :param K : Strickler friction coefficient [m1/3/s]
348
- :param rhom : sediment density [kg/m3]
349
- :param rho : water density [kg/m3]
383
+ :param q: discharge [m3/s]
384
+ :param h: water depth [m]
385
+ :param K: Strickler friction coefficient [m1/3/s]
386
+ :param rhom: sediment density [kg/m3]
387
+ :param rho: water density [kg/m3]
350
388
 
351
389
  """
352
390
  if q==0.:
@@ -360,8 +398,13 @@ def get_d_cr_susp(q:float, h:float, K:float, rhom:float=2650., rho:float=RHO_PUR
360
398
  except:
361
399
  return 0.
362
400
 
363
- def shieldsdia_sadim(s_psicr=None, dstar_psicr=None, rhom=2650., rho=RHO_PUREWATER, figax=None) -> tuple[plt.Figure,plt.Axes]:
364
- """ Plot Shields diagram with sadim"""
401
+ def shieldsdia_sadim(s_psicr=None, dstar_psicr=None, figax=None) -> tuple[plt.Figure,plt.Axes]:
402
+ """ Plot Shields diagram with sadim as x-axis
403
+
404
+ :param s_psicr: tuple (S, psicr) for a specific point to plot on the diagram
405
+ :param dstar_psicr: tuple (dstar, psicr) for a specific point to plot on the diagram
406
+ :param figax: tuple (fig, ax) to plot on a specific figure and axes
407
+ """
365
408
 
366
409
  smax = 1000
367
410
  rangoS = np.arange(0.1,smax,0.1)
@@ -416,8 +459,13 @@ def shieldsdia_sadim(s_psicr=None, dstar_psicr=None, rhom=2650., rho=RHO_PUREWAT
416
459
 
417
460
  return fig,ax
418
461
 
419
- def shieldsdia_dstar(s_psicr=None, dstar_psicr=None, rhom=2650., rho=RHO_PUREWATER, figax=None) -> tuple[plt.Figure,plt.Axes]:
420
- """ Plot Shields diagram with dstar"""
462
+ def shieldsdia_dstar(s_psicr=None, dstar_psicr=None, figax=None) -> tuple[plt.Figure,plt.Axes]:
463
+ """ Plot Shields diagram with dstar as x-axis
464
+
465
+ :param s_psicr: tuple (S, psicr) for a specific point to plot on the diagram
466
+ :param dstar_psicr: tuple (dstar, psicr) for a specific point to plot on the diagram
467
+ :param figax: tuple (fig, ax) to plot on a specific figure and axes
468
+ """
421
469
 
422
470
  smax = 1000
423
471
  d_stars = np.arange(0.1,smax,0.1)
@@ -517,9 +565,9 @@ def get_friction_slope_2D_Manning(q:float, h:float, n:float) -> float:
517
565
  """
518
566
  Compute friction slope j for 2D flow with Manning/Strickler friction law
519
567
 
520
- :param q : discharge [m3/s]
521
- :param h : water depth [m]
522
- :param n : Manning friction coefficient [m-1/3.s]
568
+ :param q: discharge [m3/s]
569
+ :param h: water depth [m]
570
+ :param n: Manning friction coefficient [m^{-1/3}.s]
523
571
  """
524
572
 
525
573
  denom = h**(4./3.)
@@ -530,13 +578,24 @@ def get_friction_slope_2D_Manning(q:float, h:float, n:float) -> float:
530
578
 
531
579
  return j
532
580
 
581
+ def get_friction_slope_2D_Strickler(q:float, h:float, K:float) -> float:
582
+ """
583
+ Compute friction slope j for 2D flow with Strickler friction law
584
+
585
+ :param q: discharge [m3/s]
586
+ :param h: water depth [m]
587
+ :param K: Strickler friction coefficient [m^{1/3}/s]
588
+ """
589
+
590
+ return get_friction_slope_2D_Manning(q, h, 1./K) # n = 1/K
591
+
533
592
  def get_friction_slope_2D_Colebrook(q:float, h:float, K:float) -> float:
534
593
  """
535
594
  Compute friction slope j for 2D flow with Colebrook-White friction law
536
595
 
537
- :param q : discharge [m3/s]
538
- :param h : water depth [m]
539
- :param K : Colebrook-White friction coefficient [m]
596
+ :param q: discharge [m3/s]
597
+ :param h: water depth [m]
598
+ :param K: height of roughness [m] - will be used to compute k/D or k/(4h) in 2D flow
540
599
  """
541
600
 
542
601
  four_hydraulic_radius = 4.0 * h
@@ -554,10 +613,10 @@ def get_shear_velocity_2D_Manning(q:float, h:float, n:float) -> float:
554
613
  """
555
614
  Compute shear velocity u_* for 2D flow with Manning/Strickler friction law
556
615
 
557
- :param j : friction slope [-]
558
- :param h : water depth [m]
559
- :param q : discharge [m3/s]
560
- :param n : Manning friction coefficient [m-1/3.s]
616
+ :param j: friction slope [-]
617
+ :param h: water depth [m]
618
+ :param q: discharge [m3/s]
619
+ :param n: Manning friction coefficient [m-1/3.s]
561
620
  """
562
621
 
563
622
  j = get_friction_slope_2D_Manning(q,h,n)
@@ -570,10 +629,10 @@ def get_shear_velocity_2D_Colebrook(q:float, h:float, K:float) -> float:
570
629
  """
571
630
  Compute shear velocity u_* for 2D flow with Colebrook-White friction law
572
631
 
573
- :param j : friction slope [-]
574
- :param h : water depth [m]
575
- :param q : discharge [m3/s]
576
- :param K : Colebrook-White friction coefficient [m]
632
+ :param j: friction slope [-]
633
+ :param h: water depth [m]
634
+ :param q: discharge [m3/s]
635
+ :param K: Colebrook-White friction coefficient [m]
577
636
  """
578
637
 
579
638
  j = get_friction_slope_2D_Colebrook(q,h,K)
@@ -586,11 +645,11 @@ def get_Shields_2D_Manning(s:float, d:float, q:float, h:float, n:float) -> float
586
645
  """
587
646
  Compute Shields dimensionless parameter for 2D flow with Manning/Strickler friction law
588
647
 
589
- :param s : sediment density / water density [-]
590
- :param d : sediment diameter [m]
591
- :param q : discharge [m3/s]
592
- :param h : water depth [m]
593
- :param n : Manning friction coefficient [m-1/3.s]
648
+ :param s: sediment density / water density [-]
649
+ :param d: sediment diameter [m]
650
+ :param q: discharge [m3/s]
651
+ :param h: water depth [m]
652
+ :param n: Manning friction coefficient [m-1/3.s]
594
653
 
595
654
  See also get_Shields_2D_Strickler
596
655
  """
@@ -607,11 +666,11 @@ def get_Shields_2D_Strickler(s:float, d:float, q:float, h:float, K:float) -> flo
607
666
  """
608
667
  Compute Shields dimensionless parameter for 2D flow with Manning/Strickler friction law
609
668
 
610
- :param s : sediment density / water density [-]
611
- :param d : sediment diameter [m]
612
- :param q : discharge [m3/s]
613
- :param h : water depth [m]
614
- :param K : Strickler friction coefficient [m1/3/s]
669
+ :param s: sediment density / water density [-]
670
+ :param d: sediment diameter [m]
671
+ :param q: discharge [m3/s]
672
+ :param h: water depth [m]
673
+ :param K: Strickler friction coefficient [m1/3/s]
615
674
 
616
675
  See also get_Shields_2D_Manning
617
676
  """
@@ -631,21 +690,23 @@ def izbach_d_cr(q:float, h:float, rhom:float=2650, rho:float=RHO_PUREWATER, meth
631
690
  (s-1) = (rho_m - rho) / rho
632
691
  u_c = 85% u_moyen)
633
692
 
634
- --> d = u_c**2 / (s * g) / 1.7**2
693
+ --> d = u_c**2 / ((s-1) * g) / 1.7**2
635
694
 
636
- --> d = (0.85 * q/h)**2 / (s * g) / 1.7**2
695
+ --> d = (0.85 * q/h)**2 / ((s-1) * g) / 1.7**2
637
696
 
638
- :param q : discharge [m3/s]
639
- :param h : water depth [m]
640
- :param rhom : sediment density [kg/m3]
641
- :param rho : water density [kg/m3]
642
- :param method : method to solve the equation (default 'ridder')
697
+ :param q: discharge [m3/s]
698
+ :param h: water depth [m]
699
+ :param rhom: sediment density [kg/m3]
700
+ :param rho: water density [kg/m3]
701
+ :param method: method to solve the equation (default 'ridder')
643
702
  """
644
703
  s = rhom/rho
645
704
  # (0.85 * q/h)**2. / ((s-1.) * GRAVITY) / 1.7**2.
646
- # <=> 0.7 * (0.85*q/h)**2. / (2 * GRAVITY) / (s-1.)
647
- # <=> (q/h)**2. / (2 * GRAVITY) / (s-1.) / .86**2
648
- return (q/h)**2. / (2 * GRAVITY) / (s-1.) / 1.2**2
705
+ # avec (2 / 1.7**2) = 0.692041... = 0.7
706
+ # <=> 0.7 * (0.85 * q/h)**2. / (2 * GRAVITY) / (s-1.)
707
+ # <=> (q/h)**2. / (2 * GRAVITY) / (s-1.) / 1.406**2
708
+
709
+ return (q/h)**2. / (2 * GRAVITY) / (s-1.) / 1.2**2 # We are using 1.2 instead of 1.406 -- see GCIV2035-1 - Hydrodynamique fluviale
649
710
 
650
711
 
651
712
  ## Portage de WOLF2D - Fortran pour Barr-Bathurst