From 333b0659c565e4120384db521cf095b02f8bd356 Mon Sep 17 00:00:00 2001 From: Rob Hammond <13874373+RHammond2@users.noreply.github.com> Date: Fri, 15 Dec 2023 17:36:05 -0800 Subject: [PATCH] Update Documentation Example to Configure Dynamically (#2) * turn off jupyter execute and use latest local build info * update documentation to dynamically reconfigure floris turbine library --- docs/waves_example.md | 9 ++ examples/waves_example.ipynb | 143 ++++++++++-------- .../base_fixed_bottom_2022_floris_jensen.yaml | 2 +- .../base_floating_2022_floris_jensen.yaml | 2 +- 4 files changed, 87 insertions(+), 69 deletions(-) diff --git a/docs/waves_example.md b/docs/waves_example.md index f2129de..ce3780e 100644 --- a/docs/waves_example.md +++ b/docs/waves_example.md @@ -79,6 +79,15 @@ turbine_library_path: /WAVES/library/base_2022/turbines/ library_path = Path("../library/base_2022/") config_fixed = load_yaml(library_path / "project/config", "base_fixed_bottom_2022.yaml") config_floating = load_yaml(library_path / "project/config", "base_floating_2022.yaml") + +# This example was designed prior to the FLORIS 3.6 release, so the path to the turbine library in +# FLORIS must be manually updated, but this example must work for all users, so a dynamic method +# is used below, ensuring this works for all users. +config_fixed["floris_config"] = load_yaml(library_path / "project/config", config_fixed["floris_config"]) +config_floating["floris_config"] = load_yaml(library_path / "project/config", config_floating["floris_config"]) + +config_fixed["floris_config"]["farm"]["turbine_library_path"] = library_path / "turbines" +config_floating["floris_config"]["farm"]["turbine_library_path"] = library_path / "turbines" ``` Now, we'll create a Project for each of the fixed bottom and floating offshore scenarios, showing diff --git a/examples/waves_example.ipynb b/examples/waves_example.ipynb index 4b99595..0211cce 100644 --- a/examples/waves_example.ipynb +++ b/examples/waves_example.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "b14a231b", + "id": "91ab3727", "metadata": {}, "source": [ "(example_cower_2022)=\n", @@ -39,7 +39,7 @@ { "cell_type": "code", "execution_count": 1, - "id": "cb947864", + "id": "28940071", "metadata": {}, "outputs": [], "source": [ @@ -59,7 +59,7 @@ }, { "cell_type": "markdown", - "id": "87961b6f", + "id": "0ebc5a9a", "metadata": {}, "source": [ "## Configuration\n", @@ -87,18 +87,27 @@ { "cell_type": "code", "execution_count": 2, - "id": "45f5ef95", + "id": "7ad25750", "metadata": {}, "outputs": [], "source": [ "library_path = Path(\"../library/base_2022/\")\n", "config_fixed = load_yaml(library_path / \"project/config\", \"base_fixed_bottom_2022.yaml\")\n", - "config_floating = load_yaml(library_path / \"project/config\", \"base_floating_2022.yaml\")" + "config_floating = load_yaml(library_path / \"project/config\", \"base_floating_2022.yaml\")\n", + "\n", + "# This example was designed prior to the FLORIS 3.6 release, so the path to the turbine library in\n", + "# FLORIS must be manually updated, but this example must work for all users, so a dynamic method\n", + "# is used below, ensuring this works for all users.\n", + "config_fixed[\"floris_config\"] = load_yaml(library_path / \"project/config\", config_fixed[\"floris_config\"])\n", + "config_floating[\"floris_config\"] = load_yaml(library_path / \"project/config\", config_floating[\"floris_config\"])\n", + "\n", + "config_fixed[\"floris_config\"][\"farm\"][\"turbine_library_path\"] = library_path / \"turbines\"\n", + "config_floating[\"floris_config\"][\"farm\"][\"turbine_library_path\"] = library_path / \"turbines\"" ] }, { "cell_type": "markdown", - "id": "9a01c782", + "id": "ad755a8f", "metadata": {}, "source": [ "Now, we'll create a Project for each of the fixed bottom and floating offshore scenarios, showing\n", @@ -110,7 +119,7 @@ { "cell_type": "code", "execution_count": 3, - "id": "0909b285", + "id": "270b9531", "metadata": {}, "outputs": [ { @@ -118,8 +127,8 @@ "output_type": "stream", "text": [ "ORBIT library intialized at '/Users/rhammond/GitHub_Public/WAVES/library/base_2022'\n", - "Fixed bottom loading time: 1.32 seconds\n", - "Floating loading time: 1.36 seconds\n" + "Fixed bottom loading time: 1.28 seconds\n", + "Floating loading time: 1.30 seconds\n" ] }, { @@ -135,8 +144,8 @@ "name": "stdout", "output_type": "stream", "text": [ - "Fixed bottom loading time: 1.32 seconds\n", - "Floating loading time: 1.36 seconds\n" + "Fixed bottom loading time: 1.28 seconds\n", + "Floating loading time: 1.30 seconds\n" ] }, { @@ -170,7 +179,7 @@ }, { "cell_type": "markdown", - "id": "2dbf606c", + "id": "33cd9ea6", "metadata": {}, "source": [ "### Visualize the wind farm\n", @@ -181,7 +190,7 @@ { "cell_type": "code", "execution_count": 4, - "id": "7c4d9829", + "id": "4787d493", "metadata": {}, "outputs": [ { @@ -201,7 +210,7 @@ }, { "cell_type": "markdown", - "id": "ae7c6248", + "id": "8a6352b3", "metadata": {}, "source": [ "## Run the Projects\n", @@ -221,7 +230,7 @@ { "cell_type": "code", "execution_count": 5, - "id": "4fd0b930", + "id": "ee0eefc4", "metadata": {}, "outputs": [ { @@ -264,8 +273,8 @@ "Correcting negative Overhang:-2.5\n", "Correcting negative Overhang:-2.5\n", "-----------------------------\n", - "Fixed run time: 53.81 seconds\n", - "Floating run time: 150.19 seconds\n" + "Fixed run time: 54.34 seconds\n", + "Floating run time: 140.73 seconds\n" ] }, { @@ -300,8 +309,8 @@ "output_type": "stream", "text": [ "-----------------------------\n", - "Fixed run time: 53.81 seconds\n", - "Floating run time: 150.19 seconds\n" + "Fixed run time: 54.34 seconds\n", + "Floating run time: 140.73 seconds\n" ] } ], @@ -331,7 +340,7 @@ }, { "cell_type": "markdown", - "id": "a0441d8b", + "id": "c762a8b9", "metadata": {}, "source": [ "(example_cower_2022:results)=\n", @@ -364,7 +373,7 @@ { "cell_type": "code", "execution_count": 6, - "id": "51d0cbb6", + "id": "cf27089d", "metadata": {}, "outputs": [], "source": [ @@ -459,7 +468,7 @@ }, { "cell_type": "markdown", - "id": "d0fed0d9", + "id": "6afdc80c", "metadata": {}, "source": [ "Before we generate the report, let's see a CapEx breakdown of each scenario. To do this, we'll\n", @@ -474,7 +483,7 @@ { "cell_type": "code", "execution_count": 7, - "id": "5e5b10da", + "id": "c528bfd6", "metadata": {}, "outputs": [ { @@ -719,7 +728,7 @@ }, { "cell_type": "markdown", - "id": "24ce0305", + "id": "e6e4296f", "metadata": {}, "source": [ "Now, let's generate the report, and then add in some additional reporting variables." @@ -728,7 +737,7 @@ { "cell_type": "code", "execution_count": 8, - "id": "1052224a", + "id": "f3f77560", "metadata": {}, "outputs": [ { @@ -814,23 +823,23 @@ " \n", " \n", " OpEx ($)\n", - " 1,138,974,592.86\n", - " 983,366,273.48\n", + " 1,085,763,711.26\n", + " 975,553,491.89\n", " \n", " \n", " OpEx per kW ($/kW)\n", - " 1,898.29\n", - " 1,638.94\n", + " 1,809.61\n", + " 1,625.92\n", " \n", " \n", " Annual OpEx per kW ($/kW)\n", - " 90.39\n", - " 78.04\n", + " 86.17\n", + " 77.42\n", " \n", " \n", " Energy Availability (%)\n", " 0.95\n", - " 0.90\n", + " 0.91\n", " \n", " \n", " Gross Capacity Factor (%)\n", @@ -849,18 +858,18 @@ " \n", " \n", " AEP (MWh)\n", - " 2,176,737.87\n", - " 2,366,197.80\n", + " 2,181,789.77\n", + " 2,370,603.04\n", " \n", " \n", " AEP per kW (MWh/kW)\n", - " 3.63\n", - " 3.94\n", + " 3.64\n", + " 3.95\n", " \n", " \n", " LCOE ($/MWh)\n", - " 100.06\n", - " 107.33\n", + " 98.67\n", + " 106.98\n", " \n", " \n", "\n", @@ -879,16 +888,16 @@ "Offtake Price ($/MWh) 83.30 \n", "CapEx ($) 2,524,329,479.24 \n", "CapEx per kW ($/kW) 4,207.22 \n", - "OpEx ($) 1,138,974,592.86 \n", - "OpEx per kW ($/kW) 1,898.29 \n", - "Annual OpEx per kW ($/kW) 90.39 \n", + "OpEx ($) 1,085,763,711.26 \n", + "OpEx per kW ($/kW) 1,809.61 \n", + "Annual OpEx per kW ($/kW) 86.17 \n", "Energy Availability (%) 0.95 \n", "Gross Capacity Factor (%) 0.53 \n", "Net Capacity Factor With Wake Losses (%) 0.47 \n", "Net Capacity Factor With All Losses (%) 0.41 \n", - "AEP (MWh) 2,176,737.87 \n", - "AEP per kW (MWh/kW) 3.63 \n", - "LCOE ($/MWh) 100.06 \n", + "AEP (MWh) 2,181,789.77 \n", + "AEP per kW (MWh/kW) 3.64 \n", + "LCOE ($/MWh) 98.67 \n", "\n", " COE 2022 - Floating \n", "Metrics \n", @@ -902,16 +911,16 @@ "Offtake Price ($/MWh) 83.30 \n", "CapEx ($) 3,196,659,962.31 \n", "CapEx per kW ($/kW) 5,327.77 \n", - "OpEx ($) 983,366,273.48 \n", - "OpEx per kW ($/kW) 1,638.94 \n", - "Annual OpEx per kW ($/kW) 78.04 \n", - "Energy Availability (%) 0.90 \n", + "OpEx ($) 975,553,491.89 \n", + "OpEx per kW ($/kW) 1,625.92 \n", + "Annual OpEx per kW ($/kW) 77.42 \n", + "Energy Availability (%) 0.91 \n", "Gross Capacity Factor (%) 0.59 \n", "Net Capacity Factor With Wake Losses (%) 0.51 \n", "Net Capacity Factor With All Losses (%) 0.45 \n", - "AEP (MWh) 2,366,197.80 \n", - "AEP per kW (MWh/kW) 3.94 \n", - "LCOE ($/MWh) 107.33 " + "AEP (MWh) 2,370,603.04 \n", + "AEP per kW (MWh/kW) 3.95 \n", + "LCOE ($/MWh) 106.98 " ] }, "execution_count": 8, @@ -978,7 +987,7 @@ } }, "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": "Python 3", "language": "python", "name": "python3" }, @@ -996,21 +1005,21 @@ }, "source_map": [ 10, - 39, - 52, - 75, - 79, - 86, - 104, - 110, - 112, - 127, - 149, - 177, - 265, - 275, - 298, - 302 + 42, + 55, + 78, + 91, + 98, + 116, + 122, + 124, + 139, + 161, + 189, + 277, + 287, + 310, + 314 ] }, "nbformat": 4, diff --git a/library/base_2022/project/config/base_fixed_bottom_2022_floris_jensen.yaml b/library/base_2022/project/config/base_fixed_bottom_2022_floris_jensen.yaml index cc5dbe3..3e32d1c 100644 --- a/library/base_2022/project/config/base_fixed_bottom_2022_floris_jensen.yaml +++ b/library/base_2022/project/config/base_fixed_bottom_2022_floris_jensen.yaml @@ -104,7 +104,7 @@ farm: - 0 - 0 - turbine_library_path: /Users/rhammond/GitHub_Public/WAVES/library/base_2022/turbines + turbine_library_path: ../../turbines turbine_type: - 12MW_216m - 12MW_216m diff --git a/library/base_2022/project/config/base_floating_2022_floris_jensen.yaml b/library/base_2022/project/config/base_floating_2022_floris_jensen.yaml index be3b284..c637f31 100644 --- a/library/base_2022/project/config/base_floating_2022_floris_jensen.yaml +++ b/library/base_2022/project/config/base_floating_2022_floris_jensen.yaml @@ -104,7 +104,7 @@ farm: - 0 - 0 - turbine_library_path: /Users/rhammond/GitHub_Public/WAVES/library/base_2022/turbines + turbine_library_path: ../../turbines turbine_type: - 12MW_216m - 12MW_216m