Skip to content
Snippets Groups Projects
Select Git revision
  • 38aae103ce6f3cb2550b0e9ee5c3ac2010f67684
  • master default protected
  • cost-models-example
  • 139-modulenotfounderror-no-module-named-openmdao-utils-concurrent
  • ellipse_spacing
  • quadratic-spacing-constraint
  • test_easy_drivers
  • mod-sgd
  • option-to-show-spacing-contraint
  • test_problem_scaling
  • opt_scaling
  • update_notebook
  • boundary_bug
  • venv_update
  • doc_2023update
  • autograd_support
  • fix_ipopt
  • ezones_paper
  • test_doc_disjoint
  • doc_2022update3
  • test_doc_2022update
  • v2.5.3
  • v2.5.2
  • v2.5.1
  • v2.5.0
  • v2.4.3
  • v2.4.2
  • v2.4.1
  • v2.4.0
  • v2.3.8
  • v2.3.7
  • v2.3.6
  • v2.3.5
  • v2.3.4
  • v2.3.3
  • v2.3.2
  • v2.3.1
  • v2.3.0
  • v2.2.6
  • v2.2.5
  • v2.2.4
41 results

overview.rst

Blame
  • _iea37.py 1.37 KiB
    from py_wake.examples.data.iea37.iea37_reader import read_iea37_windturbine
    from py_wake.wind_turbines import OneTypeWindTurbines
    from py_wake.examples.data.iea37 import iea37_path
    from py_wake.site._site import UniformSite
    import numpy as np
    
    
    class IEA37_WindTurbines(OneTypeWindTurbines):
        def __init__(self, yaml_filename=iea37_path + 'iea37-335mw.yaml'):
            name, hub_height, diameter, ct_func, power_func = read_iea37_windturbine(yaml_filename)
            super().__init__(name, diameter, hub_height, ct_func, power_func)
    
    
    class IEA37_Site(UniformSite):
        def __init__(self, n_wt, ti=.75):
            assert n_wt in [16, 36, 64]
    
            from py_wake.examples.data.iea37.iea37_reader import read_iea37_windfarm,\
                read_iea37_windrose
    
            _, _, freq = read_iea37_windrose(iea37_path + "iea37-windrose.yaml")
            self.initial_position = np.array(read_iea37_windfarm(iea37_path + 'iea37-ex%d.yaml' % n_wt)[:2]).T
    
            UniformSite.__init__(self, freq, ti)
    
    
    def main():
        if __name__ == '__main__':
            wt = IEA37_WindTurbines()
            print(wt.diameter(0))
            print(wt.hub_height(0))
    
            site = IEA37_Site(16)
            x, y = site.initial_position.T
            dw, cw, dh, dw_order = site.wt2wt_distances(x, y, 70, np.array([[0]]))
            print(dw.shape)
            WD_ilk, WS_ilk, TI_ilk, P_lk = site.local_wind(x, y)
            print(WS_ilk.shape)
    
    
    main()