NREL / reV

Renewable Energy Potential (reV) Model
https://nrel.github.io/reV/
BSD 3-Clause "New" or "Revised" License
107 stars 24 forks source link

Hub Height Differences #438

Closed Zoe-Fehlau-ES closed 10 months ago

Zoe-Fehlau-ES commented 10 months ago

I have a code that I use to obtain wind speed and capacity factor for a specific latitude and longitude using the wind_gen_standard_losses_0.json file. I'm wondering how the results would differ if I use a hub height of 120m instead of the default 80m. Would I need to modify other settings in the wind_gen_standard_losses_0.json file if I change the hub height?

def Get_Gen(Site, resource, year, pp, sam_fp, res_file):
    """
    Generates or retrieves generation data for a specific site.

    Args:
    - Site (str): Name of the site.
    - resource (str): Type of energy resource.
    - year (int): The year for which the data is being generated.
    - pp (ProjectPoints): ProjectPoints object containing site data.
    - sam_fp (str): Path to the SAM file.
    - res_file (str): Path to the resource file.

    Returns:
    - Generation data for the specified site and resource.
    """

    if len(lat_lons)==1:
        lat, long = lat_lons[0][0], lat_lons[0][1]
        if os.path.isfile(f'_outputs/{resource}/{year} - {Site}/Gen {Site}.pkl')==False:            
            print(f'\nGetting {resource} Gen and CF Profile: {datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")}')
            start_time = time.time()
            output_request = (['cf_profile', 'wind_speed']) if resource=='windpower' else (['cf_profile', 'gen_profile'])
            gen = Gen.reV_run(resource, pp, sam_fp, res_file, max_workers=1, out_fpath=None, output_request=output_request)
            print(f'Excution time: {time.time()-start_time} sec')

            with open(f'_outputs/{resource}/{year} - {Site}/Gen {Site}.pkl', 'wb') as file:
                pickle.dump(gen, file)
            return gen

        else:
            print('\nPulling Gen Data')
            with open(f'_outputs/{resource}/{year} - {Site}/Gen {Site}.pkl', 'rb') as file:
                gen = pickle.load(file)
            return gen
    else:
        GEN = []
        for lat, long in lat_lons:
            if os.path.isfile(f'_outputs/{resource}/{year} - {Site}/Gen {Site}.pkl')==False:
                print(f'\nGetting {resource} Gen and CF Profile: {datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")}')
                start_time = time.time()
                output_request = (['cf_profile', 'wind_speed']) if resource=='windpower' else (['cf_profile', 'gen_profile'])
                gen = Gen.reV_run(resource, pp, sam_fp, res_file, max_workers=1, out_fpath=None, output_request=output_request)
                print(f'Excution time: {time.time()-start_time} sec')

                with open(f'_outputs/{resource}/{year} - {Site}/Gen {Site}.pkl', 'wb') as file:
                    pickle.dump(gen, file)
                GEN.append(gen)

            else:
                print('\nPulling Gen Data')
                with open(f'_outputs/{resource}/{year} - {Site}/Gen {Site}.pkl', 'rb') as file:
                    gen = pickle.load(file)
                GEN.append(gen)
        return pd.concat(GEN)