Skip to content
Snippets Groups Projects
Select Git revision
  • 91e166d61905d6b683830453adf9a4933ab99b7c
  • master default protected
  • nicgo_custom_iec_class_good
  • AbhinavANand
  • bhawc_converter
  • nicgo_dlb_offshore
  • dlb
  • rsod-main_body_analysis
  • rsod-offshore
  • rsod-dlchighlevel
  • rsod-pages
  • rsod-coverage_example
  • rsod-crypto
  • data_manager
  • test_doc
  • iodocs
  • licoreim
  • windIO_ozgo
  • 106-save-backslash-forwardslash
  • 106-htcfile-save-method-changes-back-slash-to-forward-slash
  • ModifyHawc2
  • v0.1.31
  • v0.1.30
  • v0.1.29
  • v0.1.28
  • v0.1.27
  • v0.1.26
  • v0.1.25
  • v0.1.24
  • v0.1.23
  • v0.1.22
  • v0.1.21
  • v0.1.20
  • v0.1.19
  • v0.1.18
  • v0.1.17
  • v0.1.16
  • v0.1.15
  • v0.1.14
  • v0.1.13
  • v0.1.12
41 results

at_time_file.py

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()