Esempio n. 1
0
    def calcLoadStats(self, fname, F_p):
        # Calc statistics
        F_p_mean = np.mean(F_p)
        F_p_max  = np.max(F_p)
        F_p_min  = np.min(F_p)
        F_p_std  = np.std(F_p)

        writeToTxt(fname, "F_p_mean:      " + '{:02.3f}'.format(F_p_mean))
        writeToTxt(fname, "F_p_max:       " + '{:02.3f}'.format(F_p_max))
        writeToTxt(fname, "F_p_min:       " + '{:02.3f}'.format(F_p_min))
        writeToTxt(fname, "F_p_std:       " + '{:02.3f}'.format(F_p_std))
Esempio n. 2
0
    # Moment of Intertia   
    I = ((b+t)**4-(b-t)**4)/12

    # Stiff. red. per module
    stiff_red = 0.2

    # ULS
    # SLS
    u_lim   = H / 600           # u_r_max < u_lim
    a_lim   = 10 * 0.003        # a_r_rms < a_lim, ISO 10137 1-yr return limit for offices

    # Design for each direction
    for dn in dns:   
        
        writeToTxt(save_as, "------------------------------") 
        writeToTxt(save_as, "Direction " + dn)
        writeToTxt(save_as, "------------------------------") 

        # Load wind tunnel model properties, TPU Database files
        wtModelProp = modelProp.wtModelProp(fname)
        wtModelProp.loadTPUModelProp()

        # Calculate wind stats at different return periods
        windStats = wind.windStats(uH)
        
        # Design for deflections
        writeToTxt(save_as, "Design for deflections")
        # Set counter
        i = 0
        delta_tip_r_max = 10        
    def writeResultsToFile(self, fname, uH_fs, RPeriod):
        # Investigated wind speed
        writeToTxt(fname, "------------------------------")
        writeToTxt(fname, "u_H_mean:      " + '{:02.3f}'.format(uH_fs))
        writeToTxt(fname, "Return Period: " + RPeriod)
        writeToTxt(fname, "------------------------------")

        # Asses response with spectral analysis
        writeToTxt(fname, "Asses response with spectral analysis")
        writeToTxt(fname,
                   "a_r_std:         " + '{:02.3f}'.format(self.a_r_std))
        writeToTxt(fname, "g_peak:          " + '{:02.3f}'.format(self.g_peak))
        writeToTxt(fname,
                   "a_r_max:         " + '{:02.3f}'.format(self.a_r_max))
        writeToTxt(fname, "------------------------------")
    def writeResultsToFile(self, fname, uH_fs, RPeriod):
        # Investigated wind speed
        writeToTxt(fname, "------------------------------")
        writeToTxt(fname, "u_H_mean:      " + '{:02.3f}'.format(uH_fs))
        writeToTxt(fname, "Return Period: " + RPeriod)
        writeToTxt(fname, "------------------------------")

        # Load statistics
        writeToTxt(fname, "Aerodynamic loading")
        writeToTxt(
            fname,
            "delta_p_mean:    " + '{:02.3f}'.format(self.delta_tip_p_mean))
        writeToTxt(fname, "------------------------------")

        # Asses response with spectral analysis
        writeToTxt(fname, "Asses response with spectral analysis")
        writeToTxt(
            fname,
            "delta_r_std:     " + '{:02.3f}'.format(self.delta_tip_r_std))
        writeToTxt(fname, "g_peak:          " + '{:02.3f}'.format(self.g_peak))
        writeToTxt(
            fname,
            "delta_r_max:     " + '{:02.3f}'.format(self.delta_tip_r_max))
        writeToTxt(fname, "------------------------------")
Esempio n. 5
0
    def calcPeakDeflection(self, fname, F_r_std, H_fs, E, I, mue, nz, z_lev_fs):
        # Setting up dynamic calculation
        # ------------
        # preprocessor
        # ---------

        # constants & lists
        L = H_fs                        # length of the beam [m]
        n = nz                          # no of nodes [-]
        z = np.append(L, z_lev_fs)      # coordinates [m], append top of building
        z = np.append(z, 0)             # coordinates [m], append support node
        num_modes = 1

        # everything starts with the analysis object
        analysis = FrameAnalysis2D()

        # materials and sections are objects
        mat_dummy = Material("Dummy", E, 0.3, mue, colour='w')
        section = Section(area=1, ixx=I)

        # nodes are objects
        nodes = []
        for i in range(0,n+2): #! n+2 (support, tip)
            node = analysis.create_node(coords=[0, z[i]])
            nodes.append(node)

        # and so are beams!
        beams = []
        for i in range(0,n+1): #! n+1 (support, tip)
            beam = analysis.create_element(
                el_type='EB2-2D', nodes=[nodes[i], nodes[i+1]], material=mat_dummy, section=section)
            beams.append(beam)

        # boundary conditions are objects
        freedom_case = cases.FreedomCase()
        freedom_case.add_nodal_support(node=nodes[-1], val=0, dof=0)
        freedom_case.add_nodal_support(node=nodes[-1], val=0, dof=1)
        freedom_case.add_nodal_support(node=nodes[-1], val=0, dof=5)

        # add analysis case
        analysis_case = cases.AnalysisCase(freedom_case=freedom_case, load_case=cases.LoadCase())

        # ----------------
        # frequency solver
        # ----------------

        settings = SolverSettings()
        settings.natural_frequency.time_info = True
        settings.natural_frequency.num_modes = num_modes

        solver = NaturalFrequency(
            analysis=analysis, analysis_cases=[analysis_case], solver_settings=settings)

        # Manual solver, see feastruct/solvers/naturalfrequency.py, in order
        # to extract mass/stiffness-matrix and eigenvectors      
        # assign the global degree of freedom numbers
        solver.assign_dofs()

        # Get the global stiffness / mass matrix
        (K, Kg) = solver.assemble_stiff_matrix()
        M = solver.assemble_mass_matrix()

        # apply the boundary conditions
        K_mod = solver.remove_constrained_dofs(K=K, analysis_case=analysis_case)
        M_mod = solver.remove_constrained_dofs(K=M, analysis_case=analysis_case)

        # Solve for the eigenvalues
        (w, v) = solver.solve_eigenvalue(A=K_mod, M=M_mod, eigen_settings=settings.natural_frequency)

        # compute natural frequencies in Hz
        f = np.sqrt(w) / 2 / np.pi

        # Normalize Eigenvector
        v = v / v[0] * L

        # # Get only dof ux
        # u = np.zeros(n+1)
        # for i in range(0, n+1):
        #     j = i * 3
        #     u[i] = v[j]

        # Get generalized quantities
        K_mod = K_mod.toarray()
        K_gen = np.dot(np.dot(v.T, K_mod), v)

        M_mod = M_mod.toarray()
        M_gen = np.dot(np.dot(v.T, M_mod), v)  

        # To check, compute 
        # f_k = np.sqrt(K_gen/M_gen) / 2 / np.pi  
        # print(f/f_k)
        # K_gen = 3 * E * I /(L^3) / L
        K_gen = K_gen[0][0] 

        # Calculate peak displacement
        delta_r_std = v[0][0] / K_gen * F_r_std 
        g_peak = response.calcPeakFactor(self, 3600, f[0])      # Peak Factor   
        

        delta_r_max = g_peak * delta_r_std        

        writeToTxt(fname, "delta_r_std:     " + '{:02.3f}'.format(delta_r_std))
        writeToTxt(fname, "g_peak:          " + '{:02.3f}'.format(g_peak))
        writeToTxt(fname, "delta_r_max:     " + '{:02.3f}'.format(delta_r_max))
Esempio n. 6
0
    def calcMeanDeflection(self, fname, F_p_j, H_fs, E, I, nz, z_lev_fs):
        # Setting up static calculation
        # ------------
        # preprocessor
        # ---------

        # constants & lists
        L = H_fs                        # length of the beam [m]
        n = nz                          # no of nodes [-]
        z = np.append(L, z_lev_fs)      # coordinates [m], append top of building
        z = np.append(z, 0)             # coordinates [m], append support node

        # everything starts with the analysis object
        analysis = FrameAnalysis2D()

        # materials and sections are objects
        mat_dummy = Material("Dummy", E, 0.3, 1, colour='w')
        section = Section(area=1, ixx=I)

        # nodes are objects
        nodes = []
        for i in range(0,n+2): #! n+2 (support, tip)
            node = analysis.create_node(coords=[0, z[i]])
            nodes.append(node)

        # and so are beams!
        beams = []
        for i in range(0,n+1): #! n+1 (support, tip)
            beam = analysis.create_element(
                el_type='EB2-2D', nodes=[nodes[i], nodes[i+1]], material=mat_dummy, section=section)
            beams.append(beam)

        # boundary conditions are objects
        freedom_case = cases.FreedomCase()
        freedom_case.add_nodal_support(node=nodes[-1], val=0, dof=0)
        freedom_case.add_nodal_support(node=nodes[-1], val=0, dof=1)
        freedom_case.add_nodal_support(node=nodes[-1], val=0, dof=5)

        # so are loads!
        load_case = cases.LoadCase()

        for i in range(n):
            F_p = np.mean(F_p_j[i])        #[in KN]
            load_case.add_nodal_load(node=nodes[i+1], val=F_p , dof=0) # i+1 (support, tip)

        # an analysis case relates a support case to a load case
        analysis_case = cases.AnalysisCase(freedom_case=freedom_case, load_case=load_case)

        # ------
        # solver
        # ------

        # you can easily change the solver settings
        settings = SolverSettings()
        settings.linear_static.time_info = False

        # the linear static solver is an object and acts on the analysis object
        solver = LinearStatic(analysis=analysis, analysis_cases=[analysis_case], solver_settings=settings)
        solver.solve()

        # ----
        # post
        # ----
        # there are plenty of post processing options!
        # analysis.post.plot_geom(analysis_case=analysis_case)
        # analysis.post.plot_geom(analysis_case=analysis_case, deformed=True, def_scale=1e2)
        # analysis.post.plot_frame_forces(analysis_case=analysis_case, shear=True)
        # analysis.post.plot_frame_forces(analysis_case=analysis_case, moment=True)
        # analysis.post.plot_reactions(analysis_case=analysis_case)
        
        # Support reactions, to check bending moment for validation
        for support in analysis_case.freedom_case.items:
            if support.dof in [5]:
                reaction = support.get_reaction(analysis_case=analysis_case)

        # read out deformation at top 
        self.delta_p_mean = nodes[0].get_displacements(analysis_case)[0]

        writeToTxt(fname, "delta_p_mean:    " + '{:02.3f}'.format(self.delta_p_mean))
Esempio n. 7
0
    def calcResponse(self, fname, E_D, I_D, E_L, I_L, mue):
        # Investigated wind speed
        writeToTxt(fname, "------------------------------")
        writeToTxt(fname, "u_H_mean:      " + '{:02.3f}'.format(self.uH_fs))
        writeToTxt(fname, "Return Period: " + self.RPeriod)
        writeToTxt(fname, "------------------------------")     

        # Base moment, drag direction
        writeToTxt(fname, "Deflections in drag direction [m]")
        TipResponseDeflections.calcMeanDeflection(self, fname, self.modelForces.F_p_fs_D, self.H_fs, E_D, I_D,\
                self.modelForces.nz, self.modelForces.z_lev * self.lambda_g)
        TipResponseDeflections.calcPeakDeflection(self, fname, 146332.508, self.H_fs, E_D, I_D, mue, \
                self.modelForces.nz, self.modelForces.z_lev * self.lambda_g)

        writeToTxt(fname, "------------------------------")

        # Base moment, lift direction
        writeToTxt(fname, "Deflections in lift direction [m]")
        TipResponseDeflections.calcMeanDeflection(self, fname, self.modelForces.F_p_fs_L, self.H_fs, E_L, I_L,\
                self.modelForces.nz, self.modelForces.z_lev * self.lambda_g)
        TipResponseDeflections.calcPeakDeflection(self, fname, 370125.002, self.H_fs, E_D, I_D, mue, \
                self.modelForces.nz, self.modelForces.z_lev * self.lambda_g)

        writeToTxt(fname, "------------------------------")
Esempio n. 8
0
    def calcPeakLoading(self, fname, F_p, dT, fq_e, D):
        # Asses response with spectral analysis
        # --------------------  
        # Transform only the fluctuations "F_p_prime" to frequency domain
        F_p_mean  = np.mean(F_p)  
        F_p_prime = F_p - F_p_mean
        S_p, fq_p = response.transToSpectralDomain(self, F_p_prime, dT)

        # Apply mechanical admittance to the spectrum
        S_r = response.calcSpectralResponse(self, fq_p, S_p, fq_e, D)

        # # Setting up data to be plotted
        # plt.plot2D(fq_p, S_r, "f [Hz]", "Sr", "Spectrum", ["PSD"], xscale='log', yscale='log', savePlt=False, showPlt=True)

        # Perform the numerical integration
        F_r_std = response.numericalIntSpectrum(self, dT, S_r)

        # Estimate peak values
        g_peak = response.calcPeakFactor(self, 3600, fq_e)      # Peak Factor    
        F_r_max = F_p_mean + g_peak * F_r_std                   # Estimate max. response

        writeToTxt(fname, "Asses response with spectral analysis")
        writeToTxt(fname, "F_p_mean:        " + '{:02.3f}'.format(F_p_mean))
        writeToTxt(fname, "F_r_std:         " + '{:02.3f}'.format(F_r_std))
        writeToTxt(fname, "g_peak:          " + '{:02.3f}'.format(g_peak))
        writeToTxt(fname, "F_r_max:         " + '{:02.3f}'.format(F_r_max))

        # Comparison with the loading
        # --------------------  
        F_p_max = np.max(F_p)
        DLF_max = F_r_max / F_p_max

        writeToTxt(fname, "Comparison with loading")
        writeToTxt(fname, "F_p_max:         " + '{:02.3f}'.format(F_p_max))
        writeToTxt(fname, "DLF(F_max):      " + '{:02.3f}'.format(DLF_max))
Esempio n. 9
0
    def calcResponse(self, fname, fq_e_D, fq_e_L, D):
        # Investigated wind speed
        writeToTxt(fname, "------------------------------")
        writeToTxt(fname, "u_H_mean:      " + '{:02.3f}'.format(self.uH_fs))
        writeToTxt(fname, "Return Period: " + self.RPeriod)
        writeToTxt(fname, "------------------------------")     

        # Base moment, drag direction
        writeToTxt(fname, "Base moment in drag direction [kNm]")
        baseResponseForces.calcLoadStats(self, fname, self.modelForces.BM_p_fs_D)
        baseResponseForces.calcPeakLoading(self, fname, self.modelForces.BM_p_fs_D, self.dT_fs, fq_e_D, D)
        writeToTxt(fname, "------------------------------")

        # Base moment, lift direction
        writeToTxt(fname, "Base moment in lift direction [kNm]")
        baseResponseForces.calcLoadStats(self, fname, self.modelForces.BM_p_fs_L)
        baseResponseForces.calcPeakLoading(self, fname, self.modelForces.BM_p_fs_L, self.dT_fs, fq_e_L, D)
        writeToTxt(fname, "------------------------------")