コード例 #1
0
ファイル: test_topfarm.py プロジェクト: arne-klein/TOPFARM
    def test_2x3(self):
        # Loading the water depth map
        dat = loadtxt('data/WaterDepth1.dat')
        X, Y = meshgrid(linspace(0., 1000., 50), linspace(0., 1000., 50))
        depth = array(zip(X.flatten(), Y.flatten(), dat.flatten()))
        borders = array([[200, 200], [150, 500], [200, 800], [600, 900], [700, 700], [900, 500], [800, 200], [500, 100], [200, 200]])
        baseline = array([[587.5, 223.07692308], [525., 346.15384615], [837.5, 530.76923077], [525., 530.76923077], [525., 838.46153846], [837.5, 469.23076923]])

        wt_desc = WTDescFromWTG('data/V80-2MW-offshore.wtg').wt_desc
        wt_layout = GenericWindFarmTurbineLayout([WTPC(wt_desc=wt_desc, position=pos) for pos in baseline])

        t = Topfarm(
            baseline_layout = wt_layout,
            borders = borders,
            depth_map = depth,
            dist_WT_D = 5.0,
            distribution='spiral',
            wind_speeds=[4., 8., 20.],
            wind_directions=linspace(0., 360., 36)[:-1]
        )

        t.run()

        self.fail('make save function')
        t.save()
コード例 #2
0
ファイル: test_topfarm.py プロジェクト: yimei-wang/TOPFARM
    def _run_case(self, case):
        print self.case_dicts[case]['wwh_file']

        Dir = '/Users/pire/Projects/201312_EnergiNet/' + self.case_dicts[case][
            'Dir']
        wwh_file = Dir + '/' + self.case_dicts[case]['wwh_file']
        depth = loadtxt(Dir + '/depth.xyz')
        borders = loadtxt(Dir + '/borders.xyz', usecols=(0, 1))

        t = Topfarm(baseline_layout=PlantFromWWH(filename=wwh_file).wt_layout,
                    borders=borders,
                    depth_map=depth,
                    dist_WT_D=5.0,
                    distribution='spiral',
                    wind_speeds=[4., 8., 20.],
                    wind_directions=linspace(0., 360., 36)[:-1])
        t.run()
コード例 #3
0
ファイル: test_topfarm.py プロジェクト: arne-klein/TOPFARM
    def _run_case(self, case):
        print self.case_dicts[case]['wwh_file']

        Dir = '/Users/pire/Projects/201312_EnergiNet/' + self.case_dicts[case]['Dir']
        wwh_file = Dir+'/'+ self.case_dicts[case]['wwh_file']
        depth = loadtxt(Dir+'/depth.xyz')
        borders = loadtxt(Dir+'/borders.xyz', usecols=(0,1))

        t = Topfarm(
            baseline_layout = PlantFromWWH(filename=wwh_file).wt_layout,
            borders = borders,
            depth_map = depth,
            dist_WT_D = 5.0,
            distribution='spiral',
            wind_speeds=[4., 8., 20.],
            wind_directions=linspace(0., 360., 36)[:-1]
        )
        t.run()
コード例 #4
0
ファイル: test_topfarm.py プロジェクト: yimei-wang/TOPFARM
    def test_2x3(self):
        # Loading the water depth map
        dat = loadtxt('data/WaterDepth1.dat')
        X, Y = meshgrid(linspace(0., 1000., 50), linspace(0., 1000., 50))
        depth = array(zip(X.flatten(), Y.flatten(), dat.flatten()))
        borders = array([[200, 200], [150, 500], [200, 800], [600, 900],
                         [700, 700], [900, 500], [800, 200], [500, 100],
                         [200, 200]])
        baseline = array([[587.5, 223.07692308], [525., 346.15384615],
                          [837.5, 530.76923077], [525., 530.76923077],
                          [525., 838.46153846], [837.5, 469.23076923]])

        wt_desc = WTDescFromWTG('data/V80-2MW-offshore.wtg').wt_desc
        wt_layout = GenericWindFarmTurbineLayout(
            [WTPC(wt_desc=wt_desc, position=pos) for pos in baseline])

        t = Topfarm(baseline_layout=wt_layout,
                    borders=borders,
                    depth_map=depth,
                    dist_WT_D=5.0,
                    distribution='spiral',
                    wind_speeds=[4., 8., 20.],
                    wind_directions=linspace(0., 360., 36)[:-1])

        t.run()

        self.fail('make save function')
        t.save()
コード例 #5
0
ファイル: tutorial.py プロジェクト: yimei-wang/TOPFARM
    ],
    'foundation.foundation_length':
    'plotting.foundation_length',
    'foundation.foundations':
    'plotting.foundations',
    'elnet.elnet_layout':
    'plotting.elnet_layout',
    'elnet.elnet_length':
    'plotting.elnet_length',
    'wt_dist.min_dist':
    'plotting.min_dist'
}

input_parameters = {}

top = Topfarm(components, workflows, objectives, constraints, design_variables,
              connections, input_parameters)
top.run()

# #### Optimization using the AEP

# In[24]:

components = {
    'elnet':
    ElNetLength(scaling=0.0),
    'foundation':
    FoundationLength(borders=borders, scaling=0.0, depth=depth),
    'aep':
    AEP(wt_layout=wt_layout,
        wind_rose=wind_rose,
        wf=FGCLarsen(),
コード例 #6
0
ファイル: tutorial.py プロジェクト: arne-klein/TOPFARM
design_variables = {'driver': 'distribute'}

connections = {'distribute.wt_positions': ['foundation.wt_positions',
                                            'wt_dist.wt_positions',
                                            'plotting.wt_positions',
                                           'elnet.wt_positions',
                                          'dist_from_borders.wt_positions'],
               'foundation.foundation_length': 'plotting.foundation_length',
               'foundation.foundations': 'plotting.foundations',
               'elnet.elnet_layout': 'plotting.elnet_layout',
               'elnet.elnet_length': 'plotting.elnet_length',
               'wt_dist.min_dist': 'plotting.min_dist'}

input_parameters = {}

top = Topfarm(components, workflows, objectives, constraints, design_variables, connections, input_parameters)
top.run()


# #### Optimization using the AEP

# In[24]:

components = {
    'elnet': ElNetLength(scaling=0.0),
    'foundation': FoundationLength(borders=borders, scaling=0.0, depth=depth),
    'aep': AEP(wt_layout=wt_layout,
               wind_rose=wind_rose,
               wf=FGCLarsen(),
               wind_speeds=[4, 8, 12],
               wind_directions=linspace(0, 360, 12)[:-1],