-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue alert if calc wake needs to be run #432
Changes from 1 commit
ca3397b
f183606
bb52812
f641048
220e76a
6e1ef0c
7e105ea
e069888
e1384a2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
|
||
from floris.tools import FlorisInterface | ||
|
||
|
||
fi = FlorisInterface("inputs/gch.yaml") | ||
|
||
# # Convert to a simple two turbine layout | ||
# fi.reinitialize( layout=( [0, 500.], [0., 0.] ) ) | ||
|
||
|
||
# fi.calculate_wake() | ||
|
||
# Get the turbine powers | ||
turbine_powers = fi.get_turbine_powers()/1000. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -558,12 +558,20 @@ def check_wind_condition_for_viz(self, wd=None, ws=None): | |
if len(ws) > 1 or len(ws) < 1: | ||
raise ValueError("Wind speed input must be of length 1 for visualization. Current length is {}.".format(len(ws))) | ||
|
||
def check_calc_wake_run(self, func_name): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe make this private, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good suggestion, changed it There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe make this private, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Changed |
||
|
||
if not hasattr('self.floris.farm', 'turbine_type_map'): | ||
raise AttributeError('Cant call function %s without first calling calculate_wake' % func_name) | ||
|
||
def get_turbine_powers(self) -> NDArrayFloat: | ||
"""Calculates the power at each turbine in the windfarm. | ||
|
||
Returns: | ||
NDArrayFloat: [description] | ||
""" | ||
|
||
self.check_calc_wake_run('get_turbine_powers') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice! We also need to add it to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice! We also need to add it to |
||
|
||
turbine_powers = power( | ||
air_density=self.floris.flow_field.air_density, | ||
velocities=self.floris.flow_field.u, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is nice to demonstrate, but we should remember to remove this example file before merging
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agreed