updated KW steady state test
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"execution_count": 1,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
@@ -24,7 +24,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"execution_count": 2,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
@@ -95,7 +95,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"execution_count": 3,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
@@ -136,7 +136,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"execution_count": 4,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
@@ -208,40 +208,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"%matplotlib qt5\n",
|
||||
"# Con_T_ime loop\n",
|
||||
"\n",
|
||||
"# create a figure and subplots to display the velocity and pressure distribution across the pipeline in each pipeline step\n",
|
||||
"fig1,axs1 = plt.subplots(2,1)\n",
|
||||
"fig1.suptitle(str(0) +' s / '+str(round(t_vec[-1],2)) + ' s' )\n",
|
||||
"axs1[0].set_title('Pressure distribution in pipeline')\n",
|
||||
"axs1[0].set_xlabel(r'$x$ [$\\mathrm{m}$]')\n",
|
||||
"axs1[0].set_ylabel(r'$p$ ['+pUnit_conv+']')\n",
|
||||
"axs1[1].set_title('Flux distribution in pipeline')\n",
|
||||
"axs1[1].set_xlabel(r'$x$ [$\\mathrm{m}$]')\n",
|
||||
"axs1[1].set_ylabel(r'$Q$ [$\\mathrm{m}^3 / \\mathrm{s}$]')\n",
|
||||
"lo_p, = axs1[0].plot(Pip_x_vec,pressure_conversion(p_old,pUnit_calc, pUnit_conv),marker='.')\n",
|
||||
"lo_q, = axs1[1].plot(Pip_x_vec,Q_old,marker='.')\n",
|
||||
"lo_pmin, = axs1[0].plot(Pip_x_vec,pipe.get_lowest_pressure_per_node(disp_flag=True),c='red')\n",
|
||||
"lo_pmax, = axs1[0].plot(Pip_x_vec,pipe.get_highest_pressure_per_node(disp_flag=True),c='red')\n",
|
||||
"lo_qmin, = axs1[1].plot(Pip_x_vec,pipe.get_lowest_flux_per_node(),c='red')\n",
|
||||
"lo_qmax, = axs1[1].plot(Pip_x_vec,pipe.get_highest_flux_per_node(),c='red')\n",
|
||||
"\n",
|
||||
"axs1[0].autoscale()\n",
|
||||
"axs1[1].autoscale()\n",
|
||||
"\n",
|
||||
"fig1.tight_layout()\n",
|
||||
"fig1.show()\n",
|
||||
"plt.pause(1)\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"execution_count": 6,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
@@ -296,37 +263,16 @@
|
||||
" # prepare for next loop\n",
|
||||
" p_old = pipe.get_current_pressure_distribution()\n",
|
||||
" v_old = pipe.get_current_velocity_distribution()\n",
|
||||
" Q_old = pipe.get_current_flux_distribution()\n",
|
||||
"\n",
|
||||
" # plot some stuff\n",
|
||||
" # remove line-objects to autoscale axes (there is definetly a better way, but this works ¯\\_(ツ)_/¯ )\n",
|
||||
" if it_pipe%50 == 0:\n",
|
||||
" lo_p.remove()\n",
|
||||
" lo_pmin.remove()\n",
|
||||
" lo_pmax.remove()\n",
|
||||
" lo_q.remove()\n",
|
||||
" lo_qmin.remove()\n",
|
||||
" lo_qmax.remove()\n",
|
||||
" # plot new pressure and velocity distribution in the pipeline\n",
|
||||
" lo_p, = axs1[0].plot(Pip_x_vec,pipe.get_current_pressure_distribution(disp_flag=True),marker='.',c='blue')\n",
|
||||
" lo_pmin, = axs1[0].plot(Pip_x_vec,pipe.get_lowest_pressure_per_node(disp_flag=True),c='red')\n",
|
||||
" lo_pmax, = axs1[0].plot(Pip_x_vec,pipe.get_highest_pressure_per_node(disp_flag=True),c='red')\n",
|
||||
" lo_q, = axs1[1].plot(Pip_x_vec,pipe.get_current_flux_distribution(),marker='.',c='blue')\n",
|
||||
" lo_qmin, = axs1[1].plot(Pip_x_vec,pipe.get_lowest_flux_per_node(),c='red')\n",
|
||||
" lo_qmax, = axs1[1].plot(Pip_x_vec,pipe.get_highest_flux_per_node(),c='red')\n",
|
||||
" fig1.suptitle(str(round(t_vec[it_pipe],2))+ ' s / '+str(round(t_vec[-1],2)) + ' s' )\n",
|
||||
" fig1.canvas.draw()\n",
|
||||
" fig1.tight_layout()\n",
|
||||
" fig1.show()\n",
|
||||
" plt.pause(0.000001) "
|
||||
" Q_old = pipe.get_current_flux_distribution()\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"execution_count": 9,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"%matplotlib qt5\n",
|
||||
"fig2,axs2 = plt.subplots(1,1)\n",
|
||||
"axs2.set_title('Level and Volume reservoir')\n",
|
||||
"axs2.plot(t_vec,level_vec,label='level')\n",
|
||||
@@ -389,7 +335,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"execution_count": 10,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
||||
Reference in New Issue
Block a user