Skip to content

Commit

Permalink
add aditional formula for nozzles
Browse files Browse the repository at this point in the history
  • Loading branch information
mdsketch committed Apr 25, 2023
1 parent 1cb3e73 commit f4e961d
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 35 deletions.
43 changes: 30 additions & 13 deletions Sample.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ <h1>Tank Design Report - Sample.html</h1>
<table>
<tr>
<th>Thickness</th>
<td>0.0 in</td>
<td>0.0011464968152866241 in</td>
</tr>
</table>
<div class="category">Features</div>
Expand All @@ -65,7 +65,7 @@ <h1>Tank Design Report - Sample.html</h1>
</tr>
<tr>
<td>Internal Pressure</td>
<td>0 psi</td>
<td>1 psi</td>
</tr>
<tr>
<td>External Pressure</td>
Expand All @@ -77,7 +77,7 @@ <h1>Tank Design Report - Sample.html</h1>
</tr>
<tr>
<td>Bottom Head Type</td>
<td>Conical</td>
<td>Flat</td>
</tr>

<tr>
Expand Down Expand Up @@ -222,12 +222,7 @@ <h1>Tank Design Report - Sample.html</h1>
</tr>
<tr>
<td>Storage Type</td>
<td>Liquid</td>
</tr>

<tr>
<td>Specific Gravity</td>
<td>0</td>
<td>Gas</td>
</tr>

</table>
Expand All @@ -240,7 +235,7 @@ <h1>Tank Design Report - Sample.html</h1>
</tr>
<tr>
<td>Type:</td>
<td>Ellipsoidal</td>
<td>Flat</td>
</tr>
<tr>
<td>Live load</td>
Expand All @@ -251,7 +246,7 @@ <h1>Tank Design Report - Sample.html</h1>
<td>0 lbf</td>
</tr>
</table>
<div class="category">Top Head</div>
<div class="category">Shell</div>
<table>
<tr>
<th>Parameter</th>
Expand All @@ -262,7 +257,7 @@ <h1>Tank Design Report - Sample.html</h1>
<td>Hand Lay-Up</td>
</tr>
<tr>
<td>Hoop Tensile Modulus:</td>
<td>Hoop Tensile Modulus</td>
<td>0 psi</td>
</tr>
<tr>
Expand All @@ -278,7 +273,29 @@ <h1>Tank Design Report - Sample.html</h1>
<td>0 psi</td>
</tr>
</table>

<div class="category">Nozzle</div>
<table>
<tr>
<th>Parameter</th>
<th>Value</th>
</tr>
<tr>
<td>Number of Nozzles</td>
<td>0</td>
</tr>
<tr>
<td>Length of Nozzle</td>
<td>0 in</td>
</tr>
<tr>
<td>Thickness of Nozzle</td>
<td>0 in</td>
</tr>
<tr>
<td>Diameter of Nozzle</td>
<td>0 in</td>
</tr>
</table>
</body>

</html>
33 changes: 15 additions & 18 deletions connectors/formulas.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
Yc = 1.860E+004 # Compressive Strength (psi)
S = 1.290E+004 # Shear Strength (psi)
g = 9.81 # Gravity (m/s^2)
dEglass = 158.6 # Density of E-Glass (lb/ft^3)


def calculateTank(tank):
Expand All @@ -29,26 +30,24 @@ def calculateTank(tank):
float(tank['liquid_height'])*float(tank['specific_gravity'])
t = 0
if tank['tensile_force'] and tank['outdoor']:
t1 = tensileForceThickness(tank['operating_moment'], tank['diameter'],
tank['tensile_force_value'], tank['internal_pressure'])
t1 = tensileForceThickness(
tank['operating_moment'], tank['diameter'], tank['tensile_force_value'])
t2 = operatingCompressiveForceThickness(tank)
t = max(t1, t2)
elif tank['outdoor'] and not tank['tensile_force']:
t = operatingCompressiveForceThickness(tank)
elif tank['tensile_force'] and not tank['outdoor']:
t = tensileForceThickness(tank['operating_moment'], tank['diameter'],
tank['tensile_force_value'], tank['internal_pressure'])
else:
t, Eh = idealThickness(
tank['diameter'], tank['internal_pressure'], tank['hoop_tensile_modulus'])
tank['hoop_tensile_modulus'] = Eh
t = tensileForceThickness(
tank['operating_moment'], tank['diameter'], tank['tensile_force_value'])

t += idealThickness(tank['diameter'], tank['internal_pressure'])
tank['internal_pressure'] = p
tank['thickness'] = t + tank['corrosion_barrier_thickness'] + \
tank['corrosion_liner_thickness']
return tank


def idealThickness(D=0.0, Pi=0.0, Eh=0.0):
def idealThickness(D=0.0, Pi=0.0):
"""
Ideal thickness formula
used when none of the modifiers are selected
Expand All @@ -61,29 +60,25 @@ def idealThickness(D=0.0, Pi=0.0, Eh=0.0):
t = (PD)/(2*(0.001*Eh))
Returns:
t = thickness
Eh = hoop tensile modulus
"""
# check if we should use the default hoop tensile modulus
if Eh == 0:
Eh = E1
return ((float(Pi)*float(D)*10)/(2*Xt), Eh)
return (float(Pi)*float(D)*10)/(2*Xt)


def tensileForceThickness(Ma=0.0, D=0.0, Fat=0.0, Pi=0.0):
def tensileForceThickness(Ma=0.0, D=0.0, Fat=0.0):
"""
Thickness formula when accounting for tensile force
Parameters:
Ma = Bending moment from operating loads
D = inside diameter
Fat = Axial Tensile force
Pi = internal pressure (probably 15)
10 is design factor
Formula:
t = ((Ma*8.8507457916)/(PI()*((D/2)^2)*(Xt/10))) + ((Fat*0.2248089431)/(PI()*D*(Xt/10))) + ((P*D)/(4*(Xt/10)));
t = ((Ma*8.8507457916)/(PI()*((D/2)^2)*(Xt/10))) + ((Fat*0.2248089431)/(PI()*D*(Xt/10)))
"""
return ((float(Ma))/(math.pi*((float(D)/2)**2)*(Xt/10))) + ((float(Fat))/(math.pi*float(D)*(Xt/10))) + ((float(Pi)*float(D))/(4*(Xt/10)))
return ((float(Ma))/(math.pi*((float(D)/2)**2)*(Xt/10))) + ((float(Fat))/(math.pi*float(D)*(Xt/10)))


def operatingCompressiveForceThickness(tank):
Expand Down Expand Up @@ -122,12 +117,14 @@ def operatingCompressiveForceThickness(tank):
t2 = (((((Ma) + Mb)/(PI()*((D/2)^2))) + (((Fac)+Fbc)/(PI()*D)) + ((Pe*D)/4)) * ((5*(D/2))/(0.3*((E2*E1)^(1/2)))))^(1/2);
"""
# get values
nozzle = (2.0*math.pi*(float(tank['diameter'])/24.0)*(float(
tank['nozzle_length'])/12.0)*(float(tank['nozzle_thickness'])/12.0))*dEglass
Ma = float(tank['operating_moment'])
D = float(tank['diameter'])
Fac = float(tank['compressive_force'])
Pe = float(tank['external_pressure'])
height = float(tank['height'])
deadLoad = float(tank['dead_load'])
deadLoad = float(tank['dead_load']) + nozzle
liveLoad = float(tank['live_load'])
Ce = float(tank['snow_Ce'])
Ct = float(tank['snow_Ct'])
Expand Down
28 changes: 25 additions & 3 deletions connectors/templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@
<td>{{ dead_load }} lbf</td>
</tr>
</table>
<div class="category">Top Head</div>
<div class="category">Shell</div>
<table>
<tr>
<th>Parameter</th>
Expand All @@ -273,7 +273,7 @@
<td>{{ shell }}</td>
</tr>
<tr>
<td>Hoop Tensile Modulus:</td>
<td>Hoop Tensile Modulus</td>
<td>{{ hoop_tensile_modulus }} psi</td>
</tr>
<tr>
Expand All @@ -289,7 +289,29 @@
<td>{{ axial_tensile_strength }} psi</td>
</tr>
</table>
<div class="category">Nozzle</div>
<table>
<tr>
<th>Parameter</th>
<th>Value</th>
</tr>
<tr>
<td>Number of Nozzles</td>
<td>{{ nozzles }}</td>
</tr>
<tr>
<td>Length of Nozzle</td>
<td>{{ nozzle_length }} in</td>
</tr>
<tr>
<td>Thickness of Nozzle</td>
<td>{{ nozzle_thickness }} in</td>
</tr>
<tr>
<td>Diameter of Nozzle</td>
<td>{{ nozzle_diameter }} in</td>
</tr>
</table>
</body>
</html>
Expand Down
15 changes: 14 additions & 1 deletion ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,18 @@ def app():
sg.Spin(values=[i for i in range(0, 100, 1)], initial_value=0, key='dead_load', size=(5, 20))],
]

# Nozzle
nozzle = [
[sg.Text('Number of Nozzles:', pad=(10, 3)),
sg.Spin(values=[i for i in range(0, 100, 1)], initial_value=0, key='nozzles', size=(5, 20))],
[sg.Text('Length of Nozzle (in):', pad=(10, 3)),
sg.Spin(values=[i for i in range(0, 100, 1)], initial_value=0, key='nozzle_length', size=(5, 20))],
[sg.Text('Thickness of Nozzle (in):', pad=(10, 3)),
sg.Spin(values=[i for i in range(0, 100, 1)], initial_value=0, key='nozzle_thickness', size=(5, 20))],
[sg.Text('Diameter of Nozzle (in):', pad=(10, 3)),
sg.Spin(values=[i for i in range(0, 100, 1)], initial_value=0, key='nozzle_diameter', size=(5, 20))],
]

# Shell
shell = [
[sg.Text('Type:', pad=(10, 3)),
Expand All @@ -133,7 +145,8 @@ def app():
layout = [
[sg.Menu(menu_def, font='_ 12', key='-MENUBAR-')],
[[sg.TabGroup([[sg.Tab('Features', features), sg.Tab('Environment', environment), sg.Tab('Contents', contents),
sg.Tab('Top Head', top_head), sg.Tab('Shell', shell),]],
sg.Tab('Top Head', top_head), sg.Tab('Shell', shell),
sg.Tab('Nozzle', nozzle)]],
key='-TAB GROUP-', expand_x=True, expand_y=True),]], [actions]]

window = sg.Window("Auto FRP Tank", layout, resizable=True,
Expand Down

0 comments on commit f4e961d

Please sign in to comment.