well, I forgot to save the last changes :D

This commit is contained in:
Brantegger Georg
2022-06-28 15:39:19 +02:00
parent a109b8d8d1
commit 57cb951f5b

View File

@@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 22,
"metadata": {},
"outputs": [],
"source": [
@@ -14,7 +14,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 23,
"metadata": {},
"outputs": [],
"source": [
@@ -29,13 +29,13 @@
"h = 20 # water level in upstream reservoir [m]\n",
"n = 10 # number of pipe segments in discretization\n",
"nt = 1500 # number of time steps after initial conditions\n",
"f_D = 0.05 # Darcy friction factor\n",
"f_D = 0.01 # Darcy friction factor\n",
"c = 400 # propagation velocity of the pressure wave [m/s]"
]
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 24,
"metadata": {},
"outputs": [],
"source": [
@@ -63,14 +63,14 @@
"v_1 = np.zeros_like(t_vec)\n",
"\n",
"# storage vector for time evolution of parameters at node N+1 (at valve)\n",
"p_np1 = np.full_like(t_vec,p_old)\n",
"v_np1 = np.full_like(t_vec,v_old)\n",
"p_np1 = np.full_like(t_vec,p0)\n",
"v_np1 = np.full_like(t_vec,v0)\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 25,
"metadata": {},
"outputs": [],
"source": [
@@ -85,13 +85,12 @@
"lo_01, = axs1[1].plot(pl_vec,v_old,marker='.')\n",
"axs1[0].set_ylim([-20*p0,20*p0])\n",
"axs1[1].set_ylim([-2*v0,2*v0])\n",
"fig1.tight_layout()\n",
"plt.pause(1)\n"
"fig1.tight_layout()\n"
]
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 26,
"metadata": {},
"outputs": [],
"source": [
@@ -128,7 +127,7 @@
" fig1.suptitle(str(it))\n",
" fig1.canvas.draw()\n",
" fig1.tight_layout()\n",
" plt.pause(0.01)\n",
" plt.pause(0.001)\n",
"\n",
" # store parameters of node 1 (at reservoir)\n",
" p_1[it] = p_new[0]\n",
@@ -140,7 +139,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 27,
"metadata": {},
"outputs": [],
"source": [
@@ -149,6 +148,11 @@
"axs2[0,1].plot(t_vec,v_1)\n",
"axs2[1,0].plot(t_vec,p_np1)\n",
"axs2[1,1].plot(t_vec,v_np1)\n",
"axs2[0,0].set_title('Pressure Reservoir')\n",
"axs2[0,1].set_title('Velocity Reservoir')\n",
"axs2[1,0].set_title('Pressure Turbine')\n",
"axs2[1,1].set_title('Velocity Turbine')\n",
"fig2.tight_layout()\n",
"plt.show()"
]
}