Ejemplo n.º 1
0
def sys_print(example):
    filteredStiffeners = filtered_stiffeners_table()
    print 'number of stiffeners: ',example.number_of_rings
    print 'wall thickness: ',example.wall_thickness
    print 'VAL: ',example.VAL
    print 'VAG: ',example.VAG
    print 'VEL: ',example.VEL
    print 'VEG: ',example.VEG
    print 'web compactness: ',example.web_compactness
    print 'flange compactness: ',example.flange_compactness
    print 'stiffener: ', filteredStiffeners[example.stiffener_index]
    print 'shell+ring+bulkhead mass: ',example.shell_ring_bulkhead_mass
Ejemplo n.º 2
0
 def execute(self):
     ''' 
     '''
     def plasticityRF(F):
         dum = FY/F
         if F > FY/2:
             return F*dum*(1+3.75*dum**2)**(-0.25)
         else: 
             return F*1
     def frustrumVol(D1,D2,H): # array inputs
         l = len(D1)
         fV = np.array([0.]*l)
         r1 = D1/2.
         r2 = D2/2.
         fV = pi * (H / 3) * (r1**2 + r1*r2 + r2**2)
         return fV
     def frustrumCG(D1,D2,H):  # array inputs
         # frustrum vertical CG
         l = len(D1)
         fCG = np.array([0.]*l)
         r1 = D1/2.
         r2 = D2/2.    
         dum1 = r1**2 + 2.*r1*r2 + 3.*r2**2
         dum2 = r1**2 + r1 * r2 + r2**2
         fCG = H / 4. * (dum1/dum2)
         return fCG
     def ID(D,WALL):  # array inputs
         D = np.asarray(D)
         is_scalar = False if D.ndim>0 else True
         D.shape = (1,)*(1-D.ndim) + D.shape   
         l = len(D)
         ID = np.array([0.]*l)
         ID = D - 2.*WALL
         return ID if not is_scalar else (ID)
     def waveHeight(Hs): 
         return 1.1*Hs
     def wavePeriod(H):
         return 11.1*(H/G)**0.5   
     def waveNumber(T,D):
         k0 = 2 * pi / ( T * (G * D) **0.5)
         ktol =1 
         while ktol > 0.001:
             k = ( 2* pi/T) **2 / (G * np.tanh(k0*D))
             ktol = abs(k-k0)
             k0 = k
         return k
     def waveU(H,T,k,z,D,theta):
         return (pi*H/T)*(np.cosh(k*(z+D))/np.sinh(k*D))*np.cos(theta)
     def waveUdot(H,T,k,z,D,theta):
         return (2*pi**2*H/T**2)* (np.cosh(k*(z+D))/np.sinh(k*D))*np.sin(theta)
     def CD(U,D,DEN):
         RE = np.log10(abs(U) * D / DEN)
         if RE <= 5.:
             return 1.2
         elif RE < 5.301:
             return 1.1
         elif RE < 5.477:
             return  0.5
         elif RE < 6.:
             return 0.2
         elif RE < 6.301:
             return 0.4
         elif RE < 6.477:
             return 0.45
         elif RE < 6.699:
             return 0.5
         elif RE < 7.:
             return 0.6
         else:
             return 0.8
     def inertialForce(D,CA,L,A,VDOT,DEN):
         IF = 0.25 * pi * DEN * D** 2 * L * (A + CA * (A - VDOT))
         if A < 0:
             IF = -IF
         return IF
     def windPowerLaw(uref,href,alpha,H) :
         return uref*(H/href)**alpha
     def pipeBuoyancy(D):
         return pi/4 * D**2 *WDEN 
     def dragForce(D,CD,L,V,DEN):
         DF = 0.5 * DEN * CD * D * L * V**2
         if V < 0 :
             DF = -DF 
         return DF
     def calcPsi(F):
         dum = FY/2
         if F <= dum:
             return 1.2
         elif F > dum and F < FY:
             return 1.4 - 0.4*F/FY
         else: return 1
     def currentSpeed(XNEW):
         CDEPTH = [0.000, 61.000, 91.000, 130.000]
         CSPEED = [0.570, 0.570, 0.100, 0.100]
         return np.interp(abs(XNEW),CDEPTH,CSPEED)
     def curWaveDrag(Hs,Tp,WD,ODT,ODB,ELS,SL,CG,VDOT): 
         if Hs != 0: 
             H = waveHeight(Hs)
             k = waveNumber(Tp,WD) 
         # calculate current and wave drag 
         DL = SL /10.     # step sizes
         dtheta = pi/30. 
         S = (ODB - ODT)/SL 
         b = ODT 
         L = 0
         m = 0 
         for i in range(1,11):
             L2 = L + DL/2
             D2 = ELS -L2 
             D = S * L2 +b 
             fmax = 0.
             if (JMAX[i-1] == 0.):
                 JS = 1
                 JE = 31
             else: 
                 JS = JMAX[i-1]
                 JE = JMAX[i-1]
             for j in range(JS,JE+1):
                 V = currentSpeed(L2)
                 A = 0. 
                 if Hs != 0: 
                     V = V + waveU(H,Tp,k,D2,WD,dtheta*(j-1))
                     A = waveUdot(H,Tp,k,D2,WD,dtheta*(j-1))
                 if V != 0: 
                     CDT = CD(V,D,WDEN) 
                     f = dragForce(D,CDT,DL,V,WDEN) 
                 else:
                     f = 0
                 if Hs != 0:
                     f = f + inertialForce(D,1,DL,A,VDOT,WDEN) 
                 if f > fmax :
                     fmax = f
                     JMAX[i-1] =j
             m = m + fmax*L2 
             L = DL*i
         return m/(SL-CG)
     def calculateWindCurrentForces (flag): 
         if flag == 1: 
             VD = self.system_acceleration
         else: 
             VD = 0
         ODT = OD # outer diameter - top
         ODB = np.append(OD[1:NSEC],OD[-1]) # outer diameter - bottom
         WOD = (ODT+ODB)/2 # average outer diameter 
         COD = WOD # center outer diameter
         IDT = ID(ODT,T)
         IDB = ID(ODB,T)
         OV = frustrumVol(ODT,ODB,LB)
         IV = frustrumVol(IDT,IDB,LB)
         MV = OV - IV # shell volume 
         SHM = MV * MDEN # shell mass 
         SCG = frustrumCG(ODB,ODT,LB) # shell center of gravity
         KCG = DRAFT + ELE + SCG # keel to shell center of gravity
         KCB = DRAFT + ELE + SCG
         SHB = OV*WDEN #  outer volume --> displaced water mass
         coneH = np.array([0.]*NSEC)
         for i in range(0,len(LB)):
             if ODB[i]==ODT[i]:
                 coneH[i]=LB[i]
             else:
                 coneH[i] = -LB[i] * (ODB[i]/ODT[i]) / (1 - ODB[i]/ODT[i]) # cone height 
         # initialize arrays 
         SCF = np.array([0.]*NSEC)
         KCS = np.array([0.]*NSEC)
         SCM = np.array([0.]*NSEC)
         SWF = np.array([0.]*NSEC)
         KWS = np.array([0.]*NSEC)
         SWM = np.array([0.]*NSEC)
         BHM = np.array([0.]*NSEC)
         RGM = np.array([0.]*NSEC)
         for i in range (0,NSEC): 
         #for i in range(0,NSEC) :  # iterate through the sections
             if i <(NSEC-1) : # everything but the last section 
                 if ELE[i] <0 : # if bottom end underwater
                     HWL = abs(ELE[i]) 
                     if HWL >= LB[i]: # COMPLETELY UNDERWATER 
                         SCF[i] = curWaveDrag(Hs,Tp,WD,OD[i],OD[i+1],ELS[i],LB[i],SCG[i],VD)
                         KCS[i] = KCB[i]
                         if SCF[i] == 0: 
                             KCS[i] = 0.
                         SCM[i] = SCF[i] * (KCS[i]-KCGO)
                         SWF[i] = 0.
                         KWS[i] = 0.
                         SWM[i] = 0.
                     else: # PARTIALLY UNDER WATER 
                         if ODT[i] == ODB[i]:  # cylinder
                             SHB[i] = pipeBuoyancy(ODT[i])*HWL # redefine
                             SCG[i] = HWL/2 # redefine
                             KCB[i] = DRAFT + ELE[i] + SCG[i] # redefine 
                             ODW = ODT[i] # assign single variable
                         else: # frustrum
                             ODW = ODB[i]*(coneH[i]-HWL)/coneH[i] # assign single variable 
                             WOD[i] = (ODT[i]+ODW[i])/2  # redefine 
                             COD[i] = (ODW[i]+ODB[i])/2 # redefine 
                             SHB[i] = frustrumVol(ODW[i],ODB[i],HWL) # redefine 
                             SCG[i] = frustrumCG(ODW,ODB[i],HWL) # redefine 
                             KCB[i] = DRAFT + ELE[i] + SCG[i] # redefine 
                         SCF[i] = curWaveDrag(Hs,Tp,WD,ODW,ODB[i],0.,HWL,SCG[i],VD)
                         KCS[i] = KCB[i]
                         if SCF[i] == 0 : 
                             KCS[i] = 0.
                         SCM[i] = SCF[i]*(KCS[i]-KCGO)
                         if WREFS != 0: # if there is wind 
                             WSPEED = windPowerLaw(WREFS,WREFH,ALPHA,(LB[i]-HWL)/2) # assign single variable 
                             CDW = CD(WSPEED,WOD[i],ADEN) # assign single variable 
                             SWF[i] = dragForce(WOD[i],CDW,LB[i]-HWL,WSPEED,ADEN)
                             KWS[i]= KCG[i]
                             SWM[i] = SWF[i]*(KWS[i]-KCGO) 
                         else: # no wind 
                             SWF[i] = 0.
                             KWS[i] = 0.
                             SWM[i] = 0.
                 else: # FULLY ABOVE WATER 
                     SHB[i] = 0. # redefines 
                     KCB[i] = 0.
                     SCF[i] = 0.
                     KCS[i] = 0.
                     SCM[i] = 0.
                     if WREFS != 0: # if there is wind 
                         WSPEED = windPowerLaw(WREFS,WREFH,ALPHA,ELE[i]+LB[i]/2) # assign single variable 
                         CDW = CD(WSPEED,WOD[i],ADEN) # assign single variable 
                         SWF[i] = dragForce(WOD[i],CDW,LB[i],WSPEED,ADEN)
                         KWS[i]= KCG[i]
                         SWM[i] = SWF[i]*(KWS[i]-KCGO) 
                     else: # no wind 
                         SWF[i] = 0.
                         KWS[i] = 0.
                         SWM[i] = 0.
                 RGM[i] = N[i]*(pi*ID(WOD[i],T[i])*AR)*MDEN # ring mass
             else: # last section 
                 # SHM unchanged 
                 KCG[i] = DRAFT + ELE[i] + LB[i]/2  #redefine
                 # SHB already calculated 
                 # KCB already calculated 
                 SCF[i] = curWaveDrag(Hs,Tp,WD,OD[i],OD[i],ELS[i],LB[i],KCG[i],VD)
                 KCS[i] = KCG [i] # redefines
                 if SCF[i] ==0: 
                     KCS[i] = 0.
                 SCM[i] = SCF[i]*(KCS[i]-KCGO)
                 SWF[i] = 0.
                 KWS[i] = 0.
                 SWM[i] = 0.
                 RGM[i] = N[i]*(pi*ID(OD[i],T[i])*AR)*MDEN # ring mass
             if BH[i] == 'T':
                 BHM[i] = pi / 4 * IDT[i]**2 * T[i] * MDEN 
                 KCG[i] = (KCG[i] * SHM[i] + (DRAFT + ELS[i] - 0.5 * T[i]) * BHM[i]) / (SHM[i] + BHM[i])
             elif BH[i] == 'B' :
                 BHM[i] = pi / 4 * IDB[i]**2 * T[i] * MDEN
                 KCG[i] = (KCG[i] * SHM[i] + (DRAFT + ELE[i] + 0.5 * T[i]) * BHM[i]) / (SHM[i] + BHM[i])
             else: 
                 KCG[i] = KCG[i]
         return sum(SHM)+sum(RGM)+sum(BHM)
     def rootsearch(f,a,b,dx):
         x1 = a; f1 = f(a)
         x2 = a + dx; f2 = f(x2)
         while f1*f2 > 0.0:
             if x1 >= b:
                 return None,None
             x1 = x2; f1 = f2
             x2 = x1 + dx; f2 = f(x2)
         return x1,x2
     def bisect(f,x1,x2,switch=0,epsilon=1.0e-9):
         f1 = f(x1)
         if f1 == 0.0:
             return x1
         f2 = f(x2)
         if f2 == 0.0:
             return x2
         if f1*f2 > 0.0:
             print('Root is not bracketed')
             return None
         n = int(math.ceil(math.log(abs(x2 - x1)/epsilon)/math.log(2.0)))
         for i in range(n):
             x3 = 0.5*(x1 + x2); f3 = f(x3)
             if (switch == 1) and (abs(f3) >abs(f1)) and (abs(f3) > abs(f2)):
                 return None
             if f3 == 0.0:
                 return x3
             if f2*f3 < 0.0:
                 x1 = x3
                 f1 = f3
             else:
                 x2 =x3
                 f2 = f3
         return (x1 + x2)/2.0
     def roots(f, a, b, eps=1e-3):
         #print ('The roots on the interval [%f, %f] are:' % (a,b))
         while 1:
             x1,x2 = rootsearch(f,a,b,eps)
             if x1 != None:
                 a = x2
                 root = bisect(f,x1,x2,1)
                 if root != None:
                     pass
                     #print (round(root,-int(math.log(eps, 10))))
                     return root
             else:
                 #print ('\nDone')
                 break
     # assign all varibles so its easier to read later
     G = self.gravity
     ADEN = self.air_density 
     WDEN = self.water_density
     WD = self.water_depth
     LOADC = self.load_condition
     Hs = self.significant_wave_height
     Tp = self.significant_wave_period
     if Hs!= 0: 
         WAVEH = 1.86*Hs
         WAVEP = 0.71*Tp
         WAVEL = G*WAVEP**2/(2*pi)
         WAVEN = 2*pi/WAVEL
     KCG = self.keel_cg_mooring
     KCGO = self.keel_cg_operating_system
     WREFS = self.reference_wind_speed
     WREFH = self.reference_height
     ALPHA = self.alpha 
     MDEN = self.material_density
     E = self.E
     PR = self.nu
     FY = self.yield_stress
     RMASS = self.rotor_mass
     TMASS = self.tower_mass
     FB = self.free_board
     DRAFT = self.draft
     FBM = self.fixed_ballast_mass
     PBM = self.permanent_ballast_mass
     OD = np.array(self.outer_diameter)
     T = np.array(self.wall_thickness)
     LB = np.array(self.length)
     ELE = np.array(self.end_elevation)
     ELS = np.array(self.start_elevation)
     BH = self.bulk_head
     N = np.array(self.number_of_rings)
     NSEC = self.number_of_sections
     if self.initial_pass: # curve fits
         YNA=self.neutral_axis
         D = 0.0029+1.3345977*YNA
         IR =0.051*YNA**3.7452
         TW =np.exp(0.88132868+1.0261134*np.log(IR)-3.117086*np.log(YNA))
         AR =np.exp(4.6980391+0.36049717*YNA**0.5-2.2503113/(TW**0.5))
         TFM =1.2122528*YNA**0.13430232*YNA**1.069737
         BF = (0.96105249*TW**-0.59795001*AR**0.73163096)
         IR = 0.47602202*TW**0.99500847*YNA**2.9938134
         SMASS = self.hull_mass
     else: # discrete, actual stiffener
         SMASS = 1.11*self.shell_ring_bulkhead_mass
         allStiffeners = filtered_stiffeners_table()
         stiffener = allStiffeners[self.stiffener_index]
         stiffenerName = stiffener[0]
         AR = convert_units( stiffener[1],'inch**2','m**2')
         D = convert_units(stiffener[2],'inch','m')
         TW = convert_units(stiffener[3],'inch','m')
         BF=  convert_units(stiffener[4],'inch','m')
         TFM = convert_units(stiffener[5],'inch','m')
         YNA = convert_units(stiffener[6],'inch','m')
         IR = convert_units(stiffener[7],'inch**4','m**4')
     HW = D - TFM
     WBM = self.variable_ballast_mass
     # shell data
     RO = OD/2.  # outer radius 
     R = RO-T/2. # radius to centerline of wall/mid fiber radius 
     # ring data 
     LR = LB/(N+1.) # number of ring spacing
     #shell and ring data
     RF = RO - HW  # radius to flange
     MX = LR/(R*T)**0.5  # geometry parameter
     # effective width of shell plate in longitudinal direction 
     LE=np.array([0.]*NSEC)
     for i in range(0,NSEC):
         if MX[i] <= 1.56: 
             LE[i]=LR[i]
         else: 
             LE = 1.1*(2*R*T)**0.5+TW 
     # ring properties with effective shell plate
     AER = AR+LE*T  # cross sectional area with effective shell 
     YENA = (LE*T*T/2 + HW*TW*(HW/2+T) + TFM*BF*(TFM/2+HW+T))/AER 
     IER = IR+AR*(YNA+T/2.)**2*LE*T/AER+LE*T**3/12. # moment of inertia
     RC = RO-YENA-T/2. # radius to centroid of ring stiffener 
     # set loads (0 mass loads for external pressure) 
     MTURBINE = RMASS 
     MTOWER = TMASS 
     MBALLAST = PBM + FBM + WBM # sum of all ballast masses
     MHULL = SMASS 
     W = (MTURBINE + MTOWER + MBALLAST + MHULL) * G
     P = WDEN * G* abs(ELE)  # hydrostatic pressure at depth of section bottom 
     if Hs != 0: # dynamic head 
         DH = WAVEH/2*(np.cosh(WAVEN*(WD-abs(ELE)))/np.cosh(WAVEN*WD)) 
     else: 
         DH = 0 
     P = P + WDEN*G*DH # hydrostatic pressure + dynamic head
     #-----RING SECTION COMPACTNESS (SECTION 7)-----#
     self.flange_compactness = (0.5*BF/TFM)/(0.375*(E/FY)**0.5)
     self.web_compactness = (HW/TW)/((E/FY)**0.5)
     #-----PLATE AND RING STRESS (SECTION 11)-----#
     # shell hoop stress at ring midway 
     Dc = E*T**3/(12*(1-PR**2))  # parameter D 
     BETAc = (E*T/(4*RO**2*Dc))**0.25 # parameter beta 
     TWS = AR/HW
     dum1 = BETAc*LR
     KT = 8*BETAc**3 * Dc * (np.cosh(dum1) - np.cos(dum1))/ (np.sinh(dum1) + np.sin(dum1))
     KD = E * TWS * (RO**2 - RF**2)/(RO * ((1+PR) * RO**2 + (1-PR) * RF**2))
     dum = dum1/2. 
     PSIK = 2*(np.sin(dum) * np.cosh(dum) + np.cos(dum) * np.sinh(dum)) / (np.sinh(dum1) + np.sin(dum1))
     PSIK = PSIK.clip(min=0) # psik >= 0; set all negative values of psik to zero
     SIGMAXA = -W/(2*pi*R*T)
     PSIGMA = P + (PR*SIGMAXA*T)/RO
     PSIGMA = np.minimum(PSIGMA,P) # PSIGMA has to be <= P
     dum = KD/(KD+KT)
     KTHETAL = 1 - PSIK*PSIGMA/P*dum
     FTHETAS = KTHETAL*P*RO/T
     # shell hoop stress at ring 
     KTHETAG = 1 - (PSIGMA/P*dum)
     FTHETAR = KTHETAG*P*RO/T
     #-----LOCAL BUCKLING (SECTION 4)-----# 
     # axial compression and bending 
     ALPHAXL = 9/(300+(2*R)/T)**0.4
     CXL = (1+(150/((2*R)/T))*(ALPHAXL**2)*(MX**4))**0.5
     FXEL = CXL * (pi**2 * E / (12 * (1 - PR**2))) * (T/LR)**2 # elastic 
     FXCL=np.array(NSEC*[0.])
     for i in range(0,len(FXEL)):
         FXCL[i] = plasticityRF(FXEL[i]) # inelastic 
     # external pressure
     BETA = np.array([0.]*NSEC)
     ALPHATHETAL = np.array([0.]*NSEC)
     global ZM
     ZM = 12*(MX**2 * (1-PR**2)**.5)**2/pi**4
     for i in range(0,NSEC):
         f=lambda x:x**2*(1+x**2)**4/(2+3*x**2)-ZM[i]
         ans = roots(f, 0.,15.)
         ans_array = np.asarray(ans)
         is_scalar = False if ans_array.ndim>0 else True
         if is_scalar: 
             BETA[i] = ans 
         else: 
             BETA[i] = float(min(ans_array))
         if MX[i] < 5:
             ALPHATHETAL[i] = 1
         elif MX[i] >= 5:
             ALPHATHETAL[i] = 0.8  
     n = np.round(BETA*pi*R/LR) # solve for smallest whole number n 
     BETA = LR/(pi*R/n)
     left = (1+BETA**2)**2/(0.5+BETA**2)
     right = 0.112*MX**4 / ((1+BETA**2)**2*(0.5+BETA**2))
     CTHETAL = (left + right)*ALPHATHETAL 
     FREL = CTHETAL * pi**2 * E * (T/LR)**2 / (12*(1-PR**2)) # elastic
     FRCL=np.array(NSEC*[0.])
     for i in range(0,len(FREL)):
         FRCL[i] = plasticityRF(FREL[i]) # inelastic 
     #-----GENERAL INSTABILITY (SECTION 4)-----# 
     # axial compression and bending 
     AC = AR/(LR*T) # Ar bar 
     ALPHAX = 0.85/(1+0.0025*(OD/T))
     ALPHAXG = np.array([0.]*NSEC)
     for i in range(0,NSEC):
         if AC[i] >= 0.2 :
             ALPHAXG[i] = 0.72
         elif AC[i] > 0.06 and AC[i] <0.2:
             ALPHAXG[i] = (3.6-0.5*ALPHAX[i])*AC[i]+ALPHAX[i]
         else: 
             ALPHAXG[i] = ALPHAX[i]
     FXEG = ALPHAXG * 0.605 * E * T / R * (1 + AC)**0.5 # elastic
     FXCG = np.array(NSEC*[0.])
     for i in range(0,len(FXEG)):
         FXCG[i] = plasticityRF(FXEG[i]) # inelastic  
     # external pressure 
     ALPHATHETAG = 0.8
     LAMBDAG = pi * R / LB 
     k = 0.5 
     PEG = np.array([0.]*NSEC)
     for i in range(0,NSEC):
         t = T[i]
         r = R[i]
         lambdag = LAMBDAG[i]
         ier = IER[i]
         rc = RC[i]
         ro = RO[i]
         lr = LR[i]
         def f(x,E,t,r,lambdag,k,ier,rc,ro,lr):
             return E*(t/r)*lambdag**4/((x**2+k*lambdag**2-1)*(x**2+lambdag**2)**2) + E*ier*(x**2-1)/(lr*rc**2*ro)   
         x0 = [2]
         m = float(fmin(f, x0, xtol=1e-3, args=(E,t,r,lambdag,k,ier,rc,ro,lr))) # solve for n that gives minimum P_eG
         PEG[i] = f(m,E,t,r,lambdag,k,ier,rc,ro,lr)
     ALPHATHETAG = 0.8 #adequate for ring stiffeners 
     FREG = ALPHATHETAG*PEG*RO*KTHETAG/T # elastic 
     FRCG = np.array(NSEC*[0.])
     for i in range(0,len(FREG)):
         FRCG[i] = plasticityRF(FREG[i]) # inelastic  
     # General Load Case
     NPHI = W/(2*pi*R)
     NTHETA = P * RO 
     K = NPHI/NTHETA 
     #-----Local Buckling (SECTION 6) - Axial Compression and bending-----# 
     C = (FXCL + FRCL)/FY -1
     KPHIL = 1
     CST = K * KPHIL /KTHETAL 
     FTHETACL = np.array([0.]*NSEC)
     bnds = (0,None)
     #print FRCL
     for i in range(0,NSEC):
         cst = CST[i]
         fxcl = FXCL[i]
         frcl = FRCL[i]
         c = C[i]
         x = Symbol('x')
         ans = solve((cst*x/fxcl)**2 - c*(cst*x/fxcl)*(x/frcl) + (x/frcl)**2 - 1, x)
         FTHETACL[i] =  float(min([a for a in ans if a>0]))
     FPHICL = CST*FTHETACL
     #-----General Instability (SECTION 6) - Axial Compression and bending-----# 
     C = (FXCG + FRCG)/FY -1
     KPHIG = 1
     CST = K * KPHIG /KTHETAG 
     FTHETACG = np.array([0.]*NSEC)
     for i in range(0,NSEC):
         cst = CST[i]
         fxcg = FXCG[i]
         frcg = FRCG[i]
         c = C[i]
         x = Symbol('x',real=True)
         ans = solve((cst*x/fxcg)**2 - c*(cst*x/fxcg)*(x/frcg) + (x/frcg)**2 - 1, x)
         FTHETACG[i] =  float(min([a for a in ans if a>0]))
     FPHICG = CST*FTHETACG
     #-----Allowable Stresses-----# 
     # factor of safety
     FOS = 1.25
     if LOADC == 'N' or LOADC == 'n': 
         FOS = 1.65
     FAL = np.array([0.]*NSEC)
     F*G = np.array([0.]*NSEC)
     FEL = np.array([0.]*NSEC)
     FEG = np.array([0.]*NSEC)
     for i in range(0,NSEC):
         # axial load    
         FAL[i] = FPHICL[i]/(FOS*calcPsi(FPHICL[i]))
         F*G[i] = FPHICG[i]/(FOS*calcPsi(FPHICG[i]))
         # external pressure
         FEL[i] = FTHETACL[i]/(FOS*calcPsi(FTHETACL[i]))
         FEG[i] = FTHETACG[i]/(FOS*calcPsi(FTHETACG[i]))
     # unity check 
     self.VAL = abs(SIGMAXA / FAL)
     self.VAG = abs(SIGMAXA / F*G)
     self.VEL = abs(FTHETAS / FEL)
     self.VEG = abs(FTHETAS / FEG)
     global JMAX
     JMAX = np.array([0]*10)
     self.shell_ring_bulkhead_mass=calculateWindCurrentForces(0)
     self.shell_ring_bulkhead_mass=calculateWindCurrentForces(1)
Ejemplo n.º 3
0
def example_218WD_10MW():
    example = optimizationSpar()
    tt = time.time()
    example.water_depth = 218.
    example.load_condition = 'N'
    example.significant_wave_height = 10.820
    example.significant_wave_period = 9.800
    example.keel_cg_mooring = 45.
    example.keel_cg_operating_system = 30.730
    example.reference_wind_speed = 11.
    example.reference_height = 119.
    example.alpha = 0.110
    example.material_density = 7850.
    example.E = 200.e9
    example.nu = 0.3
    example.yield_stress = 345000000.
    example.rotor_mass = 677000.000
    example.tower_mass = 698235.000
    example.free_board = 13.
    example.draft = 92.
    example.fixed_ballast_mass = 6276669.794
    example.hull_mass = 2816863.293
    example.permanent_ballast_mass = 3133090.391
    example.variable_ballast_mass = 1420179.260
    example.number_of_sections = 4
    example.outer_diameter = [8.,9.,9.,15.]
    example.length = [6., 12., 15., 72.]
    example.end_elevation = [7., -5., -20., -92.]
    example.start_elevation = [13., 7., -5., -20.]
    example.bulk_head = ['N', 'T', 'N', 'B']
    #example.system_acceleration = 0.856545480516845
    example.gust_factor = 1.0
    example.tower_base_OD = 7.720
    example.tower_top_OD = 4.050
    example.tower_length = 102.63
    example.cut_out_speed = 25.
    example.turbine_size = '10MW'
    example.rotor_diameter = 194.0
    example.run()
    yna = convert_units(example.spar.neutral_axis ,'m','inch')
    filteredStiffeners = filtered_stiffeners_table()
    for i in range (0,len(filteredStiffeners)-1):
        stiffener_bef = filteredStiffeners[i]
        stiffener_aft = filteredStiffeners[i+1]
        if yna > stiffener_bef[6] and yna<stiffener_aft[6]:
            opt_index = i+1
    second_fit = Spar()
    second_fit.wall_thickness = example.spar.wall_thickness
    second_fit.number_of_rings = example.spar.number_of_rings
    second_fit.stiffener_index = opt_index
    second_fit.initial_pass = False

    second_fit.water_depth =  example.water_depth
    second_fit.load_condition = example.load_condition
    second_fit.significant_wave_height =  example.significant_wave_height
    second_fit.significant_wave_period = example.significant_wave_period
    second_fit.keel_cg_mooring = example.keel_cg_mooring
    second_fit.keel_cg_operating_system = example.keel_cg_operating_system
    second_fit.reference_wind_speed = example.reference_wind_speed
    second_fit.reference_height = example.reference_height
    second_fit.alpha = example.alpha
    second_fit.material_density = example.material_density
    second_fit.E = example.E
    second_fit.nu =example.nu
    second_fit.yield_stress = example.yield_stress
    second_fit.rotor_mass = example.rotor_mass
    second_fit.tower_mass = example.tower_mass
    second_fit.free_board = example.free_board
    second_fit.draft = example.draft
    second_fit.fixed_ballast_mass = example.fixed_ballast_mass
    second_fit.hull_mass = example.hull_mass
    second_fit.permanent_ballast_mass = example.permanent_ballast_mass
    second_fit.variable_ballast_mass = example.variable_ballast_mass
    second_fit.number_of_sections = example.number_of_sections
    second_fit.outer_diameter = example.outer_diameter
    second_fit.length = example.length
    second_fit.end_elevation = example.end_elevation
    second_fit.start_elevation = example.start_elevation
    second_fit.bulk_head = example.bulk_head
    #second_fit.system_acceleration=example.system_acceleration
    second_fit.gust_factor = example.gust_factor
    second_fit.tower_base_OD = example.tower_base_OD
    second_fit.tower_top_OD = example.tower_top_OD 
    second_fit.tower_length = example.tower_length 
    second_fit.cut_out_speed = example.cut_out_speed
    second_fit.turbine_size = example.turbine_size
    second_fit.rotor_diameter = example.rotor_diameter
    second_fit.run()
    index = opt_index
    unity = max(max(second_fit.VAL),max(second_fit.VAG),max(second_fit.VEL),max(second_fit.VEG))   
    while ((unity-1.0) > 1e-7):
        if index <124:
            index += 1
            second_fit.stiffener_index = index
            second_fit.run()
            unity = max(max(second_fit.VAL),max(second_fit.VAG),max(second_fit.VEL),max(second_fit.VEG)) 
            #print unity-1.0
        else:
            second_fit.stiffener_index = opt_index
            for i in range(0,second_fit.number_of_sections):
                if second_fit.VAL[i] >1. or second_fit.VAG[i]>1. or second_fit.VEL[i]>1. or second_fit.VEG[i]>1.:    
                    second_fit.number_of_rings[i] += 1 
                    second_fit.run()
                    unity = max(max(second_fit.VAL),max(second_fit.VAG),max(second_fit.VEL),max(second_fit.VEG)) 
                    #print second_fit.number_of_rings
    print '--------------example_218WD_10MW------------------'
    print "Elapsed time: ", time.time()-tt, " seconds"
    sys_print(second_fit)
Ejemplo n.º 4
0
def example_218WD_6MW():
    example = optimizationSpar()
    tt = time.time()
    example.water_depth = 218.
    example.load_condition = 'N'
    example.significant_wave_height = 10.820
    example.significant_wave_period = 9.800
    example.keel_cg_mooring = 37.177
    example.keel_cg_operating_system = 24.059
    example.reference_wind_speed = 11.
    example.reference_height = 97.
    example.alpha = 0.110
    example.material_density = 7850.
    example.E = 200.e9
    example.nu = 0.3
    example.yield_stress = 345000000.
    example.rotor_mass = 365500.000
    example.tower_mass = 366952.000
    example.free_board = 13.
    example.draft = 72.
    example.fixed_ballast_mass = 3659547.034
    example.hull_mass = 1593822.041
    example.permanent_ballast_mass = 1761475.914
    example.variable_ballast_mass = 820790.246
    example.number_of_sections = 4
    example.outer_diameter = [7., 8., 8., 13.]
    example.length = [6., 12., 15., 52.]
    example.end_elevation = [7., -5., -20., -72.]
    example.start_elevation = [13., 7., -5., -20.]
    example.bulk_head = ['N', 'T', 'N', 'B']
    #example.system_acceleration = 1.12124749328663
    example.gust_factor = 1.0
    example.tower_base_OD = 6.0
    example.tower_top_OD = 3.51
    example.tower_length = 80.5
    example.cut_out_speed = 25.
    example.turbine_size = '6MW'
    example.rotor_diameter = 154.0

    example.run()
    yna = convert_units(example.spar.neutral_axis ,'m','inch')
    filteredStiffeners = filtered_stiffeners_table()
    for i in range (0,len(filteredStiffeners)-1):
        stiffener_bef = filteredStiffeners[i]
        stiffener_aft = filteredStiffeners[i+1]
        if yna > stiffener_bef[6] and yna<stiffener_aft[6]:
            opt_index = i+1
    second_fit = Spar()
    second_fit.wall_thickness = example.spar.wall_thickness
    second_fit.number_of_rings = example.spar.number_of_rings
    second_fit.stiffener_index = opt_index
    second_fit.initial_pass = False

    second_fit.water_depth =  example.water_depth
    second_fit.load_condition = example.load_condition
    second_fit.significant_wave_height =  example.significant_wave_height
    second_fit.significant_wave_period = example.significant_wave_period
    second_fit.keel_cg_mooring = example.keel_cg_mooring
    second_fit.keel_cg_operating_system = example.keel_cg_operating_system
    second_fit.reference_wind_speed = example.reference_wind_speed
    second_fit.reference_height = example.reference_height
    second_fit.alpha = example.alpha
    second_fit.material_density = example.material_density
    second_fit.E = example.E
    second_fit.nu =example.nu
    second_fit.yield_stress = example.yield_stress
    second_fit.rotor_mass = example.rotor_mass
    second_fit.tower_mass = example.tower_mass
    second_fit.free_board = example.free_board
    second_fit.draft = example.draft
    second_fit.fixed_ballast_mass = example.fixed_ballast_mass
    second_fit.hull_mass = example.hull_mass
    second_fit.permanent_ballast_mass = example.permanent_ballast_mass
    second_fit.variable_ballast_mass = example.variable_ballast_mass
    second_fit.number_of_sections = example.number_of_sections
    second_fit.outer_diameter = example.outer_diameter
    second_fit.length = example.length
    second_fit.end_elevation = example.end_elevation
    second_fit.start_elevation = example.start_elevation
    second_fit.bulk_head = example.bulk_head
    second_fit.gust_factor = example.gust_factor
    second_fit.tower_base_OD = example.tower_base_OD
    second_fit.tower_top_OD = example.tower_top_OD 
    second_fit.tower_length = example.tower_length 
    second_fit.cut_out_speed = example.cut_out_speed
    second_fit.turbine_size = example.turbine_size
    second_fit.rotor_diameter = example.rotor_diameter
    #second_fit.system_acceleration=example.system_acceleration
    second_fit.run()
    index = opt_index
    unity = max(max(second_fit.VAL),max(second_fit.VAG),max(second_fit.VEL),max(second_fit.VEG))   
    while ((unity-1.0) > 1e-7):
        if index <124:
            index += 1
            second_fit.stiffener_index = index
            second_fit.run()
            unity = max(max(second_fit.VAL),max(second_fit.VAG),max(second_fit.VEL),max(second_fit.VEG)) 
        else:
            second_fit.stiffener_index = opt_index
            for i in range(0,second_fit.number_of_sections):
                if second_fit.VAL[i] >1. or second_fit.VAG[i]>1. or second_fit.VEL[i]>1. or second_fit.VEG[i]>1.:    
                    second_fit.number_of_rings[i] += 1 
                    second_fit.run()
                    unity = max(max(second_fit.VAL),max(second_fit.VAG),max(second_fit.VEL),max(second_fit.VEG)) 
    print '--------------example_218WD_6MW------------------'
    print "Elapsed time: ", time.time()-tt, " seconds"
    sys_print(second_fit)
Ejemplo n.º 5
0
def example_130WD_3MW():
    example = optimizationSpar()
    example.water_depth = 130.
    example.load_condition = 'N'
    example.significant_wave_height = 10.660
    example.significant_wave_period = 13.210
    example.keel_cg_mooring = 51.
    example.keel_cg_operating_system = 20.312
    example.reference_wind_speed = 11.
    example.reference_height = 75.
    example.alpha = 0.110
    example.material_density = 7850.
    example.E = 200.e9
    example.nu = 0.3
    example.yield_stress = 345000000.
    example.rotor_mass = 125000.
    example.tower_mass = 83705.
    example.free_board = 13.
    example.draft = 64.
    example.fixed_ballast_mass = 1244227.77
    example.hull_mass = 890985.086
    example.permanent_ballast_mass = 838450.256
    example.variable_ballast_mass = 418535.462
    example.number_of_sections = 4
    example.outer_diameter = [5., 6., 6., 9.]
    example.length = [6., 12., 15., 44.]
    example.end_elevation = [7., -5., -20., -64.]
    example.start_elevation = [13., 7., -5., -20.]
    example.bulk_head = ['N', 'T', 'N', 'B']
    #example.system_acceleration=1.2931
    example.run()

    yna = convert_units(example.spar.neutral_axis ,'m','inch')
    filteredStiffeners = filtered_stiffeners_table()
    for i in range (0,len(filteredStiffeners)-1):
        stiffener_bef = filteredStiffeners[i]
        stiffener_aft = filteredStiffeners[i+1]
        if yna > stiffener_bef[6] and yna<stiffener_aft[6]:
            opt_index = i+1
    second_fit = Spar()
    second_fit.wall_thickness = example.spar.wall_thickness
    second_fit.number_of_rings = example.spar.number_of_rings
    second_fit.stiffener_index = opt_index
    second_fit.initial_pass = False

    second_fit.water_depth =  example.water_depth
    second_fit.load_condition = example.load_condition
    second_fit.significant_wave_height =  example.significant_wave_height
    second_fit.significant_wave_period = example.significant_wave_period
    second_fit.keel_cg_mooring = example.keel_cg_mooring
    second_fit.keel_cg_operating_system = example.keel_cg_operating_system
    second_fit.reference_wind_speed = example.reference_wind_speed
    second_fit.reference_height = example.reference_height
    second_fit.alpha = example.alpha
    second_fit.material_density = example.material_density
    second_fit.E = example.E
    second_fit.nu =example.nu
    second_fit.yield_stress = example.yield_stress
    second_fit.rotor_mass = example.rotor_mass
    second_fit.tower_mass = example.tower_mass
    second_fit.free_board = example.free_board
    second_fit.draft = example.draft
    second_fit.fixed_ballast_mass = example.fixed_ballast_mass
    second_fit.hull_mass = example.hull_mass
    second_fit.permanent_ballast_mass = example.permanent_ballast_mass
    second_fit.variable_ballast_mass = example.variable_ballast_mass
    second_fit.number_of_sections = example.number_of_sections
    second_fit.outer_diameter = example.outer_diameter
    second_fit.length = example.length
    second_fit.end_elevation = example.end_elevation
    second_fit.start_elevation = example.start_elevation
    second_fit.bulk_head = example.bulk_head
    second_fit.system_acceleration=example.system_acceleration
    second_fit.run()
    index = opt_index
    unity = max(max(second_fit.VAL),max(second_fit.VAG),max(second_fit.VEL),max(second_fit.VEG))   
    while ((unity-1.0) > 1e-7):
        if index <124:
            index += 1
            second_fit.stiffener_index = index
            second_fit.run()
            unity = max(max(second_fit.VAL),max(second_fit.VAG),max(second_fit.VEL),max(second_fit.VEG)) 
        else:
            second_fit.stiffener_index = opt_index
            for i in range(0,second_fit.number_of_sections):
                if second_fit.VAL[i] >1. or second_fit.VAG[i]>1. or second_fit.VEL[i]>1. or second_fit.VEG[i]>1.:    
                    second_fit.number_of_rings[i] += 1 
                    second_fit.run()
                    unity = max(max(second_fit.VAL),max(second_fit.VAG),max(second_fit.VEL),max(second_fit.VEG)) 
    print '--------------example_130WD_3MW------------------'
    print "Elapsed time: ", time.time()-tt, " seconds"
    sys_print(second_fit)