示例#1
0
    def test15MWmode_shapes(self):
        # --- geometry ----
        h_param = np.array([5., 5., 5., 5., 5., 5., 5., 5., 5., 13.,  13.,  13.,  13.,  13.,  13.,  13.,  13.,  13., 14.1679])
        d_param = np.array([10., 10., 10., 10., 10., 10., 10., 10., 10., 10., 10., 9.92647687, 9.44319282, 8.83283769, 8.15148167, 7.38976138, 6.90908962, 6.74803581, 6.57231775, 6.5])
        t_param = np.array([0.05534138, 0.05344902, 0.05150928, 0.04952705, 0.04751736, 0.04551709, 0.0435267, 0.04224176, 0.04105759, 0.0394965, 0.03645589, 0.03377851, 0.03219233, 0.03070819, 0.02910109, 0.02721289, 0.02400931, 0.0208264, 0.02399756])

        self.modeling_options['tower']['n_height'] = len(d_param)
        
        prob = om.Problem()
        prob.model = tow.TowerSE(modeling_options=self.modeling_options)
        prob.setup()
        
        # Set common and then customized parameters
        prob['hub_height'] = prob['wind_reference_height'] = 30+146.1679
        prob['foundation_height'] = 0.0 #-30.0

        prob['tower_s'] = np.cumsum(np.r_[0.0, h_param]) / h_param.sum()
        prob['tower_height'] = h_param.sum()
        prob['tower_outer_diameter_in'] = d_param
        prob['tower_layer_thickness'] = t_param.reshape( (1,len(t_param)) )
        prob['tower_outfitting_factor'] = 1.0
        prob['tower_layer_materials'] = ['steel']
        prob['material_names'] = ['steel']
        prob['E_mat'] = 210e9*np.ones((1,3))
        prob['G_mat'] = 79.3e9*np.ones((1,3))
        prob['rho_mat'] = 7850.0
        prob['sigma_y_mat'] = 345e6
        
        prob['suctionpile_depth'] = 0.0 #45.0
        prob['yaw'] = 0.0
        prob['transition_piece_mass'] = 0.0 #100e3
        prob['transition_piece_cost'] = 0.0 #100e3
        prob['transition_piece_height'] = 0.0 #15.0
        #prob['G_soil'] = 140e6
        #prob['nu_soil'] = 0.4
        prob['shearExp'] = 0.11
        prob['rho_air'] = 1.225
        prob['wind_z0'] = 0.0
        prob['mu_air'] = 1.7934e-5
        prob['life'] = 20.0

        mIxx = 379640227.0
        mIyy = 224477294.0
        mIzz = 182971949.0
        mIxy = 0.0
        mIxz = -7259625.38
        mIyz = 0.0
        prob['rna_mass'] = 1007537.0
        prob['rna_I'] = np.array([mIxx, mIyy, mIzz, mIxy, mIxz, mIyz])
        prob['rna_cg'] = np.array([-5.019, 0., 0.])

        prob['wind.Uref'] = 0.0 #20.00138038
        prob['pre.rna_F'] = np.zeros(3) #np.array([3569257.70891496, -22787.83765441, -404483.54819059])
        prob['pre.rna_M'] = np.zeros(3) #np.array([68746553.1515807, 16045443.38557568, 1811078.988995])
        prob['min_d_to_t'] = 120.0
        prob['max_taper']  = 0.2

        # # --- run ---
        prob.run_model()
        '''
示例#2
0
    def testAddedMassForces(self):
        prob = om.Problem()
        prob.model = tow.TowerSE(nLC=1,
                                 nPoints=4,
                                 nFull=10,
                                 wind='PowerWind',
                                 topLevelFlag=True,
                                 monopile=True)
        prob.setup()

        prob['shearExp'] = 0.2
        prob['hub_height'] = 80.0
        prob['foundation_height'] = -30.0
        prob['transition_piece_height'] = 15.0
        prob['transition_piece_mass'] = 0.0
        prob['gravity_foundation_mass'] = 0.0
        prob['tower_section_height'] = 30.0 * np.ones(3)
        prob['tower_outer_diameter'] = 10.0 * np.ones(4)
        prob['tower_wall_thickness'] = 0.1 * np.ones(3)
        prob['tower_buckling_length'] = 20.0
        prob['tower_outfitting_factor'] = 1.0
        prob['yaw'] = 0.0
        prob['suctionpile_depth'] = 15.0
        prob['soil_G'] = 1e7
        prob['soil_nu'] = 0.5
        prob['E'] = 1e9
        prob['G'] = 1e8
        prob['material_density'] = 1e4
        prob['sigma_y'] = 1e8
        prob['rna_mass'] = 0.0
        prob['rna_I'] = np.r_[1e5, 1e5, 2e5, np.zeros(3)]
        prob['rna_cg'] = np.array([-3., 0.0, 1.0])
        prob['wind_reference_height'] = 80.0
        prob['wind_z0'] = 0.0
        prob['cd_usr'] = -1.
        prob['air_density'] = 1.225
        prob['air_viscosity'] = 1.7934e-5
        prob['water_density'] = 1025.0
        prob['water_viscosity'] = 1.3351e-3
        prob['wind_beta'] = prob['wave_beta'] = 0.0
        prob['significant_wave_height'] = 0.0
        prob['significant_wave_period'] = 1e3
        prob['gamma_f'] = 1.0
        prob['gamma_m'] = 1.0
        prob['gamma_n'] = 1.0
        prob['gamma_b'] = 1.0
        prob['gamma_fatigue'] = 1.0
        prob['DC'] = 80.0
        prob['shear'] = True
        prob['geom'] = True
        prob['tower_force_discretization'] = 5.0
        prob['nM'] = 2
        prob['Mmethod'] = 1
        prob['lump'] = 0
        prob['tol'] = 1e-9
        prob['shift'] = 0.0
        prob['min_d_to_t'] = 120.0
        prob['max_taper'] = 0.2
        prob['wind.Uref'] = 15.0
        prob['pre.rna_F'] = 1e3 * np.array([
            2.,
            3.,
            4.,
        ])
        prob['pre.rna_M'] = 1e4 * np.array([
            2.,
            3.,
            4.,
        ])
        prob.run_model()

        myFz = copy.copy(prob['post.Fz'])

        prob['rna_mass'] = 1e4
        prob.run_model()
        myFz[3:] -= 1e4 * g
        npt.assert_almost_equal(prob['post.Fz'], myFz)

        prob['transition_piece_mass'] = 1e2
        prob.run_model()
        myFz[3:7] -= 1e2 * g
        npt.assert_almost_equal(prob['post.Fz'], myFz)

        prob['gravity_foundation_mass'] = 1e3
        prob.run_model()
        #myFz[3] -= 1e3*g
        npt.assert_almost_equal(prob['post.Fz'], myFz)
示例#3
0
    def testProblemFixedPile(self):
        prob = om.Problem()
        prob.model = tow.TowerSE(nLC=1,
                                 nPoints=4,
                                 nFull=10,
                                 wind='PowerWind',
                                 topLevelFlag=True,
                                 monopile=True)
        prob.setup()

        prob['shearExp'] = 0.2
        prob['hub_height'] = 80.0
        prob['foundation_height'] = -30.0
        prob['transition_piece_height'] = 15.0
        prob['transition_piece_mass'] = 1e2
        prob['gravity_foundation_mass'] = 1e4
        prob['tower_section_height'] = 30.0 * np.ones(3)
        prob['tower_outer_diameter'] = 10.0 * np.ones(4)
        prob['tower_wall_thickness'] = 0.1 * np.ones(3)
        prob['tower_buckling_length'] = 20.0
        prob['tower_outfitting_factor'] = 1.0
        prob['yaw'] = 0.0
        prob['suctionpile_depth'] = 15.0
        prob['soil_G'] = 1e7
        prob['soil_nu'] = 0.5
        prob['E'] = 1e9
        prob['G'] = 1e8
        prob['material_density'] = 1e4
        prob['sigma_y'] = 1e8
        prob['rna_mass'] = 2e5
        prob['rna_I'] = np.r_[1e5, 1e5, 2e5, np.zeros(3)]
        prob['rna_cg'] = np.array([-3., 0.0, 1.0])
        prob['wind_reference_height'] = 80.0
        prob['wind_z0'] = 0.0
        prob['cd_usr'] = -1.
        prob['air_density'] = 1.225
        prob['air_viscosity'] = 1.7934e-5
        prob['water_density'] = 1025.0
        prob['water_viscosity'] = 1.3351e-3
        prob['wind_beta'] = prob['wave_beta'] = 0.0
        prob['significant_wave_height'] = 0.0
        prob['significant_wave_period'] = 1e3
        prob['gamma_f'] = 1.0
        prob['gamma_m'] = 1.0
        prob['gamma_n'] = 1.0
        prob['gamma_b'] = 1.0
        prob['gamma_fatigue'] = 1.0
        prob['DC'] = 80.0
        prob['shear'] = True
        prob['geom'] = True
        prob['tower_force_discretization'] = 5.0
        prob['nM'] = 2
        prob['Mmethod'] = 1
        prob['lump'] = 0
        prob['tol'] = 1e-9
        prob['shift'] = 0.0
        prob['min_d_to_t'] = 120.0
        prob['max_taper'] = 0.2
        prob['wind.Uref'] = 15.0
        prob['pre.rna_F'] = 1e3 * np.array([
            2.,
            3.,
            4.,
        ])
        prob['pre.rna_M'] = 1e4 * np.array([
            2.,
            3.,
            4.,
        ])
        prob.run_model()

        # All other tests from above
        mass_dens = 1e4 * (5.**2 - 4.9**2) * np.pi
        npt.assert_equal(prob['section_height_out'], np.r_[15.,
                                                           30. * np.ones(3)])
        npt.assert_equal(prob['outer_diameter_out'], 10. * np.ones(5))
        npt.assert_equal(prob['wall_thickness_out'], 0.1 * np.ones(4))
        npt.assert_equal(prob['z_param'], np.array([-45., -30., 0., 30., 60.]))

        self.assertEqual(prob['height_constraint'], 20.0)
        self.assertEqual(prob['tower_raw_cost'],
                         (40. / 105.) * prob['cm.cost'])
        npt.assert_equal(prob['tower_I_base'], prob['cm.I_base'])
        npt.assert_almost_equal(
            prob['tower_center_of_mass'],
            (7.5 * mass_dens * 105. + 15. * 1e2 + 1e4 * -30.) /
            (mass_dens * 105 + 1e2 + 1e4))
        npt.assert_equal(prob['tower_section_center_of_mass'],
                         prob['cm.section_center_of_mass'])
        self.assertEqual(prob['monopile_cost'], (60. / 105.) * prob['cm.cost'])
        self.assertEqual(prob['monopile_length'], 60.0)
        npt.assert_almost_equal(prob['monopile_mass'],
                                mass_dens * 60.0 + 1e2 + 1e4)
        npt.assert_almost_equal(prob['tower_mass'], mass_dens * 45.0)

        npt.assert_equal(prob['pre.kidx'], np.array([0, 1, 2, 3],
                                                    dtype=np.int_))
        npt.assert_array_less(prob['pre.kx'], 1e16)
        npt.assert_array_less(prob['pre.ky'], 1e16)
        npt.assert_array_less(prob['pre.kz'], 1e16)
        npt.assert_array_less(prob['pre.ktx'], 1e16)
        npt.assert_array_less(prob['pre.kty'], 1e16)
        npt.assert_array_less(prob['pre.ktz'], 1e16)
        npt.assert_array_less(0.0, prob['pre.kx'])
        npt.assert_array_less(0.0, prob['pre.ky'])
        npt.assert_array_less(0.0, prob['pre.kz'])
        npt.assert_array_less(0.0, prob['pre.ktx'])
        npt.assert_array_less(0.0, prob['pre.kty'])
        npt.assert_array_less(0.0, prob['pre.ktz'])

        npt.assert_equal(prob['pre.midx'], np.array([12, 7, 0]))
        npt.assert_equal(prob['pre.m'], np.array([2e5, 1e2, 1e4]))
        npt.assert_equal(prob['pre.mrhox'], np.array([-3., 0., 0.]))
        npt.assert_equal(prob['pre.mrhoy'], np.array([0., 0., 0.]))
        npt.assert_equal(prob['pre.mrhoz'], np.array([1., 0., 0.]))
        npt.assert_equal(prob['pre.mIxx'],
                         np.array([1e5, 1e2 * 25 * 0.5, 1e4 * 25 * 0.25]))
        npt.assert_equal(prob['pre.mIyy'],
                         np.array([1e5, 1e2 * 25 * 0.5, 1e4 * 25 * 0.25]))
        npt.assert_equal(prob['pre.mIzz'],
                         np.array([2e5, 1e2 * 25, 1e4 * 25 * 0.5]))
        npt.assert_equal(prob['pre.mIxy'], np.zeros(3))
        npt.assert_equal(prob['pre.mIxz'], np.zeros(3))
        npt.assert_equal(prob['pre.mIyz'], np.zeros(3))

        npt.assert_equal(prob['pre.plidx'], np.array([12]))
        npt.assert_equal(prob['pre.Fx'], np.array([2e3]))
        npt.assert_equal(prob['pre.Fy'], np.array([3e3]))
        npt.assert_equal(prob['pre.Fz'], np.array([4e3]))
        npt.assert_equal(prob['pre.Mxx'], np.array([2e4]))
        npt.assert_equal(prob['pre.Myy'], np.array([3e4]))
        npt.assert_equal(prob['pre.Mzz'], np.array([4e4]))
示例#4
0
        def fill_prob():
            prob = om.Problem()
            prob.model = tow.TowerSE(modeling_options=self.modeling_options)
            prob.setup()

            if self.modeling_options["WISDEM"]["TowerSE"]["wind"] == "PowerWind":
                prob["shearExp"] = shearExp

            # assign values to params

            # --- geometry ----
            prob["hub_height"] = h_param.sum()
            prob["water_depth"] = water_depth
            # prob['tower_section_height'] = h_param
            prob["tower_s"] = np.cumsum(np.r_[0.0, h_param]) / h_param.sum()
            prob["tower_foundation_height"] = z_foundation
            prob["tower_height"] = h_param.sum()
            prob["tower_outer_diameter_in"] = d_param
            # prob['tower_wall_thickness'] = t_param
            prob["tower_layer_thickness"] = t_param.reshape((1, len(t_param)))
            prob["tower_outfitting_factor"] = Koutfitting
            prob["tower_layer_materials"] = ["steel"]
            prob["material_names"] = ["steel"]
            prob["yaw"] = yaw
            # prob["G_soil"] = soilG
            # prob["nu_soil"] = soilnu
            # --- material props ---
            prob["E_mat"] = E * np.ones((1, 3))
            prob["G_mat"] = G * np.ones((1, 3))
            prob["rho_mat"] = rho
            prob["sigma_y_mat"] = sigma_y

            # --- extra mass ----
            prob["rna_mass"] = m
            prob["rna_I"] = mI
            prob["rna_cg"] = mrho
            # -----------

            # --- costs ---
            prob["unit_cost"] = material_cost
            prob["labor_cost_rate"] = labor_cost
            prob["painting_cost_rate"] = painting_cost
            # -----------

            # --- wind & wave ---
            prob["wind_reference_height"] = wind_zref
            prob["z0"] = wind_z0
            prob["cd_usr"] = cd_usr
            prob["rho_air"] = 1.225
            prob["mu_air"] = 1.7934e-5

            # --- fatigue ---
            prob["life"] = life
            # ---------------

            # # --- loading case 1: max Thrust ---
            prob["wind1.Uref"] = wind_Uref1

            prob["pre1.rna_F"] = np.r_[Fx1, Fy1, Fz1]
            prob["pre1.rna_M"] = np.r_[Mxx1, Myy1, Mzz1]
            # # ---------------

            # # --- loading case 2: max Wind Speed ---
            prob["wind2.Uref"] = wind_Uref2

            prob["pre2.rna_F"] = np.r_[Fx2, Fy2, Fz2]
            prob["pre2.rna_M"] = np.r_[Mxx2, Myy2, Mzz2]

            return prob
示例#5
0
    def testProblemLand(self):

        prob = om.Problem()
        prob.model = tow.TowerSE(modeling_options=self.modeling_options)
        prob.setup()

        prob["hub_height"] = 80.0
        prob["transition_piece_mass"] = 0.0
        prob["transition_piece_cost"] = 0.0
        prob["gravity_foundation_mass"] = 0.0

        prob["tower_s"] = np.linspace(0, 1, 3)
        prob["tower_foundation_height"] = 0.0
        prob["tower_height"] = 80.0
        # prob['tower_section_height'] = 40.0*np.ones(2)
        prob["tower_outer_diameter_in"] = 10.0 * np.ones(3)
        prob["tower_layer_thickness"] = 0.1 * np.ones((1, 3))
        prob["tower_outfitting_factor"] = 1.0
        prob["tower_layer_materials"] = ["steel"]
        prob["material_names"] = ["steel"]
        prob["E_mat"] = 1e9 * np.ones((1, 3))
        prob["G_mat"] = 1e8 * np.ones((1, 3))
        prob["rho_mat"] = 1e4
        prob["sigma_y_mat"] = 1e8

        prob["yaw"] = 0.0
        prob["rna_mass"] = 2e5
        prob["rna_I"] = np.r_[1e5, 1e5, 2e5, np.zeros(3)]
        prob["rna_cg"] = np.array([-3.0, 0.0, 1.0])
        prob["wind_reference_height"] = 80.0
        prob["z0"] = 0.0
        prob["cd_usr"] = -1.0
        prob["rho_air"] = 1.225
        prob["mu_air"] = 1.7934e-5
        prob["shearExp"] = 0.2
        prob["wind.Uref"] = 15.0
        prob["pre.rna_F"] = 1e3 * np.array(
            [
                2.0,
                3.0,
                4.0,
            ]
        )
        prob["pre.rna_M"] = 1e4 * np.array(
            [
                2.0,
                3.0,
                4.0,
            ]
        )
        prob.run_model()

        # All other tests from above
        mass_dens = 1e4 * (5.0 ** 2 - 4.9 ** 2) * np.pi
        npt.assert_equal(prob["z_start"], 0.0)
        npt.assert_equal(prob["transition_piece_height"], 0.0)
        npt.assert_equal(prob["suctionpile_depth"], 0.0)
        npt.assert_equal(prob["z_param"], np.array([0.0, 40.0, 80.0]))

        self.assertEqual(prob["height_constraint"], 0.0)
        self.assertEqual(prob["tower_cost"], prob["cm.cost"])
        npt.assert_equal(prob["tower_I_base"], prob["cm.I_base"])
        npt.assert_almost_equal(prob["tower_center_of_mass"], 40.0)
        npt.assert_equal(prob["tower_section_center_of_mass"], prob["cm.section_center_of_mass"])
        self.assertEqual(prob["monopile_mass"], 0.0)
        self.assertEqual(prob["monopile_cost"], 0.0)
        npt.assert_almost_equal(prob["tower_mass"], mass_dens * 80.0)

        npt.assert_equal(prob["pre.kidx"], np.array([0], dtype=np.int_))
        npt.assert_equal(prob["pre.kx"], np.array([RIGID]))
        npt.assert_equal(prob["pre.ky"], np.array([RIGID]))
        npt.assert_equal(prob["pre.kz"], np.array([RIGID]))
        npt.assert_equal(prob["pre.ktx"], np.array([RIGID]))
        npt.assert_equal(prob["pre.kty"], np.array([RIGID]))
        npt.assert_equal(prob["pre.ktz"], np.array([RIGID]))

        npt.assert_equal(prob["pre.midx"], np.array([6, 0, 0]))
        npt.assert_equal(prob["pre.m"], np.array([2e5, 0, 0]))
        npt.assert_equal(prob["pre.mrhox"], np.array([-3.0, 0.0, 0.0]))
        npt.assert_equal(prob["pre.mrhoy"], np.array([0.0, 0.0, 0.0]))
        npt.assert_equal(prob["pre.mrhoz"], np.array([1.0, 0.0, 0.0]))
        npt.assert_equal(prob["pre.mIxx"], np.array([1e5, 0.0, 0.0]))
        npt.assert_equal(prob["pre.mIyy"], np.array([1e5, 0.0, 0.0]))
        npt.assert_equal(prob["pre.mIzz"], np.array([2e5, 0.0, 0.0]))
        npt.assert_equal(prob["pre.mIxy"], np.zeros(3))
        npt.assert_equal(prob["pre.mIxz"], np.zeros(3))
        npt.assert_equal(prob["pre.mIyz"], np.zeros(3))

        npt.assert_equal(prob["pre.plidx"], np.array([6]))
        npt.assert_equal(prob["pre.Fx"], np.array([2e3]))
        npt.assert_equal(prob["pre.Fy"], np.array([3e3]))
        npt.assert_equal(prob["pre.Fz"], np.array([4e3]))
        npt.assert_equal(prob["pre.Mxx"], np.array([2e4]))
        npt.assert_equal(prob["pre.Myy"], np.array([3e4]))
        npt.assert_equal(prob["pre.Mzz"], np.array([4e4]))
示例#6
0
    def test15MWmode_shapes(self):
        # --- geometry ----
        h_param = np.array(
            [5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 13.0, 13.0, 13.0, 13.0, 13.0, 13.0, 13.0, 13.0, 13.0, 14.1679]
        )
        d_param = np.array(
            [
                10.0,
                10.0,
                10.0,
                10.0,
                10.0,
                10.0,
                10.0,
                10.0,
                10.0,
                10.0,
                10.0,
                9.92647687,
                9.44319282,
                8.83283769,
                8.15148167,
                7.38976138,
                6.90908962,
                6.74803581,
                6.57231775,
                6.5,
            ]
        )
        t_param = np.array(
            [
                0.05534138,
                0.05534138,
                0.05344902,
                0.05150928,
                0.04952705,
                0.04751736,
                0.04551709,
                0.0435267,
                0.04224176,
                0.04105759,
                0.0394965,
                0.03645589,
                0.03377851,
                0.03219233,
                0.03070819,
                0.02910109,
                0.02721289,
                0.02400931,
                0.0208264,
                0.02399756,
            ]
        )

        self.modeling_options["WISDEM"]["TowerSE"]["n_height_tower"] = len(d_param)
        self.modeling_options["WISDEM"]["TowerSE"]["n_height"] = len(d_param)

        prob = om.Problem()
        prob.model = tow.TowerSE(modeling_options=self.modeling_options)
        prob.setup()

        # Set common and then customized parameters
        prob["hub_height"] = prob["wind_reference_height"] = 30 + 146.1679
        # prob["foundation_height"] = 0.0  # -30.0

        prob["tower_s"] = np.cumsum(np.r_[0.0, h_param]) / h_param.sum()
        prob["tower_foundation_height"] = 0.0  # 15.0
        prob["water_depth"] = 0.0  # 15.0
        prob["tower_height"] = h_param.sum()
        prob["tower_outer_diameter_in"] = d_param
        prob["tower_layer_thickness"] = t_param.reshape((1, len(t_param)))
        prob["tower_outfitting_factor"] = 1.0
        prob["tower_layer_materials"] = ["steel"]
        prob["material_names"] = ["steel"]
        prob["E_mat"] = 210e9 * np.ones((1, 3))
        prob["G_mat"] = 79.3e9 * np.ones((1, 3))
        prob["rho_mat"] = 7850.0
        prob["sigma_y_mat"] = 345e6

        prob["yaw"] = 0.0
        prob["transition_piece_mass"] = 0.0  # 100e3
        prob["transition_piece_cost"] = 0.0  # 100e3
        # prob['G_soil'] = 140e6
        # prob['nu_soil'] = 0.4
        prob["shearExp"] = 0.11
        prob["rho_air"] = 1.225
        prob["z0"] = 0.0
        prob["mu_air"] = 1.7934e-5
        prob["life"] = 20.0

        mIxx = 379640227.0
        mIyy = 224477294.0
        mIzz = 182971949.0
        mIxy = 0.0
        mIxz = -7259625.38
        mIyz = 0.0
        prob["rna_mass"] = 1007537.0
        prob["rna_I"] = np.array([mIxx, mIyy, mIzz, mIxy, mIxz, mIyz])
        prob["rna_cg"] = np.array([-5.019, 0.0, 0.0])

        prob["wind.Uref"] = 0.0  # 20.00138038
        prob["pre.rna_F"] = np.zeros(3)  # np.array([3569257.70891496, -22787.83765441, -404483.54819059])
        prob["pre.rna_M"] = np.zeros(3)  # np.array([68746553.1515807, 16045443.38557568, 1811078.988995])

        # # --- run ---
        prob.run_model()
        """
示例#7
0
    def testAddedMassForces(self):
        self.modeling_options["WISDEM"]["TowerSE"]["n_height_monopile"] = 3
        self.modeling_options["WISDEM"]["TowerSE"]["n_layers_monopile"] = 1
        self.modeling_options["WISDEM"]["TowerSE"]["n_height"] = 5
        self.modeling_options["WISDEM"]["TowerSE"]["soil_springs"] = False
        self.modeling_options["WISDEM"]["TowerSE"]["gravity_foundation"] = False
        self.modeling_options["flags"]["monopile"] = True

        prob = om.Problem()
        prob.model = tow.TowerSE(modeling_options=self.modeling_options)
        prob.setup()

        prob["hub_height"] = 80.0
        prob["water_depth"] = 30.0
        prob["transition_piece_mass"] = 0.0
        prob["transition_piece_cost"] = 0.0
        prob["gravity_foundation_mass"] = 0.0

        prob["tower_s"] = np.linspace(0, 1, 3)
        prob["tower_foundation_height"] = 0.0
        prob["tower_height"] = 60.0
        prob["tower_outer_diameter_in"] = 10.0 * np.ones(3)
        prob["tower_layer_thickness"] = 0.1 * np.ones((1, 3))
        prob["tower_outfitting_factor"] = 1.0
        hval = np.array([15.0, 30.0])
        prob["monopile_s"] = np.cumsum(np.r_[0, hval]) / hval.sum()
        prob["monopile_foundation_height"] = -45.0
        prob["monopile_height"] = hval.sum()
        prob["monopile_outer_diameter_in"] = 10.0 * np.ones(3)
        prob["monopile_layer_thickness"] = 0.1 * np.ones((1, 3))
        prob["monopile_outfitting_factor"] = 1.0
        prob["tower_layer_materials"] = prob["monopile_layer_materials"] = ["steel"]
        prob["material_names"] = ["steel"]
        prob["E_mat"] = 1e9 * np.ones((1, 3))
        prob["G_mat"] = 1e8 * np.ones((1, 3))
        prob["rho_mat"] = 1e4
        prob["sigma_y_mat"] = 1e8

        prob["yaw"] = 0.0
        # prob["G_soil"] = 1e7
        # prob["nu_soil"] = 0.5
        prob["rna_mass"] = 0.0
        prob["rna_I"] = np.r_[1e5, 1e5, 2e5, np.zeros(3)]
        prob["rna_cg"] = np.array([-3.0, 0.0, 1.0])
        prob["wind_reference_height"] = 80.0
        prob["z0"] = 0.0
        prob["cd_usr"] = -1.0
        prob["rho_air"] = 1.225
        prob["mu_air"] = 1.7934e-5
        prob["shearExp"] = 0.2
        prob["rho_water"] = 1025.0
        prob["mu_water"] = 1.3351e-3
        prob["beta_wind"] = prob["beta_wave"] = 0.0
        prob["Hsig_wave"] = 0.0
        prob["Tsig_wave"] = 1e3
        prob["wind.Uref"] = 15.0
        prob["pre.rna_F"] = 1e3 * np.array(
            [
                2.0,
                3.0,
                4.0,
            ]
        )
        prob["pre.rna_M"] = 1e4 * np.array(
            [
                2.0,
                3.0,
                4.0,
            ]
        )
        prob.run_model()

        myFz = copy.copy(prob["tower.tower_Fz"])

        prob["rna_mass"] = 1e4
        prob.run_model()
        myFz[3:] -= 1e4 * g
        npt.assert_almost_equal(prob["tower.tower_Fz"], myFz)

        prob["transition_piece_mass"] = 1e2
        prob.run_model()
        myFz[3:6] -= 1e2 * g
        npt.assert_almost_equal(prob["tower.tower_Fz"], myFz)

        prob["gravity_foundation_mass"] = 1e3
        prob.run_model()
        # myFz[0] -= 1e3*g
        npt.assert_almost_equal(prob["tower.tower_Fz"], myFz)
示例#8
0
    def testProblemFixedPile_GBF(self):
        self.modeling_options["WISDEM"]["TowerSE"]["n_height_monopile"] = 3
        self.modeling_options["WISDEM"]["TowerSE"]["n_layers_monopile"] = 1
        self.modeling_options["WISDEM"]["TowerSE"]["n_height"] = 5
        self.modeling_options["WISDEM"]["TowerSE"]["soil_springs"] = False
        self.modeling_options["WISDEM"]["TowerSE"]["gravity_foundation"] = True
        self.modeling_options["flags"]["monopile"] = True

        prob = om.Problem()
        prob.model = tow.TowerSE(modeling_options=self.modeling_options)
        prob.setup()

        prob["hub_height"] = 80.0
        prob["water_depth"] = 30.0
        prob["transition_piece_mass"] = 1e2
        prob["transition_piece_cost"] = 1e3
        prob["gravity_foundation_mass"] = 1e4

        prob["tower_s"] = np.linspace(0, 1, 3)
        prob["tower_foundation_height"] = 0.0
        prob["tower_height"] = 60.0
        prob["tower_outer_diameter_in"] = 10.0 * np.ones(3)
        prob["tower_layer_thickness"] = 0.1 * np.ones(3).reshape((1, 3))
        prob["tower_outfitting_factor"] = 1.0
        hval = np.array([15.0, 30.0])
        prob["monopile_s"] = np.cumsum(np.r_[0, hval]) / hval.sum()
        prob["monopile_foundation_height"] = -45.0
        prob["monopile_height"] = hval.sum()
        prob["monopile_outer_diameter_in"] = 10.0 * np.ones(3)
        prob["monopile_layer_thickness"] = 0.1 * np.ones(3).reshape((1, 3))
        prob["monopile_outfitting_factor"] = 1.0
        prob["tower_layer_materials"] = prob["monopile_layer_materials"] = ["steel"]
        prob["material_names"] = ["steel"]
        prob["E_mat"] = 1e9 * np.ones((1, 3))
        prob["G_mat"] = 1e8 * np.ones((1, 3))
        prob["rho_mat"] = 1e4
        prob["sigma_y_mat"] = 1e8

        prob["outfitting_factor"] = 1.0
        prob["yaw"] = 0.0
        prob["rna_mass"] = 2e5
        prob["rna_I"] = np.r_[1e5, 1e5, 2e5, np.zeros(3)]
        prob["rna_cg"] = np.array([-3.0, 0.0, 1.0])
        prob["wind_reference_height"] = 80.0
        prob["z0"] = 0.0
        prob["cd_usr"] = -1.0
        prob["rho_air"] = 1.225
        prob["mu_air"] = 1.7934e-5
        prob["shearExp"] = 0.2
        prob["rho_water"] = 1025.0
        prob["mu_water"] = 1.3351e-3
        prob["beta_wind"] = prob["beta_wave"] = 0.0
        prob["Hsig_wave"] = 0.0
        prob["Tsig_wave"] = 1e3
        prob["wind.Uref"] = 15.0
        prob["pre.rna_F"] = 1e3 * np.array(
            [
                2.0,
                3.0,
                4.0,
            ]
        )
        prob["pre.rna_M"] = 1e4 * np.array(
            [
                2.0,
                3.0,
                4.0,
            ]
        )
        prob.run_model()

        # All other tests from above
        mass_dens = 1e4 * (5.0 ** 2 - 4.9 ** 2) * np.pi
        npt.assert_equal(prob["z_start"], -45.0)
        npt.assert_equal(prob["transition_piece_height"], 0.0)
        npt.assert_equal(prob["suctionpile_depth"], 15.0)
        npt.assert_equal(prob["z_param"], np.array([-45.0, -30.0, 0.0, 30.0, 60.0]))

        self.assertEqual(prob["height_constraint"], 20.0)
        npt.assert_almost_equal(prob["tower_cost"], (60.0 / 105.0) * prob["cm.cost"])
        npt.assert_equal(prob["tower_I_base"][:2], prob["cm.I_base"][:2] + 1e2 * 45 ** 2)
        npt.assert_equal(prob["tower_I_base"][2:], prob["cm.I_base"][2:])
        npt.assert_almost_equal(
            prob["tower_center_of_mass"],
            (7.5 * mass_dens * 105.0 + 0.0 * 1e2 + (-45) * 1e4) / (mass_dens * 105 + 1e2 + 1e4),
        )
        npt.assert_equal(prob["tower_section_center_of_mass"], prob["cm.section_center_of_mass"])
        npt.assert_almost_equal(prob["monopile_cost"], (45.0 / 105.0) * prob["cm.cost"] + 1e3)
        npt.assert_almost_equal(prob["monopile_mass"], mass_dens * 45.0 + 1e2 + 1e4)
        npt.assert_almost_equal(prob["tower_mass"], mass_dens * 60.0)

        npt.assert_equal(prob["pre.kidx"], 0)
        npt.assert_equal(prob["pre.kx"], RIGID)
        npt.assert_equal(prob["pre.ky"], RIGID)
        npt.assert_equal(prob["pre.kz"], RIGID)
        npt.assert_equal(prob["pre.ktx"], RIGID)
        npt.assert_equal(prob["pre.kty"], RIGID)
        npt.assert_equal(prob["pre.ktz"], RIGID)

        npt.assert_equal(prob["pre.midx"], np.array([12, 6, 0]))
        npt.assert_equal(prob["pre.m"], np.array([2e5, 1e2, 1e4]))
        npt.assert_equal(prob["pre.mrhox"], np.array([-3.0, 0.0, 0.0]))
        npt.assert_equal(prob["pre.mrhoy"], np.array([0.0, 0.0, 0.0]))
        npt.assert_equal(prob["pre.mrhoz"], np.array([1.0, 0.0, 0.0]))
        npt.assert_equal(prob["pre.mIxx"], np.array([1e5, 1e2 * 25 * 0.5, 1e4 * 25 * 0.25]))
        npt.assert_equal(prob["pre.mIyy"], np.array([1e5, 1e2 * 25 * 0.5, 1e4 * 25 * 0.25]))
        npt.assert_equal(prob["pre.mIzz"], np.array([2e5, 1e2 * 25, 1e4 * 25 * 0.5]))
        npt.assert_equal(prob["pre.mIxy"], np.zeros(3))
        npt.assert_equal(prob["pre.mIxz"], np.zeros(3))
        npt.assert_equal(prob["pre.mIyz"], np.zeros(3))

        npt.assert_equal(prob["pre.plidx"], np.array([12]))
        npt.assert_equal(prob["pre.Fx"], np.array([2e3]))
        npt.assert_equal(prob["pre.Fy"], np.array([3e3]))
        npt.assert_equal(prob["pre.Fz"], np.array([4e3]))
        npt.assert_equal(prob["pre.Mxx"], np.array([2e4]))
        npt.assert_equal(prob["pre.Myy"], np.array([3e4]))
        npt.assert_equal(prob["pre.Mzz"], np.array([4e4]))

        npt.assert_almost_equal(prob["tower.base_F"], [3.74393291e04, 1.84264671e03, -3.39826364e07], 0)
        npt.assert_almost_equal(prob["tower.base_M"], [-294477.83027742, -2732413.3684215, 40000.0], 0)
示例#9
0
    def testExampleRegression(self):
        # --- geometry ----
        h_param = np.diff(np.array([0.0, 43.8, 87.6]))
        d_param = np.array([6.0, 4.935, 3.87])
        t_param = 1.3*np.array([0.025, 0.021])
        z_foundation = 0.0
        theta_stress = 0.0
        yaw = 0.0
        Koutfitting = 1.07

        # --- material props ---
        E = 210e9
        G = 80.8e9
        rho = 8500.0
        sigma_y = 450.0e6

        # --- extra mass ----
        m = np.array([285598.8])
        mIxx = 1.14930678e+08
        mIyy = 2.20354030e+07
        mIzz = 1.87597425e+07
        mIxy = 0.0
        mIxz = 5.03710467e+05
        mIyz = 0.0
        mI = np.array([mIxx, mIyy, mIzz, mIxy, mIxz, mIyz])
        mrho = np.array([-1.13197635, 0.0, 0.50875268])
        # -----------

        # --- wind ---
        wind_zref = 90.0
        wind_z0 = 0.0
        shearExp = 0.2
        cd_usr = -1.
        # ---------------

        # --- wave ---
        hmax = 0.0
        T = 1.0
        cm = 1.0
        suction_depth = 0.0
        soilG = 140e6
        soilnu = 0.4
        # ---------------

        # --- costs ---
        material_cost = 5.0
        labor_cost    = 100.0/60.0
        painting_cost = 30.0
        # ---------------

        # two load cases.  TODO: use a case iterator

        # # --- loading case 1: max Thrust ---
        wind_Uref1 = 11.73732
        Fx1 = 1284744.19620519
        Fy1 = 0.
        Fz1 = -2914124.84400512 + m*g
        Mxx1 = 3963732.76208099
        Myy1 = -2275104.79420872
        Mzz1 = -346781.68192839
        # # ---------------

        # # --- loading case 2: max wind speed ---
        wind_Uref2 = 70.0
        Fx2 = 930198.60063279
        Fy2 = 0.
        Fz2 = -2883106.12368949 + m*g
        Mxx2 = -1683669.22411597
        Myy2 = -2522475.34625363
        Mzz2 = 147301.97023764
        # # ---------------

        # --- fatigue ---
        life = 20.0
        # ---------------

        # --- constraints ---
        min_d_to_t   = 120.0
        max_taper    = 0.2
        # ---------------

        self.modeling_options['tower']['n_height'] = len(d_param)
        self.modeling_options['tower']['n_layers'] = 1
        self.modeling_options['tower']['nLC'] = 2
        self.modeling_options['tower']['gamma_f'] = 1.35
        self.modeling_options['tower']['gamma_m'] = 1.3
        self.modeling_options['tower']['gamma_n'] = 1.0
        self.modeling_options['tower']['gamma_b'] = 1.1
        self.modeling_options['tower']['gamma_fatigue'] = 1.35*1.3*1.0


        prob = om.Problem()
        prob.model = tow.TowerSE(modeling_options=self.modeling_options)
        prob.setup()

        if self.modeling_options['tower']['wind'] == 'PowerWind':
            prob['shearExp'] = shearExp

        # assign values to params

        # --- geometry ----
        prob['hub_height'] = h_param.sum()
        prob['foundation_height'] = 0.0
        #prob['tower_section_height'] = h_param
        prob['tower_s'] = np.cumsum(np.r_[0.0, h_param]) / h_param.sum()
        prob['tower_height'] = h_param.sum()
        prob['tower_outer_diameter_in'] = d_param
        #prob['tower_wall_thickness'] = t_param
        prob['tower_layer_thickness'] = t_param.reshape( (1,len(t_param)) )
        prob['tower_outfitting_factor'] = Koutfitting
        prob['tower_layer_materials'] = ['steel']
        prob['material_names'] = ['steel']
        prob['yaw'] = yaw
        prob['suctionpile_depth'] = suction_depth
        prob['G_soil'] = soilG
        prob['nu_soil'] = soilnu
        # --- material props ---
        prob['E_mat'] = E*np.ones((1,3))
        prob['G_mat'] = G*np.ones((1,3))
        prob['rho_mat'] = rho
        prob['sigma_y_mat'] = sigma_y
        
        # --- extra mass ----
        prob['rna_mass'] = m
        prob['rna_I'] = mI
        prob['rna_cg'] = mrho
        # -----------

        # --- costs ---
        prob['unit_cost'] = material_cost
        prob['labor_cost_rate']    = labor_cost
        prob['painting_cost_rate'] = painting_cost
        # -----------

        # --- wind & wave ---
        prob['wind_reference_height'] = wind_zref
        prob['wind_z0'] = wind_z0
        prob['cd_usr'] = cd_usr
        prob['rho_air'] = 1.225
        prob['mu_air'] = 1.7934e-5

        # --- fatigue ---
        prob['life'] = life
        # ---------------

        # --- constraints ---
        prob['min_d_to_t'] = min_d_to_t
        prob['max_taper'] = max_taper
        # ---------------

        # # --- loading case 1: max Thrust ---
        prob['wind1.Uref'] = wind_Uref1

        prob['pre1.rna_F'] = np.r_[Fx1, Fy1, Fz1]
        prob['pre1.rna_M'] = np.r_[Mxx1, Myy1, Mzz1]
        # # ---------------

        # # --- loading case 2: max Wind Speed ---
        prob['wind2.Uref'] = wind_Uref2

        prob['pre2.rna_F'] = np.r_[Fx2, Fy2, Fz2]
        prob['pre2.rna_M' ] = np.r_[Mxx2, Myy2, Mzz2]

        # # --- run ---
        prob.run_model()

        npt.assert_almost_equal(prob['z_full'], [ 0.,  14.6, 29.2, 43.8, 58.4, 73.,  87.6])
        npt.assert_almost_equal(prob['d_full'], [6.,    5.645, 5.29,  4.935, 4.58,  4.225, 3.87 ])
        npt.assert_almost_equal(prob['t_full'], [0.0325, 0.0325, 0.0325, 0.0273, 0.0273, 0.0273])
        
        npt.assert_almost_equal(prob['tower_mass'], [370541.14008246])
        npt.assert_almost_equal(prob['tower_center_of_mass'], [38.78441074])
        npt.assert_almost_equal(prob['constr_d_to_t'], [-0.40192308, -0.34386447])
        npt.assert_almost_equal(prob['constr_taper'], [0.6225   , 0.5841945])
        npt.assert_almost_equal(prob['wind1.Uref'], [11.73732])
        npt.assert_almost_equal(prob['tower1.f1'], [0.33214436],5)
        npt.assert_almost_equal(prob['post1.top_deflection'], [0.69728181])
        npt.assert_almost_equal(prob['post1.stress'], [0.45829084, 0.41279851, 0.35017739, 0.31497515, 0.17978168, 0.12035124], 5)
        npt.assert_almost_equal(prob['post1.global_buckling'], [0.50459926, 0.47009267, 0.42172339, 0.40495796, 0.29807777, 0.25473308])
        npt.assert_almost_equal(prob['post1.shell_buckling'], [0.32499642, 0.25914569, 0.18536257, 0.17036815, 0.06343523, 0.03259229])
        npt.assert_almost_equal(prob['wind2.Uref'], [70.])
        npt.assert_almost_equal(prob['tower2.f1'], [0.33218936],5)
        npt.assert_almost_equal(prob['post2.top_deflection'], [0.64374406])
        npt.assert_almost_equal(prob['post2.stress'], [0.44627896, 0.38220803, 0.30583361, 0.25654412, 0.13137214, 0.10615505])
        npt.assert_almost_equal(prob['post2.global_buckling'], [0.49412205, 0.4442257,  0.38450749, 0.35599809, 0.25784865, 0.24625576])
        npt.assert_almost_equal(prob['post2.shell_buckling'], [0.31189934, 0.22790801, 0.14712692, 0.12152703, 0.03909944, 0.02623264])
        npt.assert_almost_equal(prob['tower1.base_F'], [ 1.29980269e+06,  1.39698386e-09, -6.31005811e+06], 2)
        npt.assert_almost_equal(prob['tower1.base_M'], [ 4.14769959e+06,  1.10756769e+08, -3.46781682e+05], 0)
        npt.assert_almost_equal(prob['tower2.base_F'], [ 1.61668069e+06,  6.98491931e-10, -6.27903939e+06], 2)
        npt.assert_almost_equal(prob['tower2.base_M'], [-1.76118035e+06,  1.12568312e+08,  1.47301970e+05], 0)
示例#10
0
    def testAddedMassForces(self):
        self.modeling_options['monopile']['n_height'] = 3
        self.modeling_options['monopile']['n_layers'] = 1
        self.modeling_options['flags']['monopile'] = True

        prob = om.Problem()
        prob.model = tow.TowerSE(modeling_options=self.modeling_options)
        prob.setup()

        prob['hub_height'] = 80.0
        prob['foundation_height'] = -30.0
        prob['transition_piece_height'] = 15.0
        prob['transition_piece_mass'] = 0.0
        prob['transition_piece_cost'] = 0.0
        prob['gravity_foundation_mass'] = 0.0

        prob['tower_s'] = np.linspace(0, 1, 3)
        prob['tower_height'] = 60.0
        prob['tower_outer_diameter_in'] = 10.0*np.ones(3)
        prob['tower_layer_thickness'] = 0.1*np.ones(2).reshape((1,2))
        prob['tower_outfitting_factor'] = 1.0
        hval = np.array([15.0, 30.0])
        prob['monopile_s'] = np.cumsum(np.r_[0, hval]) / hval.sum()
        prob['monopile_height'] = hval.sum()
        prob['monopile_outer_diameter_in'] = 10.0*np.ones(3)
        prob['monopile_layer_thickness'] = 0.1*np.ones(2).reshape((1,2))
        prob['monopile_outfitting_factor'] = 1.0
        prob['tower_layer_materials'] = prob['monopile_layer_materials'] = ['steel']
        prob['material_names'] = ['steel']
        prob['E_mat'] = 1e9*np.ones((1,3))
        prob['G_mat'] = 1e8*np.ones((1,3))
        prob['rho_mat'] = 1e4
        prob['sigma_y_mat'] = 1e8

        prob['suctionpile_depth'] = 15.0
        prob['yaw'] = 0.0
        prob['G_soil'] = 1e7
        prob['nu_soil'] = 0.5
        prob['rna_mass'] = 0.0
        prob['rna_I'] = np.r_[1e5, 1e5, 2e5, np.zeros(3)]
        prob['rna_cg'] = np.array([-3., 0.0, 1.0])
        prob['wind_reference_height'] = 80.0
        prob['wind_z0'] = 0.0
        prob['cd_usr'] = -1.
        prob['rho_air'] = 1.225
        prob['mu_air'] = 1.7934e-5
        prob['shearExp'] = 0.2
        prob['rho_water'] = 1025.0
        prob['mu_water'] = 1.3351e-3
        prob['beta_wind'] = prob['beta_wave'] = 0.0
        prob['hsig_wave'] = 0.0
        prob['Tsig_wave'] = 1e3
        prob['min_d_to_t'] = 120.0
        prob['max_taper'] = 0.2
        prob['wind.Uref'] = 15.0
        prob['pre.rna_F'] = 1e3*np.array([2., 3., 4.,])
        prob['pre.rna_M'] = 1e4*np.array([2., 3., 4.,])
        prob.run_model()

        myFz = copy.copy(prob['post.Fz'])

        prob['rna_mass'] = 1e4
        prob.run_model()
        myFz -= 1e4*g
        npt.assert_almost_equal(prob['post.Fz'], myFz)

        prob['transition_piece_mass'] = 1e2
        prob.run_model()
        myFz[:7] -= 1e2*g
        npt.assert_almost_equal(prob['post.Fz'], myFz)

        prob['gravity_foundation_mass'] = 1e3
        prob.run_model()
        #myFz[0] -= 1e3*g
        npt.assert_almost_equal(prob['post.Fz'], myFz)
示例#11
0
    def testProblemFixedPile(self):
        self.modeling_options['monopile']['n_height'] = 3
        self.modeling_options['monopile']['n_layers'] = 1
        self.modeling_options['flags']['monopile'] = True

        prob = om.Problem()
        prob.model = tow.TowerSE(modeling_options=self.modeling_options)
        prob.setup()

        prob['hub_height'] = 80.0
        prob['foundation_height'] = -30.0
        prob['transition_piece_height'] = 15.0
        prob['transition_piece_mass'] = 1e2
        prob['transition_piece_cost'] = 1e3
        prob['gravity_foundation_mass'] = 1e4

        prob['tower_s'] = np.linspace(0, 1, 3)
        prob['tower_height'] = 60.0
        prob['tower_outer_diameter_in'] = 10.0*np.ones(3)
        prob['tower_layer_thickness'] = 0.1*np.ones(2).reshape((1,2))
        prob['tower_outfitting_factor'] = 1.0
        hval = np.array([15.0, 30.0])
        prob['monopile_s'] = np.cumsum(np.r_[0, hval]) / hval.sum()
        prob['monopile_height'] = hval.sum()
        prob['monopile_outer_diameter_in'] = 10.0*np.ones(3)
        prob['monopile_layer_thickness'] = 0.1*np.ones(2).reshape((1,2))
        prob['monopile_outfitting_factor'] = 1.0
        prob['tower_layer_materials'] = prob['monopile_layer_materials'] = ['steel']
        prob['material_names'] = ['steel']
        prob['E_mat'] = 1e9*np.ones((1,3))
        prob['G_mat'] = 1e8*np.ones((1,3))
        prob['rho_mat'] = 1e4
        prob['sigma_y_mat'] = 1e8

        prob['suctionpile_depth'] = 15.0
        prob['outfitting_factor'] = 1.0
        prob['yaw'] = 0.0
        prob['G_soil'] = 1e7
        prob['nu_soil'] = 0.5
        prob['rna_mass'] = 2e5
        prob['rna_I'] = np.r_[1e5, 1e5, 2e5, np.zeros(3)]
        prob['rna_cg'] = np.array([-3., 0.0, 1.0])
        prob['wind_reference_height'] = 80.0
        prob['wind_z0'] = 0.0
        prob['cd_usr'] = -1.
        prob['rho_air'] = 1.225
        prob['mu_air'] = 1.7934e-5
        prob['shearExp'] = 0.2
        prob['rho_water'] = 1025.0
        prob['mu_water'] = 1.3351e-3
        prob['beta_wind'] = prob['beta_wave'] = 0.0
        prob['hsig_wave'] = 0.0
        prob['Tsig_wave'] = 1e3
        prob['min_d_to_t'] = 120.0
        prob['max_taper'] = 0.2
        prob['wind.Uref'] = 15.0
        prob['pre.rna_F'] = 1e3*np.array([2., 3., 4.,])
        prob['pre.rna_M'] = 1e4*np.array([2., 3., 4.,])
        prob.run_model()


        # All other tests from above
        mass_dens = 1e4*(5.**2-4.9**2)*np.pi
        npt.assert_equal(prob['z_start'], -45.0)
        npt.assert_equal(prob['z_param'], np.array([-45., -30., 0., 30., 60.]))
        
        self.assertEqual(prob['height_constraint'], 20.0)
        self.assertEqual(prob['tower_raw_cost'], (40./105.)*prob['cm.cost'])
        npt.assert_equal(prob['tower_I_base'][:2], prob['cm.I_base'][:2]+1e2*45**2)
        npt.assert_equal(prob['tower_I_base'][2:], prob['cm.I_base'][2:])
        npt.assert_almost_equal(prob['tower_center_of_mass'], (7.5*mass_dens*105.+15.*1e2+1e4*-30.)/(mass_dens*105+1e2+1e4))
        npt.assert_equal(prob['tower_section_center_of_mass'], prob['cm.section_center_of_mass'])
        self.assertEqual(prob['monopile_cost'], (60./105.)*prob['cm.cost']+1e3)
        self.assertEqual(prob['monopile_length'], 60.0)
        npt.assert_almost_equal(prob['monopile_mass'], mass_dens*60.0 + 1e2+1e4)
        npt.assert_almost_equal(prob['tower_mass'], mass_dens*45.0)

        npt.assert_equal(prob['pre.kidx'], np.array([0], dtype=np.int_))
        npt.assert_array_less(prob['pre.kx'], RIGID)
        npt.assert_array_less(prob['pre.ky'], RIGID)
        npt.assert_array_less(prob['pre.kz'], RIGID)
        npt.assert_array_less(prob['pre.ktx'], RIGID)
        npt.assert_array_less(prob['pre.kty'], RIGID)
        npt.assert_array_less(prob['pre.ktz'], RIGID)
        npt.assert_array_less(0.0, prob['pre.kx'])
        npt.assert_array_less(0.0, prob['pre.ky'])
        npt.assert_array_less(0.0, prob['pre.kz'])
        npt.assert_array_less(0.0, prob['pre.ktx'])
        npt.assert_array_less(0.0, prob['pre.kty'])
        npt.assert_array_less(0.0, prob['pre.ktz'])

        npt.assert_equal(prob['pre.midx'], np.array([12, 7, 0]))
        npt.assert_equal(prob['pre.m'], np.array([2e5, 1e2, 1e4]))
        npt.assert_equal(prob['pre.mrhox'], np.array([-3., 0., 0.]))
        npt.assert_equal(prob['pre.mrhoy'], np.array([0., 0., 0.]))
        npt.assert_equal(prob['pre.mrhoz'], np.array([1., 0., 0.]))
        npt.assert_equal(prob['pre.mIxx'], np.array([1e5, 1e2*25*0.5, 1e4*25*0.25]))
        npt.assert_equal(prob['pre.mIyy'], np.array([1e5, 1e2*25*0.5, 1e4*25*0.25]))
        npt.assert_equal(prob['pre.mIzz'], np.array([2e5, 1e2*25, 1e4*25*0.5]))
        npt.assert_equal(prob['pre.mIxy'], np.zeros(3))
        npt.assert_equal(prob['pre.mIxz'], np.zeros(3))
        npt.assert_equal(prob['pre.mIyz'], np.zeros(3))

        npt.assert_equal(prob['pre.plidx'], np.array([12]))
        npt.assert_equal(prob['pre.Fx'], np.array([2e3]))
        npt.assert_equal(prob['pre.Fy'], np.array([3e3]))
        npt.assert_equal(prob['pre.Fz'], np.array([4e3]))
        npt.assert_equal(prob['pre.Mxx'], np.array([2e4]))
        npt.assert_equal(prob['pre.Myy'], np.array([3e4]))
        npt.assert_equal(prob['pre.Mzz'], np.array([4e4]))
示例#12
0
    def testProblemLand(self):

        prob = om.Problem()
        prob.model = tow.TowerSE(modeling_options=self.modeling_options)
        prob.setup()

        prob['hub_height'] = 80.0
        prob['foundation_height'] = 0.0
        prob['transition_piece_height'] = 0.0
        prob['transition_piece_mass'] = 0.0
        prob['transition_piece_cost'] = 0.0
        prob['gravity_foundation_mass'] = 0.0
        
        prob['tower_s'] = np.linspace(0, 1, 3)
        prob['tower_height'] = 80.0
        #prob['tower_section_height'] = 40.0*np.ones(2)
        prob['tower_outer_diameter_in'] = 10.0*np.ones(3)
        prob['tower_layer_thickness'] = 0.1*np.ones(2).reshape((1,2))
        prob['tower_outfitting_factor'] = 1.0
        prob['tower_layer_materials'] = ['steel']
        prob['material_names'] = ['steel']
        prob['E_mat'] = 1e9*np.ones((1,3))
        prob['G_mat'] = 1e8*np.ones((1,3))
        prob['rho_mat'] = 1e4
        prob['sigma_y_mat'] = 1e8

        prob['yaw'] = 0.0
        prob['suctionpile_depth'] = 0.0
        prob['G_soil'] = 1e7
        prob['nu_soil'] = 0.5
        prob['rna_mass'] = 2e5
        prob['rna_I'] = np.r_[1e5, 1e5, 2e5, np.zeros(3)]
        prob['rna_cg'] = np.array([-3., 0.0, 1.0])
        prob['wind_reference_height'] = 80.0
        prob['wind_z0'] = 0.0
        prob['cd_usr'] = -1.
        prob['rho_air'] = 1.225
        prob['mu_air'] = 1.7934e-5
        prob['shearExp'] = 0.2
        prob['min_d_to_t'] = 120.0
        prob['max_taper'] = 0.2
        prob['wind.Uref'] = 15.0
        prob['pre.rna_F'] = 1e3*np.array([2., 3., 4.,])
        prob['pre.rna_M'] = 1e4*np.array([2., 3., 4.,])
        prob.run_model()

        # All other tests from above
        mass_dens = 1e4*(5.**2-4.9**2)*np.pi
        npt.assert_equal(prob['z_start'], 0.0)
        npt.assert_equal(prob['z_param'], np.array([0., 40., 80.]))
        
        self.assertEqual(prob['height_constraint'], 0.0)
        self.assertEqual(prob['tower_raw_cost'], prob['cm.cost'])
        npt.assert_equal(prob['tower_I_base'], prob['cm.I_base'])
        npt.assert_almost_equal(prob['tower_center_of_mass'], 40.0)
        npt.assert_equal(prob['tower_section_center_of_mass'], prob['cm.section_center_of_mass'])
        self.assertEqual(prob['monopile_mass'], 0.0)
        self.assertEqual(prob['monopile_cost'], 0.0)
        self.assertEqual(prob['monopile_length'], 0.0)
        npt.assert_almost_equal(prob['tower_mass'], mass_dens*80.0)

        npt.assert_equal(prob['pre.kidx'], np.array([0], dtype=np.int_))
        npt.assert_equal(prob['pre.kx'], np.array([RIGID]))
        npt.assert_equal(prob['pre.ky'], np.array([RIGID]))
        npt.assert_equal(prob['pre.kz'], np.array([RIGID]))
        npt.assert_equal(prob['pre.ktx'], np.array([RIGID]))
        npt.assert_equal(prob['pre.kty'], np.array([RIGID]))
        npt.assert_equal(prob['pre.ktz'], np.array([RIGID]))

        npt.assert_equal(prob['pre.midx'], np.array([6, 0, 0]))
        npt.assert_equal(prob['pre.m'], np.array([2e5, 0, 0]))
        npt.assert_equal(prob['pre.mrhox'], np.array([-3., 0., 0.]))
        npt.assert_equal(prob['pre.mrhoy'], np.array([0., 0., 0.]))
        npt.assert_equal(prob['pre.mrhoz'], np.array([1., 0., 0.]))
        npt.assert_equal(prob['pre.mIxx'], np.array([1e5, 0., 0.]))
        npt.assert_equal(prob['pre.mIyy'], np.array([1e5, 0., 0.]))
        npt.assert_equal(prob['pre.mIzz'], np.array([2e5, 0., 0.]))
        npt.assert_equal(prob['pre.mIxy'], np.zeros(3))
        npt.assert_equal(prob['pre.mIxz'], np.zeros(3))
        npt.assert_equal(prob['pre.mIyz'], np.zeros(3))

        npt.assert_equal(prob['pre.plidx'], np.array([6]))
        npt.assert_equal(prob['pre.Fx'], np.array([2e3]))
        npt.assert_equal(prob['pre.Fy'], np.array([3e3]))
        npt.assert_equal(prob['pre.Fz'], np.array([4e3]))
        npt.assert_equal(prob['pre.Mxx'], np.array([2e4]))
        npt.assert_equal(prob['pre.Myy'], np.array([3e4]))
        npt.assert_equal(prob['pre.Mzz'], np.array([4e4]))