updated steady state test for the pipeline

and visualization of the pressure surge
This commit is contained in:
Brantegger Georg
2023-02-09 15:01:10 +01:00
parent f3983cc007
commit 3b095b2598
2 changed files with 194 additions and 90 deletions

View File

@@ -6,18 +6,19 @@
"metadata": {},
"outputs": [],
"source": [
"import os\n",
"import sys\n",
"\n",
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"from Druckrohrleitung_class_file import Druckrohrleitung_class\n",
"import matplotlib.pyplot as plt\n",
"\n",
"#importing pressure conversion function\n",
"import sys\n",
"import os\n",
"current = os.path.dirname(os.path.realpath('Main_Programm.ipynb'))\n",
"parent = os.path.dirname(current)\n",
"sys.path.append(parent)\n",
"from functions.pressure_conversion import pressure_conversion\n",
"from Ausgleichsbecken.Ausgleichsbecken_class_file import Ausgleichsbecken_class"
"from Ausgleichsbecken.Ausgleichsbecken_class_file import Ausgleichsbecken_class\n",
"from functions.pressure_conversion import pressure_conversion"
]
},
{
@@ -70,7 +71,7 @@
" # for general simulation\n",
"flux_init = Tur_Q_nenn/1.1 # [m³/s] initial flux through whole system for steady state initialization \n",
"level_init = Con_targetLevel # [m] initial water level in upstream reservoir for steady state initialization\n",
"simTime_target = 3. # [s] target for total simulation time (will vary slightly to fit with Pip_dt)\n",
"simTime_target = 62. # [s] target for total simulation time (will vary slightly to fit with Pip_dt)\n",
"nt = int(simTime_target//Pip_dt) # [1] Number of timesteps of the whole system\n",
"t_vec = np.arange(0,nt+1,1)*Pip_dt # [s] time vector. At each step of t_vec the system parameters are stored\n"
]
@@ -79,23 +80,6 @@
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"61.1829727786757\n"
]
}
],
"source": [
"print(pressure_conversion(600000,'Pa','mWS'))"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
"# create objects\n",
@@ -111,7 +95,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
@@ -156,7 +140,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
@@ -195,7 +179,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
@@ -226,7 +210,7 @@
" v_old = pipe.get_current_velocity_distribution()\n",
"\n",
" # plot some stuff\n",
" if it_pipe%100 == 0:\n",
" if it_pipe%200 == 0:\n",
" # remove line-objects to autoscale axes (there is definetly a better way, but this works ¯\\_(ツ)_/¯ )\n",
" lo_0.remove()\n",
" lo_0min.remove()\n",
@@ -264,7 +248,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 7,
"metadata": {},
"outputs": [],
"source": [