foxes 0.8.2__py3-none-any.whl → 1.1.0.2__py3-none-any.whl
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.
Potentially problematic release.
This version of foxes might be problematic. Click here for more details.
- docs/source/conf.py +353 -0
- examples/abl_states/run.py +160 -0
- examples/compare_rotors_pwakes/run.py +217 -0
- examples/compare_wakes/run.py +241 -0
- examples/dyn_wakes/run.py +311 -0
- examples/field_data_nc/run.py +121 -0
- examples/induction/run.py +201 -0
- examples/multi_height/run.py +113 -0
- examples/power_mask/run.py +249 -0
- examples/random_timeseries/run.py +210 -0
- examples/scan_row/run.py +193 -0
- examples/sector_management/run.py +162 -0
- examples/sequential/run.py +209 -0
- examples/single_state/run.py +201 -0
- examples/states_lookup_table/run.py +137 -0
- examples/streamline_wakes/run.py +138 -0
- examples/tab_file/run.py +142 -0
- examples/timelines/run.py +267 -0
- examples/timeseries/run.py +190 -0
- examples/timeseries_slurm/run.py +185 -0
- examples/wind_rose/run.py +141 -0
- examples/windio/run.py +29 -0
- examples/yawed_wake/run.py +196 -0
- foxes/__init__.py +4 -8
- foxes/algorithms/__init__.py +1 -1
- foxes/algorithms/downwind/downwind.py +247 -111
- foxes/algorithms/downwind/models/farm_wakes_calc.py +12 -7
- foxes/algorithms/downwind/models/init_farm_data.py +2 -2
- foxes/algorithms/downwind/models/point_wakes_calc.py +6 -7
- foxes/algorithms/downwind/models/reorder_farm_output.py +1 -2
- foxes/algorithms/downwind/models/set_amb_farm_results.py +1 -1
- foxes/algorithms/downwind/models/set_amb_point_results.py +5 -3
- foxes/algorithms/iterative/iterative.py +74 -34
- foxes/algorithms/iterative/models/farm_wakes_calc.py +12 -7
- foxes/algorithms/iterative/models/urelax.py +3 -3
- foxes/algorithms/sequential/models/plugin.py +5 -5
- foxes/algorithms/sequential/models/seq_state.py +1 -1
- foxes/algorithms/sequential/sequential.py +126 -255
- foxes/constants.py +22 -7
- foxes/core/__init__.py +1 -0
- foxes/core/algorithm.py +632 -147
- foxes/core/data.py +252 -20
- foxes/core/data_calc_model.py +15 -291
- foxes/core/engine.py +640 -0
- foxes/core/farm_controller.py +38 -10
- foxes/core/farm_data_model.py +16 -1
- foxes/core/ground_model.py +2 -2
- foxes/core/model.py +249 -182
- foxes/core/partial_wakes_model.py +1 -1
- foxes/core/point_data_model.py +17 -2
- foxes/core/rotor_model.py +27 -21
- foxes/core/states.py +17 -1
- foxes/core/turbine_type.py +28 -0
- foxes/core/wake_frame.py +30 -34
- foxes/core/wake_model.py +5 -5
- foxes/core/wake_superposition.py +1 -1
- foxes/data/windio/windio_5turbines_timeseries.yaml +31 -15
- foxes/engines/__init__.py +17 -0
- foxes/engines/dask.py +982 -0
- foxes/engines/default.py +75 -0
- foxes/engines/futures.py +72 -0
- foxes/engines/mpi.py +38 -0
- foxes/engines/multiprocess.py +71 -0
- foxes/engines/numpy.py +167 -0
- foxes/engines/pool.py +249 -0
- foxes/engines/ray.py +79 -0
- foxes/engines/single.py +141 -0
- foxes/input/farm_layout/__init__.py +1 -0
- foxes/input/farm_layout/from_csv.py +4 -0
- foxes/input/farm_layout/from_json.py +2 -2
- foxes/input/farm_layout/grid.py +2 -2
- foxes/input/farm_layout/ring.py +65 -0
- foxes/input/farm_layout/row.py +2 -2
- foxes/input/states/__init__.py +7 -0
- foxes/input/states/create/random_abl_states.py +1 -1
- foxes/input/states/field_data_nc.py +158 -33
- foxes/input/states/multi_height.py +128 -14
- foxes/input/states/one_point_flow.py +577 -0
- foxes/input/states/scan_ws.py +74 -3
- foxes/input/states/single.py +1 -1
- foxes/input/states/slice_data_nc.py +681 -0
- foxes/input/states/states_table.py +204 -35
- foxes/input/windio/__init__.py +2 -2
- foxes/input/windio/get_states.py +44 -23
- foxes/input/windio/read_attributes.py +48 -17
- foxes/input/windio/read_farm.py +116 -102
- foxes/input/windio/read_fields.py +16 -6
- foxes/input/windio/read_outputs.py +71 -24
- foxes/input/windio/runner.py +31 -17
- foxes/input/windio/windio.py +41 -23
- foxes/models/farm_models/turbine2farm.py +1 -1
- foxes/models/ground_models/wake_mirror.py +10 -6
- foxes/models/model_book.py +58 -20
- foxes/models/partial_wakes/axiwake.py +3 -3
- foxes/models/partial_wakes/rotor_points.py +3 -3
- foxes/models/partial_wakes/top_hat.py +2 -2
- foxes/models/point_models/set_uniform_data.py +1 -1
- foxes/models/point_models/tke2ti.py +1 -1
- foxes/models/point_models/wake_deltas.py +1 -1
- foxes/models/rotor_models/centre.py +4 -0
- foxes/models/rotor_models/grid.py +24 -25
- foxes/models/rotor_models/levels.py +4 -5
- foxes/models/turbine_models/calculator.py +4 -6
- foxes/models/turbine_models/kTI_model.py +22 -6
- foxes/models/turbine_models/lookup_table.py +30 -4
- foxes/models/turbine_models/rotor_centre_calc.py +4 -3
- foxes/models/turbine_models/set_farm_vars.py +103 -34
- foxes/models/turbine_types/PCt_file.py +27 -3
- foxes/models/turbine_types/PCt_from_two.py +27 -3
- foxes/models/turbine_types/TBL_file.py +80 -0
- foxes/models/turbine_types/__init__.py +2 -0
- foxes/models/turbine_types/lookup.py +316 -0
- foxes/models/turbine_types/null_type.py +51 -1
- foxes/models/turbine_types/wsrho2PCt_from_two.py +29 -5
- foxes/models/turbine_types/wsti2PCt_from_two.py +31 -7
- foxes/models/vertical_profiles/__init__.py +1 -1
- foxes/models/vertical_profiles/data_profile.py +1 -1
- foxes/models/wake_frames/__init__.py +1 -0
- foxes/models/wake_frames/dynamic_wakes.py +424 -0
- foxes/models/wake_frames/farm_order.py +25 -5
- foxes/models/wake_frames/rotor_wd.py +6 -4
- foxes/models/wake_frames/seq_dynamic_wakes.py +61 -74
- foxes/models/wake_frames/streamlines.py +21 -22
- foxes/models/wake_frames/timelines.py +330 -129
- foxes/models/wake_frames/yawed_wakes.py +7 -4
- foxes/models/wake_models/dist_sliced.py +2 -4
- foxes/models/wake_models/induction/rankine_half_body.py +5 -5
- foxes/models/wake_models/induction/rathmann.py +78 -24
- foxes/models/wake_models/induction/self_similar.py +78 -28
- foxes/models/wake_models/induction/vortex_sheet.py +86 -48
- foxes/models/wake_models/ti/crespo_hernandez.py +6 -4
- foxes/models/wake_models/ti/iec_ti.py +40 -21
- foxes/models/wake_models/top_hat.py +1 -1
- foxes/models/wake_models/wind/bastankhah14.py +8 -6
- foxes/models/wake_models/wind/bastankhah16.py +17 -16
- foxes/models/wake_models/wind/jensen.py +4 -3
- foxes/models/wake_models/wind/turbopark.py +16 -13
- foxes/models/wake_superpositions/ti_linear.py +1 -1
- foxes/models/wake_superpositions/ti_max.py +1 -1
- foxes/models/wake_superpositions/ti_pow.py +1 -1
- foxes/models/wake_superpositions/ti_quadratic.py +1 -1
- foxes/models/wake_superpositions/ws_linear.py +8 -7
- foxes/models/wake_superpositions/ws_max.py +8 -7
- foxes/models/wake_superpositions/ws_pow.py +8 -7
- foxes/models/wake_superpositions/ws_product.py +5 -5
- foxes/models/wake_superpositions/ws_quadratic.py +8 -7
- foxes/output/__init__.py +4 -1
- foxes/output/farm_layout.py +16 -12
- foxes/output/farm_results_eval.py +1 -1
- foxes/output/flow_plots_2d/__init__.py +0 -1
- foxes/output/flow_plots_2d/flow_plots.py +70 -30
- foxes/output/grids.py +92 -22
- foxes/output/results_writer.py +2 -2
- foxes/output/rose_plot.py +3 -3
- foxes/output/seq_plugins/__init__.py +2 -0
- foxes/output/{flow_plots_2d → seq_plugins}/seq_flow_ani_plugin.py +64 -22
- foxes/output/seq_plugins/seq_wake_debug_plugin.py +145 -0
- foxes/output/slice_data.py +131 -111
- foxes/output/state_turbine_map.py +19 -14
- foxes/output/state_turbine_table.py +19 -19
- foxes/utils/__init__.py +1 -1
- foxes/utils/abl/neutral.py +2 -2
- foxes/utils/abl/stable.py +2 -2
- foxes/utils/abl/unstable.py +2 -2
- foxes/utils/data_book.py +1 -1
- foxes/utils/dev_utils.py +42 -0
- foxes/utils/dict.py +24 -1
- foxes/utils/exec_python.py +1 -1
- foxes/utils/factory.py +176 -53
- foxes/utils/geom2d/circle.py +1 -1
- foxes/utils/geom2d/polygon.py +1 -1
- foxes/utils/geopandas_utils.py +2 -2
- foxes/utils/load.py +2 -2
- foxes/utils/pandas_helpers.py +3 -2
- foxes/utils/wind_dir.py +0 -2
- foxes/utils/xarray_utils.py +24 -14
- foxes/variables.py +39 -2
- {foxes-0.8.2.dist-info → foxes-1.1.0.2.dist-info}/METADATA +75 -33
- foxes-1.1.0.2.dist-info/RECORD +309 -0
- {foxes-0.8.2.dist-info → foxes-1.1.0.2.dist-info}/WHEEL +1 -1
- foxes-1.1.0.2.dist-info/top_level.txt +4 -0
- tests/0_consistency/iterative/test_iterative.py +92 -0
- tests/0_consistency/partial_wakes/test_partial_wakes.py +90 -0
- tests/1_verification/flappy_0_6/PCt_files/flappy/run.py +85 -0
- tests/1_verification/flappy_0_6/PCt_files/test_PCt_files.py +103 -0
- tests/1_verification/flappy_0_6/abl_states/flappy/run.py +85 -0
- tests/1_verification/flappy_0_6/abl_states/test_abl_states.py +87 -0
- tests/1_verification/flappy_0_6/partial_top_hat/flappy/run.py +82 -0
- tests/1_verification/flappy_0_6/partial_top_hat/test_partial_top_hat.py +82 -0
- tests/1_verification/flappy_0_6/row_Jensen_linear_centre/flappy/run.py +92 -0
- tests/1_verification/flappy_0_6/row_Jensen_linear_centre/test_row_Jensen_linear_centre.py +93 -0
- tests/1_verification/flappy_0_6/row_Jensen_linear_tophat/flappy/run.py +92 -0
- tests/1_verification/flappy_0_6/row_Jensen_linear_tophat/test_row_Jensen_linear_tophat.py +96 -0
- tests/1_verification/flappy_0_6/row_Jensen_linear_tophat_IECTI2005/flappy/run.py +94 -0
- tests/1_verification/flappy_0_6/row_Jensen_linear_tophat_IECTI2005/test_row_Jensen_linear_tophat_IECTI_2005.py +122 -0
- tests/1_verification/flappy_0_6/row_Jensen_linear_tophat_IECTI2019/flappy/run.py +94 -0
- tests/1_verification/flappy_0_6/row_Jensen_linear_tophat_IECTI2019/test_row_Jensen_linear_tophat_IECTI_2019.py +122 -0
- tests/1_verification/flappy_0_6/row_Jensen_quadratic_centre/flappy/run.py +92 -0
- tests/1_verification/flappy_0_6/row_Jensen_quadratic_centre/test_row_Jensen_quadratic_centre.py +93 -0
- tests/1_verification/flappy_0_6_2/grid_rotors/flappy/run.py +85 -0
- tests/1_verification/flappy_0_6_2/grid_rotors/test_grid_rotors.py +130 -0
- tests/1_verification/flappy_0_6_2/row_Bastankhah_Crespo/flappy/run.py +96 -0
- tests/1_verification/flappy_0_6_2/row_Bastankhah_Crespo/test_row_Bastankhah_Crespo.py +116 -0
- tests/1_verification/flappy_0_6_2/row_Bastankhah_linear_centre/flappy/run.py +93 -0
- tests/1_verification/flappy_0_6_2/row_Bastankhah_linear_centre/test_row_Bastankhah_linear_centre.py +99 -0
- tests/3_examples/test_examples.py +34 -0
- foxes/VERSION +0 -1
- foxes/output/flow_plots_2d.py +0 -0
- foxes/utils/geopandas_helpers.py +0 -294
- foxes/utils/runners/__init__.py +0 -1
- foxes/utils/runners/runners.py +0 -280
- foxes-0.8.2.dist-info/RECORD +0 -247
- foxes-0.8.2.dist-info/top_level.txt +0 -1
- foxes-0.8.2.dist-info/zip-safe +0 -1
- {foxes-0.8.2.dist-info → foxes-1.1.0.2.dist-info}/LICENSE +0 -0
docs/source/conf.py
ADDED
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
#
|
|
3
|
+
# Configuration file for the Sphinx documentation builder.
|
|
4
|
+
#
|
|
5
|
+
# This file does only contain a selection of the most common options. For a
|
|
6
|
+
# full list see the documentation:
|
|
7
|
+
# http://www.sphinx-doc.org/en/master/config
|
|
8
|
+
|
|
9
|
+
# -- Path setup --------------------------------------------------------------
|
|
10
|
+
|
|
11
|
+
# If extensions (or modules to document with autodoc) are in another directory,
|
|
12
|
+
# add these directories to sys.path here. If the directory is relative to the
|
|
13
|
+
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
|
14
|
+
#
|
|
15
|
+
import os
|
|
16
|
+
import sys
|
|
17
|
+
|
|
18
|
+
sys.path.insert(0, os.path.abspath("../.."))
|
|
19
|
+
|
|
20
|
+
from foxes import __version__
|
|
21
|
+
|
|
22
|
+
# -- Project information -----------------------------------------------------
|
|
23
|
+
|
|
24
|
+
project = "foxes"
|
|
25
|
+
copyright = "2024, Fraunhofer IWES"
|
|
26
|
+
author = "Fraunhofer IWES"
|
|
27
|
+
|
|
28
|
+
# The short X.Y version
|
|
29
|
+
version = __version__
|
|
30
|
+
# The full version, including alpha/beta/rc tags
|
|
31
|
+
release = __version__
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
# -- General configuration ---------------------------------------------------
|
|
35
|
+
|
|
36
|
+
# If your documentation needs a minimal Sphinx version, state it here.
|
|
37
|
+
#
|
|
38
|
+
# needs_sphinx = '1.0'
|
|
39
|
+
|
|
40
|
+
# Add any Sphinx extension module names here, as strings. They can be
|
|
41
|
+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
|
42
|
+
# ones.
|
|
43
|
+
extensions = [
|
|
44
|
+
"nbsphinx",
|
|
45
|
+
"sphinx_immaterial",
|
|
46
|
+
"sphinx_immaterial.apidoc.python.apigen",
|
|
47
|
+
"sphinx.ext.autodoc",
|
|
48
|
+
"sphinx.ext.autosectionlabel",
|
|
49
|
+
# "sphinx.ext.autosummary",
|
|
50
|
+
"sphinx.ext.intersphinx",
|
|
51
|
+
"sphinx.ext.mathjax",
|
|
52
|
+
# "sphinx.ext.napoleon",
|
|
53
|
+
"sphinx.ext.viewcode",
|
|
54
|
+
# "sphinx.ext.inheritance_diagram",
|
|
55
|
+
"sphinx.ext.doctest",
|
|
56
|
+
"m2r2",
|
|
57
|
+
]
|
|
58
|
+
|
|
59
|
+
intersphinx_mapping = {
|
|
60
|
+
"python": ("https://docs.python.org/3/", None),
|
|
61
|
+
"numpy": ("https://docs.scipy.org/doc/numpy/", None),
|
|
62
|
+
"scipy": ("https://docs.scipy.org/doc/scipy/reference/", None),
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
# Add any paths that contain templates here, relative to this directory.
|
|
66
|
+
# templates_path = ["_templates"]
|
|
67
|
+
# autosummary_generate = False
|
|
68
|
+
|
|
69
|
+
# The suffix(es) of source filenames.
|
|
70
|
+
# You can specify multiple suffix as a list of string:
|
|
71
|
+
#
|
|
72
|
+
source_suffix = [".rst", ".md"]
|
|
73
|
+
|
|
74
|
+
# The master toctree document.
|
|
75
|
+
master_doc = "index"
|
|
76
|
+
|
|
77
|
+
# The language for content autogenerated by Sphinx. Refer to documentation
|
|
78
|
+
# for a list of supported languages.
|
|
79
|
+
#
|
|
80
|
+
# This is also used if you do content translation via gettext catalogs.
|
|
81
|
+
# Usually you set "language" from the command line for these cases.
|
|
82
|
+
language = "en"
|
|
83
|
+
|
|
84
|
+
# List of patterns, relative to source directory, that match files and
|
|
85
|
+
# directories to ignore when looking for source files.
|
|
86
|
+
# This pattern also affects html_static_path and html_extra_path.
|
|
87
|
+
exclude_patterns = [
|
|
88
|
+
# ipynb checkpoints
|
|
89
|
+
"notebooks/.ipynb_checkpoints/*.ipynb",
|
|
90
|
+
"build/*",
|
|
91
|
+
# "_templates/*",
|
|
92
|
+
# DEBUG
|
|
93
|
+
# "examples.rst",
|
|
94
|
+
# "notebooks/*",
|
|
95
|
+
# "notebooks/layout_opt.ipynb",
|
|
96
|
+
# "notebooks/timelines.ipynb",
|
|
97
|
+
# "notebooks/heterogeneous.ipynb",
|
|
98
|
+
# "notebooks/timeseries.ipynb",
|
|
99
|
+
# "api.rst"
|
|
100
|
+
]
|
|
101
|
+
|
|
102
|
+
# The name of the Pygments (syntax highlighting) style to use.
|
|
103
|
+
pygments_style = None
|
|
104
|
+
|
|
105
|
+
# autosummary_generate = True
|
|
106
|
+
napolean_use_rtype = False
|
|
107
|
+
|
|
108
|
+
# -- Options for sphinxcontrib.email ------------------------------------------
|
|
109
|
+
# email_automode = True
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
# -- Options for nbsphinx -----------------------------------------------------
|
|
113
|
+
|
|
114
|
+
# Execute notebooks before conversion: 'always', 'never', 'auto' (default)
|
|
115
|
+
# We execute all notebooks, exclude the slow ones using 'exclude_patterns'
|
|
116
|
+
nbsphinx_execute = "always"
|
|
117
|
+
|
|
118
|
+
# Use this kernel instead of the one stored in the notebook metadata:
|
|
119
|
+
# nbsphinx_kernel_name = 'python3'
|
|
120
|
+
|
|
121
|
+
# List of arguments to be passed to the kernel that executes the notebooks:
|
|
122
|
+
# nbsphinx_execute_arguments = []
|
|
123
|
+
|
|
124
|
+
# If True, the build process is continued even if an exception occurs:
|
|
125
|
+
# nbsphinx_allow_errors = True
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
# Controls when a cell will time out (defaults to 30; use -1 for no timeout):
|
|
129
|
+
nbsphinx_timeout = 500
|
|
130
|
+
|
|
131
|
+
# Default Pygments lexer for syntax highlighting in code cells:
|
|
132
|
+
# nbsphinx_codecell_lexer = 'ipython3'
|
|
133
|
+
|
|
134
|
+
# Width of input/output prompts used in CSS:
|
|
135
|
+
# nbsphinx_prompt_width = '8ex'
|
|
136
|
+
|
|
137
|
+
# If window is narrower than this, input/output prompts are on separate lines:
|
|
138
|
+
# nbsphinx_responsive_width = '700px'
|
|
139
|
+
|
|
140
|
+
# This is processed by Jinja2 and inserted before each notebook
|
|
141
|
+
# Fix for issue with pyplot, cf
|
|
142
|
+
# https://github.com/readthedocs/sphinx_rtd_theme/issues/788#issuecomment-585785027
|
|
143
|
+
nbsphinx_prolog = r"""
|
|
144
|
+
.. raw:: html
|
|
145
|
+
|
|
146
|
+
<script src='http://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.10/require.min.js'></script>
|
|
147
|
+
<script>require=requirejs;</script>
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
"""
|
|
151
|
+
|
|
152
|
+
# This is processed by Jinja2 and inserted after each notebook
|
|
153
|
+
# nbsphinx_epilog = r"""
|
|
154
|
+
# """
|
|
155
|
+
|
|
156
|
+
# Input prompt for code cells. "%s" is replaced by the execution count.
|
|
157
|
+
nbsphinx_input_prompt = "In [%s]:"
|
|
158
|
+
|
|
159
|
+
# Output prompt for code cells. "%s" is replaced by the execution count.
|
|
160
|
+
nbsphinx_output_prompt = "Out[%s]:"
|
|
161
|
+
|
|
162
|
+
# Specify conversion functions for custom notebook formats:
|
|
163
|
+
# import jupytext
|
|
164
|
+
# nbsphinx_custom_formats = {
|
|
165
|
+
# '.Rmd': lambda s: jupytext.reads(s, '.Rmd'),
|
|
166
|
+
# }
|
|
167
|
+
|
|
168
|
+
# Link or path to require.js, set to empty string to disable
|
|
169
|
+
# nbsphinx_requirejs_path = ''
|
|
170
|
+
|
|
171
|
+
# Options for loading require.js
|
|
172
|
+
# nbsphinx_requirejs_options = {'async': 'async'}
|
|
173
|
+
mathjax3_config = {
|
|
174
|
+
"TeX": {"equationNumbers": {"autoNumber": "AMS", "useLabelIds": True}},
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
# Additional files needed for generating LaTeX/PDF output:
|
|
178
|
+
# latex_additional_files = ['references.bib']
|
|
179
|
+
|
|
180
|
+
# -- Options for autodoc ----------------------------------------------------
|
|
181
|
+
# https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#configuration
|
|
182
|
+
|
|
183
|
+
# Automatically extract typehints when specified and place them in
|
|
184
|
+
# descriptions of the relevant function/method.
|
|
185
|
+
autodoc_typehints = "description"
|
|
186
|
+
|
|
187
|
+
# Don't show class signature with the class' name.
|
|
188
|
+
autodoc_class_signature = "separated"
|
|
189
|
+
|
|
190
|
+
# -- Options for HTML output -------------------------------------------------
|
|
191
|
+
|
|
192
|
+
# The theme to use for HTML and HTML Help pages. See the documentation for
|
|
193
|
+
# a list of builtin themes.
|
|
194
|
+
#
|
|
195
|
+
html_theme = "sphinx_immaterial"
|
|
196
|
+
|
|
197
|
+
# html_theme = 'cloud'
|
|
198
|
+
|
|
199
|
+
# Theme options are theme-specific and customize the look and feel of a theme
|
|
200
|
+
# further. For a list of options available for each theme, see the
|
|
201
|
+
# documentation.
|
|
202
|
+
html_theme_options = {
|
|
203
|
+
# TOC options
|
|
204
|
+
#'navigation_depth': 2, # only show 2 levels on left sidebar
|
|
205
|
+
# "collapse_navigation": False, # don't allow sidebar to collapse,
|
|
206
|
+
"site_url": "https://fraunhoferiwes.github.io/foxes.docs/index.html",
|
|
207
|
+
"repo_url": "https://github.com/FraunhoferIWES/foxes",
|
|
208
|
+
"icon": {"repo": "fontawesome/brands/github", "edit": "material/file-edit-outline"},
|
|
209
|
+
"palette": {"primary": "teal"},
|
|
210
|
+
"toc_title_is_page_title": True,
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
# Add any paths that contain custom static files (such as style sheets) here,
|
|
214
|
+
# relative to this directory. They are copied after the builtin static files,
|
|
215
|
+
# so a file named "default.css" will overwrite the builtin "default.css".
|
|
216
|
+
# html_static_path = ["_static"]
|
|
217
|
+
|
|
218
|
+
# custom.css is inside one of the html_static_path folders (e.g. _static)
|
|
219
|
+
# html_css_files = ["custom.css"]
|
|
220
|
+
|
|
221
|
+
# Custom sidebar templates, must be a dictionary that maps document names
|
|
222
|
+
# to template names.
|
|
223
|
+
#
|
|
224
|
+
# The default sidebars (for documents that don't match any pattern) are
|
|
225
|
+
# defined by theme itself. Builtin themes are using these templates by
|
|
226
|
+
# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
|
|
227
|
+
# 'searchbox.html']``.
|
|
228
|
+
#
|
|
229
|
+
# html_sidebars = {}
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
# -- Options for HTMLHelp output ---------------------------------------------
|
|
233
|
+
|
|
234
|
+
# Output file base name for HTML help builder.
|
|
235
|
+
htmlhelp_basename = "foxesdoc"
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
# -- Options for LaTeX output ------------------------------------------------
|
|
239
|
+
|
|
240
|
+
latex_elements = {
|
|
241
|
+
# The paper size ('letterpaper' or 'a4paper').
|
|
242
|
+
#
|
|
243
|
+
# 'papersize': 'letterpaper',
|
|
244
|
+
# The font size ('10pt', '11pt' or '12pt').
|
|
245
|
+
#
|
|
246
|
+
# 'pointsize': '10pt',
|
|
247
|
+
# Additional stuff for the LaTeX preamble.
|
|
248
|
+
#
|
|
249
|
+
# 'preamble': '',
|
|
250
|
+
# Latex figure (float) alignment
|
|
251
|
+
#
|
|
252
|
+
# 'figure_align': 'htbp',
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
# Grouping the document tree into LaTeX files. List of tuples
|
|
256
|
+
# (source start file, target name, title,
|
|
257
|
+
# author, documentclass [howto, manual, or own class]).
|
|
258
|
+
latex_documents = [
|
|
259
|
+
(master_doc, "foxes.tex", "foxes Documentation", "Fraunhofer IWES", "manual"),
|
|
260
|
+
]
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
# -- Options for manual page output ------------------------------------------
|
|
264
|
+
|
|
265
|
+
# One entry per manual page. List of tuples
|
|
266
|
+
# (source start file, name, description, authors, manual section).
|
|
267
|
+
man_pages = [(master_doc, "foxes", "foxes Documentation", [author], 1)]
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
# -- Options for Texinfo output ----------------------------------------------
|
|
271
|
+
|
|
272
|
+
# Grouping the document tree into Texinfo files. List of tuples
|
|
273
|
+
# (source start file, target name, title, author,
|
|
274
|
+
# dir menu entry, description, category)
|
|
275
|
+
texinfo_documents = [
|
|
276
|
+
(
|
|
277
|
+
master_doc,
|
|
278
|
+
"foxes",
|
|
279
|
+
"foxes Documentation",
|
|
280
|
+
author,
|
|
281
|
+
"foxes",
|
|
282
|
+
"Farm Optimization and eXtended yield Evaluation Software",
|
|
283
|
+
"Miscellaneous",
|
|
284
|
+
),
|
|
285
|
+
]
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
# -- Options for Epub output -------------------------------------------------
|
|
289
|
+
|
|
290
|
+
# Bibliographic Dublin Core info.
|
|
291
|
+
epub_title = project
|
|
292
|
+
|
|
293
|
+
# The unique identifier of the text. This can be a ISBN number
|
|
294
|
+
# or the project homepage.
|
|
295
|
+
#
|
|
296
|
+
# epub_identifier = ''
|
|
297
|
+
|
|
298
|
+
# A unique identification for the text.
|
|
299
|
+
#
|
|
300
|
+
# epub_uid = ''
|
|
301
|
+
|
|
302
|
+
# A list of files that should not be packed into the epub file.
|
|
303
|
+
epub_exclude_files = ["search.html"]
|
|
304
|
+
|
|
305
|
+
# -- python_apigen configuration -------------------------------------------------
|
|
306
|
+
|
|
307
|
+
python_apigen_modules = {
|
|
308
|
+
"foxes.variables": "_foxes/variables/",
|
|
309
|
+
"foxes.constants": "_foxes/constants/",
|
|
310
|
+
"foxes.algorithms": "_foxes/algorithms/",
|
|
311
|
+
"foxes.algorithms.downwind": "_foxes/algorithms/downwind/",
|
|
312
|
+
"foxes.algorithms.downwind.models": "_foxes/algorithms/downwind/models/",
|
|
313
|
+
"foxes.algorithms.iterative": "_foxes/algorithms/iterative/",
|
|
314
|
+
"foxes.algorithms.iterative.models": "_foxes/algorithms/iterative/models/",
|
|
315
|
+
"foxes.algorithms.sequential": "_foxes/algorithms/sequential/",
|
|
316
|
+
"foxes.algorithms.sequential.models": "_foxes/algorithms/sequential/models/",
|
|
317
|
+
"foxes.core": "_foxes/core/",
|
|
318
|
+
"foxes.data": "_foxes/data/",
|
|
319
|
+
"foxes.engines": "_foxes/engines/",
|
|
320
|
+
"foxes.input.farm_layout": "_foxes/input/farm_layout/",
|
|
321
|
+
"foxes.input.states": "_foxes/input/states/",
|
|
322
|
+
"foxes.input.states.create": "_foxes/input/states/create/",
|
|
323
|
+
"foxes.input.windio": "_foxes/input/windio/",
|
|
324
|
+
"foxes.output": "_foxes/output/",
|
|
325
|
+
"foxes.output.flow_plots_2d": "_foxes/output/flow_plots_2d/",
|
|
326
|
+
"foxes.output.seq_plugins": "_foxes/output/seq_plugins/",
|
|
327
|
+
"foxes.models": "_foxes/models/",
|
|
328
|
+
"foxes.models.farm_controllers": "_foxes/models/farm_controllers/",
|
|
329
|
+
"foxes.models.farm_models": "_foxes/models/farm_models/",
|
|
330
|
+
"foxes.models.partial_wakes": "_foxes/models/partial_wakes/",
|
|
331
|
+
"foxes.models.point_models": "_foxes/models/point_models/",
|
|
332
|
+
"foxes.models.rotor_models": "_foxes/models/rotor_models/",
|
|
333
|
+
"foxes.models.turbine_models": "_foxes/models/turbine_models/",
|
|
334
|
+
"foxes.models.turbine_types": "_foxes/models/turbine_types/",
|
|
335
|
+
"foxes.models.vertical_profiles": "_foxes/models/vertical_profiles/",
|
|
336
|
+
"foxes.models.axial_induction": "_foxes/models/axial_induction",
|
|
337
|
+
"foxes.models.ground_models": "_foxes/models/ground_models",
|
|
338
|
+
"foxes.models.wake_frames": "_foxes/models/wake_frames/",
|
|
339
|
+
"foxes.models.wake_models": "_foxes/models/wake_models/",
|
|
340
|
+
"foxes.models.wake_models.induction": "_foxes/models/wake_models/induction/",
|
|
341
|
+
"foxes.models.wake_models.wind": "_foxes/models/wake_models/wind/",
|
|
342
|
+
"foxes.models.wake_models.ti": "_foxes/models/wake_models/ti/",
|
|
343
|
+
"foxes.models.wake_superpositions": "_foxes/models/wake_superpositions/",
|
|
344
|
+
"foxes.utils": "_foxes/utils/",
|
|
345
|
+
"foxes.utils.abl": "_foxes/utils/abl",
|
|
346
|
+
"foxes.utils.geom2d": "_foxes/utils/geom2d/",
|
|
347
|
+
"foxes.utils.runners": "_foxes/utils/runners/",
|
|
348
|
+
"foxes.utils.two_circles": "_foxes/utils/two_circles/",
|
|
349
|
+
"foxes.utils.abl.neutral": "_foxes/utils/abl/neutral/",
|
|
350
|
+
"foxes.utils.abl.stable": "_foxes/utils/abl/stable/",
|
|
351
|
+
"foxes.utils.abl.unstable": "_foxes/utils/abl/unstable/",
|
|
352
|
+
"foxes.utils.abl.sheared": "_foxes/utils/abl/sheared/",
|
|
353
|
+
}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import time
|
|
2
|
+
import argparse
|
|
3
|
+
|
|
4
|
+
import foxes
|
|
5
|
+
import foxes.variables as FV
|
|
6
|
+
|
|
7
|
+
if __name__ == "__main__":
|
|
8
|
+
parser = argparse.ArgumentParser()
|
|
9
|
+
parser.add_argument(
|
|
10
|
+
"-l",
|
|
11
|
+
"--layout",
|
|
12
|
+
help="The wind farm layout file (path or static)",
|
|
13
|
+
default="test_farm_67.csv",
|
|
14
|
+
)
|
|
15
|
+
parser.add_argument(
|
|
16
|
+
"-s",
|
|
17
|
+
"--states",
|
|
18
|
+
help="The states input file (path or static)",
|
|
19
|
+
default="abl_states_6000.csv.gz",
|
|
20
|
+
)
|
|
21
|
+
parser.add_argument(
|
|
22
|
+
"-t",
|
|
23
|
+
"--turbine_file",
|
|
24
|
+
help="The P-ct-curve csv file (path or static)",
|
|
25
|
+
default="NREL-5MW-D126-H90.csv",
|
|
26
|
+
)
|
|
27
|
+
parser.add_argument("-r", "--rotor", help="The rotor model", default="level4")
|
|
28
|
+
parser.add_argument(
|
|
29
|
+
"-p", "--pwakes", help="The partial wakes models", default=None, nargs="+"
|
|
30
|
+
)
|
|
31
|
+
parser.add_argument(
|
|
32
|
+
"-w",
|
|
33
|
+
"--wakes",
|
|
34
|
+
help="The wake models",
|
|
35
|
+
default=["CrespoHernandez_quadratic_k002", "Bastankhah2016_linear_lim_k004"],
|
|
36
|
+
nargs="+",
|
|
37
|
+
)
|
|
38
|
+
parser.add_argument(
|
|
39
|
+
"-m", "--tmodels", help="The turbine models", default=[], nargs="+"
|
|
40
|
+
)
|
|
41
|
+
parser.add_argument("-e", "--engine", help="The engine", default=None)
|
|
42
|
+
parser.add_argument(
|
|
43
|
+
"-n", "--n_cpus", help="The number of cpus", default=None, type=int
|
|
44
|
+
)
|
|
45
|
+
parser.add_argument(
|
|
46
|
+
"-c",
|
|
47
|
+
"--chunksize_states",
|
|
48
|
+
help="The chunk size for states",
|
|
49
|
+
default=None,
|
|
50
|
+
type=int,
|
|
51
|
+
)
|
|
52
|
+
parser.add_argument(
|
|
53
|
+
"-C",
|
|
54
|
+
"--chunksize_points",
|
|
55
|
+
help="The chunk size for points",
|
|
56
|
+
default=None,
|
|
57
|
+
type=int,
|
|
58
|
+
)
|
|
59
|
+
parser.add_argument(
|
|
60
|
+
"-nf", "--nofig", help="Do not show figures", action="store_true"
|
|
61
|
+
)
|
|
62
|
+
args = parser.parse_args()
|
|
63
|
+
|
|
64
|
+
mbook = foxes.models.ModelBook()
|
|
65
|
+
ttype = foxes.models.turbine_types.PCtFile(args.turbine_file)
|
|
66
|
+
mbook.turbine_types[ttype.name] = ttype
|
|
67
|
+
|
|
68
|
+
states = foxes.input.states.StatesTable(
|
|
69
|
+
data_source=args.states,
|
|
70
|
+
output_vars=[FV.WS, FV.WD, FV.TI, FV.RHO, FV.MOL],
|
|
71
|
+
var2col={FV.WS: "ws", FV.WD: "wd", FV.TI: "ti", FV.MOL: "mol"},
|
|
72
|
+
fixed_vars={FV.RHO: 1.225, FV.Z0: 0.05, FV.H: 100.0},
|
|
73
|
+
profiles={FV.WS: "ABLLogWsProfile"},
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
farm = foxes.WindFarm()
|
|
77
|
+
foxes.input.farm_layout.add_from_file(
|
|
78
|
+
farm,
|
|
79
|
+
args.layout,
|
|
80
|
+
col_x="x",
|
|
81
|
+
col_y="y",
|
|
82
|
+
col_H="H",
|
|
83
|
+
turbine_models=args.tmodels + [ttype.name],
|
|
84
|
+
)
|
|
85
|
+
|
|
86
|
+
algo = foxes.algorithms.Downwind(
|
|
87
|
+
farm,
|
|
88
|
+
states,
|
|
89
|
+
wake_models=args.wakes,
|
|
90
|
+
rotor_model=args.rotor,
|
|
91
|
+
wake_frame="rotor_wd",
|
|
92
|
+
partial_wakes=args.pwakes,
|
|
93
|
+
mbook=mbook,
|
|
94
|
+
engine=args.engine,
|
|
95
|
+
n_procs=args.n_cpus,
|
|
96
|
+
chunk_size_states=args.chunksize_states,
|
|
97
|
+
chunk_size_points=args.chunksize_points,
|
|
98
|
+
)
|
|
99
|
+
|
|
100
|
+
time0 = time.time()
|
|
101
|
+
farm_results = algo.calc_farm()
|
|
102
|
+
time1 = time.time()
|
|
103
|
+
|
|
104
|
+
print("\nCalc time =", time1 - time0, "\n")
|
|
105
|
+
|
|
106
|
+
print(farm_results)
|
|
107
|
+
|
|
108
|
+
fr = farm_results.to_dataframe()
|
|
109
|
+
print(fr[[FV.WD, FV.H, FV.AMB_REWS, FV.REWS, FV.AMB_P, FV.P]])
|
|
110
|
+
|
|
111
|
+
o = foxes.output.FarmResultsEval(farm_results)
|
|
112
|
+
o = foxes.output.FarmResultsEval(farm_results)
|
|
113
|
+
o.add_capacity(algo)
|
|
114
|
+
o.add_capacity(algo, ambient=True)
|
|
115
|
+
o.add_efficiency()
|
|
116
|
+
|
|
117
|
+
# state-turbine results
|
|
118
|
+
farm_df = farm_results.to_dataframe()
|
|
119
|
+
print("\nFarm results data:\n")
|
|
120
|
+
print(
|
|
121
|
+
farm_df[
|
|
122
|
+
[
|
|
123
|
+
FV.X,
|
|
124
|
+
FV.WD,
|
|
125
|
+
FV.AMB_REWS,
|
|
126
|
+
FV.REWS,
|
|
127
|
+
FV.AMB_TI,
|
|
128
|
+
FV.TI,
|
|
129
|
+
FV.AMB_P,
|
|
130
|
+
FV.P,
|
|
131
|
+
FV.EFF,
|
|
132
|
+
]
|
|
133
|
+
]
|
|
134
|
+
)
|
|
135
|
+
print()
|
|
136
|
+
|
|
137
|
+
# results by turbine
|
|
138
|
+
turbine_results = o.reduce_states(
|
|
139
|
+
{
|
|
140
|
+
FV.AMB_P: "mean",
|
|
141
|
+
FV.P: "mean",
|
|
142
|
+
FV.AMB_CAP: "mean",
|
|
143
|
+
FV.CAP: "mean",
|
|
144
|
+
FV.EFF: "mean",
|
|
145
|
+
}
|
|
146
|
+
)
|
|
147
|
+
turbine_results[FV.AMB_YLD] = o.calc_turbine_yield(
|
|
148
|
+
algo=algo, annual=True, ambient=True
|
|
149
|
+
)
|
|
150
|
+
turbine_results[FV.YLD] = o.calc_turbine_yield(algo=algo, annual=True)
|
|
151
|
+
print("\nResults by turbine:\n")
|
|
152
|
+
print(turbine_results)
|
|
153
|
+
|
|
154
|
+
# power results
|
|
155
|
+
P0 = o.calc_mean_farm_power(ambient=True)
|
|
156
|
+
P = o.calc_mean_farm_power()
|
|
157
|
+
print(f"\nFarm power : {P/1000:.1f} MW")
|
|
158
|
+
print(f"Farm ambient power: {P0/1000:.1f} MW")
|
|
159
|
+
print(f"Farm efficiency : {o.calc_farm_efficiency():.2f}")
|
|
160
|
+
print(f"Annual farm yield : {turbine_results[FV.YLD].sum():.2f} GWh.")
|