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

Allow "unsetting" non-critical keyword arguments to FlorisModel.set() #974

Open
misi9170 opened this issue Aug 30, 2024 · 1 comment
Open
Assignees
Labels
enhancement An improvement of an existing feature

Comments

@misi9170
Copy link
Collaborator

Provide ability to "unset" certain elements of the FlorisModel

When keyword arguments are set on the instantiated FlorisModel using the set() method, they are remembered. To override a previously set variable, one most override that variable with a new call to set(). However, for some arguments, in particular, heterogeneous_inflow_config, it would be nice to be able to "unset" or forget a previous setting. FlorisModel currently has no way to do this, since passing None (e.g. fmodel.set(heterogeneous_inflow_config=None)) simply means using the previously set case.

Proposed solution

A possible solution would be to allow a special (unambiguous) argument to be passed to keywords that could be "unset" in order to trigger the unsetting action. For example, fmodel.set(heterogeneous_inflow_config=-1) or fmodel.set(heterogeneous_inflow_config=False).

Alternatives considered

A second alternative is to define new methods on FlorisModel for the unsetting procedure. This is actually something that we already have for unsetting previously set control actions: FlorisModel.reset_operation(). However, if we go down this route, we'll need a new method for each non-critical variable, which seems a little annoying (especially if these changes are to be reflected in UncertainFlorisModel and ParallelFlorisModel).

Current workaround

For now, users can "forget" things by simply reinstantiating their FlorisModel from scratch.

Additional context

I'd like a general solution here, which requires identifying which of the arguments to FlorisModel.set() are valid candidates for "unsetting". I would think at least the following:

  • heterogeneous_inflow_config
  • Control setpoints (yaw_angles, power_setpoints, awc_modes, awc_amplitudes, awc_frequencies, disable_turbines)
  • possibly wind_data, turbine_type and turbine_library_path, solver_settings
@misi9170 misi9170 self-assigned this Aug 30, 2024
@misi9170 misi9170 added the enhancement An improvement of an existing feature label Aug 30, 2024
@misi9170
Copy link
Collaborator Author

#959 may be related

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An improvement of an existing feature
Projects
None yet
Development

No branches or pull requests

1 participant