Skip to content

Commit

Permalink
Update all tespy dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
fwitte committed Nov 27, 2023
1 parent 6ef924b commit 4c154f7
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: oemof-heat-pump-tutorial-env
channels:
- conda-forge
dependencies:
- python==3.10
- python==3.11
- pip
- pip:
- oemof.solph
Expand Down
12 changes: 6 additions & 6 deletions heat-pump-partload-tespy.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
tespy>=0.6.2
tespy>=0.7.0
oemof.solph>=0.5
2 changes: 1 addition & 1 deletion simple-heat-pump-tespy.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
]
},
{
Expand Down
14 changes: 7 additions & 7 deletions workshop/model/tespy-partload-performance.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -955,7 +955,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.13"
"version": "3.10.0"
},
"orig_nbformat": 4
},
Expand Down
6 changes: 3 additions & 3 deletions workshop/model/tespy-simple.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
]
},
{
Expand Down Expand Up @@ -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)"
Expand Down Expand Up @@ -491,7 +491,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.13"
"version": "3.10.0"
}
},
"nbformat": 4,
Expand Down

0 comments on commit 4c154f7

Please sign in to comment.