Skip to content

Commit

Permalink
Rename to Converter
Browse files Browse the repository at this point in the history
  • Loading branch information
fwitte committed Mar 13, 2024
1 parent d983aca commit 12a099b
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion heat-pump-partload-tespy.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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\")"
]
}
],
Expand Down
14 changes: 7 additions & 7 deletions heat-pump-solph.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -65,7 +65,7 @@
"\n",
"\n",
" es.add(electricity_grid, thermal_storage, heat_demand)\n",
" \n",
"\n",
" return es, bus_electricity, bus_heat_35C"
]
},
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions workshop/getting-started/5-minutes-into-solph.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
},
{
Expand Down Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion workshop/model/solph-minimal-load.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
20 changes: 10 additions & 10 deletions workshop/model/solph-offset.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
"```"
Expand Down Expand Up @@ -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)"
]
},
{
Expand Down Expand Up @@ -129,8 +129,8 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"With respect to the previous version {ref}`using minimal load <solph-minimal-load>`), the Transformer is replaced by an\n",
"OffsetTransformer."
"With respect to the previous version {ref}`using minimal load <solph-minimal-load>`), the `Converter` is replaced by an\n",
"`OffsetConverter`."
]
},
{
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -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",
"```"
]
},
Expand Down
2 changes: 1 addition & 1 deletion workshop/model/solph-simple.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion workshop/model/solph-with-tespy.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions workshop/model/tespy-partload-performance.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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\")"
]
}
],
Expand Down
2 changes: 1 addition & 1 deletion workshop/model/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 12a099b

Please sign in to comment.