Skip to content

Commit 27e921c

Browse files
committed
Correct width and depth solvers; define variables
1 parent ee4fd12 commit 27e921c

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

grlp/grlp.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ def __init__(self):
1818
self.A = None
1919
self.Q = None
2020
self.B = None
21+
self.D = None # Grain size; needed only to resolve width and depth
22+
self.b = None # Width and depth need not be resoloved to compute
23+
self.h = None # long-profile evolution
2124
self.S0 = None # S0 for Q_s_0 where there is a defined boundary input
2225
self.dx_ext = None
2326
self.dx_2cell = None
@@ -523,14 +526,14 @@ def compute_channel_width(self):
523526
* ((self.rho_s - self.rho)/self.rho)**(5/3.)
524527
* (1+self.epsilon)**(5/3.)
525528
* (self.tau_star_c**(5/3.)) ) \
526-
* self.Q * self.S**(7/6.) * self.D**1.5
529+
* self.Q * self.S**(7/6.) / self.D**1.5
527530
else:
528531
raise ValueError('Set grain size to compute channel width.')
529532

530533
def compute_flow_depth(self):
531534
if self.D is not None:
532-
h = (self.rho_s - self.rho)/self.rho * (1+self.epsilon) \
533-
* self.tau_star_c * self.D / self.S
535+
self.h = (self.rho_s - self.rho)/self.rho * (1+self.epsilon) \
536+
* self.tau_star_c * self.D / self.S
534537
else:
535538
raise ValueError('Set grain size to compute channel depth.')
536539

0 commit comments

Comments
 (0)