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

Feature request: ability to disable wake deflection submodel to speed up calculations #394

Closed
Bartdoekemeijer opened this issue Mar 17, 2022 · 3 comments · Fixed by #395
Closed
Assignees
Labels
enhancement An improvement of an existing feature v3 Label to denote focus on v3

Comments

@Bartdoekemeijer
Copy link
Collaborator

Is your feature request related to a problem? Please describe.
#270 suggests the option to assign "None" to the wake deflection model choice, which then skips those calculations. This can further speed up computations for when we are not interested in wake deflection.

Describe the solution you'd like
Ability to assign None to the wake deflection submodel. Perhaps something similar for other submodel types, such as the local turbulence model and perhaps even the wake deficit model, assuming it is simple to do.

Describe alternatives you've considered
N/A

Additional context
N/A

@Bartdoekemeijer Bartdoekemeijer added enhancement An improvement of an existing feature v3 Label to denote focus on v3 labels Mar 17, 2022
@paulf81
Copy link
Collaborator

paulf81 commented Mar 17, 2022

This seems like a good idea to me too

@rafmudaf
Copy link
Collaborator

rafmudaf commented Mar 17, 2022

One idea for implementing this is to have a "no_deflection" wake deflection model that simply returns zero. Something like this:

@define
class NoDeflection(BaseModel):
    """
    Don't do anything
    """

    model_string = "none"

    def prepare_function(
        self,
        grid: Grid,
        flow_field: FlowField,
    ) -> Dict[str, Any]:
        return dict()

    # @profile
    def function(
        self,
        x_i: np.ndarray,
        y_i: np.ndarray,
        yaw_i: np.ndarray,
        turbulence_intensity_i: np.ndarray,
        ct_i: np.ndarray,
        rotor_diameter_i: np.ndarray,
        *
    ):
        return 0.0

I think a scalar 0.0 will work but that should be double checked. If not, you could get grid.x in the prepare function and use that to get the right shape for np.zeros().

@Bartdoekemeijer
Copy link
Collaborator Author

@rafmudaf this is exactly what I have implemented. I was just struggling with GitHub and pushing up that branch to my fork, but essentially that is what I did for the deflection, deficit and added turbulence models.

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 v3 Label to denote focus on v3
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants