adaptations after convergence method improvements

This commit is contained in:
Brantegger Georg
2022-09-13 14:54:54 +02:00
parent b5e60dd083
commit ce368852ca
4 changed files with 103 additions and 66 deletions

View File

@@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
@@ -24,7 +24,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 9,
"metadata": {},
"outputs": [],
"source": [
@@ -95,7 +95,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 10,
"metadata": {},
"outputs": [],
"source": [
@@ -136,7 +136,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 11,
"metadata": {},
"outputs": [],
"source": [
@@ -209,7 +209,7 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": 12,
"metadata": {},
"outputs": [],
"source": [
@@ -244,12 +244,12 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": 13,
"metadata": {},
"outputs": [],
"source": [
"# needed for turbine convergence\n",
"convergence_parameters = [p_old[-2],v_old[-2],Pip_dia,Pip_area,Pip_angle,Pip_f_D,Pip_pw_vel,rho,Pip_dt]\n",
"convergence_parameters = [p_old[-2],v_old[-2],Pip_dia,Pip_area,Pip_angle,Pip_f_D,Pip_pw_vel,rho,Pip_dt,p_old[-1]]\n",
"\n",
"# loop through time steps of the pipeline\n",
"for it_pipe in range(1,nt+1):\n",
@@ -281,6 +281,7 @@
" # set boundary condition for the next timestep of the characteristic method\n",
" convergence_parameters[0] = p_old[-2]\n",
" convergence_parameters[1] = v_old[-2]\n",
" convergence_parameters[9] = p_old[-1]\n",
" KW_UL.set_pressure(p_old[-1])\n",
" KW_UL.converge(convergence_parameters)\n",
" p_boundary_res[it_pipe] = reservoir.get_current_pressure()\n",
@@ -304,7 +305,7 @@
"\n",
" # plot some stuff\n",
" # remove line-objects to autoscale axes (there is definetly a better way, but this works ¯\\_(ツ)_/¯ )\n",
" if it_pipe%25 == 0:\n",
" if it_pipe%100 == 0:\n",
" lo_p.remove()\n",
" lo_pmin.remove()\n",
" lo_pmax.remove()\n",
@@ -327,7 +328,7 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": 14,
"metadata": {},
"outputs": [],
"source": [
@@ -393,7 +394,7 @@
},
{
"cell_type": "code",
"execution_count": 16,
"execution_count": 15,
"metadata": {},
"outputs": [],
"source": [