Exemplo n.º 1
0
 def test_PCFile_ae(self):
     pc = PCFile(self.testfilepath + "NREL_5MW_pc.txt")
     ae = AEFile(self.testfilepath + "NREL_5MW_ae.txt")
     thickness = ae.thickness(36)
     self.assertEqual(pc.CL(thickness, 10), 1.358)
     self.assertEqual(pc.CD(thickness, 10), 0.0255)
     self.assertEqual(pc.CM(thickness, 10), -0.1103)
 def test_PCFile_ae(self):
     """Verify correct values in values of object loaded from pc file"""
     pc = PCFile(self.testfilepath + "NREL_5MW_pc.txt")
     ae = AEFile(self.testfilepath + "NREL_5MW_ae.txt")
     thickness = ae.thickness(36)
     self.assertEqual(pc.CL(thickness, 10), 1.358)
     self.assertEqual(pc.CD(thickness, 10), 0.0255)
     self.assertEqual(pc.CM(thickness, 10), -0.1103)
    def test_add_set(self):
        ae = AEFile(testfilepath + "NREL_5MW_ae.txt")

        ae.add_set(
            radius=[0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0],
            chord=[1.1, 1.0, 0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2, 0.1],
            thickness=[
                100.0, 100.0, 90.0, 80.0, 70.0, 60.0, 50.0, 40.0, 30.0, 20.0,
                10.0
            ],
            pc_set_id=[1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0])

        ae.add_set(radius=[0.0, 0.1],
                   chord=[1.1, 1.0],
                   thickness=[100.0, 100.0],
                   pc_set_id=[1.0, 1.0],
                   set_id=4)

        self.assertEqual(ae.thickness(38.950), 21)
        self.assertEqual(ae.chord(38.950), 3.256)
        self.assertEqual(ae.pc_set_nr(38.950), 1)
        np.testing.assert_array_equal(ae.chord(
            None, 2), [1.1, 1.0, 0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2, 0.1])
        np.testing.assert_array_equal(ae.ae_sets[2][:2], ae.ae_sets[4])
 def test_aefile_interpolate(self):
     ae = AEFile(testfilepath + "NREL_5MW_ae.txt")
     self.assertEqual(ae.thickness(32), 23.78048780487805)
     self.assertEqual(ae.chord(32), 3.673)
     self.assertEqual(ae.pc_set_nr(32), 1)
 def test_aefile(self):
     ae = AEFile(testfilepath + "NREL_5MW_ae.txt")
     self.assertEqual(ae.thickness(38.950), 21)
     self.assertEqual(ae.chord(38.950), 3.256)
     self.assertEqual(ae.pc_set_nr(38.950), 1)