From 12a099b36c78e6b190fb3eba2b1302a0d0652c0f Mon Sep 17 00:00:00 2001 From: Francesco Witte Date: Wed, 13 Mar 2024 11:38:25 +0100 Subject: [PATCH] Rename to Converter --- heat-pump-partload-tespy.ipynb | 2 +- heat-pump-solph.ipynb | 14 ++++++------- .../5-minutes-into-solph.ipynb | 4 ++-- workshop/model/solph-minimal-load.ipynb | 2 +- workshop/model/solph-offset.ipynb | 20 +++++++++---------- workshop/model/solph-simple.ipynb | 2 +- workshop/model/solph-with-tespy.ipynb | 2 +- .../model/tespy-partload-performance.ipynb | 4 ++-- workshop/model/utilities.py | 2 +- 9 files changed, 26 insertions(+), 26 deletions(-) diff --git a/heat-pump-partload-tespy.ipynb b/heat-pump-partload-tespy.ipynb index 1f7e177..eaa3499 100644 --- a/heat-pump-partload-tespy.ipynb +++ b/heat-pump-partload-tespy.ipynb @@ -451,7 +451,7 @@ " x = data[\"compressor-power\"].values.astype(float)\n", " export_df.loc[key] = least_squares(x, y)\n", "\n", - "export_df.to_csv(\"coefficients-offset-transformer.csv\")" + "export_df.to_csv(\"coefficients-offset-converter.csv\")" ] } ], diff --git a/heat-pump-solph.ipynb b/heat-pump-solph.ipynb index eb77cbb..05f62ee 100644 --- a/heat-pump-solph.ipynb +++ b/heat-pump-solph.ipynb @@ -53,7 +53,7 @@ " inputs={bus_heat_35C: solph.Flow()},\n", " outputs={bus_heat_35C: solph.Flow()},\n", " loss_rate=0.02,\n", - " nominal_storage_capacity=8.7, # Assume 5 k of spread and 1.5 m³ volume \n", + " nominal_storage_capacity=8.7, # Assume 5 k of spread and 1.5 m³ volume\n", " )\n", "\n", " demand = input_data[\"Heat load (kW)\"][:-1]\n", @@ -65,7 +65,7 @@ "\n", "\n", " es.add(electricity_grid, thermal_storage, heat_demand)\n", - " \n", + "\n", " return es, bus_electricity, bus_heat_35C" ] }, @@ -95,7 +95,7 @@ "source": [ "es, bus_electricity, bus_heat_35C = create_energy_system_stub(input_data=input_data.head(24*2))\n", "\n", - "heat_pump_constant = solph.components.Transformer(\n", + "heat_pump_constant = solph.components.Converter(\n", " label=\"heat pump\",\n", " inputs={bus_electricity: solph.Flow()},\n", " outputs={bus_heat_35C: solph.Flow(nominal_value=hp_thermal_power)},\n", @@ -270,7 +270,7 @@ "source": [ "es, bus_electricity, bus_heat_35C = create_energy_system_stub(input_data=input_data.head(24*2))\n", "\n", - "heat_pump_carnot = solph.components.Transformer(\n", + "heat_pump_carnot = solph.components.Converter(\n", " label=\"heat pump\",\n", " inputs={bus_electricity: solph.Flow()},\n", " outputs={bus_heat_35C: solph.Flow(nominal_value=hp_thermal_power)},\n", @@ -331,7 +331,7 @@ "\n", "es, bus_electricity, bus_heat_35C = create_energy_system_stub(input_data=input_data.head(24*2))\n", "\n", - "heat_pump_tespy = solph.components.Transformer(\n", + "heat_pump_tespy = solph.components.Converter(\n", " label=\"heat pump\",\n", " inputs={bus_electricity: solph.Flow()},\n", " outputs={bus_heat_35C: solph.Flow(nominal_value=hp_thermal_power)},\n", @@ -392,7 +392,7 @@ "\n", "es, bus_electricity, bus_heat_35C = create_energy_system_stub(input_data=input_data.head(24*2))\n", "\n", - "heat_pump_nonconvex = solph.components.Transformer(\n", + "heat_pump_nonconvex = solph.components.Converter(\n", " label=\"heat pump\",\n", " inputs={bus_electricity: solph.Flow()},\n", " outputs={bus_heat_35C: solph.Flow(\n", @@ -457,7 +457,7 @@ "\n", "es, bus_electricity, bus_heat_35C = create_energy_system_stub(input_data=input_data.head(24*2))\n", "\n", - "heat_pump_offset = solph.components.OffsetTransformer(\n", + "heat_pump_offset = solph.components.OffsetConverter(\n", " label=f\"heat pump\",\n", " inputs={bus_electricity: solph.Flow(\n", " nominal_value=5,\n", diff --git a/workshop/getting-started/5-minutes-into-solph.ipynb b/workshop/getting-started/5-minutes-into-solph.ipynb index 795a535..bbefc6a 100644 --- a/workshop/getting-started/5-minutes-into-solph.ipynb +++ b/workshop/getting-started/5-minutes-into-solph.ipynb @@ -24,7 +24,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "- Mini Code example: Buses, Components (Transformer, Source, Sink, but there are more), EnergySystem, Model" + "- Mini Code example: Buses, Components (Converter, Source, Sink, but there are more), EnergySystem, Model" ] }, { @@ -54,7 +54,7 @@ ")\n", "es.add(electricity_grid, heat_demand)\n", "\n", - "heating_rod = solph.components.Transformer(\n", + "heating_rod = solph.components.Converter(\n", " label=\"heating rod\",\n", " inputs={b_electricity: solph.Flow()},\n", " outputs={b_heat_35C: solph.Flow()},\n", diff --git a/workshop/model/solph-minimal-load.ipynb b/workshop/model/solph-minimal-load.ipynb index 9ceca6b..edd4216 100644 --- a/workshop/model/solph-minimal-load.ipynb +++ b/workshop/model/solph-minimal-load.ipynb @@ -55,7 +55,7 @@ "hp_thermal_power = 9.1 # kW\n", "cop = input_data[\"simple TESPy COP\"][:-1]\n", "\n", - "heat_pump = solph.components.Transformer(\n", + "heat_pump = solph.components.Converter(\n", " label=\"heat pump\",\n", " inputs={bus_electricity: solph.Flow()},\n", " outputs={\n", diff --git a/workshop/model/solph-offset.ipynb b/workshop/model/solph-offset.ipynb index 77dec2a..a5c2c35 100644 --- a/workshop/model/solph-offset.ipynb +++ b/workshop/model/solph-offset.ipynb @@ -9,11 +9,11 @@ "# oemof-solph model with variable partload efficiency\n", "\n", "The final modification in our energy system model is to implement the load dependent variable COP. To do that we can use\n", - "the `OffsetTransformer`. This component requires different input compared to our previous implementations. Instead of\n", + "the `OffsetConverter`. This component requires different input compared to our previous implementations. Instead of\n", "a conversion factor connecting input with output as shown in eq. {eq}`simple-conversion`, we define a slope and an \n", "offset (eq. {eq}`slope-offset-conversion`). This also changes the overall efficiency value in an interesting way per eq.\n", "{eq}`offset-efficiency`: We have nonlinear efficiency in a linear model. We can visualize the effect in\n", - "{numref}`heatpump-offset-transformer`. For that we load the TESPy results and plot the compressor power and COP over the\n", + "{numref}`heatpump-offset-converter`. For that we load the TESPy results and plot the compressor power and COP over the\n", "heat production.\n", "\n", "```{math}\n", @@ -31,8 +31,8 @@ "\\eta = \\frac{E_\\text{out}}{E_0 + m \\cdot \\cdot E_\\text{in}}\n", "```\n", "\n", - "```{glue:figure} heatpump-offset-transformer\n", - ":name: \"heatpump-offset-transformer\"\n", + "```{glue:figure} heatpump-offset-converter\n", + ":name: \"heatpump-offset-converter\"\n", "\n", "Compressor power and COP as function of the heat pump heat production at 7 °C.\n", "```" @@ -86,7 +86,7 @@ "outputs": [], "source": [ "from myst_nb import glue\n", - "glue(\"heatpump-offset-transformer\", fig, display=False)" + "glue(\"heatpump-offset-converter\", fig, display=False)" ] }, { @@ -129,8 +129,8 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "With respect to the previous version {ref}`using minimal load `), the Transformer is replaced by an\n", - "OffsetTransformer." + "With respect to the previous version {ref}`using minimal load `), the `Converter` is replaced by an\n", + "`OffsetConverter`." ] }, { @@ -148,7 +148,7 @@ "demand = input_data[\"Heat load (kW)\"][:-1]\n", "\n", "\n", - "heat_pump = solph.components.OffsetTransformer(\n", + "heat_pump = solph.components.OffsetConverter(\n", " label=f\"heat pump\",\n", " inputs={bus_electricity: solph.Flow(\n", " nominal_value=5,\n", @@ -188,7 +188,7 @@ "metadata": {}, "source": [ "In our final example {numref}`results-solph-offset` shows that the heat pump is mostly operated at full load. This is\n", - "because the COP of the heat pump in largest in that point (see {numref}`heatpump-offset-transformer`). The storage\n", + "because the COP of the heat pump in largest in that point (see {numref}`heatpump-offset-converter`). The storage\n", "losses are higher overall as the filling level is higher as well. However, the increased storage losses are lower than\n", "those induced by decrease of the heat pump's COP in part load. The overall electricity consumption consequently\n", "increases from {glue}`solph-minimal-load.ipynb::results-electricity-minload` kWh to {glue}`results-electricity-offset`\n", @@ -197,7 +197,7 @@ "```{glue:figure} results-solph-offset\n", ":name: \"results-solph-offset\"\n", "\n", - "Operation of the heat pump modeled as OffsetTransformer.\n", + "Operation of the heat pump modeled as OffsetConverter.\n", "```" ] }, diff --git a/workshop/model/solph-simple.ipynb b/workshop/model/solph-simple.ipynb index 6335d78..5064614 100644 --- a/workshop/model/solph-simple.ipynb +++ b/workshop/model/solph-simple.ipynb @@ -295,7 +295,7 @@ "metadata": {}, "outputs": [], "source": [ - "heat_pump = solph.components.Transformer(\n", + "heat_pump = solph.components.Converter(\n", " label=\"heat pump\",\n", " inputs={b_electricity: solph.Flow()},\n", " outputs={b_heat_35C: solph.Flow(nominal_value=hp_thermal_power)},\n", diff --git a/workshop/model/solph-with-tespy.ipynb b/workshop/model/solph-with-tespy.ipynb index 5bf7cef..81da218 100644 --- a/workshop/model/solph-with-tespy.ipynb +++ b/workshop/model/solph-with-tespy.ipynb @@ -130,7 +130,7 @@ "hp_thermal_power = 9.1 # kW\n", "cop = input_data[\"simple TESPy COP\"][:-1]\n", "\n", - "heat_pump = solph.components.Transformer(\n", + "heat_pump = solph.components.Converter(\n", " label=\"heat pump\",\n", " inputs={bus_electricity: solph.Flow()},\n", " outputs={bus_heat_35C: solph.Flow(nominal_value=hp_thermal_power)},\n", diff --git a/workshop/model/tespy-partload-performance.ipynb b/workshop/model/tespy-partload-performance.ipynb index a989364..65bd731 100644 --- a/workshop/model/tespy-partload-performance.ipynb +++ b/workshop/model/tespy-partload-performance.ipynb @@ -909,7 +909,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "The final step to provide the data for the `OffsetTransformer` of `oemof-solph` is to change the output structure.\n", + "The final step to provide the data for the `OffsetConverter` of `oemof-solph` is to change the output structure.\n", "`oemof-solph` expects the coefficients (offset and slope) per ambient temperature level and inverted, i.e. the heat\n", "output as function of the electricity input. We can build a new dataframe, that holds the information and exports it\n", "into csv format and export that information. \n", @@ -932,7 +932,7 @@ " x = data[\"compressor-power\"].values.astype(float)\n", " export_df.loc[key] = least_squares(x, y)\n", "\n", - "export_df.to_csv(\"coefficients-offset-transformer.csv\")" + "export_df.to_csv(\"coefficients-offset-converter.csv\")" ] } ], diff --git a/workshop/model/utilities.py b/workshop/model/utilities.py index 6b24cda..9586038 100644 --- a/workshop/model/utilities.py +++ b/workshop/model/utilities.py @@ -61,7 +61,7 @@ def load_tespy_cop(): def load_tespy_coefficients(): - df = pd.read_csv(_file_path + "/coefficients-offset-transformer.csv", index_col=[0]) + df = pd.read_csv(_file_path + "/coefficients-offset-converter.csv", index_col=[0]) # hack to work with floats as index df2 = df.reindex(np.arange(-100, 210, 1)/10)