Skip to content

Commit

Permalink
Add lower bound to Ct interpolation; add bounds to Cp interpolation
Browse files Browse the repository at this point in the history
* add lower bound to Ct interpolation

* Bound C term sqrt to 0,1

* Adding interpolation limits to Cp

* Update version to 2.2.1

Co-authored-by: Paul <[email protected]>
  • Loading branch information
bayc and paulf81 authored Nov 11, 2020
1 parent 5f7e6b0 commit ec89c14
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 14 deletions.
8 changes: 4 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ Citation
If FLORIS played a role in your research, please cite it. This software can be
cited as:

FLORIS. Version 2.2.0 (2020). Available at https://github.com/NREL/floris.
FLORIS. Version 2.2.1 (2020). Available at https://github.com/NREL/floris.

For LaTeX users:

.. code-block:: latex

@misc{FLORIS_2020,
author = {NREL},
title = {{FLORIS. Version 2.2.0},
title = {{FLORIS. Version 2.2.1},
year = {2020},
publisher = {GitHub},
journal = {GitHub repository},
Expand All @@ -80,7 +80,7 @@ can install with `pip` or `conda`, as shown below.
# Using pip...
pip install floris # Latest version
pip install floris==1.1.0 # Specified version number
# Using conda...
conda install floris # Latest version
conda install floris=1.1.0 # Specified version number
Expand Down Expand Up @@ -116,7 +116,7 @@ Within a Python shell or a Python script, this code should
display information:

.. code-block:: python
import floris
print( help( floris ) )
print( dir( floris ) )
Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@
# |version| and |release|, also used in various other places throughout the
# built documents.
#
version = "2.2.0"
release = "2.2.0"
version = "2.2.1"
release = "2.2.1"

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
4 changes: 2 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@ Citation
If FLORIS played a role in your research, please cite it. This software can be
cited as:

FLORIS. Version 2.2.0 (2020). Available at https://github.com/NREL/floris.
FLORIS. Version 2.2.1 (2020). Available at https://github.com/NREL/floris.

For LaTeX users:

.. code-block:: latex

@misc{FLORIS_2020,
author = {NREL},
title = {{FLORIS. Version 2.2.0}},
title = {{FLORIS. Version 2.2.1}},
year = {2020},
publisher = {GitHub},
journal = {GitHub repository},
Expand Down
10 changes: 9 additions & 1 deletion floris/simulation/turbine.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,10 @@ def _fCp(self, at_wind_speed):
_cp = self.fCpInterp(at_wind_speed)
if _cp.size > 1:
_cp = _cp[0]
if _cp > 1.0:
_cp = 1.0
if _cp < 0.0:
_cp = 0.0
return float(_cp)

def _fCt(self, at_wind_speed):
Expand All @@ -225,6 +229,8 @@ def _fCt(self, at_wind_speed):
_ct = _ct[0]
if _ct > 1.0:
_ct = 0.9999
if _ct <= 0.0:
_ct = 0.0001
return float(_ct)

# Public methods
Expand Down Expand Up @@ -403,7 +409,9 @@ def TI_to_TKE(self):
Returns:
list: converted TKE values
"""
return ((self.average_velocity * self.current_turbulence_intensity) ** 2) / (2 / 3)
return ((self.average_velocity * self.current_turbulence_intensity) ** 2) / (
2 / 3
)

def u_prime(self):
"""
Expand Down
13 changes: 9 additions & 4 deletions floris/simulation/wake_velocity/gaussianModels/gauss_legacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,9 @@ def function(
TI_mixing = self.yaw_added_turbulence_mixing(
turbine_coord, turbine, flow_field, x_locations, y_locations, z_locations
)
turbine.current_turbulence_intensity = turbine.current_turbulence_intensity + \
self.gch_gain * TI_mixing
turbine.current_turbulence_intensity = (
turbine.current_turbulence_intensity + self.gch_gain * TI_mixing
)
TI = copy.deepcopy(turbine.current_turbulence_intensity) # + TI_mixing

# turbine parameters
Expand Down Expand Up @@ -186,7 +187,9 @@ def function(
- 2 * b * ((y_locations - turbine_coord.x2) - delta) * ((z_locations - HH))
+ c * ((z_locations - HH)) ** 2
)
C = 1 - np.sqrt(1 - (Ct * cosd(yaw) / (8.0 * sigma_y * sigma_z / D ** 2)))
C = 1 - np.sqrt(
np.clip(1 - (Ct * cosd(yaw) / (8.0 * sigma_y * sigma_z / D ** 2)), 0.0, 1.0)
)

velDef = GaussianModel.gaussian_function(U_local, C, r, 1, np.sqrt(0.5))
velDef[x_locations < xR] = 0
Expand All @@ -209,7 +212,9 @@ def function(
- 2 * b * (y_locations - turbine_coord.x2 - delta) * (z_locations - HH)
+ c * (z_locations - HH) ** 2
)
C = 1 - np.sqrt(1 - (Ct * cosd(yaw) / (8.0 * sigma_y * sigma_z / D ** 2)))
C = 1 - np.sqrt(
np.clip(1 - (Ct * cosd(yaw) / (8.0 * sigma_y * sigma_z / D ** 2)), 0.0, 1.0)
)

# compute velocities in the far wake
velDef1 = GaussianModel.gaussian_function(U_local, C, r, 1, np.sqrt(0.5))
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
EMAIL = "[email protected]"
AUTHOR = "NREL National Wind Technology Center"
REQUIRES_PYTHON = ">=3.6.0"
VERSION = "2.2.0"
VERSION = "2.2.1"

# What packages are required for this module to be executed?
REQUIRED = [
Expand Down

0 comments on commit ec89c14

Please sign in to comment.