[BUGFIX] Enable Cumulative Curl model to work with a cubature grid #1170
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.
As raised in #970 and originally in #709 , the Cumulative Curl model does not currently work with a cubature grid. It took me quite a while to track the issue down, but finally, the solution was simply to add dimensions to
turb_avg_velsfor use in the initial computation ofthrust_coefficientandaxial_induction.@Bartdoekemeijer kindly provided a test script:
On the develop branch, this fails, producing the error reported in #970. After this bugfix, the code runs as expected, producing
Moreover, commenting out the line
fmodel.set(solver_settings={"type": "turbine_cubature_grid", "turbine_grid_points": 3})(which is to say, using the "standard" square grid) produceson both the develop branch and this bugfix branch (that is, no change to results when not using a cubature grid). The difference in powers between the cubature grid and square grid is expected.
All tests pass and this PR is ready for review and merger.