foxes 0.7.1__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.
- foxes/VERSION +1 -1
- foxes/algorithms/downwind/downwind.py +60 -46
- foxes/algorithms/downwind/models/farm_wakes_calc.py +17 -6
- foxes/algorithms/downwind/models/point_wakes_calc.py +13 -45
- foxes/algorithms/iterative/iterative.py +1 -1
- foxes/algorithms/iterative/models/farm_wakes_calc.py +18 -4
- foxes/constants.py +5 -0
- foxes/core/__init__.py +2 -1
- foxes/core/ground_model.py +254 -0
- foxes/core/model.py +3 -2
- foxes/core/partial_wakes_model.py +19 -3
- foxes/core/states.py +33 -0
- foxes/core/wake_model.py +138 -2
- foxes/data/__init__.py +1 -1
- foxes/data/states/WRF-Timeseries-3000.nc +0 -0
- foxes/data/states/windio_timeseries_5000.nc +0 -0
- foxes/data/static_data.py +7 -0
- foxes/data/windio/DTU_10MW_turbine.yaml +10 -0
- foxes/data/windio/__init__.py +0 -0
- foxes/data/windio/windio_5turbines_timeseries.yaml +63 -0
- foxes/input/states/__init__.py +1 -0
- foxes/input/states/multi_height.py +225 -6
- foxes/input/windio/__init__.py +6 -1
- foxes/input/windio/get_states.py +115 -0
- foxes/input/windio/read_attributes.py +321 -0
- foxes/input/windio/read_farm.py +163 -0
- foxes/input/windio/read_fields.py +164 -0
- foxes/input/windio/runner.py +105 -0
- foxes/input/windio/windio.py +136 -254
- foxes/models/__init__.py +2 -1
- foxes/models/ground_models/__init__.py +2 -0
- foxes/models/ground_models/no_ground.py +12 -0
- foxes/models/ground_models/wake_mirror.py +161 -0
- foxes/models/model_book.py +114 -164
- foxes/models/partial_wakes/axiwake.py +27 -4
- foxes/models/partial_wakes/top_hat.py +26 -4
- foxes/models/turbine_types/PCt_file.py +1 -0
- foxes/models/turbine_types/PCt_from_two.py +92 -0
- foxes/models/wake_frames/yawed_wakes.py +41 -38
- foxes/models/wake_models/__init__.py +0 -1
- foxes/models/wake_models/induction/__init__.py +1 -0
- foxes/models/wake_models/induction/rankine_half_body.py +1 -1
- foxes/models/wake_models/induction/vortex_sheet.py +227 -0
- foxes/models/wake_models/ti/crespo_hernandez.py +26 -24
- foxes/models/wake_models/ti/iec_ti.py +33 -26
- foxes/models/wake_models/wind/bastankhah14.py +11 -32
- foxes/models/wake_models/wind/bastankhah16.py +30 -34
- foxes/models/wake_models/wind/jensen.py +13 -29
- foxes/models/wake_models/wind/turbopark.py +31 -61
- foxes/models/wake_superpositions/ws_max.py +1 -0
- foxes/models/wake_superpositions/ws_pow.py +1 -0
- foxes/models/wake_superpositions/ws_quadratic.py +1 -0
- foxes/output/grids.py +6 -6
- foxes/output/output.py +6 -6
- foxes/utils/__init__.py +1 -1
- foxes/utils/factory.py +284 -76
- {foxes-0.7.1.dist-info → foxes-0.7.3.dist-info}/METADATA +8 -6
- {foxes-0.7.1.dist-info → foxes-0.7.3.dist-info}/RECORD +65 -51
- {foxes-0.7.1.dist-info → foxes-0.7.3.dist-info}/WHEEL +1 -1
- foxes/models/wake_models/wake_mirror.py +0 -196
- /foxes/models/{axial_induction_models → axial_induction}/__init__.py +0 -0
- /foxes/models/{axial_induction_models → axial_induction}/betz.py +0 -0
- /foxes/models/{axial_induction_models → axial_induction}/madsen.py +0 -0
- {foxes-0.7.1.dist-info → foxes-0.7.3.dist-info}/LICENSE +0 -0
- {foxes-0.7.1.dist-info → foxes-0.7.3.dist-info}/top_level.txt +0 -0
- {foxes-0.7.1.dist-info → foxes-0.7.3.dist-info}/zip-safe +0 -0
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
from foxes.core import GroundModel
|
|
2
|
+
import foxes.variables as FV
|
|
3
|
+
import foxes.constants as FC
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class WakeMirror(GroundModel):
|
|
7
|
+
"""
|
|
8
|
+
Wake reflection from ground and/or other horizontal planes.
|
|
9
|
+
|
|
10
|
+
Attributes
|
|
11
|
+
----------
|
|
12
|
+
heights: list of float
|
|
13
|
+
The reflection heights
|
|
14
|
+
|
|
15
|
+
:group: models.ground_models
|
|
16
|
+
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
def __init__(self, heights):
|
|
20
|
+
"""
|
|
21
|
+
Constructor.
|
|
22
|
+
|
|
23
|
+
Parameters
|
|
24
|
+
----------
|
|
25
|
+
heights: list of float
|
|
26
|
+
The reflection heights
|
|
27
|
+
|
|
28
|
+
"""
|
|
29
|
+
super().__init__()
|
|
30
|
+
self.heights = heights
|
|
31
|
+
|
|
32
|
+
def contribute_to_farm_wakes(
|
|
33
|
+
self,
|
|
34
|
+
algo,
|
|
35
|
+
mdata,
|
|
36
|
+
fdata,
|
|
37
|
+
tdata,
|
|
38
|
+
downwind_index,
|
|
39
|
+
wake_deltas,
|
|
40
|
+
wmodel,
|
|
41
|
+
pwake,
|
|
42
|
+
):
|
|
43
|
+
"""
|
|
44
|
+
Modifies wake deltas at target points by
|
|
45
|
+
contributions from the specified wake source turbines.
|
|
46
|
+
|
|
47
|
+
Parameters
|
|
48
|
+
----------
|
|
49
|
+
algo: foxes.core.Algorithm
|
|
50
|
+
The calculation algorithm
|
|
51
|
+
mdata: foxes.core.MData
|
|
52
|
+
The model data
|
|
53
|
+
fdata: foxes.core.FData
|
|
54
|
+
The farm data
|
|
55
|
+
tdata: foxes.core.TData
|
|
56
|
+
The target point data
|
|
57
|
+
downwind_index: int
|
|
58
|
+
The index of the wake causing turbine
|
|
59
|
+
in the downwnd order
|
|
60
|
+
wake_deltas: dict
|
|
61
|
+
The wake deltas. Key: variable name,
|
|
62
|
+
value: numpy.ndarray with shape
|
|
63
|
+
(n_states, n_targets, n_tpoints, ...)
|
|
64
|
+
wmodel: foxes.core.WakeModel
|
|
65
|
+
The wake model
|
|
66
|
+
pwake: foxes.core.PartialWakesModel
|
|
67
|
+
The partial wakes model
|
|
68
|
+
|
|
69
|
+
"""
|
|
70
|
+
# prepare:
|
|
71
|
+
hh = fdata[FV.H][:, downwind_index].copy()
|
|
72
|
+
|
|
73
|
+
# contribution from main wake:
|
|
74
|
+
wcoos = algo.wake_frame.get_wake_coos(algo, mdata, fdata, tdata, downwind_index)
|
|
75
|
+
wmodel.contribute(algo, mdata, fdata, tdata, downwind_index, wcoos, wake_deltas)
|
|
76
|
+
|
|
77
|
+
# contribution from mirrors:
|
|
78
|
+
tdata[FC.TARGETS] = tdata[FC.TARGETS].copy() # making sure this is no ref
|
|
79
|
+
for h in self.heights:
|
|
80
|
+
|
|
81
|
+
fdata[FV.H][:, downwind_index] = hh + 2 * (h - hh)
|
|
82
|
+
|
|
83
|
+
pwake.contribute(
|
|
84
|
+
algo, mdata, fdata, tdata, downwind_index, wake_deltas, wmodel
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
# reset heights:
|
|
88
|
+
fdata[FV.H][:, downwind_index] = hh
|
|
89
|
+
|
|
90
|
+
def contribute_to_point_wakes(
|
|
91
|
+
self,
|
|
92
|
+
algo,
|
|
93
|
+
mdata,
|
|
94
|
+
fdata,
|
|
95
|
+
tdata,
|
|
96
|
+
downwind_index,
|
|
97
|
+
wake_deltas,
|
|
98
|
+
wmodel,
|
|
99
|
+
):
|
|
100
|
+
"""
|
|
101
|
+
Modifies wake deltas at target points by
|
|
102
|
+
contributions from the specified wake source turbines.
|
|
103
|
+
|
|
104
|
+
Parameters
|
|
105
|
+
----------
|
|
106
|
+
algo: foxes.core.Algorithm
|
|
107
|
+
The calculation algorithm
|
|
108
|
+
mdata: foxes.core.MData
|
|
109
|
+
The model data
|
|
110
|
+
fdata: foxes.core.FData
|
|
111
|
+
The farm data
|
|
112
|
+
tdata: foxes.core.TData
|
|
113
|
+
The target point data
|
|
114
|
+
downwind_index: int
|
|
115
|
+
The index of the wake causing turbine
|
|
116
|
+
in the downwnd order
|
|
117
|
+
wake_deltas: dict
|
|
118
|
+
The wake deltas. Key: variable name,
|
|
119
|
+
value: numpy.ndarray with shape
|
|
120
|
+
(n_states, n_targets, n_tpoints, ...)
|
|
121
|
+
wmodel: foxes.core.WakeModel
|
|
122
|
+
The wake model
|
|
123
|
+
|
|
124
|
+
"""
|
|
125
|
+
# prepare:
|
|
126
|
+
hh = fdata[FV.H][:, downwind_index].copy()
|
|
127
|
+
|
|
128
|
+
# contribution from main wake:
|
|
129
|
+
wcoos = algo.wake_frame.get_wake_coos(algo, mdata, fdata, tdata, downwind_index)
|
|
130
|
+
wmodel.contribute(algo, mdata, fdata, tdata, downwind_index, wcoos, wake_deltas)
|
|
131
|
+
|
|
132
|
+
# contribution from mirrors:
|
|
133
|
+
tdata[FC.TARGETS] = tdata[FC.TARGETS].copy() # making sure this is no ref
|
|
134
|
+
for h in self.heights:
|
|
135
|
+
|
|
136
|
+
fdata[FV.H][:, downwind_index] = hh + 2 * (h - hh)
|
|
137
|
+
|
|
138
|
+
wcoos = algo.wake_frame.get_wake_coos(
|
|
139
|
+
algo, mdata, fdata, tdata, downwind_index
|
|
140
|
+
)
|
|
141
|
+
wmodel.contribute(
|
|
142
|
+
algo, mdata, fdata, tdata, downwind_index, wcoos, wake_deltas
|
|
143
|
+
)
|
|
144
|
+
|
|
145
|
+
# reset heights:
|
|
146
|
+
fdata[FV.H][:, downwind_index] = hh
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
class GroundMirror(WakeMirror):
|
|
150
|
+
"""
|
|
151
|
+
Wake reflection from the ground.
|
|
152
|
+
|
|
153
|
+
:group: models.ground_models
|
|
154
|
+
|
|
155
|
+
"""
|
|
156
|
+
|
|
157
|
+
def __init__(self):
|
|
158
|
+
"""
|
|
159
|
+
Constructor.
|
|
160
|
+
"""
|
|
161
|
+
super().__init__(heights=[0.0])
|