diff --git a/environment.yml b/environment.yml index 2a3c1a7..df77653 100644 --- a/environment.yml +++ b/environment.yml @@ -2,7 +2,7 @@ name: oemof-heat-pump-tutorial-env channels: - conda-forge dependencies: -- python==3.10 +- python==3.11 - pip - pip: - oemof.solph diff --git a/heat-pump-partload-tespy.ipynb b/heat-pump-partload-tespy.ipynb index d04f328..1f7e177 100644 --- a/heat-pump-partload-tespy.ipynb +++ b/heat-pump-partload-tespy.ipynb @@ -46,7 +46,7 @@ "from tespy.networks import Network\n", "\n", "wf = \"R290\"\n", - "nwk = Network(fluids=[wf, \"air\", \"Water\"], p_unit=\"bar\", T_unit=\"C\", iterinfo=False)\n", + "nwk = Network(p_unit=\"bar\", T_unit=\"C\", iterinfo=False)\n", "\n", "cp = Compressor(\"compressor\")\n", "ev = HeatExchanger(\"evaporator\")\n", @@ -102,10 +102,10 @@ "\n", "# connections\n", "T_ambient_design = 7\n", - "c2.set_attr(fluid={wf: 1, \"Water\": 0, \"air\": 0}, x=1.0)\n", - "c11.set_attr(fluid={wf: 0, \"Water\": 0, \"air\": 1}, p=1.0, T=T_ambient_design)\n", + "c2.set_attr(fluid={wf: 1}, x=1.0)\n", + "c11.set_attr(fluid={\"air\": 1}, p=1.0, T=T_ambient_design)\n", "c12.set_attr(T=Ref(c11, 1, -2))\n", - "c21.set_attr(fluid={wf: 0, \"Water\": 1, \"air\": 0}, p=3.0, T=30)\n", + "c21.set_attr(fluid={\"Water\": 1}, p=3.0, T=30)\n", "c22.set_attr(T=35)\n", "\n", "# components\n", @@ -238,7 +238,7 @@ " nwk.save(\"tmp\")\n", " init_path = \"tmp\"\n", " else:\n", - " nwk.solve(\"offdesign\", design_path=\"design-state\") \n", + " nwk.solve(\"offdesign\", design_path=\"design-state\")\n", "\n", " results[temperature].loc[heat, \"COP\"] = abs(cd.Q.val) / cp.P.val\n", " results[temperature].loc[heat, \"compressor-power\"] = cp.P.val\n", @@ -414,7 +414,7 @@ "fig, ax = plt.subplots(1)\n", "\n", "for temp in temperature_range[::10]:\n", - " \n", + "\n", " x = -results[temp].index.values.astype(float)\n", " y = results[temp][\"compressor-power\"].values.astype(float)\n", " slope, offset = least_squares(x, y)\n", diff --git a/requirements.txt b/requirements.txt index 977d001..048b6ec 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ -tespy>=0.6.2 +tespy>=0.7.0 oemof.solph>=0.5 \ No newline at end of file diff --git a/simple-heat-pump-tespy.ipynb b/simple-heat-pump-tespy.ipynb index 335119e..3f4dd76 100644 --- a/simple-heat-pump-tespy.ipynb +++ b/simple-heat-pump-tespy.ipynb @@ -47,7 +47,7 @@ "outputs": [], "source": [ "wf = \"R290\"\n", - "nwk = Network(fluids=[wf], p_unit=\"bar\", T_unit=\"C\", iterinfo=False)" + "nwk = Network(p_unit=\"bar\", T_unit=\"C\", iterinfo=False)" ] }, { diff --git a/workshop/model/tespy-partload-performance.ipynb b/workshop/model/tespy-partload-performance.ipynb index ad3740d..a989364 100644 --- a/workshop/model/tespy-partload-performance.ipynb +++ b/workshop/model/tespy-partload-performance.ipynb @@ -80,7 +80,7 @@ "from tespy.networks import Network\n", "\n", "wf = \"R290\"\n", - "nwk = Network(fluids=[wf, \"air\", \"Water\"], p_unit=\"bar\", T_unit=\"C\", iterinfo=False)\n", + "nwk = Network(p_unit=\"bar\", T_unit=\"C\", iterinfo=False)\n", "\n", "cp = Compressor(\"compressor\")\n", "ev = HeatExchanger(\"evaporator\")\n", @@ -144,10 +144,10 @@ "\n", "# connections\n", "T_ambient_design = 7\n", - "c2.set_attr(fluid={wf: 1, \"Water\": 0, \"air\": 0}, x=1.0)\n", - "c11.set_attr(fluid={wf: 0, \"Water\": 0, \"air\": 1}, p=1.0, T=T_ambient_design)\n", + "c2.set_attr(fluid={wf: 1}, x=1.0)\n", + "c11.set_attr(fluid={\"air\": 1}, p=1.0, T=T_ambient_design)\n", "c12.set_attr(T=Ref(c11, 1, -2))\n", - "c21.set_attr(fluid={wf: 0, \"Water\": 1, \"air\": 0}, p=3.0, T=30)\n", + "c21.set_attr(fluid={\"Water\": 1}, p=3.0, T=30)\n", "c22.set_attr(T=35)\n", "\n", "# components\n", @@ -695,7 +695,7 @@ " nwk.solve(\"offdesign\", design_path=\"design-state\", init_path=\"tmp\")\n", " nwk.save(\"tmp\")\n", " else:\n", - " nwk.solve(\"offdesign\", design_path=\"design-state\") \n", + " nwk.solve(\"offdesign\", design_path=\"design-state\")\n", "\n", " results[temperature].loc[heat, \"COP\"] = abs(cd.Q.val) / cp.P.val\n", " results[temperature].loc[heat, \"compressor-power\"] = cp.P.val\n", @@ -875,7 +875,7 @@ "fig, ax = plt.subplots(1)\n", "\n", "for temp in temperature_range[::10]:\n", - " \n", + "\n", " x = -results[temp].index.values.astype(float)\n", " y = results[temp][\"compressor-power\"].values.astype(float)\n", " slope, offset = least_squares(x, y)\n", @@ -955,7 +955,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.13" + "version": "3.10.0" }, "orig_nbformat": 4 }, diff --git a/workshop/model/tespy-simple.ipynb b/workshop/model/tespy-simple.ipynb index d1b2970..67778d5 100644 --- a/workshop/model/tespy-simple.ipynb +++ b/workshop/model/tespy-simple.ipynb @@ -97,7 +97,7 @@ "outputs": [], "source": [ "wf = \"R290\"\n", - "nwk = Network(fluids=[wf], p_unit=\"bar\", T_unit=\"C\", iterinfo=False)" + "nwk = Network(p_unit=\"bar\", T_unit=\"C\", iterinfo=False)" ] }, { @@ -308,7 +308,7 @@ " if i > 10:\n", " print(\"no solution found\")\n", " break\n", - " \n", + "\n", " i += 1\n", "\n", "efficiency = round(cp.eta_s.val, 3)" @@ -491,7 +491,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.13" + "version": "3.10.0" } }, "nbformat": 4,