-
Notifications
You must be signed in to change notification settings - Fork 10
Feature/wisdem #96
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
Feature/wisdem #96
Conversation
…re generic latent variable set up
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.
Pull Request Overview
This PR improves the wisdem wrapping by replacing deprecated components with updated ones and updating references across unit tests, system tests, and examples.
- Updated subsystem calls from LandBOSSE to LandBOSSEArdComp (and similarly in glue/prototype.py)
- Adjusted import paths in tests and examples to point to ard.cost.wisdem_wrap
- Changed component naming (e.g. Orbit to ORBIT) and removed deprecated code in ard/cost/approximate_turbine_spacing.py
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| test/unit/ard/cost/test_wisdem_wrap.py | Updated subsystem instantiation to use LandBOSSEArdComp |
| test/system/ard/cost/test_spacing_approximations_connections.py | Updated import reference for spacing approximations |
| examples/onshore/optimization_demo.py | Updated import, turbine spec, and latent setup adjustments |
| examples/offshore/optimization_demo.py | Refactored control variable from inline constant to named flag |
| examples/offshore-fixed/optimization_demo.py | Changed Orbit component instantiation to ORBIT for consistency |
| ard/glue/prototype.py | Replaced LandBOSSE with LandBOSSEArdComp |
| ard/cost/approximate_turbine_spacing.py | Removed deprecated LandBOSSEWithSpacingApproximations group |
Comments suppressed due to low confidence (2)
examples/offshore-fixed/optimization_demo.py:173
- [nitpick] The component is changed from 'Orbit' to 'ORBIT'. Verify that this naming convention is consistent with the rest of the codebase or consider aligning with a consistent naming style.
ard.cost.wisdem_wrap.ORBIT(floating=True),
ard/cost/approximate_turbine_spacing.py:1
- The entire LandBOSSEWithSpacingApproximations component has been removed. Confirm that all usages have been migrated to the updated implementation in ard.cost.wisdem_wrap and that this removal is fully documented.
import openmdao.api as om
ard/cost/wisdem_wrap.py
Outdated
| # # Add new entries at the top | ||
| # import pdb; pdb.set_trace() | ||
| # if "N_turbines" in modeling_options["farm"]: | ||
| # self.set_input_defaults( | ||
| # "num_turbines", | ||
| # int(modeling_options["farm"]["N_turbines"]), | ||
| # ) | ||
|
|
||
| # self.set_input_defaults( | ||
| # "turbine_rating_MW", | ||
| # modeling_options["turbine"]["nameplate"]["power_rated"] * 1.0e3, | ||
| # units="kW", | ||
| # ) | ||
| # self.set_input_defaults( | ||
| # "hub_height_meters", | ||
| # modeling_options["turbine"]["geometry"]["height_hub"], | ||
| # units="m", | ||
| # ) | ||
| # # self.set_input_defaults( | ||
| # # "wind_shear_exponent", | ||
| # # modeling_options["turbine"]["costs"]["wind_shear_exponent"], | ||
| # # ) | ||
| # self.set_input_defaults( | ||
| # "rotor_diameter_m", | ||
| # modeling_options["turbine"]["geometry"]["diameter_rotor"], | ||
| # units="m", | ||
| # ) | ||
| # # self.set_input_defaults( | ||
| # # "number_of_blades", | ||
| # # modeling_options["turbine"]["geometry"]["num_blades"], | ||
| # # ) | ||
| # # self.set_input_defaults( | ||
| # # "rated_thrust_N", | ||
| # # modeling_options["turbine"]["costs"]["rated_thrust_N"], | ||
| # # units="N", | ||
| # # ) | ||
| # # self.set_input_defaults( | ||
| # # "gust_velocity_m_per_s", | ||
| # # modeling_options["turbine"]["costs"]["gust_velocity_m_per_s"], | ||
| # # units="m/s", | ||
| # # ) | ||
| # # self.set_input_defaults( | ||
| # # "blade_surface_area", | ||
| # # modeling_options["turbine"]["costs"]["blade_surface_area"], | ||
| # # units="m**2", | ||
| # # ) | ||
| # self.set_input_defaults( | ||
| # "tower_mass", | ||
| # modeling_options["turbine"]["costs"]["tower_mass"], | ||
| # units="kg", | ||
| # ) | ||
| # self.set_input_defaults( | ||
| # "nacelle_mass", | ||
| # modeling_options["turbine"]["costs"]["nacelle_mass"], | ||
| # units="kg", | ||
| # ) | ||
| # # self.set_input_defaults( | ||
| # # "hub_mass", | ||
| # # modeling_options["turbine"]["costs"]["hub_mass"], | ||
| # # units="kg", | ||
| # # ) | ||
| # self.set_input_defaults( | ||
| # "blade_mass", | ||
| # modeling_options["turbine"]["costs"]["blade_mass"], | ||
| # units="kg", | ||
| # ) | ||
| # # self.set_input_defaults( | ||
| # # "foundation_height", | ||
| # # modeling_options["turbine"]["costs"]["foundation_height"], | ||
| # # units="m", | ||
| # # ) | ||
| # self.set_input_defaults( | ||
| # "commissioning_cost_kW", | ||
| # modeling_options["turbine"]["costs"]["commissioning_cost_kW"], | ||
| # units="USD/kW", | ||
| # ) | ||
| # self.set_input_defaults( | ||
| # "decommissioning_cost_kW", | ||
| # modeling_options["turbine"]["costs"]["decommissioning_cost_kW"], | ||
| # units="USD/kW", | ||
| # ) | ||
| # self.set_input_defaults( | ||
| # "trench_len_to_substation_km", | ||
| # modeling_options["turbine"]["costs"]["trench_len_to_substation_km"], | ||
| # units="km", | ||
| # ) | ||
| # self.set_input_defaults( | ||
| # "interconnect_voltage_kV", | ||
| # modeling_options["turbine"]["costs"]["interconnect_voltage_kV"], | ||
| # units="kV", | ||
| # ) | ||
|
|
||
| # Existing entries | ||
| # self.set_input_defaults("tower_section_length_m", 30.0, units="m") | ||
| # self.set_input_defaults("blade_drag_coefficient", use_default_component_data) # Unitless | ||
| # self.set_input_defaults("blade_lever_arm", use_default_component_data, units="m") | ||
| # self.set_input_defaults("blade_install_cycle_time", use_default_component_data, units="h") | ||
| # self.set_input_defaults("blade_offload_hook_height", use_default_component_data, units="m") | ||
| # self.set_input_defaults("blade_offload_cycle_time", use_default_component_data, units="h") | ||
| # self.set_input_defaults("blade_drag_multiplier", use_default_component_data) # Unitless | ||
| # self.set_input_defaults("blade_surface_area", use_default_component_data, units="m**2") | ||
|
|
||
| # self.set_input_defaults("turbine_spacing_rotor_diameters", 4) | ||
| # self.set_input_defaults("row_spacing_rotor_diameters", 10) |
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.
Can we just blow these comments away? Or are the serving a utility by sticking around?
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.
Yes and done
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.
Let's put a few more comments in because this is going to be a little bit harder for an end user to pick up with the changes. They're really good changes and will reduce the median user's need to fiddle with stuff, but we should keep in mind people who will be digging for gold in the source.
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.
Done
cfrontin
left a comment
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.
Overall looks great- maybe a few more comments and we should be good to go.
Working to improve the wisdem wrapping