floris 4.2.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. floris-4.2.1/LICENSE.txt +26 -0
  2. floris-4.2.1/PKG-INFO +243 -0
  3. floris-4.2.1/README.md +175 -0
  4. floris-4.2.1/floris/__init__.py +24 -0
  5. floris-4.2.1/floris/convert_floris_input_v3_to_v4.py +93 -0
  6. floris-4.2.1/floris/convert_turbine_v3_to_v4.py +86 -0
  7. floris-4.2.1/floris/core/__init__.py +61 -0
  8. floris-4.2.1/floris/core/base.py +65 -0
  9. floris-4.2.1/floris/core/core.py +411 -0
  10. floris-4.2.1/floris/core/farm.py +523 -0
  11. floris-4.2.1/floris/core/flow_field.py +347 -0
  12. floris-4.2.1/floris/core/grid.py +671 -0
  13. floris-4.2.1/floris/core/rotor_velocity.py +241 -0
  14. floris-4.2.1/floris/core/solver.py +1528 -0
  15. floris-4.2.1/floris/core/turbine/__init__.py +9 -0
  16. floris-4.2.1/floris/core/turbine/operation_models.py +730 -0
  17. floris-4.2.1/floris/core/turbine/turbine.py +673 -0
  18. floris-4.2.1/floris/core/wake.py +164 -0
  19. floris-4.2.1/floris/core/wake_combination/__init__.py +4 -0
  20. floris-4.2.1/floris/core/wake_combination/fls.py +32 -0
  21. floris-4.2.1/floris/core/wake_combination/max.py +38 -0
  22. floris-4.2.1/floris/core/wake_combination/sosfs.py +31 -0
  23. floris-4.2.1/floris/core/wake_deflection/__init__.py +5 -0
  24. floris-4.2.1/floris/core/wake_deflection/empirical_gauss.py +141 -0
  25. floris-4.2.1/floris/core/wake_deflection/gauss.py +503 -0
  26. floris-4.2.1/floris/core/wake_deflection/jimenez.py +130 -0
  27. floris-4.2.1/floris/core/wake_deflection/none.py +54 -0
  28. floris-4.2.1/floris/core/wake_turbulence/__init__.py +4 -0
  29. floris-4.2.1/floris/core/wake_turbulence/crespo_hernandez.py +87 -0
  30. floris-4.2.1/floris/core/wake_turbulence/none.py +32 -0
  31. floris-4.2.1/floris/core/wake_turbulence/wake_induced_mixing.py +76 -0
  32. floris-4.2.1/floris/core/wake_velocity/__init__.py +8 -0
  33. floris-4.2.1/floris/core/wake_velocity/cumulative_gauss_curl.py +239 -0
  34. floris-4.2.1/floris/core/wake_velocity/empirical_gauss.py +305 -0
  35. floris-4.2.1/floris/core/wake_velocity/gauss.py +237 -0
  36. floris-4.2.1/floris/core/wake_velocity/jensen.py +127 -0
  37. floris-4.2.1/floris/core/wake_velocity/none.py +50 -0
  38. floris-4.2.1/floris/core/wake_velocity/turbopark.py +181 -0
  39. floris-4.2.1/floris/core/wake_velocity/turbopark_lookup_table.mat +0 -0
  40. floris-4.2.1/floris/core/wake_velocity/turboparkgauss.py +142 -0
  41. floris-4.2.1/floris/cut_plane.py +485 -0
  42. floris-4.2.1/floris/floris_model.py +1812 -0
  43. floris-4.2.1/floris/flow_visualization.py +768 -0
  44. floris-4.2.1/floris/heterogeneous_map.py +533 -0
  45. floris-4.2.1/floris/layout_visualization.py +591 -0
  46. floris-4.2.1/floris/logging_manager.py +144 -0
  47. floris-4.2.1/floris/optimization/__init__.py +5 -0
  48. floris-4.2.1/floris/optimization/layout_optimization/__init__.py +0 -0
  49. floris-4.2.1/floris/optimization/layout_optimization/layout_optimization_base.py +289 -0
  50. floris-4.2.1/floris/optimization/layout_optimization/layout_optimization_boundary_grid.py +648 -0
  51. floris-4.2.1/floris/optimization/layout_optimization/layout_optimization_gridded.py +212 -0
  52. floris-4.2.1/floris/optimization/layout_optimization/layout_optimization_pyoptsparse.py +231 -0
  53. floris-4.2.1/floris/optimization/layout_optimization/layout_optimization_pyoptsparse_spread.py +212 -0
  54. floris-4.2.1/floris/optimization/layout_optimization/layout_optimization_random_search.py +760 -0
  55. floris-4.2.1/floris/optimization/layout_optimization/layout_optimization_scipy.py +263 -0
  56. floris-4.2.1/floris/optimization/other/__init__.py +1 -0
  57. floris-4.2.1/floris/optimization/other/boundary_grid.py +448 -0
  58. floris-4.2.1/floris/optimization/yaw_optimization/__init__.py +0 -0
  59. floris-4.2.1/floris/optimization/yaw_optimization/yaw_optimization_base.py +627 -0
  60. floris-4.2.1/floris/optimization/yaw_optimization/yaw_optimization_tools.py +130 -0
  61. floris-4.2.1/floris/optimization/yaw_optimization/yaw_optimizer_geometric.py +255 -0
  62. floris-4.2.1/floris/optimization/yaw_optimization/yaw_optimizer_scipy.py +148 -0
  63. floris-4.2.1/floris/optimization/yaw_optimization/yaw_optimizer_sr.py +314 -0
  64. floris-4.2.1/floris/par_floris_model.py +366 -0
  65. floris-4.2.1/floris/parallel_floris_model.py +690 -0
  66. floris-4.2.1/floris/turbine_library/__init__.py +5 -0
  67. floris-4.2.1/floris/turbine_library/iea_10MW.yaml +93 -0
  68. floris-4.2.1/floris/turbine_library/iea_15MW.yaml +185 -0
  69. floris-4.2.1/floris/turbine_library/iea_15MW_floating_multi_dim_cp_ct.yaml +29 -0
  70. floris-4.2.1/floris/turbine_library/iea_15MW_multi_dim_cp_ct.yaml +11 -0
  71. floris-4.2.1/floris/turbine_library/nrel_5MW.yaml +240 -0
  72. floris-4.2.1/floris/turbine_library/turbine_previewer.py +839 -0
  73. floris-4.2.1/floris/turbine_library/turbine_utilities.py +200 -0
  74. floris-4.2.1/floris/type_dec.py +274 -0
  75. floris-4.2.1/floris/uncertain_floris_model.py +1214 -0
  76. floris-4.2.1/floris/utilities.py +441 -0
  77. floris-4.2.1/floris/wind_data.py +3380 -0
  78. floris-4.2.1/floris.egg-info/PKG-INFO +243 -0
  79. floris-4.2.1/floris.egg-info/SOURCES.txt +82 -0
  80. floris-4.2.1/floris.egg-info/dependency_links.txt +1 -0
  81. floris-4.2.1/floris.egg-info/requires.txt +23 -0
  82. floris-4.2.1/floris.egg-info/top_level.txt +1 -0
  83. floris-4.2.1/pyproject.toml +233 -0
  84. floris-4.2.1/setup.cfg +4 -0
@@ -0,0 +1,26 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2024, Alliance for Sustainable Energy LLC, All rights reserved.
4
+
5
+ Redistribution and use in source and binary forms, with or without modification, are permitted
6
+ provided that the following conditions are met:
7
+
8
+ * Redistributions of source code must retain the above copyright notice, this list of conditions
9
+ and the following disclaimer.
10
+
11
+ * Redistributions in binary form must reproduce the above copyright notice, this list of
12
+ conditions and the following disclaimer in the documentation and/or other materials provided
13
+ with the distribution.
14
+
15
+ * Neither the name of the copyright holder nor the names of its contributors may be used to
16
+ endorse or promote products derived from this software without specific prior written permission.
17
+
18
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
19
+ IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
20
+ AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER
21
+ OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
24
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26
+ POSSIBILITY OF SUCH DAMAGE.
floris-4.2.1/PKG-INFO ADDED
@@ -0,0 +1,243 @@
1
+ Metadata-Version: 2.1
2
+ Name: floris
3
+ Version: 4.2.1
4
+ Summary: A controls-oriented engineering wake model.
5
+ Author-email: Rafael Mudafort <rafael.mudafort@nrel.gov>, Paul Fleming <paul.fleming@nrel.gov>, "Michael (Misha) Sinner" <Michael.Sinner@nrel.gov>, Eric Simley <Eric.Simley@nrel.gov>, Christopher Bay <Christopher.Bay@nrel.gov>
6
+ License: BSD 3-Clause License
7
+
8
+ Copyright (c) 2024, Alliance for Sustainable Energy LLC, All rights reserved.
9
+
10
+ Redistribution and use in source and binary forms, with or without modification, are permitted
11
+ provided that the following conditions are met:
12
+
13
+ * Redistributions of source code must retain the above copyright notice, this list of conditions
14
+ and the following disclaimer.
15
+
16
+ * Redistributions in binary form must reproduce the above copyright notice, this list of
17
+ conditions and the following disclaimer in the documentation and/or other materials provided
18
+ with the distribution.
19
+
20
+ * Neither the name of the copyright holder nor the names of its contributors may be used to
21
+ endorse or promote products derived from this software without specific prior written permission.
22
+
23
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
24
+ IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
25
+ AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER
26
+ OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
28
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
29
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
30
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31
+ POSSIBILITY OF SUCH DAMAGE.
32
+
33
+ Project-URL: Homepage, https://github.com/NREL/floris
34
+ Project-URL: Documentation, https://nrel.github.io/floris/
35
+ Keywords: floris
36
+ Classifier: License :: OSI Approved :: BSD License
37
+ Classifier: Programming Language :: Python
38
+ Classifier: Programming Language :: Python :: 3
39
+ Classifier: Programming Language :: Python :: 3.8
40
+ Classifier: Programming Language :: Python :: 3.9
41
+ Classifier: Programming Language :: Python :: 3.10
42
+ Classifier: Programming Language :: Python :: Implementation :: CPython
43
+ Classifier: Programming Language :: Python :: Implementation :: PyPy
44
+ Requires-Python: >=3.8
45
+ Description-Content-Type: text/markdown
46
+ License-File: LICENSE.txt
47
+ Requires-Dist: attrs
48
+ Requires-Dist: pyyaml~=6.0
49
+ Requires-Dist: numexpr~=2.0
50
+ Requires-Dist: numpy~=1.20
51
+ Requires-Dist: scipy~=1.1
52
+ Requires-Dist: matplotlib~=3.0
53
+ Requires-Dist: pandas~=2.0
54
+ Requires-Dist: shapely~=2.0
55
+ Requires-Dist: coloredlogs~=15.0
56
+ Requires-Dist: pathos~=0.3
57
+ Provides-Extra: docs
58
+ Requires-Dist: jupyter-book; extra == "docs"
59
+ Requires-Dist: sphinx-book-theme; extra == "docs"
60
+ Requires-Dist: sphinx-autodoc-typehints; extra == "docs"
61
+ Requires-Dist: sphinxcontrib-autoyaml; extra == "docs"
62
+ Requires-Dist: sphinxcontrib.mermaid; extra == "docs"
63
+ Provides-Extra: develop
64
+ Requires-Dist: pytest; extra == "develop"
65
+ Requires-Dist: pre-commit; extra == "develop"
66
+ Requires-Dist: ruff; extra == "develop"
67
+ Requires-Dist: isort; extra == "develop"
68
+
69
+ # FLORIS Wake Modeling and Wind Farm Controls Software
70
+
71
+ FLORIS is a controls-focused wind farm simulation software incorporating
72
+ steady-state engineering wake models into a performance-focused Python
73
+ framework. It has been in active development at NREL since 2013 and the latest
74
+ release is [FLORIS v4.2.1](https://github.com/NREL/floris/releases/latest).
75
+ Online documentation is available at https://nrel.github.io/floris.
76
+
77
+ The software is in active development and engagement with the development team
78
+ is highly encouraged. If you are interested in using FLORIS to conduct studies
79
+ of a wind farm or extending FLORIS to include your own wake model, please join
80
+ the conversation in [GitHub Discussions](https://github.com/NREL/floris/discussions/)!
81
+
82
+ ## Installation
83
+
84
+ **WARNING:**
85
+ Support for python version 3.8 will be dropped in FLORIS v4.3. See [Installation documentation](https://nrel.github.io/floris/installation.html#installation) for details.
86
+
87
+ **If upgrading from a previous version, it is recommended to install FLORIS v4 into a new virtual environment**.
88
+ If you intend to use [pyOptSparse](https://mdolab-pyoptsparse.readthedocs-hosted.com/en/latest/) with FLORIS,
89
+ it is recommended to install that package first before installing FLORIS.
90
+
91
+ FLORIS can be installed by downloading the source code or via the PyPI
92
+ package manager with `pip`.
93
+
94
+ The simplest method is with `pip` by using this command:
95
+
96
+ ```bash
97
+ pip install floris
98
+ ```
99
+
100
+ Developers and anyone who intends to inspect the source code
101
+ can install FLORIS by downloading the git repository
102
+ from GitHub with ``git`` and use ``pip`` to locally install it.
103
+ It is highly recommended to use a Python virtual environment manager
104
+ such as [conda](https://docs.conda.io/en/latest/miniconda.html)
105
+ in order to maintain a clean and sandboxed environment. The following
106
+ commands in a terminal or shell will download and install FLORIS.
107
+
108
+ ```bash
109
+ # Download the source code from the `main` branch
110
+ git clone -b main https://github.com/NREL/floris.git
111
+
112
+ # If using conda, be sure to activate your environment prior to installing
113
+ # conda activate <env name>
114
+
115
+ # If using pyOptSpare, install it first
116
+ conda install -c conda-forge pyoptsparse
117
+
118
+ # Install FLORIS
119
+ pip install -e floris
120
+ ```
121
+
122
+ With both methods, the installation can be verified by opening a Python interpreter
123
+ and importing FLORIS:
124
+
125
+ ```python
126
+ >>> import floris
127
+ >>> help(floris)
128
+
129
+ Help on package floris:
130
+
131
+ NAME
132
+ floris - # Copyright 2024 NREL
133
+
134
+ PACKAGE CONTENTS
135
+ convert_floris_input_v3_to_v4
136
+ convert_turbine_v3_to_v4
137
+ core (package)
138
+ cut_plane
139
+ floris_model
140
+ flow_visualization
141
+ layout_visualization
142
+ logging_manager
143
+ optimization (package)
144
+ parallel_floris_model
145
+ turbine_library (package)
146
+ type_dec
147
+ uncertain_floris_model
148
+ utilities
149
+ version
150
+ wind_data
151
+
152
+ VERSION
153
+ 4.2.1
154
+
155
+ FILE
156
+ ~/floris/floris/__init__.py
157
+ ```
158
+
159
+ It is important to regularly check for new updates and releases as new
160
+ features, improvements, and bug fixes will be issued on an ongoing basis.
161
+
162
+ ## Quick Start
163
+
164
+ FLORIS is a Python package run on the command line typically by providing
165
+ an input file with an initial configuration. It can be installed with
166
+ ```pip install floris``` (see [installation](https://nrel.github.io/floris/installation.html)).
167
+ The typical entry point is
168
+ [FlorisModel](https://nrel.github.io/floris/_autosummary/floris.floris_model.html)
169
+ which accepts the path to the input file as an argument. From there,
170
+ changes can be made to the initial configuration through the
171
+ [FlorisModel.set](https://nrel.github.io/floris/_autosummary/floris.floris_model.html#floris.floris_model.FlorisModel.set)
172
+ routine, and the simulation is executed with
173
+ [FlorisModel.run](https://nrel.github.io/floris/_autosummary/floris.floris_model.html#floris.floris_model.FlorisModel.run).
174
+
175
+ ```python
176
+ from floris import FlorisModel
177
+ fmodel = FlorisModel("path/to/input.yaml")
178
+ fmodel.set(
179
+ wind_directions=[i for i in range(10)],
180
+ wind_speeds=[8.0]*10,
181
+ turbulence_intensities=[0.06]*10
182
+ )
183
+ fmodel.run()
184
+ ```
185
+
186
+ Finally, results can be analyzed via post-processing functions available within
187
+ [FlorisModel](https://nrel.github.io/floris/_autosummary/floris.floris_model.html#floris.floris_model.FlorisModel)
188
+ such as
189
+ - [FlorisModel.get_turbine_layout](https://nrel.github.io/floris/_autosummary/floris.floris_model.html#floris.floris_model.FlorisModel.get_turbine_layout)
190
+ - [FlorisModel.get_turbine_powers](https://nrel.github.io/floris/_autosummary/floris.floris_model.html#floris.floris_model.FlorisModel.get_turbine_powers)
191
+ - [FlorisModel.get_farm_AEP](https://nrel.github.io/floris/_autosummary/floris.floris_model.html#floris.floris_model.FlorisModel.get_farm_AEP)
192
+
193
+ and in two visualization packages: [layoutviz](https://nrel.github.io/floris/_autosummary/floris.layout_visualization.html) and [flowviz](https://nrel.github.io/floris/_autosummary/floris.flow_visualization.html).
194
+ A collection of examples describing the creation of simulations as well as
195
+ analysis and post processing are included in the
196
+ [repository](https://github.com/NREL/floris/tree/main/examples). Examples are also listed
197
+ in the [online documentation](https://nrel.github.io/floris/examples/001_opening_floris_computing_power.html).
198
+
199
+ ## Engaging on GitHub
200
+
201
+ FLORIS leverages the following GitHub features to coordinate support and development efforts:
202
+
203
+ - [Discussions](https://github.com/NREL/floris/discussions): Collaborate to develop ideas for new use cases, features, and software designs, and get support for usage questions
204
+ - [Issues](https://github.com/NREL/floris/issues): Report potential bugs and well-developed feature requests
205
+ - [Projects](https://github.com/orgs/NREL/projects/96): Include current and future work on a timeline and assign a person to "own" it
206
+
207
+ Generally, the first entry point for the community will be within one of the
208
+ categories in Discussions.
209
+ [Ideas](https://github.com/NREL/floris/discussions/categories/ideas) is a great spot to develop the
210
+ details for a feature request. [Q&A](https://github.com/NREL/floris/discussions/categories/q-a)
211
+ is where to get usage support.
212
+ [Show and tell](https://github.com/NREL/floris/discussions/categories/show-and-tell) is a free-form
213
+ space to show off the things you are doing with FLORIS.
214
+
215
+
216
+ # License
217
+
218
+ BSD 3-Clause License
219
+
220
+ Copyright (c) 2024, Alliance for Sustainable Energy LLC, All rights reserved.
221
+
222
+ Redistribution and use in source and binary forms, with or without modification, are permitted
223
+ provided that the following conditions are met:
224
+
225
+ * Redistributions of source code must retain the above copyright notice, this list of conditions
226
+ and the following disclaimer.
227
+
228
+ * Redistributions in binary form must reproduce the above copyright notice, this list of
229
+ conditions and the following disclaimer in the documentation and/or other materials provided
230
+ with the distribution.
231
+
232
+ * Neither the name of the copyright holder nor the names of its contributors may be used to
233
+ endorse or promote products derived from this software without specific prior written permission.
234
+
235
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
236
+ IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
237
+ AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER
238
+ OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
239
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
240
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
241
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
242
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
243
+ POSSIBILITY OF SUCH DAMAGE.
floris-4.2.1/README.md ADDED
@@ -0,0 +1,175 @@
1
+ # FLORIS Wake Modeling and Wind Farm Controls Software
2
+
3
+ FLORIS is a controls-focused wind farm simulation software incorporating
4
+ steady-state engineering wake models into a performance-focused Python
5
+ framework. It has been in active development at NREL since 2013 and the latest
6
+ release is [FLORIS v4.2.1](https://github.com/NREL/floris/releases/latest).
7
+ Online documentation is available at https://nrel.github.io/floris.
8
+
9
+ The software is in active development and engagement with the development team
10
+ is highly encouraged. If you are interested in using FLORIS to conduct studies
11
+ of a wind farm or extending FLORIS to include your own wake model, please join
12
+ the conversation in [GitHub Discussions](https://github.com/NREL/floris/discussions/)!
13
+
14
+ ## Installation
15
+
16
+ **WARNING:**
17
+ Support for python version 3.8 will be dropped in FLORIS v4.3. See [Installation documentation](https://nrel.github.io/floris/installation.html#installation) for details.
18
+
19
+ **If upgrading from a previous version, it is recommended to install FLORIS v4 into a new virtual environment**.
20
+ If you intend to use [pyOptSparse](https://mdolab-pyoptsparse.readthedocs-hosted.com/en/latest/) with FLORIS,
21
+ it is recommended to install that package first before installing FLORIS.
22
+
23
+ FLORIS can be installed by downloading the source code or via the PyPI
24
+ package manager with `pip`.
25
+
26
+ The simplest method is with `pip` by using this command:
27
+
28
+ ```bash
29
+ pip install floris
30
+ ```
31
+
32
+ Developers and anyone who intends to inspect the source code
33
+ can install FLORIS by downloading the git repository
34
+ from GitHub with ``git`` and use ``pip`` to locally install it.
35
+ It is highly recommended to use a Python virtual environment manager
36
+ such as [conda](https://docs.conda.io/en/latest/miniconda.html)
37
+ in order to maintain a clean and sandboxed environment. The following
38
+ commands in a terminal or shell will download and install FLORIS.
39
+
40
+ ```bash
41
+ # Download the source code from the `main` branch
42
+ git clone -b main https://github.com/NREL/floris.git
43
+
44
+ # If using conda, be sure to activate your environment prior to installing
45
+ # conda activate <env name>
46
+
47
+ # If using pyOptSpare, install it first
48
+ conda install -c conda-forge pyoptsparse
49
+
50
+ # Install FLORIS
51
+ pip install -e floris
52
+ ```
53
+
54
+ With both methods, the installation can be verified by opening a Python interpreter
55
+ and importing FLORIS:
56
+
57
+ ```python
58
+ >>> import floris
59
+ >>> help(floris)
60
+
61
+ Help on package floris:
62
+
63
+ NAME
64
+ floris - # Copyright 2024 NREL
65
+
66
+ PACKAGE CONTENTS
67
+ convert_floris_input_v3_to_v4
68
+ convert_turbine_v3_to_v4
69
+ core (package)
70
+ cut_plane
71
+ floris_model
72
+ flow_visualization
73
+ layout_visualization
74
+ logging_manager
75
+ optimization (package)
76
+ parallel_floris_model
77
+ turbine_library (package)
78
+ type_dec
79
+ uncertain_floris_model
80
+ utilities
81
+ version
82
+ wind_data
83
+
84
+ VERSION
85
+ 4.2.1
86
+
87
+ FILE
88
+ ~/floris/floris/__init__.py
89
+ ```
90
+
91
+ It is important to regularly check for new updates and releases as new
92
+ features, improvements, and bug fixes will be issued on an ongoing basis.
93
+
94
+ ## Quick Start
95
+
96
+ FLORIS is a Python package run on the command line typically by providing
97
+ an input file with an initial configuration. It can be installed with
98
+ ```pip install floris``` (see [installation](https://nrel.github.io/floris/installation.html)).
99
+ The typical entry point is
100
+ [FlorisModel](https://nrel.github.io/floris/_autosummary/floris.floris_model.html)
101
+ which accepts the path to the input file as an argument. From there,
102
+ changes can be made to the initial configuration through the
103
+ [FlorisModel.set](https://nrel.github.io/floris/_autosummary/floris.floris_model.html#floris.floris_model.FlorisModel.set)
104
+ routine, and the simulation is executed with
105
+ [FlorisModel.run](https://nrel.github.io/floris/_autosummary/floris.floris_model.html#floris.floris_model.FlorisModel.run).
106
+
107
+ ```python
108
+ from floris import FlorisModel
109
+ fmodel = FlorisModel("path/to/input.yaml")
110
+ fmodel.set(
111
+ wind_directions=[i for i in range(10)],
112
+ wind_speeds=[8.0]*10,
113
+ turbulence_intensities=[0.06]*10
114
+ )
115
+ fmodel.run()
116
+ ```
117
+
118
+ Finally, results can be analyzed via post-processing functions available within
119
+ [FlorisModel](https://nrel.github.io/floris/_autosummary/floris.floris_model.html#floris.floris_model.FlorisModel)
120
+ such as
121
+ - [FlorisModel.get_turbine_layout](https://nrel.github.io/floris/_autosummary/floris.floris_model.html#floris.floris_model.FlorisModel.get_turbine_layout)
122
+ - [FlorisModel.get_turbine_powers](https://nrel.github.io/floris/_autosummary/floris.floris_model.html#floris.floris_model.FlorisModel.get_turbine_powers)
123
+ - [FlorisModel.get_farm_AEP](https://nrel.github.io/floris/_autosummary/floris.floris_model.html#floris.floris_model.FlorisModel.get_farm_AEP)
124
+
125
+ and in two visualization packages: [layoutviz](https://nrel.github.io/floris/_autosummary/floris.layout_visualization.html) and [flowviz](https://nrel.github.io/floris/_autosummary/floris.flow_visualization.html).
126
+ A collection of examples describing the creation of simulations as well as
127
+ analysis and post processing are included in the
128
+ [repository](https://github.com/NREL/floris/tree/main/examples). Examples are also listed
129
+ in the [online documentation](https://nrel.github.io/floris/examples/001_opening_floris_computing_power.html).
130
+
131
+ ## Engaging on GitHub
132
+
133
+ FLORIS leverages the following GitHub features to coordinate support and development efforts:
134
+
135
+ - [Discussions](https://github.com/NREL/floris/discussions): Collaborate to develop ideas for new use cases, features, and software designs, and get support for usage questions
136
+ - [Issues](https://github.com/NREL/floris/issues): Report potential bugs and well-developed feature requests
137
+ - [Projects](https://github.com/orgs/NREL/projects/96): Include current and future work on a timeline and assign a person to "own" it
138
+
139
+ Generally, the first entry point for the community will be within one of the
140
+ categories in Discussions.
141
+ [Ideas](https://github.com/NREL/floris/discussions/categories/ideas) is a great spot to develop the
142
+ details for a feature request. [Q&A](https://github.com/NREL/floris/discussions/categories/q-a)
143
+ is where to get usage support.
144
+ [Show and tell](https://github.com/NREL/floris/discussions/categories/show-and-tell) is a free-form
145
+ space to show off the things you are doing with FLORIS.
146
+
147
+
148
+ # License
149
+
150
+ BSD 3-Clause License
151
+
152
+ Copyright (c) 2024, Alliance for Sustainable Energy LLC, All rights reserved.
153
+
154
+ Redistribution and use in source and binary forms, with or without modification, are permitted
155
+ provided that the following conditions are met:
156
+
157
+ * Redistributions of source code must retain the above copyright notice, this list of conditions
158
+ and the following disclaimer.
159
+
160
+ * Redistributions in binary form must reproduce the above copyright notice, this list of
161
+ conditions and the following disclaimer in the documentation and/or other materials provided
162
+ with the distribution.
163
+
164
+ * Neither the name of the copyright holder nor the names of its contributors may be used to
165
+ endorse or promote products derived from this software without specific prior written permission.
166
+
167
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
168
+ IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
169
+ AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER
170
+ OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
171
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
172
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
173
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
174
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
175
+ POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,24 @@
1
+
2
+ from importlib.metadata import version
3
+ from pathlib import Path
4
+
5
+
6
+ __version__ = version("floris")
7
+
8
+
9
+ from .floris_model import FlorisModel
10
+ from .flow_visualization import (
11
+ plot_rotor_values,
12
+ visualize_cut_plane,
13
+ visualize_quiver,
14
+ )
15
+ from .heterogeneous_map import HeterogeneousMap
16
+ from .par_floris_model import ParFlorisModel
17
+ from .parallel_floris_model import ParallelFlorisModel
18
+ from .uncertain_floris_model import ApproxFlorisModel, UncertainFlorisModel
19
+ from .wind_data import (
20
+ TimeSeries,
21
+ WindRose,
22
+ WindRoseWRG,
23
+ WindTIRose,
24
+ )
@@ -0,0 +1,93 @@
1
+ import sys
2
+ from pathlib import Path
3
+
4
+ import yaml
5
+
6
+
7
+ """
8
+ This script is intended to be called with an argument and converts a floris input
9
+ yaml file specified for FLORIS v3 to one specified for FLORIS v4.
10
+
11
+ Usage:
12
+ python convert_floris_input_v3_to_v4.py <path/to/floris_input>.yaml
13
+
14
+ The resulting floris input file is placed in the same directory as the original yaml,
15
+ and is appended _v4.
16
+ """
17
+
18
+
19
+ def ignore_include(loader, node):
20
+ # Parrot back the !include tag
21
+ return node.tag + " " + node.value
22
+
23
+
24
+ if __name__ == "__main__":
25
+ if len(sys.argv) != 2:
26
+ raise Exception(
27
+ "Usage: python convert_floris_input_v3_to_v4.py <path/to/floris_input>.yaml"
28
+ )
29
+
30
+ # Set the yaml loader to ignore the !include tag
31
+ yaml.SafeLoader.add_constructor("!include", ignore_include)
32
+
33
+ input_yaml = sys.argv[1]
34
+
35
+ # Handling the path and new filename
36
+ input_path = Path(input_yaml)
37
+ split_input = input_path.parts
38
+ [filename_v3, extension] = split_input[-1].split(".")
39
+ filename_v4 = filename_v3 + "_v4"
40
+ split_output = list(split_input[:-1]) + [filename_v4 + "." + extension]
41
+ output_path = Path(*split_output)
42
+
43
+ # Load existing v3 model
44
+ with open(input_yaml, "r") as file:
45
+ v3_floris_input_dict = yaml.safe_load(file)
46
+ v4_floris_input_dict = v3_floris_input_dict.copy()
47
+
48
+ # Change turbulence_intensity field to turbulence_intensities as list
49
+ if "turbulence_intensities" in v3_floris_input_dict["flow_field"]:
50
+ if "turbulence_intensity" in v3_floris_input_dict["flow_field"]:
51
+ del v4_floris_input_dict["flow_field"]["turbulence_intensity"]
52
+ elif "turbulence_intensity" in v3_floris_input_dict["flow_field"]:
53
+ v4_floris_input_dict["flow_field"]["turbulence_intensities"] = [
54
+ v3_floris_input_dict["flow_field"]["turbulence_intensity"]
55
+ ]
56
+ del v4_floris_input_dict["flow_field"]["turbulence_intensity"]
57
+
58
+ # Change multidim_cp_ct velocity model to gauss
59
+ if v3_floris_input_dict["wake"]["model_strings"]["velocity_model"] == "multidim_cp_ct":
60
+ print(
61
+ "multidim_cp_ct velocity model specified. Changing to gauss, "
62
+ + "but note that other velocity models are also compatible with multidimensional "
63
+ + "turbines in FLORIS v4. "
64
+ + "You will also need to convert your multidimensional turbine yaml files and their "
65
+ + "corresponding power/thrust csv files to be compatible with FLORIS v4 and to reflect "
66
+ + " the absolute power curve, rather than the power coefficient curve."
67
+ )
68
+ v4_floris_input_dict["wake"]["model_strings"]["velocity_model"] = "gauss"
69
+
70
+ # Add enable_active_wake_mixing field
71
+ v4_floris_input_dict["wake"]["enable_active_wake_mixing"] = False
72
+
73
+ # Write the new v4 model to a new file, note that the in order to ignore the !include tag
74
+ # it is wrapped in single quotes by the ignore include/load/dump sequence and these will
75
+ # need to be removed in the next block of code
76
+ yaml.dump(v4_floris_input_dict, open(output_path, "w"), sort_keys=False)
77
+
78
+ # Open the output file and loop through line by line
79
+ # if a line contains the substring !include, then strip all
80
+ # occurrences of ' from the line to remove the extra single quotes
81
+ # added by the ignore include/load/dump sequence
82
+ temp_output_path = output_path.with_name("temp.yaml")
83
+ with open(temp_output_path, "w") as file:
84
+ with open(output_path, "r") as f:
85
+ for line in f:
86
+ if "!include" in line:
87
+ line = line.replace("'", "")
88
+ file.write(line)
89
+
90
+ # Move the temp file to the output file
91
+ temp_output_path.replace(output_path)
92
+
93
+ print(output_path, "created.")
@@ -0,0 +1,86 @@
1
+
2
+ import sys
3
+ from pathlib import Path
4
+
5
+ from floris.turbine_library import build_cosine_loss_turbine_dict, check_smooth_power_curve
6
+ from floris.utilities import load_yaml
7
+
8
+
9
+ """
10
+ This script is intended to be called with an argument and converts a turbine
11
+ yaml file specified for FLORIS v3 to one specified for FLORIS v4.
12
+
13
+ Usage:
14
+ python convert_turbine_v3_to_v4.py <path/to/turbine>.yaml
15
+
16
+ The resulting turbine is placed in the same directory as the original yaml,
17
+ and is appended _v4.
18
+ """
19
+
20
+
21
+ if __name__ == "__main__":
22
+ if len(sys.argv) != 2:
23
+ raise Exception("Usage: python convert_turbine_v3_to_v4.py <path/to/turbine>.yaml")
24
+
25
+ input_yaml = sys.argv[1]
26
+
27
+ # Handling the path and new filename
28
+ input_path = Path(input_yaml)
29
+ split_input = input_path.parts
30
+ [filename_v3, extension] = split_input[-1].split(".")
31
+ filename_v4 = filename_v3 + "_v4"
32
+ split_output = list(split_input[:-1]) + [filename_v4+"."+extension]
33
+ output_path = Path(*split_output)
34
+
35
+ # Load existing v3 model
36
+ v3_turbine_dict = load_yaml(input_yaml)
37
+
38
+ # Split into components expected by build_turbine_dict
39
+ power_thrust_table = v3_turbine_dict["power_thrust_table"]
40
+ if "power_thrust_data_file" in power_thrust_table:
41
+ raise ValueError(
42
+ "Cannot convert multidimensional turbine model. Please manually update your "
43
+ + "turbine yaml. Note that the power_thrust_data_file csv needs to be updated to "
44
+ + "reflect the absolute power curve, rather than the power coefficient curve,"
45
+ + "and that `thrust` has been replaced by `thrust_coefficient`."
46
+ )
47
+ power_thrust_table["power_coefficient"] = power_thrust_table["power"]
48
+ power_thrust_table["thrust_coefficient"] = power_thrust_table["thrust"]
49
+ power_thrust_table.pop("power")
50
+ power_thrust_table.pop("thrust")
51
+
52
+ valid_properties = [
53
+ "generator_efficiency",
54
+ "hub_height",
55
+ "cosine_loss_exponent_yaw",
56
+ "cosine_loss_exponent_tilt",
57
+ "rotor_diameter",
58
+ "TSR",
59
+ "ref_air_density",
60
+ "ref_tilt"
61
+ ]
62
+
63
+ turbine_properties = {k:v for k,v in v3_turbine_dict.items() if k in valid_properties}
64
+ turbine_properties["ref_air_density"] = v3_turbine_dict["ref_density_cp_ct"]
65
+ turbine_properties["cosine_loss_exponent_yaw"] = v3_turbine_dict["pP"]
66
+ if "ref_tilt_cp_ct" in v3_turbine_dict:
67
+ turbine_properties["ref_tilt"] = v3_turbine_dict["ref_tilt_cp_ct"]
68
+ if "pT" in v3_turbine_dict:
69
+ turbine_properties["cosine_loss_exponent_tilt"] = v3_turbine_dict["pT"]
70
+
71
+ # Convert to v4 and print new yaml
72
+ v4_turbine_dict = build_cosine_loss_turbine_dict(
73
+ power_thrust_table,
74
+ v3_turbine_dict["turbine_type"],
75
+ output_path,
76
+ **turbine_properties
77
+ )
78
+
79
+ if not check_smooth_power_curve(
80
+ v4_turbine_dict["power_thrust_table"]["power"],
81
+ tolerance=0.001
82
+ ):
83
+ print(
84
+ "Non-smoothness detected in output power curve. ",
85
+ "Check above-rated power in generated v4 yaml file."
86
+ )