edwinrajeev commited on
Commit
770f1c9
·
1 Parent(s): 2dacb5f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +48 -15
app.py CHANGED
@@ -396,6 +396,42 @@ def goda(Case, Hs, Hmax, h, d, h_acc, hc, T, beta, rho, slope_foreshore, B, lamb
396
 
397
  import streamlit as st
398
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
399
  def main():
400
  st.title("Goda Horizontal Loading Calculator")
401
  # Display the image
@@ -416,22 +452,19 @@ def main():
416
  Pmin = st.number_input("Non-Dimensional Pmin (For Suction Loads - from Graphs Above)", value=0.4)
417
  s = st.number_input("Non-Dimensional s (For Suction Loads - from Graphs Above)", value=0.5)
418
  p2_bottom = st.number_input("Non-Dimensional p2 (For Suction Loads - from Graphs Above)", value=0.55)
419
-
420
-
421
- Hmax = Hs*1.8 #design wave height, equal to the mean of the highest 1/250 of the wave heights [m].
422
- h = Still_Water_Level - Bottom_of_Wall #water depth [m]
423
- d = h #water depth in front of the caisson, on top of the foundation [m]
424
- h_acc = h #submerged depth of the caisson [m]
425
- hc = Top_of_Wall_Height - Still_Water_Level #height of the caisson above the water line [m]
426
- slope_foreshore = [1,100] #slope of the foreshore [rad]
427
- lambda_=[1,1,1]
428
-
429
- if st.button("Calculate"):
430
- result = goda(Case = Case_number, Hs=Hs, Hmax=Hmax, h=h, d=d, h_acc=h_acc, hc=hc, T=T,
431
- beta=beta, rho=rho, slope_foreshore=slope_foreshore, B = B, lambda_=lambda_,
432
- Still_Water_Level = Still_Water_Level, Top_of_Wall_Height= Top_of_Wall_Height,
433
- Bottom_of_Wall=Bottom_of_Wall, Pmin=Pmin, s=s, p2_bottom=p2_bottom )
434
 
 
 
 
 
 
 
 
 
 
 
 
 
435
 
436
 
437
  if __name__ == "__main__":
 
396
 
397
  import streamlit as st
398
 
399
+ #def main():
400
+ # st.title("Goda Horizontal Loading Calculator")
401
+ # # Display the image
402
+ # img = mpimg.imread('Goda_Suction.png')
403
+ # st.image(img, use_column_width=True)
404
+
405
+ # User Inputs
406
+ # Case_number = st.number_input("Case Number", value=3, min_value=1, step=1)
407
+ # B = st.number_input("Width of Wall", value=2.0, min_value=0.0)
408
+ # Bottom_of_Wall = st.number_input("Bottom of Wall", value=-11.92)
409
+ # Still_Water_Level = st.number_input("Stillwater Level", value=0.0)
410
+ # Top_of_Wall_Height = st.number_input("Top of Wall Height", value=7.27)
411
+ # Hs = st.number_input("Hs", value=4.5)
412
+ # T = st.number_input("T", value=7.0)
413
+ # beta = st.number_input("Beta", value=0.0)
414
+ # rho = st.number_input("Rho", value=2.0)
415
+
416
+ # Pmin = st.number_input("Non-Dimensional Pmin (For Suction Loads - from Graphs Above)", value=0.4)
417
+ # s = st.number_input("Non-Dimensional s (For Suction Loads - from Graphs Above)", value=0.5)
418
+ # p2_bottom = st.number_input("Non-Dimensional p2 (For Suction Loads - from Graphs Above)", value=0.55)
419
+
420
+
421
+ # Hmax = Hs*1.8 #design wave height, equal to the mean of the highest 1/250 of the wave heights [m].
422
+ # h = Still_Water_Level - Bottom_of_Wall #water depth [m]
423
+ # d = h #water depth in front of the caisson, on top of the foundation [m]
424
+ # h_acc = h #submerged depth of the caisson [m]
425
+ # hc = Top_of_Wall_Height - Still_Water_Level #height of the caisson above the water line [m]
426
+ # slope_foreshore = [1,100] #slope of the foreshore [rad]
427
+ # lambda_=[1,1,1]
428
+
429
+ # if st.button("Calculate"):
430
+ # result = goda(Case = Case_number, Hs=Hs, Hmax=Hmax, h=h, d=d, h_acc=h_acc, hc=hc, T=T,
431
+ # beta=beta, rho=rho, slope_foreshore=slope_foreshore, B = B, lambda_=lambda_,
432
+ # Still_Water_Level = Still_Water_Level, Top_of_Wall_Height= Top_of_Wall_Height,
433
+ # Bottom_of_Wall=Bottom_of_Wall, Pmin=Pmin, s=s, p2_bottom=p2_bottom )
434
+
435
  def main():
436
  st.title("Goda Horizontal Loading Calculator")
437
  # Display the image
 
452
  Pmin = st.number_input("Non-Dimensional Pmin (For Suction Loads - from Graphs Above)", value=0.4)
453
  s = st.number_input("Non-Dimensional s (For Suction Loads - from Graphs Above)", value=0.5)
454
  p2_bottom = st.number_input("Non-Dimensional p2 (For Suction Loads - from Graphs Above)", value=0.55)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
455
 
456
+ if st.button("Run Dispersion"):
457
+ dispersion_result = dispersion(Hs, T, beta)
458
+ st.write("Dispersion Result:")
459
+ st.write("Wave Length:", dispersion_result["wave_length"])
460
+
461
+ if st.button("Run Goda"):
462
+ goda_result = goda(Case=Case_number, Hs=Hs, Hmax=Hmax, h=h, d=d, h_acc=h_acc, hc=hc, T=T,
463
+ beta=beta, rho=rho, slope_foreshore=slope_foreshore, B=B, lambda_=lambda_,
464
+ Still_Water_Level=Still_Water_Level, Top_of_Wall_Height=Top_of_Wall_Height,
465
+ Bottom_of_Wall=Bottom_of_Wall, Pmin=Pmin, s=s, p2_bottom=p2_bottom)
466
+ st.write("Goda Result:")
467
+ st.write("Output:", goda_result)
468
 
469
 
470
  if __name__ == "__main__":