예제 #1
0
    def setUp(self):
        self.top = set_as_top(Assembly())
        self.top.add('c1', GeomComponent())
        self.top.c1.add('parametric_geometry', DummyGeometry())
        self.top.add('c2', GeomRecieve())
        self.top.connect('c1.geom_out', 'c2.geom_in')
        self.top.driver.workflow.add(['c1', 'c2'])

        self.top.c1.x = [3.0, 4.0]
        self.top.c1.y = 10

        self.inputs = ['c1.x', 'c1.y']
        self.outputs = ['c1.z', 'c2.out']
예제 #2
0
    def test_collision(self):
        logging.debug('')
        logging.debug('test_collision')

        g = set_as_top(GeomComponent())
        g.add("parametric_geometry", VSPParametricGeometry())
        g.parametric_geometry.model_file = os.path.join(TESTDIR, 'hwb.xml')        
        g.vsp_path = VSP_PATH

        g.generate_cfd_mesh = True
        g.write_nascart = True

        msg = ': CFD meshing and NASCART output use the same output filenames'
        assert_raises(self, 'g.run()', globals(), locals(), Exception, msg)
    def test_basic_delegation(self):
        top = Assembly()
        top.add('geo', GeomComponent())

        # Function not there before we slot
        self.assertTrue(not hasattr(top.geo, 'apply_deriv'))
        self.assertTrue(not hasattr(top.geo, 'apply_derivT'))
        self.assertTrue(not hasattr(top.geo, 'provideJ'))

        top.geo.add('parametric_geometry', GeoWithDerivatives())

        # Now they should be there.
        self.assertTrue(hasattr(top.geo, 'apply_deriv'))
        self.assertTrue(hasattr(top.geo, 'apply_derivT'))
        self.assertTrue(hasattr(top.geo, 'provideJ'))
예제 #4
0
    def test_ge90(self):
        logging.debug('')
        logging.debug('test_ge90')

        g = set_as_top(GeomComponent())
        g.add("parametric_geometry", VSPParametricGeometry())
        g.parametric_geometry.model_file = os.path.join(TESTDIR, 'GE90.xml')        
        g.vsp_path = VSP_PATH
        g.comp_geom     = True
        g.run()

        # 'desired' from Linux, 'tolerance' for Mac/Windows.
        assert_rel_error(self, g.theoretical_area, 2043.568902, 0.001)
        assert_rel_error(self, g.theoretical_volume, 1031.974785, 0.0003)
        assert_rel_error(self, g.wetted_area, 1894.494077, 0.005)
        assert_rel_error(self, g.wetted_volume, 979.795926, 0.002)
예제 #5
0
    def test_eagle_eye(self):
        logging.debug('')
        logging.debug('test_eagle_eye')

        g = set_as_top(GeomComponent())
        g.add("parametric_geometry", VSPParametricGeometry())
        g.parametric_geometry.model_file = os.path.join(TESTDIR, 'eagle_eye.xml')
        g.vsp_path = VSP_PATH
        g.comp_geom     = True
        g.run()

        # 'desired' from Linux, 'tolerance' for Mac/Windows.
        assert_rel_error(self, g.theoretical_area, 374.888362, 0.0007)
        assert_rel_error(self, g.theoretical_volume, 104.646845, 0.002)
        assert_rel_error(self, g.wetted_area, 277.323347, 0.0006)
        assert_rel_error(self, g.wetted_volume, 92.116985, 0.002)
예제 #6
0
    def test_m6_singleside(self):
        logging.debug('')
        logging.debug('test_m6_singleside')

        g = set_as_top(GeomComponent())
        g.add("parametric_geometry", VSPParametricGeometry())
        g.parametric_geometry.model_file = os.path.join(TESTDIR, 'm6_singleside.xml')        
        g.vsp_path = VSP_PATH
        g.comp_geom     = False
        g.run()

        # 'desired' from Linux, 'tolerance' for Mac/Windows.
        assert_rel_error(self, g.theoretical_area, 0, 0.0001)
        assert_rel_error(self, g.theoretical_volume, 0, 0.0001)
        assert_rel_error(self, g.wetted_area, 0, 0.0001)
        assert_rel_error(self, g.wetted_volume, 0, 0.0001)
예제 #7
0
    def test_schweizer2_32(self):
        logging.debug('')
        logging.debug('test_schweizer2_32777')

        g = set_as_top(GeomComponent())
        g.add("parametric_geometry", VSPParametricGeometry())
        g.parametric_geometry.model_file = os.path.join(TESTDIR, 'Schweizer2_32.xml')        
        g.vsp_path = VSP_PATH

        g.comp_geom     = True
        g.run()

        # 'desired' from Linux, 'tolerance' for Mac/Windows.
        assert_rel_error(self, g.theoretical_area, 688.442371, 0.0003)
        assert_rel_error(self, g.theoretical_volume, 177.148284, 0.0009)
        assert_rel_error(self, g.wetted_area, 590.724803, 0.0003)
        assert_rel_error(self, g.wetted_volume, 155.390161, 0.0009)
예제 #8
0
    def test_hwb(self):
        logging.debug('')
        logging.debug('test_hwb')

        g = set_as_top(GeomComponent())
        g.add("parametric_geometry", VSPParametricGeometry())
        g.parametric_geometry.model_file = os.path.join(TESTDIR, 'hwb.xml')        
        g.vsp_path = VSP_PATH

        g.comp_geom    = True

        g.run()

        # 'desired' from Linux, 'tolerance' for Mac/Windows.
        assert_rel_error(self, g.theoretical_area, 647.158638, 0.0001)
        assert_rel_error(self, g.theoretical_volume, 122.884067, 0.0001)
        assert_rel_error(self, g.wetted_area, 608.236512, 0.0001)
        assert_rel_error(self, g.wetted_volume, 121.853274, 0.0001)
예제 #9
0
    def test_cessna182(self):
        logging.debug('')
        logging.debug('test_cessna182')

        logging.debug(os.getcwd())

        g = set_as_top(GeomComponent())
        g.add("parametric_geometry", VSPParametricGeometry())
        g.parametric_geometry.model_file = os.path.join(TESTDIR, 'Cessna182.vsp')

        g.vsp_path = VSP_PATH
        g.comp_geom     = True
        g.run()

        # 'desired' from Linux, 'tolerance' for Mac/Windows.
        assert_rel_error(self, g.theoretical_area, 849.669075, 0.0005)
        assert_rel_error(self, g.theoretical_volume, 303.350163, 0.002)
        assert_rel_error(self, g.wetted_area, 713.083095, 0.0005)
        assert_rel_error(self, g.wetted_volume, 287.489547, 0.002)
 def setUp(self):
     self.geomcomp = GeomComponent()
     self.tdir = tempfile.mkdtemp()
     comp = Component()
     self.base_inputs = set(comp.list_inputs())
     self.base_outputs = set(comp.list_outputs())
예제 #11
0
 def setUp(self):
     self.geomcomp = GeomComponent()
     self.tdir = tempfile.mkdtemp()
     self.base_inputs = set(self.geomcomp.list_inputs())
     #need to manually add geom_out here, since it's a special case
     self.base_outputs = set(self.geomcomp.list_outputs() + ['geom_out'])