diff --git a/.coveragerc b/.coveragerc index 71266e80..b602a0c6 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,6 +1,5 @@ [run] omit = - ard/glue/prototype.py ard/utils/test_utils.py ard/farm_aero/placeholder.py diff --git a/.coveragerc_no_interarray b/.coveragerc_no_interarray index 5d80974e..fdd9c5b7 100644 --- a/.coveragerc_no_interarray +++ b/.coveragerc_no_interarray @@ -1,6 +1,5 @@ [run] omit = - ard/glue/prototype.py ard/test_utils.py ard/collection/optiwindnet_wrap.py diff --git a/ard/farm_aero/floris.py b/ard/farm_aero/floris.py index a406c307..2cf77254 100644 --- a/ard/farm_aero/floris.py +++ b/ard/farm_aero/floris.py @@ -141,6 +141,9 @@ def create_FLORIS_turbine_from_windIO( rotor_diameter=windIOturbine["rotor_diameter"], TSR=windIOturbine.get("TSR"), generator_efficiency=windIOturbine.get("generator_efficiency", 1.0), + ref_air_density=modeling_options.get("floris", {}).get( + "ref_air_density", 1.225 + ), ) ) @@ -200,8 +203,12 @@ def setup(self): wind_shear=self.windIO["site"]["energy_resource"]["wind_resource"].get( "shear" ), + reference_wind_height=( + self.wind_query.reference_height + if hasattr(self.wind_query, "reference_height") + else None + ), ) - self.fmodel.assign_hub_height_to_ref_height() self.case_title = self.options["case_title"] self.dir_floris = Path("case_files", self.case_title, "floris_inputs") diff --git a/examples/02_offshore_fixed/optimization_demo.ipynb b/examples/02_offshore_fixed/optimization_demo.ipynb index 7acb8b29..5277135c 100644 --- a/examples/02_offshore_fixed/optimization_demo.ipynb +++ b/examples/02_offshore_fixed/optimization_demo.ipynb @@ -181,9 +181,7 @@ " \"OpEx_val\": float(prob.get_val(\"opex.opex\", units=\"MUSD/yr\")[0]),\n", " \"LCOE_val\": float(prob.get_val(\"financese.lcoe\", units=\"USD/MW/h\")[0]),\n", " \"area_tight\": float(prob.get_val(\"landuse.area_tight\", units=\"km**2\")[0]),\n", - " \"coll_length\": float(\n", - " prob.get_val(\"collection.total_length_cables\", units=\"km\")[0]\n", - " ),\n", + " \"coll_length\": float(prob.get_val(\"collection.total_length_cables\", units=\"km\")[0]),\n", " \"turbine_spacing\": float(\n", " np.min(prob.get_val(\"spacing_constraint.turbine_spacing\", units=\"km\"))\n", " ),\n", @@ -453,11 +451,10 @@ " print(\"\\n\\nRESULTS (opt):\\n\")\n", " pp.pprint(test_data)\n", " print(\"\\n\\n\")\n", - " # plot convergence\n", + " # plot convergence\n", " ## read cases\n", " cr = om.CaseReader(\n", - " prob.get_outputs_dir()\n", - " / input_dict[\"analysis_options\"][\"recorder\"][\"filepath\"]\n", + " prob.get_outputs_dir() / input_dict[\"analysis_options\"][\"recorder\"][\"filepath\"]\n", " )\n", "\n", " # Extract the driver cases\n", @@ -471,9 +468,7 @@ " for i, case in enumerate(cases):\n", " iterations.append(i)\n", " objective_values.append(\n", - " case.get_objectives()[\n", - " input_dict[\"analysis_options\"][\"objective\"][\"name\"]\n", - " ]\n", + " case.get_objectives()[input_dict[\"analysis_options\"][\"objective\"][\"name\"]]\n", " )\n", "\n", " # Plot the convergence\n", @@ -484,7 +479,7 @@ " plt.title(\"Convergence Plot\")\n", " plt.legend()\n", " plt.grid()\n", - " plt.show()\n" + " plt.show()" ] }, { diff --git a/examples/03_offshore_floating_custom_system/optimization_demo.ipynb b/examples/03_offshore_floating_custom_system/optimization_demo.ipynb index f175620e..c0617af4 100644 --- a/examples/03_offshore_floating_custom_system/optimization_demo.ipynb +++ b/examples/03_offshore_floating_custom_system/optimization_demo.ipynb @@ -157,9 +157,7 @@ " \"OpEx_val\": float(prob.get_val(\"opex.opex\", units=\"MUSD/yr\")[0]),\n", " \"LCOE_val\": float(prob.get_val(\"financese.lcoe\", units=\"USD/MW/h\")[0]),\n", " \"area_tight\": float(prob.get_val(\"landuse.area_tight\", units=\"km**2\")[0]),\n", - " \"coll_length\": float(\n", - " prob.get_val(\"collection.total_length_cables\", units=\"km\")[0]\n", - " ),\n", + " \"coll_length\": float(prob.get_val(\"collection.total_length_cables\", units=\"km\")[0]),\n", " \"mooring_spacing\": float(\n", " np.min(prob.get_val(\"mooring_constraint.mooring_spacing\", units=\"km\"))\n", " ),\n", @@ -765,8 +763,7 @@ " # plot convergence\n", " ## read cases\n", " cr = om.CaseReader(\n", - " prob.get_outputs_dir()\n", - " / input_dict[\"analysis_options\"][\"recorder\"][\"filepath\"]\n", + " prob.get_outputs_dir() / input_dict[\"analysis_options\"][\"recorder\"][\"filepath\"]\n", " )\n", "\n", " # Extract the driver cases\n", @@ -780,9 +777,7 @@ " for i, case in enumerate(cases):\n", " iterations.append(i)\n", " objective_values.append(\n", - " case.get_objectives()[\n", - " input_dict[\"analysis_options\"][\"objective\"][\"name\"]\n", - " ]\n", + " case.get_objectives()[input_dict[\"analysis_options\"][\"objective\"][\"name\"]]\n", " )\n", "\n", " # Plot the convergence\n", @@ -824,9 +819,7 @@ } ], "source": [ - "plot_layout(\n", - " prob, input_dict=input_dict, show_image=True, include_cable_routing=True\n", - ")" + "plot_layout(prob, input_dict=input_dict, show_image=True, include_cable_routing=True)" ] } ], diff --git a/examples/data/wrg_example.wrg b/examples/data/wrg_example.wrg deleted file mode 100644 index cba94e7c..00000000 --- a/examples/data/wrg_example.wrg +++ /dev/null @@ -1,7 +0,0 @@ -2 3 0.0 0.0 1000.0 - 0 0 0 90 9.5 2.25 0 12 116 106 273 86 93 228 61 76 220 54 74 220 66 79 220 121 98 244 177 107 279 84 89 232 43 70 195 36 75 188 53 100 201 98 111 267 - 0 1000 0 90 9.6 2.31 0 12 116 107 341 86 93 228 61 76 220 54 74 220 66 79 220 121 98 244 177 107 279 84 89 232 43 70 195 36 75 188 53 100 201 98 111 267 - 0 2000 0 90 9.7 2.36 0 12 116 106 409 86 93 228 61 76 220 54 74 220 66 79 220 121 98 244 177 107 279 84 89 232 43 70 195 36 75 188 53 100 201 98 111 267 - 1000 0 0 90 9.6 2.34 0 12 116 106 273 86 93 228 61 76 220 54 82 407 66 79 220 121 98 244 177 107 279 84 89 232 43 70 195 36 75 188 53 100 201 98 111 267 - 1000 1000 0 90 9.6 2.40 0 12 116 107 341 86 93 228 61 76 220 54 82 407 66 79 220 121 98 244 177 107 279 84 89 232 43 70 195 36 75 188 53 100 201 98 111 267 - 1000 2000 0 90 9.7 2.46 0 12 116 106 409 86 93 228 61 76 220 54 82 407 66 79 220 121 98 244 177 107 279 84 89 232 43 70 195 36 75 188 53 100 201 98 111 267 \ No newline at end of file diff --git a/test/unit/ard/farm_aero/test_floris_batch_pyrite.npz b/test/unit/ard/farm_aero/test_floris_batch_pyrite.npz index 14faf7c9..f85d68ae 100644 Binary files a/test/unit/ard/farm_aero/test_floris_batch_pyrite.npz and b/test/unit/ard/farm_aero/test_floris_batch_pyrite.npz differ