Esempio n. 1
0
import os
import numpy as np
from matplotlib import pyplot as plt

import wflopg
import wflopg.visualization as vis


os.chdir("../../../documents/IEA37_CS1+2/")
plt.rc('text', usetex=True)
plt.rc('font', family='serif', serif='Times')
plt.rc('axes', titlesize=10)

# %% set up problem
o = wflopg.Owflop()
o.load_problem("problem-IEA37_Optimization_Case_Study-small.yaml",
               wind_resource="wind_resource-from_West.yaml")
o.calculate_wakeless_power()
o.calculate_deficit()
o.calculate_power()
o.calculate_relative_wake_loss_vector()

# %% save initial layout figure
fig = plt.figure()
ax = plt.subplot(111)
vis.site_setup(ax, o.minimal_proximity)
vis.draw_boundaries(ax, o.boundaries)
vis.draw_turbines(ax, o._ds.layout, o.rotor_radius_adim, o.minimal_proximity)
fig.savefig('IEA37C1W_16-layout_initial.pdf', bbox_inches="tight")
Esempio n. 2
0
            'iterations': 30,
            'kwargs': {
                'multiplier': 1.3,
                'scaling': [.5, .99]
            }
        },
        64: {
            'size': "large",
            'iterations': 30,
            'kwargs': {
                'multiplier': 3,
                'scaling': [.9, 2]
            }
        }
}.items():
    os[n] = wflopg.Owflop()
    os[n].load_problem(
        f"problem-IEA37_Optimization_Case_Study-{params['size']}.yaml")
    os[n].calculate_wakeless_power()
    histories[n] = opt.step_iterator(os[n],
                                     max_iterations=params['iterations'],
                                     **params['kwargs'])

# %% create and save figure giving overview of optimizations
fig = plt.figure(figsize=(3.4, 5.))
gs = fig.add_gridspec(ncols=2,
                      nrows=3,
                      wspace=0.,
                      hspace=0.,
                      width_ratios=[1] * 2,
                      height_ratios=[1.1, .9, .9])