-
Notifications
You must be signed in to change notification settings - Fork 171
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
[Bug] reference_wind_height does not update when turbine_type is changed #806
Comments
I agree, the warning seems like we should definitely do that right away, and maybe longer-term consider other solutions. But it's true that the desired behavior in this case is ambiguous so perhaps the warning is the final solution? |
Agreed. I think raising a warning is the way to go, and probably nothing more needed than that. I'll create a PR for that. |
@misi9170 can you describe the situation where this came up? Was this in an optimization loop or in an analysis script? I'm just wondering how it would present to the user. |
@rafmudaf Yes, I'll add a paragraph to the description on that |
Closed by #1000 |
I'll start out by saying this isn't a true bug, but it's something that hung me up for quite a while today, so worth possibly discussing...
If the input floris .yaml file specifies
reference_wind_height: -1
, thenfi.floris.flow_field.reference_wind_height
is set to the hub height of whatever turbine is specified in theturbine_type
field of the input yaml. If the turbine_type is then changed with areinitialize()
call (without also explicitly setting thereference_wind_height
argument ofreinitialize()
), thereference_wind_height
stays at it's old value.For example,
produces
(which is the hub height of the NREL_5MW model that is specified by gch.yaml).
Again, this is not strictly wrong---however, since
reference_wind_height: -1
is specified in the original yaml, it's rather confusing (to me, at least!) that the reference wind height does not get updated when theturbine_type
changes.Actually changing the
fi.floris.flow_field.reference_wind_height
to a new value whenturbine_type
is changed may not be straightforward; however, I propose that a warning be raised ifreinitialize()
is called withturbine_type
specified andreference_wind_height
not specified. This warning should also state what thereference_wind_height
is being left as.Background
This came up for me because I was wanting to quickly compare the outputs of various wake models for a farm of iea_15MW turbines in an analysis script. To do so, I copied and pasted turbopark.yaml, cc.yaml, gch.yaml, and emgauss.yaml to my project folder, and then created a script that:
FlorisInterface
objectreintialize()
, changed the layout of the farm to my desired layout and the turbine types to"iea_15mw"
, as well as setting my wind conditions of interestcalculate_wake()
and looked at the power output.This runs normally. However, in one of the .yamls I copied over, I changed the
nrel_5MW
turbine (in the yaml) toiea_15MW
, not thinking much about it. However, this created problems: when I took the steps above, the onefi
that had been instantiated with a model containingiea_15MW
had areference_wind_height
of 150 m, while all of the others had areference_wind_height
of 90 m. I didn't know that at first, and the power produced by the turbines differed due to the difference inreference_wind_height
(and the nonzero vertical shear), which confused me for quite a while.This is perhaps not a super common situation (swapping out one turbine in the turbine_library for another dynamically); however, I can imagine some users wanting to set the
turbine_type
to their own turbine model dynamically and not realizing that thereference_wind_height
is retained from whatever thehub_height
of the turbine specified in the floris input yaml is.The text was updated successfully, but these errors were encountered: