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.

Files changed (66) hide show
  1. foxes/VERSION +1 -1
  2. foxes/algorithms/downwind/downwind.py +60 -46
  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 +2 -1
  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 +114 -164
  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/models/wake_superpositions/ws_max.py +1 -0
  51. foxes/models/wake_superpositions/ws_pow.py +1 -0
  52. foxes/models/wake_superpositions/ws_quadratic.py +1 -0
  53. foxes/output/grids.py +6 -6
  54. foxes/output/output.py +6 -6
  55. foxes/utils/__init__.py +1 -1
  56. foxes/utils/factory.py +284 -76
  57. {foxes-0.7.1.dist-info → foxes-0.7.3.dist-info}/METADATA +8 -6
  58. {foxes-0.7.1.dist-info → foxes-0.7.3.dist-info}/RECORD +65 -51
  59. {foxes-0.7.1.dist-info → foxes-0.7.3.dist-info}/WHEEL +1 -1
  60. foxes/models/wake_models/wake_mirror.py +0 -196
  61. /foxes/models/{axial_induction_models → axial_induction}/__init__.py +0 -0
  62. /foxes/models/{axial_induction_models → axial_induction}/betz.py +0 -0
  63. /foxes/models/{axial_induction_models → axial_induction}/madsen.py +0 -0
  64. {foxes-0.7.1.dist-info → foxes-0.7.3.dist-info}/LICENSE +0 -0
  65. {foxes-0.7.1.dist-info → foxes-0.7.3.dist-info}/top_level.txt +0 -0
  66. {foxes-0.7.1.dist-info → foxes-0.7.3.dist-info}/zip-safe +0 -0
@@ -0,0 +1,12 @@
1
+ from foxes.core import GroundModel
2
+
3
+
4
+ class NoGround(GroundModel):
5
+ """
6
+ No ground effects
7
+
8
+ :group: models.ground_models
9
+
10
+ """
11
+
12
+ pass
@@ -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])