Skip to content
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

[BUGFIX] AWC wake mixing factor with mixed awc_modes inputs #1090

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

gyalla
Copy link
Contributor

@gyalla gyalla commented Mar 25, 2025

This PR addresses a bug in the mixing factor when using AWC that was identified in issue #1089.

@gyalla
Copy link
Contributor Author

gyalla commented Mar 25, 2025

@misi9170 These changes fix the issue with AWC in the cases I'm testing. However, I'm not sure I fully understand the shape of the numpy arrays awc_mode_i and awc_amplitude_i in this part of the code, and particularly why the [:,:,0,0] slicing is used. Can you double check the changes? Thank you.

@misi9170
Copy link
Collaborator

@gyalla , totally fair, yes I'll take a look now

@misi9170
Copy link
Collaborator

misi9170 commented Mar 25, 2025

@gyalla , your proposal looks good to me. I've reformatted it a little bit, but all works fine. I was going to add another test to ensure that checks this functionality, but I realized we don't yet have a place where we test how the operation models affect flows, so to speak---I'll open an issue for that (#1091 ), but likely that'll happen at a later date.

Thanks again for providing an example runscript in #1089---that's really helpful.

@misi9170 misi9170 self-requested a review March 25, 2025 16:06
@gyalla
Copy link
Contributor Author

gyalla commented Mar 25, 2025

Thanks for taking a look @misi9170, and for reformatting the code. All looks good to me, so feel free to merge whenever makes sense.

@misi9170 misi9170 changed the title [BUGFIX] AWC wake mixing factor with mixed awc_modes inputs #1089 [BUGFIX] AWC wake mixing factor with mixed awc_modes inputs Mar 26, 2025
@misi9170
Copy link
Collaborator

Making a note here that this change means that if any entries in awc_mode_i are something other than "helix", zeros will be returned. This works as intended (for instance, if the entry is "baseline"), but will also return zeros if the awc_mode_i contains anything other than "helix" or "baseline". Previously, passing anything else would have raised a NotImplementedError. Still, I think that's fine, since there is already a warning raised in the AWCTurbine model if this occurs. Moreover, I'd like to incorporate this kind of "checking" into a future class that is dedicated to handling control setpoints #1032.

@gyalla
Copy link
Contributor Author

gyalla commented Mar 27, 2025

@misi9170, we need to specify the mixing factor as

awc_mixing_factor = np.zeros_like(awc_amplitude_i,dtype=float)

Otherwise, if awc_amplitudes are specified with integers, which they commonly are, then awc_mixing_factor will be rounded down and likely zeroed out. Thanks to @moprak-nrel for helping me track this one down! I'll push the fix.

@misi9170
Copy link
Collaborator

Good catch @gyalla ! Actually, I was just talking to @rafmudaf about exactly this type of thing, and what we should really be using is the floris_float_type---I'm going to quickly change it to that, but you're right about specifying the type!

@misi9170 misi9170 changed the base branch from main to develop March 28, 2025 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants