foxes 0.7.2__py3-none-any.whl → 0.7.3__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.

Files changed (60) hide show
  1. foxes/VERSION +1 -1
  2. foxes/algorithms/downwind/downwind.py +57 -45
  3. foxes/algorithms/downwind/models/farm_wakes_calc.py +17 -6
  4. foxes/algorithms/downwind/models/point_wakes_calc.py +13 -45
  5. foxes/algorithms/iterative/iterative.py +1 -1
  6. foxes/algorithms/iterative/models/farm_wakes_calc.py +18 -4
  7. foxes/constants.py +5 -0
  8. foxes/core/__init__.py +2 -1
  9. foxes/core/ground_model.py +254 -0
  10. foxes/core/model.py +3 -2
  11. foxes/core/partial_wakes_model.py +19 -3
  12. foxes/core/states.py +33 -0
  13. foxes/core/wake_model.py +138 -2
  14. foxes/data/__init__.py +1 -1
  15. foxes/data/states/WRF-Timeseries-3000.nc +0 -0
  16. foxes/data/states/windio_timeseries_5000.nc +0 -0
  17. foxes/data/static_data.py +7 -0
  18. foxes/data/windio/DTU_10MW_turbine.yaml +10 -0
  19. foxes/data/windio/__init__.py +0 -0
  20. foxes/data/windio/windio_5turbines_timeseries.yaml +63 -0
  21. foxes/input/states/__init__.py +1 -0
  22. foxes/input/states/multi_height.py +225 -6
  23. foxes/input/windio/__init__.py +6 -1
  24. foxes/input/windio/get_states.py +115 -0
  25. foxes/input/windio/read_attributes.py +321 -0
  26. foxes/input/windio/read_farm.py +163 -0
  27. foxes/input/windio/read_fields.py +164 -0
  28. foxes/input/windio/runner.py +105 -0
  29. foxes/input/windio/windio.py +136 -254
  30. foxes/models/__init__.py +1 -0
  31. foxes/models/ground_models/__init__.py +2 -0
  32. foxes/models/ground_models/no_ground.py +12 -0
  33. foxes/models/ground_models/wake_mirror.py +161 -0
  34. foxes/models/model_book.py +68 -149
  35. foxes/models/partial_wakes/axiwake.py +27 -4
  36. foxes/models/partial_wakes/top_hat.py +26 -4
  37. foxes/models/turbine_types/PCt_file.py +1 -0
  38. foxes/models/turbine_types/PCt_from_two.py +92 -0
  39. foxes/models/wake_frames/yawed_wakes.py +41 -38
  40. foxes/models/wake_models/__init__.py +0 -1
  41. foxes/models/wake_models/induction/__init__.py +1 -0
  42. foxes/models/wake_models/induction/rankine_half_body.py +1 -1
  43. foxes/models/wake_models/induction/vortex_sheet.py +227 -0
  44. foxes/models/wake_models/ti/crespo_hernandez.py +26 -24
  45. foxes/models/wake_models/ti/iec_ti.py +33 -26
  46. foxes/models/wake_models/wind/bastankhah14.py +11 -32
  47. foxes/models/wake_models/wind/bastankhah16.py +30 -34
  48. foxes/models/wake_models/wind/jensen.py +13 -29
  49. foxes/models/wake_models/wind/turbopark.py +31 -61
  50. foxes/output/grids.py +6 -6
  51. foxes/output/output.py +6 -6
  52. foxes/utils/__init__.py +1 -1
  53. foxes/utils/factory.py +203 -11
  54. {foxes-0.7.2.dist-info → foxes-0.7.3.dist-info}/METADATA +8 -6
  55. {foxes-0.7.2.dist-info → foxes-0.7.3.dist-info}/RECORD +59 -45
  56. {foxes-0.7.2.dist-info → foxes-0.7.3.dist-info}/WHEEL +1 -1
  57. foxes/models/wake_models/wake_mirror.py +0 -196
  58. {foxes-0.7.2.dist-info → foxes-0.7.3.dist-info}/LICENSE +0 -0
  59. {foxes-0.7.2.dist-info → foxes-0.7.3.dist-info}/top_level.txt +0 -0
  60. {foxes-0.7.2.dist-info → foxes-0.7.3.dist-info}/zip-safe +0 -0
@@ -1,196 +0,0 @@
1
- import numpy as np
2
-
3
- from foxes.core import WakeModel
4
- import foxes.variables as FV
5
- import foxes.constants as FC
6
-
7
-
8
- class WakeMirror(WakeModel):
9
- """
10
- A wake model wrapper that adds mirror turbines
11
- that model wake reflection from a horizontal plane,
12
- e.g. the ground
13
-
14
- Attributes
15
- ----------
16
- wmodel: foxes.core.WakeModel
17
- The original wake model
18
- heights: list of float
19
- The reflection heights
20
-
21
- :group: models.wake_models
22
-
23
- """
24
-
25
- def __init__(self, wmodel, heights):
26
- """
27
- Constructor.
28
-
29
- Parameters
30
- ----------
31
- wmodel: foxes.core.WakeModel
32
- The original wake model
33
- heights: list of float
34
- The reflection heights
35
-
36
- """
37
- super().__init__()
38
- self.wmodel = wmodel
39
- self.heights = heights
40
- self.name = self.name + "_" + wmodel.name
41
-
42
- def sub_models(self):
43
- """
44
- List of all sub-models
45
-
46
- Returns
47
- -------
48
- smdls: list of foxes.core.Model
49
- All sub models
50
-
51
- """
52
- return [self.wmodel]
53
-
54
- def new_wake_deltas(self, algo, mdata, fdata, tdata):
55
- """
56
- Creates new empty wake delta arrays.
57
-
58
- Parameters
59
- ----------
60
- algo: foxes.core.Algorithm
61
- The calculation algorithm
62
- mdata: foxes.core.MData
63
- The model data
64
- fdata: foxes.core.FData
65
- The farm data
66
- tdata: foxes.core.TData
67
- The target point data
68
-
69
- Returns
70
- -------
71
- wake_deltas: dict
72
- Key: variable name, value: The zero filled
73
- wake deltas, shape: (n_states, n_turbines, n_rpoints, ...)
74
-
75
- """
76
- return self.wmodel.new_wake_deltas(algo, mdata, fdata, tdata)
77
-
78
- def contribute(
79
- self,
80
- algo,
81
- mdata,
82
- fdata,
83
- tdata,
84
- downwind_index,
85
- wake_coos,
86
- wake_deltas,
87
- ):
88
- """
89
- Modifies wake deltas at target points by
90
- contributions from the specified wake source turbines.
91
-
92
- Parameters
93
- ----------
94
- algo: foxes.core.Algorithm
95
- The calculation algorithm
96
- mdata: foxes.core.MData
97
- The model data
98
- fdata: foxes.core.FData
99
- The farm data
100
- tdata: foxes.core.TData
101
- The target point data
102
- downwind_index: int
103
- The index of the wake causing turbine
104
- in the downwnd order
105
- wake_coos: numpy.ndarray
106
- The wake frame coordinates of the evaluation
107
- points, shape: (n_states, n_targets, n_tpoints, 3)
108
- wake_deltas: dict
109
- The wake deltas. Key: variable name,
110
- value: numpy.ndarray with shape
111
- (n_states, n_targets, n_tpoints, ...)
112
-
113
- """
114
- hh = fdata[FV.H][:, downwind_index].copy()
115
- self.wmodel.contribute(
116
- algo, mdata, fdata, tdata, downwind_index, wake_coos, wake_deltas
117
- )
118
-
119
- tdata[FC.TARGETS] = tdata[FC.TARGETS].copy() # making sure this is no ref
120
-
121
- for h in self.heights:
122
-
123
- fdata[FV.H][:, downwind_index] = hh + 2 * (h - hh)
124
-
125
- nwcoos = algo.wake_frame.get_wake_coos(
126
- algo, mdata, fdata, tdata, downwind_index
127
- )
128
-
129
- self.wmodel.contribute(
130
- algo, mdata, fdata, tdata, downwind_index, nwcoos, wake_deltas
131
- )
132
-
133
- fdata[FV.H][:, downwind_index] = hh
134
-
135
- def finalize_wake_deltas(
136
- self,
137
- algo,
138
- mdata,
139
- fdata,
140
- amb_results,
141
- wake_deltas,
142
- ):
143
- """
144
- Finalize the wake calculation.
145
-
146
- Modifies wake_deltas on the fly.
147
-
148
- Parameters
149
- ----------
150
- algo: foxes.core.Algorithm
151
- The calculation algorithm
152
- mdata: foxes.core.MData
153
- The model data
154
- fdata: foxes.core.FData
155
- The farm data
156
- amb_results: dict
157
- The ambient results, key: variable name str,
158
- values: numpy.ndarray with shape
159
- (n_states, n_targets, n_tpoints)
160
- wake_deltas: dict
161
- The wake deltas object at the selected target
162
- turbines. Key: variable str, value: numpy.ndarray
163
- with shape (n_states, n_targets, n_tpoints)
164
-
165
- """
166
- self.wmodel.finalize_wake_deltas(
167
- algo,
168
- mdata,
169
- fdata,
170
- amb_results,
171
- wake_deltas,
172
- )
173
-
174
-
175
- class GroundMirror(WakeMirror):
176
- """
177
- A wake model wrapper that adds mirror turbines
178
- that model wake reflection from the ground
179
-
180
- :group: models.wake_models
181
-
182
- """
183
-
184
- def __init__(self, *args, **kwargs):
185
- """
186
- Constructor.
187
-
188
- Parameters
189
- ----------
190
- args: tuple, optional
191
- Additional parameters for WakeMirror
192
- kwargs: dict, optional
193
- Additional parameters for WakeMirror
194
-
195
- """
196
- super().__init__(*args, heights=[0], **kwargs)
File without changes