From 6057a7eda80cd93e90bf3f774189182c62ed284e Mon Sep 17 00:00:00 2001 From: bayc Date: Wed, 25 Oct 2023 20:14:20 -0600 Subject: [PATCH] Updating input reference guide for multi-dimensional Cp/Ct data --- examples/inputs/gch.yaml | 9 +++++++++ floris/simulation/farm.py | 9 ++++++--- floris/simulation/turbine.py | 2 ++ floris/turbine_library/nrel_5MW.yaml | 13 +++++++++++++ 4 files changed, 30 insertions(+), 3 deletions(-) diff --git a/examples/inputs/gch.yaml b/examples/inputs/gch.yaml index c30c35c3b..220fafeac 100644 --- a/examples/inputs/gch.yaml +++ b/examples/inputs/gch.yaml @@ -134,6 +134,15 @@ flow_field: # The wind veer as a constant value for all points in the grid. wind_veer: 0.0 + ### + # The conditions that are specified for use with the multi-dimensional Cp/Ct capbility. + # These conditions are external to FLORIS and specified by the user. They are used internally + # through a nearest-neighbor selection process to choose the correct Cp/Ct interpolants + # to use. These conditions are only used with the ``multidim_cp_ct`` velocity deficit model. + multidim_conditions: + Tp: 2.5 + Hs: 3.01 + ### # Configure the wake model. wake: diff --git a/floris/simulation/farm.py b/floris/simulation/farm.py index 52749de5b..dc1435a88 100644 --- a/floris/simulation/farm.py +++ b/floris/simulation/farm.py @@ -248,7 +248,8 @@ def construct_turbine_correct_cp_ct_for_tilt(self): ) def construct_turbine_map(self): - if 'multi_dimensional_cp_ct' in self.turbine_definitions[0].keys(): + if 'multi_dimensional_cp_ct' in self.turbine_definitions[0].keys() \ + and self.turbine_definitions[0]['multi_dimensional_cp_ct'] is True: self.turbine_map = [ TurbineMultiDimensional.from_dict(turb) for turb in self.turbine_definitions ] @@ -291,7 +292,8 @@ def expand_farm_properties( sorted_coord_indices, axis=2 ) - if 'multi_dimensional_cp_ct' in self.turbine_definitions[0].keys(): + if 'multi_dimensional_cp_ct' in self.turbine_definitions[0].keys() \ + and self.turbine_definitions[0]['multi_dimensional_cp_ct'] is True: wd_dim = np.shape(template_shape)[0] ws_dim = np.shape(template_shape)[1] if wd_dim != 1 | ws_dim != 0: @@ -398,7 +400,8 @@ def calculate_tilt_for_eff_velocities(self, rotor_effective_velocities): return tilt_angles def finalize(self, unsorted_indices): - if 'multi_dimensional_cp_ct' in self.turbine_definitions[0].keys(): + if 'multi_dimensional_cp_ct' in self.turbine_definitions[0].keys() \ + and self.turbine_definitions[0]['multi_dimensional_cp_ct'] is True: self.turbine_fCts = np.take_along_axis( self.turbine_fCts_sorted, unsorted_indices[:,:,:,0,0], diff --git a/floris/simulation/turbine.py b/floris/simulation/turbine.py index 7981d87b6..0c056322d 100644 --- a/floris/simulation/turbine.py +++ b/floris/simulation/turbine.py @@ -627,6 +627,8 @@ class Turbine(BaseClass): power_thrust_table: PowerThrustTable = field(default=None) floating_tilt_table: TiltTable = field(default=None) floating_correct_cp_ct_for_tilt: bool = field(default=None) + power_thrust_data_file: str = field(default=None) + multi_dimensional_cp_ct: bool = field(default=False) # rloc: float = float_attrib() # TODO: goes here or on the Grid? # use_points_on_perimeter: bool = bool_attrib() diff --git a/floris/turbine_library/nrel_5MW.yaml b/floris/turbine_library/nrel_5MW.yaml index 70c34a9f4..653ef14c7 100644 --- a/floris/turbine_library/nrel_5MW.yaml +++ b/floris/turbine_library/nrel_5MW.yaml @@ -197,3 +197,16 @@ power_thrust_table: - 25.01 - 25.02 - 50.0 + +### +# A boolean flag used when the user wants FLORIS to use the user-supplied multi-dimensional +# Cp/Ct information. +multi_dimensional_cp_ct: False + +### +# The path to the .csv file that contains the multi-dimensional Cp/Ct data. The format of this +# file is such that any external conditions, such as wave height or wave period, that the +# Cp/Ct data is dependent on come first, in column format. The last three columns of the .csv +# file must be ``ws``, ``Cp``, and ``Ct``, in that order. An example of fictional data is given +# in ``floris/turbine_library/iea_15MW_multi_dim_Tp_Hs.csv``. +power_thrust_data_file: '../floris/turbine_library/iea_15MW_multi_dim_Tp_Hs.csv'