Compare commits
No commits in common. "main" and "redesign" have entirely different histories.
3 changed files with 350 additions and 364 deletions
|
|
@ -1,353 +1,350 @@
|
||||||
import math
|
import math
|
||||||
import csv
|
import csv
|
||||||
from colorama import just_fix_windows_console
|
from colorama import just_fix_windows_console
|
||||||
just_fix_windows_console()
|
just_fix_windows_console()
|
||||||
from colorama import Fore, Back, Style
|
from colorama import Fore, Back, Style
|
||||||
|
|
||||||
#
|
#
|
||||||
# HELLO MODIFY THIS!
|
# HELLO MODIFY THIS!
|
||||||
#
|
#
|
||||||
#Hello there! Modify this!
|
#Hello there! Modify this!
|
||||||
#INITIAL SET UP
|
#INITIAL SET UP
|
||||||
Ebasis = 65500.00
|
Ebasis = 65500.00
|
||||||
mass_limit = 28.000
|
mass_limit = 28.000
|
||||||
|
|
||||||
#MODIFY THIS EVERY NEW ITERATION
|
#MODIFY THIS EVERY NEW ITERATION
|
||||||
modAmount = 2 # amount of results you want to iterate through (starts at panel_val_0 and goes to this value minus one)
|
modAmount = 2 # amount of results you want to iterate through (starts at panel_val_0 and goes to this value minus one)
|
||||||
# So the highest x of panel_val_x with one added to it. (modAmount = 1 only runs panel_val_0, modAmount = 3 runs through panel_val_0, 1 and 2)
|
# So the highest x of panel_val_x with one added to it. (modAmount = 1 only runs panel_val_0, modAmount = 3 runs through panel_val_0, 1 and 2)
|
||||||
|
|
||||||
# 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16
|
# 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16
|
||||||
pThickness_01 = [ 4, 5] # panel 1 and 10
|
pThickness_01 = [ 4, 5] # panel 1 and 10
|
||||||
pThickness_02 = [ 4, 5] # panel 2 and 9
|
pThickness_02 = [ 4, 5] # panel 2 and 9
|
||||||
pThickness_03 = [ 4, 5] # panel 3 and 8
|
pThickness_03 = [ 4, 5] # panel 3 and 8
|
||||||
pThickness_04 = [ 4, 5] # panel 4 and 7
|
pThickness_04 = [ 4, 5] # panel 4 and 7
|
||||||
pThickness_05 = [ 4, 6] # panel 5 and 6
|
pThickness_05 = [ 4, 6] # panel 5 and 6
|
||||||
|
|
||||||
# 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16
|
# 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16
|
||||||
dim1_0 = [25,70]
|
dim1_0 = [25,70]
|
||||||
dim2_0 = [ 2, 2]
|
dim2_0 = [ 2, 2]
|
||||||
dim3_0 = [20,10]
|
dim3_0 = [20,10]
|
||||||
dim4_0 = [15,15]
|
dim4_0 = [15,15]
|
||||||
|
|
||||||
|
|
||||||
# BELOW THIS NOTHING NEEDS TO BE MODIFIED
|
# BELOW THIS NOTHING NEEDS TO BE MODIFIED
|
||||||
|
|
||||||
def GetValueofElement(ElementID, Loadcase, Valuetype, Fileadress):
|
def GetValueofElement(ElementID, Loadcase, Valuetype, Fileadress):
|
||||||
FindTitle = False
|
FindTitle = False
|
||||||
intiated = False
|
intiated = False
|
||||||
with open(Fileadress, newline='') as csvfile:
|
with open(Fileadress, newline='') as csvfile:
|
||||||
reader = csv.reader(csvfile, delimiter=',', quotechar="'")
|
reader = csv.reader(csvfile, delimiter=',', quotechar="'")
|
||||||
for row in reader:
|
for row in reader:
|
||||||
values = row
|
values = row
|
||||||
#print(values)
|
#print(values)
|
||||||
if intiated:
|
if intiated:
|
||||||
if str(values[ElemID_ID]) == str(ElementID) and str(values[Loadcase_ID])==str(Loadcase):
|
if str(values[ElemID_ID]) == str(ElementID) and str(values[Loadcase_ID])==str(Loadcase):
|
||||||
return float(values[Value_ID])*1.5 #Safety Factor here!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
return float(values[Value_ID])*1.5 #Safety Factor here!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||||
if FindTitle:
|
if FindTitle:
|
||||||
#print(str(values))
|
#print(str(values))
|
||||||
Header = values
|
Header = values
|
||||||
ElemID_ID = Header.index("Elements")
|
ElemID_ID = Header.index("Elements")
|
||||||
Loadcase_ID = Header.index("Loadcase")
|
Loadcase_ID = Header.index("Loadcase")
|
||||||
Value_ID = Header.index(Valuetype)
|
Value_ID = Header.index(Valuetype)
|
||||||
FindTitle = False
|
FindTitle = False
|
||||||
intiated = True
|
intiated = True
|
||||||
if len(values)==0:
|
if len(values)==0:
|
||||||
FindTitle=True
|
FindTitle=True
|
||||||
return None
|
return None
|
||||||
|
|
||||||
#CONSTANTS
|
#CONSTANTS
|
||||||
axial = 'Element Stresses (1D):CBAR/CBEAM Axial Stress'
|
axial = 'Element Stresses (1D):CBAR/CBEAM Axial Stress'
|
||||||
# material properties
|
# material properties
|
||||||
sUlt = 530
|
sUlt = 530
|
||||||
sYield = 490
|
sYield = 490
|
||||||
density = 2.7 * (10 ** -6) #2.7*10^-9 in t/mm^3
|
density = 2.7 * (10 ** -6) #2.7*10^-9 in t/mm^3
|
||||||
|
|
||||||
pWidth_0 = [200,200,200,200,200,200,200,200,200,200,200,200,200,200]
|
pWidth_0 = [200,200,200,200,200,200,200,200,200,200,200,200,200,200]
|
||||||
pLength_0 = [750,750,750,750,750,750,750,750,750,750,750,750,750]
|
pLength_0 = [750,750,750,750,750,750,750,750,750,750,750,750,750]
|
||||||
|
|
||||||
def GetAvgStressofPanel(panelNo, Loadcase, ValueType):
|
def GetAvgStressofPanel(panelNo, Loadcase, ValueType):
|
||||||
id = panelNo * 3 - 2
|
id = panelNo * 3 - 2
|
||||||
return (GetValueofElement(id, Loadcase, ValueType, panel) + GetValueofElement(id+1, Loadcase, ValueType, panel) + GetValueofElement(id+2, Loadcase, ValueType, panel))/(3*1.5)
|
return (GetValueofElement(id, Loadcase, ValueType, panel) + GetValueofElement(id+1, Loadcase, ValueType, panel) + GetValueofElement(id+2, Loadcase, ValueType, panel))/(3*1.5)
|
||||||
|
|
||||||
|
|
||||||
def GetCombAvgStressofStringer(stringerNo, Loadcase):
|
def GetCombAvgStressofStringer(stringerNo, Loadcase):
|
||||||
id = stringerNo * 3 - 3 + 40
|
id = stringerNo * 3 - 3 + 40
|
||||||
avgStringerStress = (GetValueofElement(id, Loadcase, axial, stringer) + GetValueofElement(id+1, Loadcase, axial, stringer) + GetValueofElement(id+2, Loadcase, axial, stringer))/(3*1.5)
|
avgStringerStress = (GetValueofElement(id, Loadcase, axial, stringer) + GetValueofElement(id+1, Loadcase, axial, stringer) + GetValueofElement(id+2, Loadcase, axial, stringer))/(3*1.5)
|
||||||
leftPID = stringerNo
|
leftPID = stringerNo
|
||||||
rightPID = stringerNo + 1
|
rightPID = stringerNo + 1
|
||||||
leftPStress = GetAvgStressofPanel(leftPID, Loadcase, 'XX')
|
leftPStress = GetAvgStressofPanel(leftPID, Loadcase, 'XX')
|
||||||
rightPStress = GetAvgStressofPanel(rightPID, Loadcase, 'XX')
|
rightPStress = GetAvgStressofPanel(rightPID, Loadcase, 'XX')
|
||||||
return((leftPStress * 0.5 * pThickness[stringerNo - 1] * pWidth + rightPStress * 0.5 * pThickness[stringerNo]*pWidth + avgStringerStress * areaStringer) / (areaStringer + 0.5*pThickness[stringerNo-1] * pWidth + 0.5 * pThickness[stringerNo]*pWidth))
|
return((leftPStress * 0.5 * pThickness[stringerNo - 1] * pWidth + rightPStress * 0.5 * pThickness[stringerNo]*pWidth + avgStringerStress * areaStringer) / (areaStringer + 0.5*pThickness[stringerNo-1] * pWidth + 0.5 * pThickness[stringerNo]*pWidth))
|
||||||
|
|
||||||
def GetAlpha(x):
|
|
||||||
if(0.4 <= x <= 1.095):
|
def GetSigCrip(stringerNo, Loadcase): ## unfinished, need to understand x claulcation still a bit
|
||||||
alpha = 1.4 - 0.628 * x
|
x = (dim1/dim2)*math.sqrt(sYield/(3.60*Ebasis))
|
||||||
elif(1.095 < x <= 1.633):
|
|
||||||
alpha = 0.78/x
|
if(0.4 <= x <= 1.095):
|
||||||
elif(x > 1.633):
|
alpha = 1.4 - 0.628 * x
|
||||||
alpha = 0.69/(x**0.75)
|
elif(1.095 < x <= 1.633):
|
||||||
else:
|
alpha = 0.78/x
|
||||||
alpha = 0
|
elif(x > 1.633):
|
||||||
return(alpha)
|
alpha = 0.69/(x**0.75)
|
||||||
|
else:
|
||||||
def GetSigCrip(stringerNo, Loadcase): ## unfinished, need to understand x claulcation still a bit
|
alpha = 1
|
||||||
#use b1 and b2 for calc
|
|
||||||
#E_c = Ebasis
|
|
||||||
#no alpha = 1 it is none -> what do then? -> ignore that element in averaging
|
sigCrip12 = alpha * sYield
|
||||||
#averaging only with elements that cripple
|
|
||||||
#if nothing cripples, use yield strength
|
x = (dim4/dim2)*math.sqrt(sYield/(3.60*Ebasis))
|
||||||
b1 = dim1 - dim2
|
|
||||||
b2 = dim3 - dim2
|
if(0.4 <= x <= 1.095):
|
||||||
|
alpha = 1.4 - 0.628 * x
|
||||||
x1 = (b1/dim2)*math.sqrt(sYield/(3.60*Ebasis))
|
elif(1.095 < x <= 1.633):
|
||||||
|
alpha = 0.78/x
|
||||||
alpha1 = GetAlpha(x1)
|
elif(x > 1.633):
|
||||||
|
alpha = 0.69/(x**0.75)
|
||||||
#print("x12: " + str(x))
|
else:
|
||||||
sigCrip1 = alpha1 * sYield
|
alpha = 1
|
||||||
|
|
||||||
x2 = (b2/dim2)*math.sqrt(sYield/(3.60*Ebasis))
|
|
||||||
|
sigCrip24 = alpha * sYield
|
||||||
alpha2 = GetAlpha(x2)
|
|
||||||
|
x = (dim3/dim2)*math.sqrt(sYield/(3.60*Ebasis))
|
||||||
sigCrip2 = alpha2 * sYield
|
|
||||||
|
if(0.4 <= x <= 1.095):
|
||||||
if(alpha1 != 0 and alpha2 != 0):
|
alpha = 1.4 - 0.628 * x
|
||||||
sigCripAVG = (sigCrip1 * b1 * dim2 + sigCrip2 * b2 * dim2 * 2)/(b1 * dim2 + b2 * dim2 * 2)
|
elif(1.095 < x <= 1.633):
|
||||||
elif(alpha1 != 0):
|
alpha = 0.78/x
|
||||||
sigCripAVG = (sigCrip1 * b1 * dim2)/(b1 * dim2)
|
elif(x > 1.633):
|
||||||
elif(alpha2 != 0):
|
alpha = 0.69/(x**0.75)
|
||||||
sigCripAVG = (sigCrip2 * b2 * dim2)/(b2 * dim2)
|
else:
|
||||||
else:
|
alpha = 1
|
||||||
sigCripAVG = sYield
|
|
||||||
|
sigCrip23 = alpha * sYield
|
||||||
# average only over what can buckle!!! F/A, A = sumOf(bi*ti)
|
# i know this is inefficient and shittily as hell!! its quick and dirty tho
|
||||||
return min(sigCripAVG, sYield)
|
# TODO: FIX!!
|
||||||
|
sigCripAVG = (sigCrip12 * dim1 * dim2 + sigCrip23 * dim2 * dim3 + sigCrip24 * dim2 * dim4)/(dim1 * dim2 + dim2 * dim3 + dim2 * dim4)
|
||||||
|
|
||||||
def kBiax(panelNo,Loadcase):
|
if(sigCripAVG < sYield):
|
||||||
beta = GetAvgStressofPanel(panelNo, Loadcase, 'YY')/GetAvgStressofPanel(panelNo, Loadcase, 'XX')
|
return sigCripAVG
|
||||||
kSigX = 100000000
|
else:
|
||||||
for m in range(1, 10):
|
return sYield
|
||||||
for n in range(1, 100):
|
|
||||||
kTemp = (m*m+n*n*alpha*alpha)*(m*m+n*n*alpha*alpha)/(alpha*alpha*(m*m+beta*n*n*alpha*alpha))
|
|
||||||
if(0 < kTemp < kSigX):
|
def kBiax(panelNo,Loadcase):
|
||||||
kSigX = kTemp
|
beta = GetAvgStressofPanel(panelNo, Loadcase, 'YY')/GetAvgStressofPanel(panelNo, Loadcase, 'XX')
|
||||||
return(kSigX)
|
kSigX = 100000000
|
||||||
|
for m in range(1, 10):
|
||||||
|
for n in range(1, 100):
|
||||||
def RF_panel(panelNo, Loadcase):
|
kTemp = (m*m+n*n*alpha*alpha)*(m*m+n*n*alpha*alpha)/(alpha*alpha*(m*m+beta*n*n*alpha*alpha))
|
||||||
sE = ((pThickness[panelNo-1]/pWidth)**2) * Ebasis * math.pi * math.pi / (12*(1-(0.34*0.34)))
|
if(0 < kTemp < kSigX):
|
||||||
#print(sE)
|
kSigX = kTemp
|
||||||
rfBiax = (kBiax(panelNo, Loadcase)*sE)/abs(1.5*GetAvgStressofPanel(panelNo, Loadcase, 'XX'))
|
return(kSigX)
|
||||||
rfShear = (kShear*sE)/abs(1.5*GetAvgStressofPanel(panelNo, Loadcase, 'XY'))
|
|
||||||
result = 1 / ( (1 / rfBiax) + (1 / (rfShear*rfShear)))
|
|
||||||
#print(rfBiax)
|
def RF_panel(panelNo, Loadcase):
|
||||||
#print(rfShear)
|
sE = ((pThickness[panelNo-1]/pWidth)**2) * Ebasis * math.pi * math.pi / (12*(1-(0.34*0.34)))
|
||||||
return(result)
|
#print(sE)
|
||||||
|
rfBiax = (kBiax(panelNo, Loadcase)*sE)/abs(1.5*GetAvgStressofPanel(panelNo, Loadcase, 'XX'))
|
||||||
|
rfShear = (kShear*sE)/abs(1.5*GetAvgStressofPanel(panelNo, Loadcase, 'XY'))
|
||||||
def GetLambda(i): # checked and correct
|
result = 1 / ( (1 / rfBiax) + (1 / (rfShear*rfShear)))
|
||||||
I_comb = GetIcomb(i)
|
#print(rfBiax)
|
||||||
r_gyr = math.sqrt(I_comb/(areaStringer + 0.5 * pThickness[i] * pWidth + 0.5 * pThickness[i+1] * pWidth))
|
#print(rfShear)
|
||||||
c = 1
|
return(result)
|
||||||
sLambda = c*pLength/r_gyr
|
|
||||||
return(sLambda)
|
|
||||||
|
def GetLambda(stringerNo):
|
||||||
|
I_comb = GetIcomb(i)
|
||||||
def GetSigCRIT(stringerNo, Loadcase):
|
r_gyr = math.sqrt(I_comb/(areaStringer + 0.5 * pThickness[i] * pWidth + 0.5 * pThickness[i+1] * pWidth))
|
||||||
sLambda_crit = math.sqrt((2*math.pi*math.pi*Ebasis)/GetSigCrip(stringerNo,Loadcase))
|
c = 1
|
||||||
# Lambda_crit correct
|
return(1*pLength/r_gyr)
|
||||||
hSigCrip = GetSigCrip(stringerNo, Loadcase)
|
|
||||||
# SigCrip correct!!
|
|
||||||
hLambda = GetLambda(stringerNo-1)
|
def GetSigCRIT(stringerNo, Loadcase):
|
||||||
#print("Lmabda: " + str(hLambda))
|
sLambda_crit = math.sqrt((2*math.pi*math.pi*Ebasis)/GetSigCrip(i,0))
|
||||||
# ISSUE HERE - Lambda off from results
|
if(GetLambda(stringerNo)<sLambda_crit):
|
||||||
# no double checking now
|
return(GetSigCrip(stringerNo, Loadcase) - ((1/Ebasis)*((GetSigCrip(stringerNo, Loadcase)/(2*math.pi))**2)*(GetLambda(stringerNo)**2)))
|
||||||
|
else:
|
||||||
if(hLambda<sLambda_crit):
|
return((math.pi**2)*Ebasis / (GetLambda(stringerNo) ** 2))
|
||||||
return(hSigCrip - ((1/Ebasis)*((hSigCrip/(2*math.pi))**2)*(hLambda**2)))
|
|
||||||
else:
|
|
||||||
return((math.pi**2)*Ebasis / (hLambda ** 2))
|
def GetRFstringer(stringerNo, Loadcase):
|
||||||
|
return(abs(GetSigCRIT(stringerNo, Loadcase)/(1.5*GetCombAvgStressofStringer(stringerNo, Loadcase))))
|
||||||
|
|
||||||
def GetRFstringer(stringerNo, Loadcase):
|
def GetCrosssectionValues(i):
|
||||||
return(abs(GetSigCRIT(stringerNo, Loadcase)/(1.5*GetCombAvgStressofStringer(stringerNo, Loadcase))))
|
I_comb = GetIcomb(i)
|
||||||
|
r_gyr = math.sqrt(I_comb/(areaStringer + 0.5 * pThickness[i] * pWidth + 0.5 * pThickness[i+1] * pWidth))
|
||||||
def GetCrosssectionValues(i):
|
c = 1
|
||||||
I_comb = GetIcomb(i)
|
sLambda = c*pLength/r_gyr
|
||||||
r_gyr = math.sqrt(I_comb/(areaStringer + 0.5 * pThickness[i] * pWidth + 0.5 * pThickness[i+1] * pWidth))
|
sLambda_crit = math.sqrt((2*math.pi*math.pi*Ebasis)/GetSigCrip(i, 0)) # IMPORTANT THIS IS ONLY FOR S crip above 490
|
||||||
c = 1
|
return(str(I_comb) + "," + str(r_gyr) + "," + str(sLambda) + "," + str(sLambda_crit))
|
||||||
sLambda = c*pLength/r_gyr
|
|
||||||
sLambda_crit = math.sqrt((2*math.pi*math.pi*Ebasis)/GetSigCrip(i, 0)) # IMPORTANT THIS IS ONLY FOR S crip above 490
|
|
||||||
return(str(I_comb) + "," + str(r_gyr) + "," + str(sLambda) + "," + str(sLambda_crit))
|
def GetIcomb(i):
|
||||||
|
wing_1_w = pWidth/2
|
||||||
|
wing_2_w = pWidth/2
|
||||||
def GetIcomb(i):
|
|
||||||
wing_1_w = pWidth/2
|
wing_1_t = pThickness[i]
|
||||||
wing_2_w = pWidth/2
|
wing_2_t = pThickness[i+1]
|
||||||
|
|
||||||
wing_1_t = pThickness[i]
|
|
||||||
wing_2_t = pThickness[i+1]
|
z1 = -dim1/2
|
||||||
|
z3 = -(dim1-(dim2/2))
|
||||||
|
z4 = -dim2/2
|
||||||
z1 = -dim1/2
|
|
||||||
z3 = -(dim1-(dim2/2))
|
y1 = ((dim3/2)-(dim2/2))
|
||||||
z4 = -dim2/2
|
y3 = 0
|
||||||
|
y4 = dim3+(dim4/2)
|
||||||
y1 = ((dim3/2)-(dim2/2))
|
|
||||||
y3 = 0
|
zw_1 = wing_1_t/2
|
||||||
y4 = dim3+(dim4/2)
|
zw_2 = wing_2_t/2
|
||||||
|
|
||||||
zw_1 = wing_1_t/2
|
yw_1 = 50
|
||||||
zw_2 = wing_2_t/2
|
yw_2 = -50
|
||||||
|
|
||||||
yw_1 = 50
|
|
||||||
yw_2 = -50
|
a1 = dim1*dim2
|
||||||
|
a3 = dim2*(dim3-dim2-dim2)
|
||||||
|
a4 = dim4*dim2
|
||||||
a1 = dim1*dim2
|
|
||||||
a3 = dim2*(dim3-dim2-dim2)
|
aw_1 = wing_1_w * wing_1_t
|
||||||
a4 = dim4*dim2
|
aw_2 = wing_2_t * wing_2_w
|
||||||
|
|
||||||
aw_1 = wing_1_w * wing_1_t
|
Iyy1 = (dim2*(dim1**3))/12
|
||||||
aw_2 = wing_2_t * wing_2_w
|
Izz1 = (dim1*(dim2**3))/12
|
||||||
|
|
||||||
Iyy1 = (dim2*(dim1**3))/12
|
Iyy3 = ((dim3-dim2-dim2)*(dim2**3))/12
|
||||||
Izz1 = (dim1*(dim2**3))/12
|
Izz3 = (((dim3-dim2-dim2)**3)*(dim2))/12
|
||||||
|
|
||||||
Iyy3 = ((dim3-dim2-dim2)*(dim2**3))/12
|
Iyy4 = (dim4*(dim2**3))/12
|
||||||
Izz3 = (((dim3-dim2-dim2)**3)*(dim2))/12
|
Izz4 = (dim2*(dim4**3))/12
|
||||||
|
|
||||||
Iyy4 = (dim4*(dim2**3))/12
|
Iw_1_yy = (wing_1_w*(wing_1_t**3))/12
|
||||||
Izz4 = (dim2*(dim4**3))/12
|
Iw_1_zz = (wing_1_t*(wing_1_w**3))/12
|
||||||
|
|
||||||
Iw_1_yy = (wing_1_w*(wing_1_t**3))/12
|
Iw_2_yy = (wing_2_w*(wing_2_t**3))/12
|
||||||
Iw_1_zz = (wing_1_t*(wing_1_w**3))/12
|
Iw_2_zz = (wing_2_t*(wing_2_w**3))/12
|
||||||
|
|
||||||
Iw_2_yy = (wing_2_w*(wing_2_t**3))/12
|
|
||||||
Iw_2_zz = (wing_2_t*(wing_2_w**3))/12
|
z_c = (z1*a1+z1*a1+z3*a3+z4*a4+z4*a4+zw_1*aw_1+zw_1*aw_2)/(a1+a1+a3+a4+a4+aw_1+aw_2)
|
||||||
|
y_c = (-y1*a1+y1*a1+y3*a3+(-y4*a4)+y4*a4+yw_1*aw_1+yw_2*aw_2)/(a1+a1+a3+a4+a4+aw_1+aw_2)
|
||||||
|
|
||||||
z_c = (z1*a1+z1*a1+z3*a3+z4*a4+z4*a4+zw_1*aw_1+zw_1*aw_2)/(a1+a1+a3+a4+a4+aw_1+aw_2)
|
Iyy = (Iyy1+((z1-z_c)**2)*a1)+(Iyy1+((z1-z_c)**2)*a1)+(Iyy3+((z3-z_c)**2)*a3)+(Iyy4+((z4-z_c)**2)*a4)+(Iyy4+((z4-z_c)**2)*a4)+(Iw_1_yy+((zw_1-z_c)**2)*aw_1)+(Iw_2_yy+((zw_2-z_c)**2)*aw_2)
|
||||||
y_c = (-y1*a1+y1*a1+y3*a3+(-y4*a4)+y4*a4+yw_1*aw_1+yw_2*aw_2)/(a1+a1+a3+a4+a4+aw_1+aw_2)
|
Izz = (Izz1+((y1-y_c)**2)*a1)+(Izz1+((-y1-y_c)**2)*a1)+(Izz3+((y3-y_c)**2)*a3)+(Izz4+((y4-y_c)**2)*a4)+(Izz4+((-y4-y_c)**2)*a4)+(Iw_1_zz+((yw_1-y_c)**2)*aw_1)+(Iw_2_zz+((yw_2-y_c)**2)*aw_2)
|
||||||
|
|
||||||
Iyy = (Iyy1+((z1-z_c)**2)*a1)+(Iyy1+((z1-z_c)**2)*a1)+(Iyy3+((z3-z_c)**2)*a3)+(Iyy4+((z4-z_c)**2)*a4)+(Iyy4+((z4-z_c)**2)*a4)+(Iw_1_yy+((zw_1-z_c)**2)*aw_1)+(Iw_2_yy+((zw_2-z_c)**2)*aw_2)
|
|
||||||
Izz = (Izz1+((y1-y_c)**2)*a1)+(Izz1+((-y1-y_c)**2)*a1)+(Izz3+((y3-y_c)**2)*a3)+(Izz4+((y4-y_c)**2)*a4)+(Izz4+((-y4-y_c)**2)*a4)+(Iw_1_zz+((yw_1-y_c)**2)*aw_1)+(Iw_2_zz+((yw_2-y_c)**2)*aw_2)
|
if(Iyy > Izz):
|
||||||
|
return(Izz)
|
||||||
|
else:
|
||||||
if(Iyy > Izz):
|
return(Iyy)
|
||||||
return(Izz)
|
|
||||||
else:
|
|
||||||
return(Iyy)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
for u in range(modAmount):
|
||||||
|
isWithinRF = 1
|
||||||
|
|
||||||
for u in range(modAmount):
|
panel = 'panel_val_' + str(u) +'.csv'
|
||||||
isWithinRF = 1
|
stringer = 'stringer_val_' + str(u) + '.csv'
|
||||||
|
|
||||||
panel = 'panel_val_' + str(u) +'.csv'
|
# dimensions
|
||||||
stringer = 'stringer_val_' + str(u) + '.csv'
|
pThickness = [pThickness_01[u], pThickness_02[u], pThickness_03[u], pThickness_04[u], pThickness_05[u], pThickness_05[u], pThickness_04[u], pThickness_03[u], pThickness_02[u], pThickness_01[u]]
|
||||||
|
pWidth = pWidth_0[u]
|
||||||
# dimensions
|
pLength = pLength_0[u]
|
||||||
pThickness = [pThickness_01[u], pThickness_02[u], pThickness_03[u], pThickness_04[u], pThickness_05[u], pThickness_05[u], pThickness_04[u], pThickness_03[u], pThickness_02[u], pThickness_01[u]]
|
|
||||||
pWidth = pWidth_0[u]
|
dim1 = dim1_0[u]
|
||||||
pLength = pLength_0[u]
|
dim2 = dim2_0[u]
|
||||||
|
dim3 = dim3_0[u]
|
||||||
dim1 = dim1_0[u]
|
dim4 = dim4_0[u]
|
||||||
dim2 = dim2_0[u]
|
|
||||||
dim3 = dim3_0[u]
|
areaStringer = dim4 * dim2 * 2 + (dim1 - dim2) * dim2 * 2 + dim3 * dim2
|
||||||
dim4 = dim4_0[u]
|
|
||||||
|
print("\n\n" + Back.CYAN + "Calculations for iteration " + str(u) + Style.RESET_ALL)
|
||||||
areaStringer = dim4 * dim2 * 2 + (dim1 - dim2) * dim2 * 2 + dim3 * dim2
|
print("\n Panel Thickness 1 & 10: " + str(pThickness[0]) + "\n Panel Thickness 2 & 9: " + str(pThickness[1]) + "\n Panel Thickness 3 & 8: " + str(pThickness[2]) + "\n Panel Thickness 4 & 7: " + str(pThickness[3]) + "\n Panel Thickness 5 & 6: " + str(pThickness[4]) + "\n Panel Width: " + str(pWidth) + "\n Panel Length: " + str(pLength) + "\n\n Dim 1: " + str(dim1) + "\n Dim2: " + str(dim2) + "\n Dim 3: "+ str(dim3) + "\n Dim 4: "+ str(dim4))
|
||||||
|
|
||||||
print("\n\n" + Back.CYAN + "Calculations for iteration " + str(u) + Style.RESET_ALL)
|
#print("\n Panel Offset: " + str(pThickness/2) + "\n Stringer Offset: " + str(dim1/2))
|
||||||
print("\n Panel Thickness 1 & 10: " + str(pThickness[0]) + "\n Panel Thickness 2 & 9: " + str(pThickness[1]) + "\n Panel Thickness 3 & 8: " + str(pThickness[2]) + "\n Panel Thickness 4 & 7: " + str(pThickness[3]) + "\n Panel Thickness 5 & 6: " + str(pThickness[4]) + "\n Panel Width: " + str(pWidth) + "\n Panel Length: " + str(pLength) + "\n\n Dim 1: " + str(dim1) + "\n Dim2: " + str(dim2) + "\n Dim 3: "+ str(dim3) + "\n Dim 4: "+ str(dim4))
|
|
||||||
|
mass = density*(areaStringer*pLength*9) # + 10*pWidth*pThickness*pLength)
|
||||||
#print("\n Panel Offset: " + str(pThickness/2) + "\n Stringer Offset: " + str(dim1/2))
|
for i in range(10):
|
||||||
|
mass = mass + pWidth*pThickness[i]*density*pLength
|
||||||
mass = density*(areaStringer*pLength*9) # + 10*pWidth*pThickness*pLength)
|
if(mass<mass_limit):
|
||||||
for i in range(10):
|
print("\n\n Mass: " + Back.GREEN + str(mass) + Style.RESET_ALL)
|
||||||
mass = mass + pWidth*pThickness[i]*density*pLength
|
else:
|
||||||
if(mass<mass_limit):
|
print("\n\n Mass: " + Back.RED + str(mass) + Style.RESET_ALL)
|
||||||
print("\n\n Mass: " + Back.GREEN + str(mass) + Style.RESET_ALL)
|
isWithinRF = 0
|
||||||
else:
|
|
||||||
print("\n\n Mass: " + Back.RED + str(mass) + Style.RESET_ALL)
|
# REMEMBER SAFETY FACTOR OF 1.5 ALREADY INCLUDED
|
||||||
isWithinRF = 0
|
# RF calculator for panels
|
||||||
|
for c in range(1,4):
|
||||||
# REMEMBER SAFETY FACTOR OF 1.5 ALREADY INCLUDED
|
print("\nPanel RF for loadcase " + str(c))
|
||||||
# RF calculator for panels
|
for i in range(1, 31):
|
||||||
for c in range(1,4):
|
w = sUlt/GetValueofElement(i,c,'vonMises',panel)
|
||||||
print("\nPanel RF for loadcase " + str(c))
|
if(w>1):
|
||||||
for i in range(1, 31):
|
print(Back.GREEN + str(w) + Style.RESET_ALL)
|
||||||
w = sUlt/GetValueofElement(i,c,'vonMises',panel)
|
else:
|
||||||
if(w>1):
|
print(Back.RED + str(w) + Style.RESET_ALL)
|
||||||
print(Back.GREEN + str(w) + Style.RESET_ALL)
|
isWithinRF = 0
|
||||||
else:
|
|
||||||
print(Back.RED + str(w) + Style.RESET_ALL)
|
print(" ")
|
||||||
isWithinRF = 0
|
# RF calculator for stringers
|
||||||
|
for c in range(1,4):
|
||||||
print(" ")
|
print("\nStringer RF for loadcase " + str(c))
|
||||||
# RF calculator for stringers
|
for i in range(40,67):
|
||||||
for c in range(1,4):
|
w = abs(sUlt/GetValueofElement(i,c,axial,stringer))
|
||||||
print("\nStringer RF for loadcase " + str(c))
|
if(w>1):
|
||||||
for i in range(40,67):
|
print(Back.GREEN + str(w) + Style.RESET_ALL)
|
||||||
w = abs(sUlt/GetValueofElement(i,c,axial,stringer))
|
else:
|
||||||
if(w>1):
|
print(Back.RED + str(w) + Style.RESET_ALL)
|
||||||
print(Back.GREEN + str(w) + Style.RESET_ALL)
|
isWithinRF = 0
|
||||||
else:
|
|
||||||
print(Back.RED + str(w) + Style.RESET_ALL)
|
# Stability Analysis
|
||||||
isWithinRF = 0
|
print("\n\nStability Analysis\nPanel buckling")
|
||||||
|
# Panel buckling
|
||||||
# Stability Analysis
|
# sig_aa,avg calculator
|
||||||
print("\n\nStability Analysis\nPanel buckling")
|
alpha = pLength/pWidth
|
||||||
# Panel buckling
|
kShear = 5.34 + 4/(alpha*alpha)
|
||||||
# sig_aa,avg calculator
|
for c in range(1,4):
|
||||||
alpha = pLength/pWidth
|
print("\nLoadcase " + str(c) + "\nAverage stress for panels 1 to 5 - XX, YY, XY - k_shear, k_biax, RF_panelbuckl")
|
||||||
kShear = 5.34 + 4/(alpha*alpha)
|
for i in range(1,6):
|
||||||
for c in range(1,4):
|
w = RF_panel(i,c)
|
||||||
print("\nLoadcase " + str(c) + "\nAverage stress for panels 1 to 5 - XX, YY, XY - k_shear, k_biax, RF_panelbuckl")
|
if(w>1):
|
||||||
for i in range(1,6):
|
w = Back.GREEN + str(w) + Style.RESET_ALL
|
||||||
w = RF_panel(i,c)
|
else:
|
||||||
if(w>1):
|
w = Back.RED + str(w) + Style.RESET_ALL
|
||||||
w = Back.GREEN + str(w) + Style.RESET_ALL
|
isWithinRF = 0
|
||||||
else:
|
|
||||||
w = Back.RED + str(w) + Style.RESET_ALL
|
print(str(GetAvgStressofPanel(i, c, 'XX')) + "," + str(GetAvgStressofPanel(i, c, 'YY')) + "," + str(GetAvgStressofPanel(i, c, 'XY')) + "," + str(kShear) + "," + str(kBiax(i, c)) + "," + str(w))
|
||||||
isWithinRF = 0
|
|
||||||
|
# Stringer buckling
|
||||||
print(str(GetAvgStressofPanel(i, c, 'XX')) + "," + str(GetAvgStressofPanel(i, c, 'YY')) + "," + str(GetAvgStressofPanel(i, c, 'XY')) + "," + str(kShear) + "," + str(kBiax(i, c)) + "," + str(w))
|
print("\n\nStringer buckling")
|
||||||
|
for c in range(1,4):
|
||||||
# Stringer buckling
|
print("\nLoadcase " + str(c) + "\nCombined, average axial stress for stringers 1 to 5")
|
||||||
print("\n\nStringer buckling")
|
for i in range(1,6):
|
||||||
for c in range(1,4):
|
w = GetRFstringer(i,c)
|
||||||
print("\nLoadcase " + str(c) + "\nCombined, average axial stress for stringers 1 to 5")
|
if(w>1):
|
||||||
for i in range(1,6):
|
w = Back.GREEN + str(w) + Style.RESET_ALL
|
||||||
w = GetRFstringer(i,c)
|
else:
|
||||||
if(w>1):
|
w = Back.RED + str(w) + Style.RESET_ALL
|
||||||
w = Back.GREEN + str(w) + Style.RESET_ALL
|
isWithinRF = 0
|
||||||
else:
|
|
||||||
w = Back.RED + str(w) + Style.RESET_ALL
|
|
||||||
isWithinRF = 0
|
print(str(GetCombAvgStressofStringer(i,c)) + "," + str(GetSigCrip(i, c)) + "," + str(w)) # no longer slightly off, RF stringer calc still wrong?
|
||||||
|
|
||||||
|
# combined crosssection properties for combined buckling mode
|
||||||
print(str(GetCombAvgStressofStringer(i,c)) + "," + str(GetSigCrip(i, c)) + "," + str(w)) # no longer slightly off, RF stringer calc still wrong?
|
print("\n\nCombined crosssection properties for combined buckling")
|
||||||
|
for i in range(5):
|
||||||
# combined crosssection properties for combined buckling mode
|
print(GetCrosssectionValues(i))
|
||||||
print("\n\nCombined crosssection properties for combined buckling")
|
|
||||||
for i in range(5):
|
if(isWithinRF == 1):
|
||||||
print(GetCrosssectionValues(i))
|
print("\n\n" + Back.GREEN + str(u) + " WORKS!" + Style.RESET_ALL)
|
||||||
|
else:
|
||||||
if(isWithinRF == 1):
|
print("\n\n" + Back.RED + str(u) + " FAILURE!" + Style.RESET_ALL)
|
||||||
print("\n\n" + Back.GREEN + str(u) + " WORKS!" + Style.RESET_ALL)
|
|
||||||
else:
|
#print(GetIcomb())
|
||||||
print("\n\n" + Back.RED + str(u) + " FAILURE!" + Style.RESET_ALL)
|
|
||||||
|
|
||||||
#print(GetIcomb())
|
## OVERVIEW OF TODO:
|
||||||
|
|
||||||
|
|
||||||
## OVERVIEW OF TODO:
|
|
||||||
# - improve some sections of code with TODO
|
# - improve some sections of code with TODO
|
||||||
|
|
@ -1,21 +1,10 @@
|
||||||
# ASE Redesign Calculator
|
# ASE Redesign Calculator
|
||||||
|
|
||||||
**Important:**
|
|
||||||
|
|
||||||
Version was updated --- new release. There might be issues with the RF of the column buckling. I am unsure at this exact moment.
|
|
||||||
|
|
||||||
Nothing regarding the procedure has changed.
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
This redesign calculator requires manual input in Hyperworks, but returns the values needed for the final results csv file.
|
This redesign calculator requires manual input in Hyperworks, but returns the values needed for the final results csv file.
|
||||||
It can calculate several results at the same time which I found helpful for comparing and analysing.
|
It can calculate several results at the same time which I found helpful for comparing and analysing.
|
||||||
It has the following limitations:
|
It has the following limitations:
|
||||||
1. All stringers have to have the same dimensions (panel thickness may vary tho)
|
1. All stringers have to have the same dimensions (panel thickness may vary tho)
|
||||||
2. Dimensions must be inputted into Python as well as Hyperworks
|
2. Dimensions must be inputted into Python as well as Hyperworks
|
||||||
|
|
||||||
[Releases here](https://git.zoerdu.net/Sasha/uni/releases)
|
|
||||||
|
|
||||||
## Quick rundown
|
## Quick rundown
|
||||||
1. Modify the dimensions of the stringers and panels in the *.hm* and *aseredesign.py* file
|
1. Modify the dimensions of the stringers and panels in the *.hm* and *aseredesign.py* file
|
||||||
2. Run the simulation
|
2. Run the simulation
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,2 @@
|
||||||
# Uni stuff
|
# Uni stuff
|
||||||
[aseredesign](https://git.zoerdu.net/Sasha/uni/src/branch/main/aseredesign)
|
[aseredesign](https://git.zoerdu.net/Sasha/uni/aseredesign)
|
||||||
Loading…
Add table
Reference in a new issue