You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
annual_maintenance_implementer : Zero 7 days/year at lowest-flow week.
105
+
major_maintenance_implementer : Zero 14 days/5 years at lowest bi-weekly mean.
106
+
"""
107
+
35
108
# Function that sets max turbine flow to the design flow
36
109
defmax_turbineflow_checker(self, flow_obj):
110
+
"""
111
+
Cap turbine flow at the design flow.
112
+
113
+
Parameters
114
+
----------
115
+
flow_obj : object
116
+
Object with attributes:
117
+
- flow : numpy.ndarray
118
+
Raw inflow time series (m^3/s).
119
+
- design_flow : float or numpy.ndarray
120
+
Turbine design flow (m^3/s). If array, must align with `flow`.
121
+
122
+
Side Effects
123
+
------------
124
+
Updates `flow_obj.turbine_flow` (numpy.ndarray), where each element is
125
+
`min(flow, design_flow)`.
126
+
127
+
Examples
128
+
--------
129
+
>>> # flow_obj.flow = [12, 8], design_flow = 10
130
+
>>> # turbine_flow becomes [10, 8]
131
+
"""
37
132
38
133
flow=flow_obj.flow# this is a numpy array
39
134
design_flow=flow_obj.design_flow
40
135
flow_obj.turbine_flow=np.where(flow>design_flow, design_flow, flow) # turbine_flow is created here as this code is always active and runs 1st. flow is < design flow
41
136
42
137
# Function that sets min turbine flow to the design flow
43
138
defmin_turbineflow_checker(self, flow_obj):
139
+
"""
140
+
Enforce a minimum turbine flow threshold; set values below it to zero.
141
+
142
+
Logic
143
+
-----
144
+
- If `flow_obj.minimum_turbineflow` is provided, use it (m^3/s).
145
+
- Else, compute min flow as
146
+
(`minimum_turbineflow_percent` or 10 by default) × `design_flow` / 100.
147
+
The computed value is stored back into `flow_obj.minimum_turbineflow`.
148
+
149
+
Parameters
150
+
----------
151
+
flow_obj : object
152
+
Object with attributes:
153
+
- turbine_flow : numpy.ndarray
154
+
Turbine flow series (m^3/s), typically after max-capping.
155
+
- design_flow : float or numpy.ndarray
156
+
Turbine design flow (m^3/s).
157
+
- minimum_turbineflow : float or None
158
+
- minimum_turbineflow_percent : float or None
159
+
160
+
Side Effects
161
+
------------
162
+
Updates `flow_obj.turbine_flow`, replacing values `< min_flow` with 0.
163
+
164
+
Notes
165
+
-----
166
+
- If `design_flow` is an array, elementwise percentages are applied.
167
+
- Default minimum percent is 10 if neither absolute nor percentage is given.
0 commit comments