-
Notifications
You must be signed in to change notification settings - Fork 156
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
Convert core data structures and tools to use 4D arrays #764
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Make changes such that test_ct passes in 4d * Set axial_induction() and test to 4d * fix test_rotor_velocity_yaw_correction to 4d * test_rotor_velocity_tilt_correction to 4d * test_compute_tilt_angles_for_floating_turbines 4d * Add simple cubature test which passes in 5d * Add test of cubit cubuture which passes in 4d * Convert cubature functions to 4d * Change sample to findex, n_findex * add N_FINDEX to conftest * convert farm and unit_tests to 4D * Delete non-input from docstring * Add test for 5d reverse rotation and ruff format * convert utilties and tests to 4d * Reset formatting * rem N_WIND_D/S in favor of N_FINDEX in conftest.py * Clean up some commented code * Clean up commented code * fix turbine_type_map in unit test * fix turbine_type_map size * revert wind speed and direction tests * fix doubled code block * Clean up comments * Clean up typos * A few more typos --------- Co-authored-by: Rafael M Mudafort <[email protected]>
* update reg_tandem to mimic Jensen. * Partway through solve; commiting to realign with 4d. * Tandem reg test passing. * Updated reg tests; all pass. * Adding reg test for yaw_added_mixing; final values not yet in. * Removing 5th dim * Update print_test_values for 4d; add optional max findex to print. * yaw_added_recovery test updated to include default 0 gain and nonzero gain.
# Conflicts: # floris/simulation/flow_field.py # tests/turbine_unit_test.py
* initial commit * first pass edit of 01 example * ruff formatting * bugfix * bugfix * Convert to 4d * correct docstrings * fix docstring * convert tests to 4d * back to gch * Update conditions to evaluate block to 4d * fix floris_interface test and add power tests * Add shape test * Update example 04 * Convert 05 * Update 06 to 4d * Update 09 to 4D * Update 18 to 4d * Update 21 to 4d * Update 22 to 4d * convert 24 to 4d * remove wind speed from call to PointsGrid * change PointsGrid to 4d * change call to set_tilt to pass n_findex * Update comment * start fixing * Remove todo * Remove todo * Clean up some comments * More comment clean up --------- Co-authored-by: Rafael M Mudafort <[email protected]>
* update turbopark solver for 4D * update turbopark model for 4D * update turbopark regression test for 4D * Update regression test API --------- Co-authored-by: Rafael M Mudafort <[email protected]>
rafmudaf
added
enhancement
An improvement of an existing feature
floris.tools
floris.simulation
labels
Dec 14, 2023
* Fix API in an example * Fix index in rotor visualization method * Fix inconsistent wind condition arrays * Describe 4D arrays in Getting Started docs * Clarify description of setting atmospheric conditions
* Update wind condition broadcast for turbine tests The inputs changed in conftest but this wasn’t updated * Update multidimensional turbine module for 4D arrays * Update multidimensional example API’s * Unit test bug fix * Remove a few missed extra dimensions
This was referenced Feb 20, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Convert core FLORIS to use 4D arrays as low-level data structures
As part of the ongoing effort to support a higher degree of wind farm controls, FLORIS is undergoing a major change from the current 5-dimensional data structures at the lowest level to 4-dimensional data structures. Currently, FLORIS relies heavily on Numpy arrays to do all computations. The shape and size of the arrays vary depending on the context, but they all always have the same first two dimensions (left most) that map to a wind direction and wind speed. Common array shapes are:
This was introduced during the v3 redesign in order to vectorize computations with Numpy broadcasting and SIMD instructions. While the new Structure of Arrays architecture was an improvement over the Array of Structures in FLORIS v2, it also introduced some unintended complexities including the default scenario of creating a product of all wind speeds and wind directions. The alternative to this has been to create a tuple of wind directions and wind speeds in the first dimension and use size 1 for the second dimension - this has been called
time_series
mode in FLORIS v3. Noting that this is the most explicit method to define a calculation, FLORIS v4 is adoption 4D arrays to directly support this use.This pull request changes the
floris.simulation
package to support the 4D arrays. Where possible, dimensional constraints are removed entirely so that any future changes to the low level data structures are made easier. This change typically involves removing a:
in array indexing and changing the axis for particular Numpy operations. For example, a typical changes is including below fromsolver.py
.Though this pull request focuses specifically on the
floris.simulation
package, portions of thefloris.tools
package have also been updated to reflect this change to facilitate testing. The test suite has also been updated to reflect this change. Most of the set of examples have been updated, but tests including the optimization routines are not updated since thefloris.tools.optimization
package is outside of the scope of this pull request.Impacted areas of the software
This impacts nearly all of the
floris.simulation
package as well asFlorisInterface
andfloris.tools.visualization
.