Skip to content

Commit bbb80e2

Browse files
committed
Add a function to display the input configs
1 parent 2c7d975 commit bbb80e2

File tree

2 files changed

+68
-3
lines changed

2 files changed

+68
-3
lines changed

docs/advanced_concepts.ipynb

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,59 @@
150150
"cell_type": "code",
151151
"execution_count": 4,
152152
"metadata": {},
153-
"outputs": [],
153+
"outputs": [
154+
{
155+
"name": "stdout",
156+
"output_type": "stream",
157+
"text": [
158+
"solver\n",
159+
" type\n",
160+
" turbine_grid\n",
161+
" turbine_grid_points\n",
162+
" 3\n",
163+
"wake\n",
164+
" model_strings\n",
165+
" combination_model\n",
166+
" sosfs\n",
167+
" deflection_model\n",
168+
" gauss\n",
169+
" turbulence_model\n",
170+
" crespo_hernandez\n",
171+
" velocity_model\n",
172+
" jensen\n",
173+
"farm\n",
174+
" layout_x\n",
175+
" [0.0]\n",
176+
" layout_y\n",
177+
" [0.0]\n",
178+
" turbine_type\n",
179+
" ['nrel_5MW']\n",
180+
" turbine_library_path\n",
181+
" /Users/rmudafor/Development/floris/floris/turbine_library\n",
182+
"flow_field\n",
183+
" wind_speeds\n",
184+
" [5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0]\n",
185+
" wind_directions\n",
186+
" [0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0]\n",
187+
" wind_veer\n",
188+
" 0.0\n",
189+
" wind_shear\n",
190+
" 0.12\n",
191+
" air_density\n",
192+
" 1.225\n",
193+
" turbulence_intensities\n",
194+
" [0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0]\n",
195+
" reference_wind_height\n",
196+
" 90.0\n",
197+
"name\n",
198+
" GCH\n",
199+
"description\n",
200+
" Default initialization: Gauss-Curl hybrid model (GCH)\n",
201+
"floris_version\n",
202+
" v4\n"
203+
]
204+
}
205+
],
154206
"source": [
155207
"import floris\n",
156208
"\n",
@@ -173,6 +225,9 @@
173225
" # turbine_type=[\"my_turbine\"]\n",
174226
")\n",
175227
"\n",
228+
"# Verify settings are correct\n",
229+
"fmodel.show_config() # Shows truncated set of inputs; show all with fmodel.show_config(full=True)\n",
230+
"\n",
176231
"# Within the calling code's computation, run FLORIS\n",
177232
"fmodel.run()"
178233
]

floris/floris_model.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1636,10 +1636,20 @@ def get_turbine_layout(self, z=False):
16361636
else:
16371637
return xcoords, ycoords
16381638

1639-
def print_dict(self) -> None:
1639+
def show_config(self, full=False) -> None:
16401640
"""Print the FlorisModel dictionary.
16411641
"""
1642-
print_nested_dict(self.core.as_dict())
1642+
config_dict = self.core.as_dict()
1643+
if not full:
1644+
del config_dict["logging"]
1645+
del config_dict["wake"]["enable_secondary_steering"]
1646+
del config_dict["wake"]["enable_yaw_added_recovery"]
1647+
del config_dict["wake"]["enable_transverse_velocities"]
1648+
del config_dict["wake"]["enable_active_wake_mixing"]
1649+
del config_dict["wake"]["wake_deflection_parameters"]
1650+
del config_dict["wake"]["wake_velocity_parameters"]
1651+
del config_dict["wake"]["wake_turbulence_parameters"]
1652+
print_nested_dict(config_dict)
16431653

16441654

16451655
### Properties

0 commit comments

Comments
 (0)