Compare commits

..

7 commits

Author SHA1 Message Date
2aa8abc1fb fixed indeces of stringers 2025-07-03 19:05:38 +01:00
8a58c99694 Update aseredesign/readme.md 2025-07-02 20:33:18 +01:00
7a56d6792f Update aseredesign/readme.md 2025-07-02 20:31:21 +01:00
0b84e1024c fixed column buckling hopefully
hello everynyan
i hope this fixed the issues, i am worried there might be issues with the RF calculation for the column buckling due to what I got on the feedback, but ill see tomorrow (I am hoping its just a fluke rn)
2025-07-02 20:30:17 +01:00
c1cec3cf6f Update aseredesign/readme.md 2025-07-02 12:51:23 +01:00
ed74f3f98e Update aseredesign/readme.md 2025-06-26 14:28:24 +01:00
a76b423689 Update readme.md 2025-06-26 14:26:51 +01:00
3 changed files with 364 additions and 350 deletions

View file

@ -1,350 +1,353 @@
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):
def GetSigCrip(stringerNo, Loadcase): ## unfinished, need to understand x claulcation still a bit if(0.4 <= x <= 1.095):
x = (dim1/dim2)*math.sqrt(sYield/(3.60*Ebasis)) alpha = 1.4 - 0.628 * x
elif(1.095 < x <= 1.633):
if(0.4 <= x <= 1.095): alpha = 0.78/x
alpha = 1.4 - 0.628 * x elif(x > 1.633):
elif(1.095 < x <= 1.633): alpha = 0.69/(x**0.75)
alpha = 0.78/x else:
elif(x > 1.633): alpha = 0
alpha = 0.69/(x**0.75) return(alpha)
else:
alpha = 1 def GetSigCrip(stringerNo, Loadcase): ## unfinished, need to understand x claulcation still a bit
#use b1 and b2 for calc
#E_c = Ebasis
sigCrip12 = alpha * sYield #no alpha = 1 it is none -> what do then? -> ignore that element in averaging
#averaging only with elements that cripple
x = (dim4/dim2)*math.sqrt(sYield/(3.60*Ebasis)) #if nothing cripples, use yield strength
b1 = dim1 - dim2
if(0.4 <= x <= 1.095): b2 = dim3 - dim2
alpha = 1.4 - 0.628 * x
elif(1.095 < x <= 1.633): x1 = (b1/dim2)*math.sqrt(sYield/(3.60*Ebasis))
alpha = 0.78/x
elif(x > 1.633): alpha1 = GetAlpha(x1)
alpha = 0.69/(x**0.75)
else: #print("x12: " + str(x))
alpha = 1 sigCrip1 = alpha1 * sYield
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):
alpha = 1.4 - 0.628 * x if(alpha1 != 0 and alpha2 != 0):
elif(1.095 < x <= 1.633): sigCripAVG = (sigCrip1 * b1 * dim2 + sigCrip2 * b2 * dim2 * 2)/(b1 * dim2 + b2 * dim2 * 2)
alpha = 0.78/x elif(alpha1 != 0):
elif(x > 1.633): sigCripAVG = (sigCrip1 * b1 * dim2)/(b1 * dim2)
alpha = 0.69/(x**0.75) elif(alpha2 != 0):
else: sigCripAVG = (sigCrip2 * b2 * dim2)/(b2 * dim2)
alpha = 1 else:
sigCripAVG = sYield
sigCrip23 = alpha * sYield
# i know this is inefficient and shittily as hell!! its quick and dirty tho # average only over what can buckle!!! F/A, A = sumOf(bi*ti)
# TODO: FIX!! return min(sigCripAVG, sYield)
sigCripAVG = (sigCrip12 * dim1 * dim2 + sigCrip23 * dim2 * dim3 + sigCrip24 * dim2 * dim4)/(dim1 * dim2 + dim2 * dim3 + dim2 * dim4)
if(sigCripAVG < sYield): def kBiax(panelNo,Loadcase):
return sigCripAVG beta = GetAvgStressofPanel(panelNo, Loadcase, 'YY')/GetAvgStressofPanel(panelNo, Loadcase, 'XX')
else: kSigX = 100000000
return sYield for m in range(1, 10):
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))
def kBiax(panelNo,Loadcase): if(0 < kTemp < kSigX):
beta = GetAvgStressofPanel(panelNo, Loadcase, 'YY')/GetAvgStressofPanel(panelNo, Loadcase, 'XX') kSigX = kTemp
kSigX = 100000000 return(kSigX)
for m in range(1, 10):
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)) def RF_panel(panelNo, Loadcase):
if(0 < kTemp < kSigX): sE = ((pThickness[panelNo-1]/pWidth)**2) * Ebasis * math.pi * math.pi / (12*(1-(0.34*0.34)))
kSigX = kTemp #print(sE)
return(kSigX) rfBiax = (kBiax(panelNo, Loadcase)*sE)/abs(1.5*GetAvgStressofPanel(panelNo, Loadcase, 'XX'))
rfShear = (kShear*sE)/abs(1.5*GetAvgStressofPanel(panelNo, Loadcase, 'XY'))
result = 1 / ( (1 / rfBiax) + (1 / (rfShear*rfShear)))
def RF_panel(panelNo, Loadcase): #print(rfBiax)
sE = ((pThickness[panelNo-1]/pWidth)**2) * Ebasis * math.pi * math.pi / (12*(1-(0.34*0.34))) #print(rfShear)
#print(sE) return(result)
rfBiax = (kBiax(panelNo, Loadcase)*sE)/abs(1.5*GetAvgStressofPanel(panelNo, Loadcase, 'XX'))
rfShear = (kShear*sE)/abs(1.5*GetAvgStressofPanel(panelNo, Loadcase, 'XY'))
result = 1 / ( (1 / rfBiax) + (1 / (rfShear*rfShear))) def GetLambda(i): # checked and correct
#print(rfBiax) I_comb = GetIcomb(i)
#print(rfShear) r_gyr = math.sqrt(I_comb/(areaStringer + 0.5 * pThickness[i] * pWidth + 0.5 * pThickness[i+1] * pWidth))
return(result) c = 1
sLambda = c*pLength/r_gyr
return(sLambda)
def GetLambda(stringerNo):
I_comb = GetIcomb(i)
r_gyr = math.sqrt(I_comb/(areaStringer + 0.5 * pThickness[i] * pWidth + 0.5 * pThickness[i+1] * pWidth)) def GetSigCRIT(stringerNo, Loadcase):
c = 1 sLambda_crit = math.sqrt((2*math.pi*math.pi*Ebasis)/GetSigCrip(stringerNo,Loadcase))
return(1*pLength/r_gyr) # Lambda_crit correct
hSigCrip = GetSigCrip(stringerNo, Loadcase)
# SigCrip correct!!
def GetSigCRIT(stringerNo, Loadcase): hLambda = GetLambda(stringerNo-1)
sLambda_crit = math.sqrt((2*math.pi*math.pi*Ebasis)/GetSigCrip(i,0)) #print("Lmabda: " + str(hLambda))
if(GetLambda(stringerNo)<sLambda_crit): # ISSUE HERE - Lambda off from results
return(GetSigCrip(stringerNo, Loadcase) - ((1/Ebasis)*((GetSigCrip(stringerNo, Loadcase)/(2*math.pi))**2)*(GetLambda(stringerNo)**2))) # no double checking now
else:
return((math.pi**2)*Ebasis / (GetLambda(stringerNo) ** 2)) if(hLambda<sLambda_crit):
return(hSigCrip - ((1/Ebasis)*((hSigCrip/(2*math.pi))**2)*(hLambda**2)))
else:
def GetRFstringer(stringerNo, Loadcase): return((math.pi**2)*Ebasis / (hLambda ** 2))
return(abs(GetSigCRIT(stringerNo, Loadcase)/(1.5*GetCombAvgStressofStringer(stringerNo, Loadcase))))
def GetCrosssectionValues(i): def GetRFstringer(stringerNo, Loadcase):
I_comb = GetIcomb(i) return(abs(GetSigCRIT(stringerNo, Loadcase)/(1.5*GetCombAvgStressofStringer(stringerNo, Loadcase))))
r_gyr = math.sqrt(I_comb/(areaStringer + 0.5 * pThickness[i] * pWidth + 0.5 * pThickness[i+1] * pWidth))
c = 1 def GetCrosssectionValues(i):
sLambda = c*pLength/r_gyr I_comb = GetIcomb(i)
sLambda_crit = math.sqrt((2*math.pi*math.pi*Ebasis)/GetSigCrip(i, 0)) # IMPORTANT THIS IS ONLY FOR S crip above 490 r_gyr = math.sqrt(I_comb/(areaStringer + 0.5 * pThickness[i] * pWidth + 0.5 * pThickness[i+1] * pWidth))
return(str(I_comb) + "," + str(r_gyr) + "," + str(sLambda) + "," + str(sLambda_crit)) c = 1
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
def GetIcomb(i): return(str(I_comb) + "," + str(r_gyr) + "," + str(sLambda) + "," + str(sLambda_crit))
wing_1_w = pWidth/2
wing_2_w = pWidth/2
def GetIcomb(i):
wing_1_t = pThickness[i] wing_1_w = pWidth/2
wing_2_t = pThickness[i+1] wing_2_w = pWidth/2
wing_1_t = pThickness[i]
z1 = -dim1/2 wing_2_t = pThickness[i+1]
z3 = -(dim1-(dim2/2))
z4 = -dim2/2
z1 = -dim1/2
y1 = ((dim3/2)-(dim2/2)) z3 = -(dim1-(dim2/2))
y3 = 0 z4 = -dim2/2
y4 = dim3+(dim4/2)
y1 = ((dim3/2)-(dim2/2))
zw_1 = wing_1_t/2 y3 = 0
zw_2 = wing_2_t/2 y4 = dim3+(dim4/2)
yw_1 = 50 zw_1 = wing_1_t/2
yw_2 = -50 zw_2 = wing_2_t/2
yw_1 = 50
a1 = dim1*dim2 yw_2 = -50
a3 = dim2*(dim3-dim2-dim2)
a4 = dim4*dim2
a1 = dim1*dim2
aw_1 = wing_1_w * wing_1_t a3 = dim2*(dim3-dim2-dim2)
aw_2 = wing_2_t * wing_2_w a4 = dim4*dim2
Iyy1 = (dim2*(dim1**3))/12 aw_1 = wing_1_w * wing_1_t
Izz1 = (dim1*(dim2**3))/12 aw_2 = wing_2_t * wing_2_w
Iyy3 = ((dim3-dim2-dim2)*(dim2**3))/12 Iyy1 = (dim2*(dim1**3))/12
Izz3 = (((dim3-dim2-dim2)**3)*(dim2))/12 Izz1 = (dim1*(dim2**3))/12
Iyy4 = (dim4*(dim2**3))/12 Iyy3 = ((dim3-dim2-dim2)*(dim2**3))/12
Izz4 = (dim2*(dim4**3))/12 Izz3 = (((dim3-dim2-dim2)**3)*(dim2))/12
Iw_1_yy = (wing_1_w*(wing_1_t**3))/12 Iyy4 = (dim4*(dim2**3))/12
Iw_1_zz = (wing_1_t*(wing_1_w**3))/12 Izz4 = (dim2*(dim4**3))/12
Iw_2_yy = (wing_2_w*(wing_2_t**3))/12 Iw_1_yy = (wing_1_w*(wing_1_t**3))/12
Iw_2_zz = (wing_2_t*(wing_2_w**3))/12 Iw_1_zz = (wing_1_t*(wing_1_w**3))/12
Iw_2_yy = (wing_2_w*(wing_2_t**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) Iw_2_zz = (wing_2_t*(wing_2_w**3))/12
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)
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) 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)
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) 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)
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)
if(Iyy > Izz): 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)
return(Izz)
else:
return(Iyy) if(Iyy > Izz):
return(Izz)
else:
return(Iyy)
for u in range(modAmount):
isWithinRF = 1
panel = 'panel_val_' + str(u) +'.csv' for u in range(modAmount):
stringer = 'stringer_val_' + str(u) + '.csv' isWithinRF = 1
# dimensions panel = 'panel_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]] stringer = 'stringer_val_' + str(u) + '.csv'
pWidth = pWidth_0[u]
pLength = pLength_0[u] # dimensions
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]]
dim1 = dim1_0[u] pWidth = pWidth_0[u]
dim2 = dim2_0[u] pLength = pLength_0[u]
dim3 = dim3_0[u]
dim4 = dim4_0[u] dim1 = dim1_0[u]
dim2 = dim2_0[u]
areaStringer = dim4 * dim2 * 2 + (dim1 - dim2) * dim2 * 2 + dim3 * dim2 dim3 = dim3_0[u]
dim4 = dim4_0[u]
print("\n\n" + Back.CYAN + "Calculations for iteration " + str(u) + Style.RESET_ALL)
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)) areaStringer = dim4 * dim2 * 2 + (dim1 - dim2) * dim2 * 2 + dim3 * dim2
#print("\n Panel Offset: " + str(pThickness/2) + "\n Stringer Offset: " + str(dim1/2)) print("\n\n" + Back.CYAN + "Calculations for iteration " + str(u) + Style.RESET_ALL)
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)
for i in range(10): #print("\n Panel Offset: " + str(pThickness/2) + "\n Stringer Offset: " + str(dim1/2))
mass = mass + pWidth*pThickness[i]*density*pLength
if(mass<mass_limit): mass = density*(areaStringer*pLength*9) # + 10*pWidth*pThickness*pLength)
print("\n\n Mass: " + Back.GREEN + str(mass) + Style.RESET_ALL) for i in range(10):
else: mass = mass + pWidth*pThickness[i]*density*pLength
print("\n\n Mass: " + Back.RED + str(mass) + Style.RESET_ALL) if(mass<mass_limit):
isWithinRF = 0 print("\n\n Mass: " + Back.GREEN + str(mass) + Style.RESET_ALL)
else:
# REMEMBER SAFETY FACTOR OF 1.5 ALREADY INCLUDED print("\n\n Mass: " + Back.RED + str(mass) + Style.RESET_ALL)
# RF calculator for panels isWithinRF = 0
for c in range(1,4):
print("\nPanel RF for loadcase " + str(c)) # REMEMBER SAFETY FACTOR OF 1.5 ALREADY INCLUDED
for i in range(1, 31): # RF calculator for panels
w = sUlt/GetValueofElement(i,c,'vonMises',panel) for c in range(1,4):
if(w>1): print("\nPanel RF for loadcase " + str(c))
print(Back.GREEN + str(w) + Style.RESET_ALL) for i in range(1, 31):
else: w = sUlt/GetValueofElement(i,c,'vonMises',panel)
print(Back.RED + str(w) + Style.RESET_ALL) if(w>1):
isWithinRF = 0 print(Back.GREEN + str(w) + Style.RESET_ALL)
else:
print(" ") print(Back.RED + str(w) + Style.RESET_ALL)
# RF calculator for stringers isWithinRF = 0
for c in range(1,4):
print("\nStringer RF for loadcase " + str(c)) print(" ")
for i in range(40,67): # RF calculator for stringers
w = abs(sUlt/GetValueofElement(i,c,axial,stringer)) for c in range(1,4):
if(w>1): print("\nStringer RF for loadcase " + str(c))
print(Back.GREEN + str(w) + Style.RESET_ALL) for i in range(40,67):
else: w = abs(sUlt/GetValueofElement(i,c,axial,stringer))
print(Back.RED + str(w) + Style.RESET_ALL) if(w>1):
isWithinRF = 0 print(Back.GREEN + str(w) + Style.RESET_ALL)
else:
# Stability Analysis print(Back.RED + str(w) + Style.RESET_ALL)
print("\n\nStability Analysis\nPanel buckling") isWithinRF = 0
# Panel buckling
# sig_aa,avg calculator # Stability Analysis
alpha = pLength/pWidth print("\n\nStability Analysis\nPanel buckling")
kShear = 5.34 + 4/(alpha*alpha) # Panel buckling
for c in range(1,4): # sig_aa,avg calculator
print("\nLoadcase " + str(c) + "\nAverage stress for panels 1 to 5 - XX, YY, XY - k_shear, k_biax, RF_panelbuckl") alpha = pLength/pWidth
for i in range(1,6): kShear = 5.34 + 4/(alpha*alpha)
w = RF_panel(i,c) for c in range(1,4):
if(w>1): print("\nLoadcase " + str(c) + "\nAverage stress for panels 1 to 5 - XX, YY, XY - k_shear, k_biax, RF_panelbuckl")
w = Back.GREEN + str(w) + Style.RESET_ALL for i in range(1,6):
else: w = RF_panel(i,c)
w = Back.RED + str(w) + Style.RESET_ALL if(w>1):
isWithinRF = 0 w = Back.GREEN + str(w) + Style.RESET_ALL
else:
print(str(GetAvgStressofPanel(i, c, 'XX')) + "," + str(GetAvgStressofPanel(i, c, 'YY')) + "," + str(GetAvgStressofPanel(i, c, 'XY')) + "," + str(kShear) + "," + str(kBiax(i, c)) + "," + str(w)) w = Back.RED + str(w) + Style.RESET_ALL
isWithinRF = 0
# Stringer buckling
print("\n\nStringer 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))
for c in range(1,4):
print("\nLoadcase " + str(c) + "\nCombined, average axial stress for stringers 1 to 5") # Stringer buckling
for i in range(1,6): print("\n\nStringer buckling")
w = GetRFstringer(i,c) for c in range(1,4):
if(w>1): print("\nLoadcase " + str(c) + "\nCombined, average axial stress for stringers 1 to 5")
w = Back.GREEN + str(w) + Style.RESET_ALL for i in range(1,6):
else: w = GetRFstringer(i,c)
w = Back.RED + str(w) + Style.RESET_ALL if(w>1):
isWithinRF = 0 w = Back.GREEN + str(w) + Style.RESET_ALL
else:
w = Back.RED + str(w) + Style.RESET_ALL
print(str(GetCombAvgStressofStringer(i,c)) + "," + str(GetSigCrip(i, c)) + "," + str(w)) # no longer slightly off, RF stringer calc still wrong? isWithinRF = 0
# combined crosssection properties for combined buckling mode
print("\n\nCombined crosssection properties for combined buckling") print(str(GetCombAvgStressofStringer(i,c)) + "," + str(GetSigCrip(i, c)) + "," + str(w)) # no longer slightly off, RF stringer calc still wrong?
for i in range(5):
print(GetCrosssectionValues(i)) # combined crosssection properties for combined buckling mode
print("\n\nCombined crosssection properties for combined buckling")
if(isWithinRF == 1): for i in range(5):
print("\n\n" + Back.GREEN + str(u) + " WORKS!" + Style.RESET_ALL) print(GetCrosssectionValues(i))
else:
print("\n\n" + Back.RED + str(u) + " FAILURE!" + Style.RESET_ALL) if(isWithinRF == 1):
print("\n\n" + Back.GREEN + str(u) + " WORKS!" + Style.RESET_ALL)
#print(GetIcomb()) else:
print("\n\n" + Back.RED + str(u) + " FAILURE!" + Style.RESET_ALL)
## OVERVIEW OF TODO: #print(GetIcomb())
## OVERVIEW OF TODO:
# - improve some sections of code with TODO # - improve some sections of code with TODO

View file

@ -1,10 +1,21 @@
# 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

View file

@ -1,2 +1,2 @@
# Uni stuff # Uni stuff
[aseredesign](https://git.zoerdu.net/Sasha/uni/aseredesign) [aseredesign](https://git.zoerdu.net/Sasha/uni/src/branch/main/aseredesign)