Spaces:
Sleeping
Sleeping
Upload 7 files
Browse files- README.md +11 -8
- app.py +5 -5
- continuous_beam.py +31 -17
README.md
CHANGED
|
@@ -1,22 +1,22 @@
|
|
| 1 |
---
|
| 2 |
-
title: Continuous Beam RC Design
|
| 3 |
-
emoji: 🏗️
|
| 4 |
colorFrom: blue
|
| 5 |
colorTo: green
|
| 6 |
sdk: gradio
|
| 7 |
-
sdk_version:
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
---
|
| 11 |
|
| 12 |
-
# Continuous Beam RC Design App
|
| 13 |
|
| 14 |
-
A comprehensive continuous beam reinforced concrete design application using finite element analysis
|
| 15 |
|
| 16 |
## Features
|
| 17 |
|
| 18 |
- **Finite Element Analysis**: Accurate structural analysis for up to 10 spans
|
| 19 |
-
- **
|
| 20 |
- **Multiple Loading Types**:
|
| 21 |
- Distributed loads (kN/m)
|
| 22 |
- Point loads (kN)
|
|
@@ -39,7 +39,10 @@ A comprehensive continuous beam reinforced concrete design application using fin
|
|
| 39 |
## Technical Details
|
| 40 |
|
| 41 |
- **Analysis Method**: Finite Element Method with beam elements
|
| 42 |
-
- **Design
|
|
|
|
|
|
|
|
|
|
| 43 |
- **Capacity**: Up to 10 continuous spans
|
| 44 |
- **Load Types**: Distributed and concentrated loads
|
| 45 |
- **Output**: Moments, shears, reinforcement, stirrups
|
|
@@ -54,4 +57,4 @@ A comprehensive continuous beam reinforced concrete design application using fin
|
|
| 54 |
|
| 55 |
---
|
| 56 |
|
| 57 |
-
*Using advanced finite element analysis for accurate continuous beam behavior*
|
|
|
|
| 1 |
---
|
| 2 |
+
title: "Continuous Beam RC Design - Thai Standards"
|
| 3 |
+
emoji: "🏗️"
|
| 4 |
colorFrom: blue
|
| 5 |
colorTo: green
|
| 6 |
sdk: gradio
|
| 7 |
+
sdk_version: "4.0.0"
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
---
|
| 11 |
|
| 12 |
+
# Continuous Beam RC Design App - Thai Standards
|
| 13 |
|
| 14 |
+
A comprehensive continuous beam reinforced concrete design application using finite element analysis with Thai reinforcement standards.
|
| 15 |
|
| 16 |
## Features
|
| 17 |
|
| 18 |
- **Finite Element Analysis**: Accurate structural analysis for up to 10 spans
|
| 19 |
+
- **Thai Standards**: Reinforcement design using Thai steel grades (fy = 4000 ksc)
|
| 20 |
- **Multiple Loading Types**:
|
| 21 |
- Distributed loads (kN/m)
|
| 22 |
- Point loads (kN)
|
|
|
|
| 39 |
## Technical Details
|
| 40 |
|
| 41 |
- **Analysis Method**: Finite Element Method with beam elements
|
| 42 |
+
- **Design Standards**: Thai reinforcement standards
|
| 43 |
+
- **Steel Strength**: fy = 4000 ksc (Thai standard)
|
| 44 |
+
- **Reinforcement Bars**: DB12, DB16, DB20, DB24, DB32
|
| 45 |
+
- **Stirrups**: RB6, RB9 (selected automatically based on shear demand)
|
| 46 |
- **Capacity**: Up to 10 continuous spans
|
| 47 |
- **Load Types**: Distributed and concentrated loads
|
| 48 |
- **Output**: Moments, shears, reinforcement, stirrups
|
|
|
|
| 57 |
|
| 58 |
---
|
| 59 |
|
| 60 |
+
*Using advanced finite element analysis for accurate continuous beam behavior*
|
app.py
CHANGED
|
@@ -150,10 +150,10 @@ class GradioBeamApp:
|
|
| 150 |
def create_interface():
|
| 151 |
app = GradioBeamApp()
|
| 152 |
|
| 153 |
-
with gr.Blocks(title="Continuous Beam RC Design -
|
| 154 |
|
| 155 |
-
gr.Markdown("# Continuous Beam RC Design -
|
| 156 |
-
gr.Markdown("*Using Finite Element Analysis
|
| 157 |
|
| 158 |
with gr.Row():
|
| 159 |
with gr.Column(scale=1):
|
|
@@ -164,8 +164,8 @@ def create_interface():
|
|
| 164 |
depth_input = gr.Number(label="Beam Depth (mm)", value=500)
|
| 165 |
|
| 166 |
with gr.Row():
|
| 167 |
-
fc_input = gr.Number(label="f'c (
|
| 168 |
-
fy_input = gr.Number(label="fy (
|
| 169 |
|
| 170 |
cover_input = gr.Number(label="Cover (mm)", value=40)
|
| 171 |
|
|
|
|
| 150 |
def create_interface():
|
| 151 |
app = GradioBeamApp()
|
| 152 |
|
| 153 |
+
with gr.Blocks(title="Continuous Beam RC Design - Thai Standards", theme=gr.themes.Default()) as interface:
|
| 154 |
|
| 155 |
+
gr.Markdown("# Continuous Beam RC Design - Thai Standards")
|
| 156 |
+
gr.Markdown("*Using Finite Element Analysis with Thai reinforcement standards (DB bars, RB stirrups)*")
|
| 157 |
|
| 158 |
with gr.Row():
|
| 159 |
with gr.Column(scale=1):
|
|
|
|
| 164 |
depth_input = gr.Number(label="Beam Depth (mm)", value=500)
|
| 165 |
|
| 166 |
with gr.Row():
|
| 167 |
+
fc_input = gr.Number(label="f'c (ksc)", value=280)
|
| 168 |
+
fy_input = gr.Number(label="fy (ksc)", value=4000)
|
| 169 |
|
| 170 |
cover_input = gr.Number(label="Cover (mm)", value=40)
|
| 171 |
|
continuous_beam.py
CHANGED
|
@@ -21,8 +21,8 @@ class ContinuousBeam:
|
|
| 21 |
self.supports = []
|
| 22 |
self.moments = []
|
| 23 |
self.shears = []
|
| 24 |
-
self.fc =
|
| 25 |
-
self.fy =
|
| 26 |
self.beam_width = 300 # mm
|
| 27 |
self.beam_depth = 500 # mm
|
| 28 |
self.cover = 40 # mm
|
|
@@ -479,9 +479,9 @@ class ContinuousBeam:
|
|
| 479 |
# Convert moment to N-mm
|
| 480 |
Mu = abs(moment) * 1e6
|
| 481 |
|
| 482 |
-
# Material properties
|
| 483 |
-
fc = self.fc # MPa
|
| 484 |
-
fy = self.fy # MPa
|
| 485 |
b = self.beam_width # mm
|
| 486 |
d = self.d # mm
|
| 487 |
|
|
@@ -526,9 +526,9 @@ class ContinuousBeam:
|
|
| 526 |
# Convert shear to N
|
| 527 |
Vu = abs(shear) * 1000
|
| 528 |
|
| 529 |
-
# Material properties
|
| 530 |
-
fc = self.fc # MPa
|
| 531 |
-
fy = self.fy # MPa (for stirrups)
|
| 532 |
b = self.beam_width # mm
|
| 533 |
d = self.d # mm
|
| 534 |
|
|
@@ -552,8 +552,15 @@ class ContinuousBeam:
|
|
| 552 |
raise ValueError("Shear exceeds maximum capacity - increase beam size")
|
| 553 |
|
| 554 |
# Calculate required stirrup area
|
| 555 |
-
#
|
| 556 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 557 |
|
| 558 |
# Calculate required spacing
|
| 559 |
s_required = Av * fy * d / Vs # mm
|
|
@@ -571,10 +578,11 @@ class ContinuousBeam:
|
|
| 571 |
s_required = max(s_required, 50) # Minimum practical spacing
|
| 572 |
|
| 573 |
return {
|
| 574 |
-
"stirrup_spacing": f"{s_required:.0f} mm c/c",
|
| 575 |
"Av": Av,
|
| 576 |
"Vs": Vs / 1000, # Convert back to kN
|
| 577 |
-
"Vc": Vc / 1000 # Convert back to kN
|
|
|
|
| 578 |
}
|
| 579 |
|
| 580 |
def design_beam(self):
|
|
@@ -604,8 +612,14 @@ class ContinuousBeam:
|
|
| 604 |
if moment != 0:
|
| 605 |
As_required = self.calculate_required_reinforcement(moment)
|
| 606 |
|
| 607 |
-
# Select reinforcement bars
|
| 608 |
-
bar_areas = {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 609 |
|
| 610 |
# Try different bar sizes
|
| 611 |
for bar_size, bar_area in bar_areas.items():
|
|
@@ -615,8 +629,8 @@ class ContinuousBeam:
|
|
| 615 |
break
|
| 616 |
else:
|
| 617 |
# Use largest bars if can't fit
|
| 618 |
-
bar_size =
|
| 619 |
-
bar_area =
|
| 620 |
num_bars = math.ceil(As_required / bar_area)
|
| 621 |
As_provided = num_bars * bar_area
|
| 622 |
|
|
@@ -625,7 +639,7 @@ class ContinuousBeam:
|
|
| 625 |
'moment': moment,
|
| 626 |
'As_required': As_required,
|
| 627 |
'As_provided': As_provided,
|
| 628 |
-
'bars': f"{num_bars}
|
| 629 |
'ratio': As_provided / (self.beam_width * self.d) * 100
|
| 630 |
}
|
| 631 |
else:
|
|
|
|
| 21 |
self.supports = []
|
| 22 |
self.moments = []
|
| 23 |
self.shears = []
|
| 24 |
+
self.fc = 280 # Concrete compressive strength (ksc) - converted from 28 MPa
|
| 25 |
+
self.fy = 4000 # Steel yield strength (ksc) - Thai standard
|
| 26 |
self.beam_width = 300 # mm
|
| 27 |
self.beam_depth = 500 # mm
|
| 28 |
self.cover = 40 # mm
|
|
|
|
| 479 |
# Convert moment to N-mm
|
| 480 |
Mu = abs(moment) * 1e6
|
| 481 |
|
| 482 |
+
# Material properties - convert from ksc to MPa
|
| 483 |
+
fc = self.fc / 10.2 # Convert ksc to MPa (1 ksc ≈ 0.098 MPa)
|
| 484 |
+
fy = self.fy / 10.2 # Convert ksc to MPa
|
| 485 |
b = self.beam_width # mm
|
| 486 |
d = self.d # mm
|
| 487 |
|
|
|
|
| 526 |
# Convert shear to N
|
| 527 |
Vu = abs(shear) * 1000
|
| 528 |
|
| 529 |
+
# Material properties - convert from ksc to MPa
|
| 530 |
+
fc = self.fc / 10.2 # Convert ksc to MPa
|
| 531 |
+
fy = self.fy / 10.2 # Convert ksc to MPa (for stirrups)
|
| 532 |
b = self.beam_width # mm
|
| 533 |
d = self.d # mm
|
| 534 |
|
|
|
|
| 552 |
raise ValueError("Shear exceeds maximum capacity - increase beam size")
|
| 553 |
|
| 554 |
# Calculate required stirrup area
|
| 555 |
+
# Use RB9 or RB6 stirrups based on shear demand
|
| 556 |
+
if Vs > 150000: # High shear - use RB9
|
| 557 |
+
stirrup_dia = 9
|
| 558 |
+
Av = 2 * math.pi * (9/2)**2 # 2-leg RB9 stirrups = 2 × 63.6 = 127 mm²
|
| 559 |
+
stirrup_designation = "RB9"
|
| 560 |
+
else: # Lower shear - use RB6
|
| 561 |
+
stirrup_dia = 6
|
| 562 |
+
Av = 2 * math.pi * (6/2)**2 # 2-leg RB6 stirrups = 2 × 28.3 = 57 mm²
|
| 563 |
+
stirrup_designation = "RB6"
|
| 564 |
|
| 565 |
# Calculate required spacing
|
| 566 |
s_required = Av * fy * d / Vs # mm
|
|
|
|
| 578 |
s_required = max(s_required, 50) # Minimum practical spacing
|
| 579 |
|
| 580 |
return {
|
| 581 |
+
"stirrup_spacing": f"{stirrup_designation} @ {s_required:.0f} mm c/c",
|
| 582 |
"Av": Av,
|
| 583 |
"Vs": Vs / 1000, # Convert back to kN
|
| 584 |
+
"Vc": Vc / 1000, # Convert back to kN
|
| 585 |
+
"stirrup_type": stirrup_designation
|
| 586 |
}
|
| 587 |
|
| 588 |
def design_beam(self):
|
|
|
|
| 612 |
if moment != 0:
|
| 613 |
As_required = self.calculate_required_reinforcement(moment)
|
| 614 |
|
| 615 |
+
# Select reinforcement bars - Thai DB bars
|
| 616 |
+
bar_areas = {
|
| 617 |
+
12: 113, # DB12: π×(12/2)² = 113 mm²
|
| 618 |
+
16: 201, # DB16: π×(16/2)² = 201 mm²
|
| 619 |
+
20: 314, # DB20: π×(20/2)² = 314 mm²
|
| 620 |
+
24: 452, # DB24: π×(24/2)² = 452 mm²
|
| 621 |
+
32: 804 # DB32: π×(32/2)² = 804 mm²
|
| 622 |
+
}
|
| 623 |
|
| 624 |
# Try different bar sizes
|
| 625 |
for bar_size, bar_area in bar_areas.items():
|
|
|
|
| 629 |
break
|
| 630 |
else:
|
| 631 |
# Use largest bars if can't fit
|
| 632 |
+
bar_size = 32
|
| 633 |
+
bar_area = 804
|
| 634 |
num_bars = math.ceil(As_required / bar_area)
|
| 635 |
As_provided = num_bars * bar_area
|
| 636 |
|
|
|
|
| 639 |
'moment': moment,
|
| 640 |
'As_required': As_required,
|
| 641 |
'As_provided': As_provided,
|
| 642 |
+
'bars': f"{num_bars}-DB{bar_size}",
|
| 643 |
'ratio': As_provided / (self.beam_width * self.d) * 100
|
| 644 |
}
|
| 645 |
else:
|