Skip to content

Commit

Permalink
Add a function to display the input configs
Browse files Browse the repository at this point in the history
  • Loading branch information
rafmudaf committed Feb 4, 2025
1 parent 2c7d975 commit bbb80e2
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 3 deletions.
57 changes: 56 additions & 1 deletion docs/advanced_concepts.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,59 @@
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"solver\n",
" type\n",
" turbine_grid\n",
" turbine_grid_points\n",
" 3\n",
"wake\n",
" model_strings\n",
" combination_model\n",
" sosfs\n",
" deflection_model\n",
" gauss\n",
" turbulence_model\n",
" crespo_hernandez\n",
" velocity_model\n",
" jensen\n",
"farm\n",
" layout_x\n",
" [0.0]\n",
" layout_y\n",
" [0.0]\n",
" turbine_type\n",
" ['nrel_5MW']\n",
" turbine_library_path\n",
" /Users/rmudafor/Development/floris/floris/turbine_library\n",
"flow_field\n",
" wind_speeds\n",
" [5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0]\n",
" wind_directions\n",
" [0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0]\n",
" wind_veer\n",
" 0.0\n",
" wind_shear\n",
" 0.12\n",
" air_density\n",
" 1.225\n",
" turbulence_intensities\n",
" [0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0]\n",
" reference_wind_height\n",
" 90.0\n",
"name\n",
" GCH\n",
"description\n",
" Default initialization: Gauss-Curl hybrid model (GCH)\n",
"floris_version\n",
" v4\n"
]
}
],
"source": [
"import floris\n",
"\n",
Expand All @@ -173,6 +225,9 @@
" # turbine_type=[\"my_turbine\"]\n",
")\n",
"\n",
"# Verify settings are correct\n",
"fmodel.show_config() # Shows truncated set of inputs; show all with fmodel.show_config(full=True)\n",
"\n",
"# Within the calling code's computation, run FLORIS\n",
"fmodel.run()"
]
Expand Down
14 changes: 12 additions & 2 deletions floris/floris_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -1636,10 +1636,20 @@ def get_turbine_layout(self, z=False):
else:
return xcoords, ycoords

def print_dict(self) -> None:
def show_config(self, full=False) -> None:
"""Print the FlorisModel dictionary.
"""
print_nested_dict(self.core.as_dict())
config_dict = self.core.as_dict()
if not full:
del config_dict["logging"]
del config_dict["wake"]["enable_secondary_steering"]
del config_dict["wake"]["enable_yaw_added_recovery"]
del config_dict["wake"]["enable_transverse_velocities"]
del config_dict["wake"]["enable_active_wake_mixing"]
del config_dict["wake"]["wake_deflection_parameters"]
del config_dict["wake"]["wake_velocity_parameters"]
del config_dict["wake"]["wake_turbulence_parameters"]
print_nested_dict(config_dict)


### Properties
Expand Down

0 comments on commit bbb80e2

Please sign in to comment.