renamed Francis Turbine class to just Turbine class
This commit is contained in:
@@ -11,7 +11,6 @@ current = os.path.dirname(os.path.realpath(__file__))
|
|||||||
parent = os.path.dirname(current)
|
parent = os.path.dirname(current)
|
||||||
sys.path.append(parent)
|
sys.path.append(parent)
|
||||||
from functions.pressure_conversion import pressure_conversion
|
from functions.pressure_conversion import pressure_conversion
|
||||||
from Turbinen.Turbinen_class_file import Francis_Turbine
|
|
||||||
|
|
||||||
|
|
||||||
class Kraftwerk_class:
|
class Kraftwerk_class:
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
"from functions.pressure_conversion import pressure_conversion\n",
|
"from functions.pressure_conversion import pressure_conversion\n",
|
||||||
"from Ausgleichsbecken.Ausgleichsbecken_class_file import Ausgleichsbecken_class\n",
|
"from Ausgleichsbecken.Ausgleichsbecken_class_file import Ausgleichsbecken_class\n",
|
||||||
"from Druckrohrleitung.Druckrohrleitung_class_file import Druckrohrleitung_class\n",
|
"from Druckrohrleitung.Druckrohrleitung_class_file import Druckrohrleitung_class\n",
|
||||||
"from Turbinen.Turbinen_class_file import Francis_Turbine\n",
|
"from Turbinen.Turbinen_class_file import Turbine\n",
|
||||||
"from Regler.Regler_class_file import PI_controller_class"
|
"from Regler.Regler_class_file import PI_controller_class"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -110,8 +110,8 @@
|
|||||||
"pipe.set_steady_state(flux_init,reservoir.get_current_pressure())\n",
|
"pipe.set_steady_state(flux_init,reservoir.get_current_pressure())\n",
|
||||||
"\n",
|
"\n",
|
||||||
"# influx setting turbines\n",
|
"# influx setting turbines\n",
|
||||||
"OL_T1 = Francis_Turbine(OL_T1_Q_nenn,OL_T1_p_nenn,OL_T1_closingTime,Pip_dt,pUnit_conv)\n",
|
"OL_T1 = Turbine(OL_T1_Q_nenn,OL_T1_p_nenn,OL_T1_closingTime,Pip_dt,pUnit_conv)\n",
|
||||||
"OL_T2 = Francis_Turbine(OL_T2_Q_nenn,OL_T2_p_nenn,OL_T2_closingTime,Pip_dt,pUnit_conv)\n",
|
"OL_T2 = Turbine(OL_T2_Q_nenn,OL_T2_p_nenn,OL_T2_closingTime,Pip_dt,pUnit_conv)\n",
|
||||||
"\n",
|
"\n",
|
||||||
"KW_OL = Kraftwerk_class()\n",
|
"KW_OL = Kraftwerk_class()\n",
|
||||||
"KW_OL.add_turbine(OL_T1)\n",
|
"KW_OL.add_turbine(OL_T1)\n",
|
||||||
@@ -120,8 +120,8 @@
|
|||||||
"KW_OL.set_steady_state_by_flux(flux_init,OL_T1_p_nenn)\n",
|
"KW_OL.set_steady_state_by_flux(flux_init,OL_T1_p_nenn)\n",
|
||||||
"\n",
|
"\n",
|
||||||
"# downstream turbines\n",
|
"# downstream turbines\n",
|
||||||
"UL_T1 = Francis_Turbine(UL_T1_Q_nenn,UL_T1_p_nenn,UL_T1_closingTime,Pip_dt,pUnit_conv)\n",
|
"UL_T1 = Turbine(UL_T1_Q_nenn,UL_T1_p_nenn,UL_T1_closingTime,Pip_dt,pUnit_conv)\n",
|
||||||
"UL_T2 = Francis_Turbine(UL_T2_Q_nenn,UL_T2_p_nenn,UL_T2_closingTime,Pip_dt,pUnit_conv)\n",
|
"UL_T2 = Turbine(UL_T2_Q_nenn,UL_T2_p_nenn,UL_T2_closingTime,Pip_dt,pUnit_conv)\n",
|
||||||
"\n",
|
"\n",
|
||||||
"KW_UL = Kraftwerk_class()\n",
|
"KW_UL = Kraftwerk_class()\n",
|
||||||
"KW_UL.add_turbine(UL_T1)\n",
|
"KW_UL.add_turbine(UL_T1)\n",
|
||||||
@@ -380,13 +380,6 @@
|
|||||||
"fig3.tight_layout()\n",
|
"fig3.tight_layout()\n",
|
||||||
"plt.show()"
|
"plt.show()"
|
||||||
]
|
]
|
||||||
},
|
|
||||||
{
|
|
||||||
"cell_type": "code",
|
|
||||||
"execution_count": null,
|
|
||||||
"metadata": {},
|
|
||||||
"outputs": [],
|
|
||||||
"source": []
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"metadata": {
|
"metadata": {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ sys.path.append(parent)
|
|||||||
from functions.pressure_conversion import pressure_conversion
|
from functions.pressure_conversion import pressure_conversion
|
||||||
|
|
||||||
|
|
||||||
class Francis_Turbine:
|
class Turbine:
|
||||||
# units
|
# units
|
||||||
# make sure that units and display units are the same
|
# make sure that units and display units are the same
|
||||||
# units are used to label graphs and disp units are used to have a bearable format when using pythons print()
|
# units are used to label graphs and disp units are used to have a bearable format when using pythons print()
|
||||||
@@ -119,7 +119,7 @@ class Francis_Turbine:
|
|||||||
# :<10 pads the self.value to be 10 characters wide
|
# :<10 pads the self.value to be 10 characters wide
|
||||||
print_str = (f"Turbine has the following attributes: {new_line}"
|
print_str = (f"Turbine has the following attributes: {new_line}"
|
||||||
f"----------------------------- {new_line}"
|
f"----------------------------- {new_line}"
|
||||||
f"Type = Francis {new_line}"
|
f"Type = Generisch {new_line}"
|
||||||
f"Nominal flux = {self.Q_n:<10} {self.flux_unit_disp} {new_line}"
|
f"Nominal flux = {self.Q_n:<10} {self.flux_unit_disp} {new_line}"
|
||||||
f"Nominal pressure = {round(p_n,3):<10} {self.pressure_unit_disp}{new_line}"
|
f"Nominal pressure = {round(p_n,3):<10} {self.pressure_unit_disp}{new_line}"
|
||||||
f"Nominal LA = {self.LA_n*100:<10} {self.LA_unit_disp} {new_line}"
|
f"Nominal LA = {self.LA_n*100:<10} {self.LA_unit_disp} {new_line}"
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -2,28 +2,29 @@
|
|||||||
"cells": [
|
"cells": [
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 1,
|
"execution_count": 41,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"import numpy as np\n",
|
|
||||||
"import matplotlib.pyplot as plt\n",
|
|
||||||
"from Turbinen_class_file import Francis_Turbine\n",
|
|
||||||
"\n",
|
|
||||||
"import sys\n",
|
|
||||||
"import os\n",
|
"import os\n",
|
||||||
|
"import sys\n",
|
||||||
|
"\n",
|
||||||
|
"import matplotlib.pyplot as plt\n",
|
||||||
|
"import numpy as np\n",
|
||||||
|
"\n",
|
||||||
"current = os.path.dirname(os.path.realpath('Main_Programm.ipynb'))\n",
|
"current = os.path.dirname(os.path.realpath('Main_Programm.ipynb'))\n",
|
||||||
"parent = os.path.dirname(current)\n",
|
"parent = os.path.dirname(current)\n",
|
||||||
"sys.path.append(parent)\n",
|
"sys.path.append(parent)\n",
|
||||||
"from functions.pressure_conversion import pressure_conversion\n",
|
"from Turbinen_class_file import Turbine\n",
|
||||||
"from Ausgleichsbecken.Ausgleichsbecken_class_file import Ausgleichsbecken_class\n",
|
"from Ausgleichsbecken.Ausgleichsbecken_class_file import Ausgleichsbecken_class\n",
|
||||||
"from Druckrohrleitung.Druckrohrleitung_class_file import Druckrohrleitung_class\n",
|
"from Druckrohrleitung.Druckrohrleitung_class_file import Druckrohrleitung_class\n",
|
||||||
|
"from functions.pressure_conversion import pressure_conversion\n",
|
||||||
"from Regler.Regler_class_file import PI_controller_class"
|
"from Regler.Regler_class_file import PI_controller_class"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 2,
|
"execution_count": 42,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
@@ -31,7 +32,7 @@
|
|||||||
"\n",
|
"\n",
|
||||||
" # for physics\n",
|
" # for physics\n",
|
||||||
"g = 9.81 # [m/s²] gravitational acceleration \n",
|
"g = 9.81 # [m/s²] gravitational acceleration \n",
|
||||||
"rho = 1000. # [kg/m³] density of water \n",
|
"rho = 0.9982067*1e3 # [kg/m³] density of water \n",
|
||||||
"pUnit_calc = 'Pa' # [text] DO NOT CHANGE! for pressure conversion in print statements and plot labels \n",
|
"pUnit_calc = 'Pa' # [text] DO NOT CHANGE! for pressure conversion in print statements and plot labels \n",
|
||||||
"pUnit_conv = 'mWS' # [text] for pressure conversion in print statements and plot labels\n",
|
"pUnit_conv = 'mWS' # [text] for pressure conversion in print statements and plot labels\n",
|
||||||
"\n",
|
"\n",
|
||||||
@@ -42,8 +43,8 @@
|
|||||||
"\n",
|
"\n",
|
||||||
" # for PI controller\n",
|
" # for PI controller\n",
|
||||||
"Con_targetLevel = 8. # [m]\n",
|
"Con_targetLevel = 8. # [m]\n",
|
||||||
"Con_K_p = 0.1 # [-] proportional constant of PI controller\n",
|
"Con_K_p = 2. # [-] proportional constant of PI controller\n",
|
||||||
"Con_T_i = 10. # [s] timespan in which a steady state error is corrected by the intergal term\n",
|
"Con_T_i = 100. # [s] timespan in which a steady state error is corrected by the intergal term\n",
|
||||||
"Con_deadbandRange = 0.05 # [m] Deadband range around targetLevel for which the controller does NOT intervene\n",
|
"Con_deadbandRange = 0.05 # [m] Deadband range around targetLevel for which the controller does NOT intervene\n",
|
||||||
"\n",
|
"\n",
|
||||||
" # for pipeline\n",
|
" # for pipeline\n",
|
||||||
@@ -74,19 +75,23 @@
|
|||||||
" # for general simulation\n",
|
" # for general simulation\n",
|
||||||
"flux_init = Tur_Q_nenn/1.1 # [m³/s] initial flux through whole system for steady state initialization \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",
|
"level_init = Con_targetLevel # [m] initial water level in upstream reservoir for steady state initialization\n",
|
||||||
"simTime_target = 600. # [s] target for total simulation time (will vary slightly to fit with Pip_dt)\n",
|
"simTime_target = 1800. # [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",
|
"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"
|
"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"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 6,
|
"execution_count": 43,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"# create objects\n",
|
"# create objects\n",
|
||||||
"\n",
|
"\n",
|
||||||
|
"# influx setting turbine\n",
|
||||||
|
"turbine_in = Turbine(Tur_Q_nenn,Tur_p_nenn,Tur_closingTime/2,Pip_dt,pUnit_conv)\n",
|
||||||
|
"turbine_in.set_steady_state_by_flux(flux_init,Tur_p_nenn)\n",
|
||||||
|
"\n",
|
||||||
"# Upstream reservoir\n",
|
"# Upstream reservoir\n",
|
||||||
"reservoir = Ausgleichsbecken_class(Res_area_base,Res_area_out,Res_dt,Res_level_crit_lo,Res_level_crit_hi,rho)\n",
|
"reservoir = Ausgleichsbecken_class(Res_area_base,Res_area_out,Res_dt,Res_level_crit_lo,Res_level_crit_hi,rho)\n",
|
||||||
"reservoir.set_steady_state(flux_init,level_init)\n",
|
"reservoir.set_steady_state(flux_init,level_init)\n",
|
||||||
@@ -96,13 +101,9 @@
|
|||||||
"pipe.set_steady_state(flux_init,reservoir.get_current_pressure())\n",
|
"pipe.set_steady_state(flux_init,reservoir.get_current_pressure())\n",
|
||||||
"\n",
|
"\n",
|
||||||
"# downstream turbine\n",
|
"# downstream turbine\n",
|
||||||
"turbine = Francis_Turbine(Tur_Q_nenn,Tur_p_nenn,Tur_closingTime,Pip_dt,pUnit_conv)\n",
|
"turbine = Turbine(Tur_Q_nenn,Tur_p_nenn,Tur_closingTime,Pip_dt,pUnit_conv)\n",
|
||||||
"turbine.set_steady_state_by_flux(flux_init,pipe.get_current_pressure_distribution()[-1])\n",
|
"turbine.set_steady_state_by_flux(flux_init,pipe.get_current_pressure_distribution()[-1])\n",
|
||||||
"\n",
|
"\n",
|
||||||
"# influx setting turbine\n",
|
|
||||||
"turbine_in = Francis_Turbine(Tur_Q_nenn,Tur_p_nenn,Tur_closingTime/2,Pip_dt,pUnit_conv)\n",
|
|
||||||
"turbine_in.set_steady_state_by_flux(flux_init,Tur_p_nenn)\n",
|
|
||||||
"\n",
|
|
||||||
"# level controll\n",
|
"# level controll\n",
|
||||||
"level_control = PI_controller_class(Con_targetLevel,Con_deadbandRange,Con_K_p,Con_T_i,Pip_dt)\n",
|
"level_control = PI_controller_class(Con_targetLevel,Con_deadbandRange,Con_K_p,Con_T_i,Pip_dt)\n",
|
||||||
"level_control.set_control_variable(turbine.get_current_LA(),display_warning=False)\n"
|
"level_control.set_control_variable(turbine.get_current_LA(),display_warning=False)\n"
|
||||||
@@ -110,7 +111,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 7,
|
"execution_count": 44,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
@@ -127,7 +128,7 @@
|
|||||||
"p_max = pipe.get_current_pressure_distribution()\n",
|
"p_max = pipe.get_current_pressure_distribution()\n",
|
||||||
"\n",
|
"\n",
|
||||||
"Q_in_vec = np.zeros_like(t_vec)\n",
|
"Q_in_vec = np.zeros_like(t_vec)\n",
|
||||||
"Q_in_vec[0] = flux_init\n",
|
"Q_in_vec[0] = turbine_in.get_current_Q()\n",
|
||||||
"\n",
|
"\n",
|
||||||
"v_boundary_res = np.zeros_like(t_vec)\n",
|
"v_boundary_res = np.zeros_like(t_vec)\n",
|
||||||
"v_boundary_tur = np.zeros_like(t_vec)\n",
|
"v_boundary_tur = np.zeros_like(t_vec)\n",
|
||||||
@@ -146,16 +147,18 @@
|
|||||||
"p_boundary_res[0] = p_old[0]\n",
|
"p_boundary_res[0] = p_old[0]\n",
|
||||||
"p_boundary_tur[0] = p_old[-1]\n",
|
"p_boundary_tur[0] = p_old[-1]\n",
|
||||||
"\n",
|
"\n",
|
||||||
"LA_soll_vec = np.full_like(t_vec,turbine.get_current_LA())\n",
|
"OL_LA_soll_vec = np.full_like(t_vec,turbine_in.get_current_LA())\n",
|
||||||
"LA_ist_vec = np.full_like(t_vec,turbine.get_current_LA())\n",
|
"OL_LA_ist_vec = np.full_like(t_vec,turbine_in.get_current_LA())\n",
|
||||||
"\n",
|
"\n",
|
||||||
"LA_soll_vec2 = np.full_like(t_vec,turbine_in.get_current_LA())\n",
|
"UL_LA_soll_vec = np.zeros_like(t_vec)\n",
|
||||||
"# LA_soll_vec2[100:] = 0\n"
|
"UL_LA_soll_vec[0] = turbine.get_current_LA()\n",
|
||||||
|
"UL_LA_ist_vec = np.zeros_like(t_vec)\n",
|
||||||
|
"UL_LA_ist_vec[0] = turbine.get_current_LA()"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 8,
|
"execution_count": 45,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
@@ -188,7 +191,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 9,
|
"execution_count": 46,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
@@ -197,7 +200,7 @@
|
|||||||
"# loop through Con_T_ime steps of the pipeline\n",
|
"# loop through Con_T_ime steps of the pipeline\n",
|
||||||
"for it_pipe in range(1,nt+1):\n",
|
"for it_pipe in range(1,nt+1):\n",
|
||||||
"\n",
|
"\n",
|
||||||
" turbine_in.update_LA(LA_soll_vec2[it_pipe])\n",
|
" turbine_in.update_LA(OL_LA_soll_vec[it_pipe])\n",
|
||||||
" turbine_in.set_pressure(Tur_p_nenn)\n",
|
" turbine_in.set_pressure(Tur_p_nenn)\n",
|
||||||
" Q_in_vec[it_pipe] = turbine_in.get_current_Q()\n",
|
" Q_in_vec[it_pipe] = turbine_in.get_current_Q()\n",
|
||||||
" reservoir.set_influx(Q_in_vec[it_pipe])\n",
|
" reservoir.set_influx(Q_in_vec[it_pipe])\n",
|
||||||
@@ -214,11 +217,11 @@
|
|||||||
"\n",
|
"\n",
|
||||||
" # get the control variable\n",
|
" # get the control variable\n",
|
||||||
" level_control.update_control_variable(level_vec[it_pipe])\n",
|
" level_control.update_control_variable(level_vec[it_pipe])\n",
|
||||||
" LA_soll_vec[it_pipe] = level_control.get_current_control_variable()\n",
|
" UL_LA_soll_vec[it_pipe] = level_control.get_current_control_variable()\n",
|
||||||
" \n",
|
" \n",
|
||||||
" # change the Leitapparatöffnung based on the target value\n",
|
" # change the Leitapparatöffnung based on the target value\n",
|
||||||
" turbine.update_LA(LA_soll_vec[it_pipe])\n",
|
" turbine.update_LA(UL_LA_soll_vec[it_pipe])\n",
|
||||||
" LA_ist_vec[it_pipe] = turbine.get_current_LA()\n",
|
" UL_LA_ist_vec[it_pipe] = turbine.get_current_LA()\n",
|
||||||
"\n",
|
"\n",
|
||||||
" # set boundary condition for the next timestep of the characterisCon_T_ic method\n",
|
" # set boundary condition for the next timestep of the characterisCon_T_ic method\n",
|
||||||
" turbine.set_pressure(p_old[-1])\n",
|
" turbine.set_pressure(p_old[-1])\n",
|
||||||
@@ -269,12 +272,11 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 10,
|
"execution_count": 47,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"# plot Con_T_ime evolution of boundary pressure and velocity as well as the reservoir level\n",
|
"%matplotlib qt5\n",
|
||||||
"\n",
|
|
||||||
"fig2,axs2 = plt.subplots(1,1)\n",
|
"fig2,axs2 = plt.subplots(1,1)\n",
|
||||||
"axs2.set_title('Level and Volume reservoir')\n",
|
"axs2.set_title('Level and Volume reservoir')\n",
|
||||||
"axs2.plot(t_vec,level_vec,label='level')\n",
|
"axs2.plot(t_vec,level_vec,label='level')\n",
|
||||||
@@ -287,43 +289,45 @@
|
|||||||
"\n",
|
"\n",
|
||||||
"fig2,axs2 = plt.subplots(1,1)\n",
|
"fig2,axs2 = plt.subplots(1,1)\n",
|
||||||
"axs2.set_title('LA')\n",
|
"axs2.set_title('LA')\n",
|
||||||
"axs2.plot(t_vec,100*LA_soll_vec,label='Target')\n",
|
"axs2.plot(t_vec,100*OL_LA_soll_vec,label='OL Target',c='b')\n",
|
||||||
"axs2.plot(t_vec,100*LA_ist_vec,label='Actual')\n",
|
"axs2.scatter(t_vec[::200],100*OL_LA_ist_vec[::200],label='OL Actual',c='b',marker='+')\n",
|
||||||
|
"axs2.plot(t_vec,100*UL_LA_soll_vec,label='UL Target',c='r')\n",
|
||||||
|
"axs2.scatter(t_vec[::200],100*UL_LA_ist_vec[::200],label='UL Actual',c='r',marker='+')\n",
|
||||||
"axs2.set_xlabel(r'$t$ [$\\mathrm{s}$]')\n",
|
"axs2.set_xlabel(r'$t$ [$\\mathrm{s}$]')\n",
|
||||||
"axs2.set_ylabel(r'$LA$ [%]')\n",
|
"axs2.set_ylabel(r'$LA$ [%]')\n",
|
||||||
"axs2.legend()\n",
|
"axs2.legend()\n",
|
||||||
"\n",
|
"\n",
|
||||||
"fig2,axs2 = plt.subplots(1,1)\n",
|
"fig2,axs2 = plt.subplots(1,1)\n",
|
||||||
"axs2.set_title('Pressure reservoir and turbine')\n",
|
"axs2.set_title('Pressure change vs t=0 at reservoir and turbine')\n",
|
||||||
"axs2.plot(t_vec,pressure_conversion(p_boundary_res,pUnit_calc, pUnit_conv),label='Reservoir')\n",
|
"axs2.plot(t_vec,pressure_conversion(p_boundary_res-p_boundary_res[0],pUnit_calc, pUnit_conv),label='Reservoir')\n",
|
||||||
"axs2.plot(t_vec,pressure_conversion(p_boundary_tur,pUnit_calc, pUnit_conv),label='Turbine')\n",
|
"axs2.plot(t_vec,pressure_conversion(p_boundary_tur-p_boundary_tur[0],pUnit_calc, pUnit_conv),label='Turbine')\n",
|
||||||
"axs2.set_xlabel(r'$t$ [$\\mathrm{s}$]')\n",
|
"axs2.set_xlabel(r'$t$ [$\\mathrm{s}$]')\n",
|
||||||
"axs2.set_ylabel(r'$p$ ['+pUnit_conv+']')\n",
|
"axs2.set_ylabel(r'$p$ ['+pUnit_conv+']')\n",
|
||||||
"axs2.legend()\n",
|
"axs2.legend()\n",
|
||||||
"\n",
|
"\n",
|
||||||
"fig2,axs2 = plt.subplots(1,1)\n",
|
"fig2,axs2 = plt.subplots(1,1)\n",
|
||||||
"axs2.set_title('Fluxes')\n",
|
"axs2.set_title('Fluxes')\n",
|
||||||
"axs2.plot(t_vec,Q_boundary_res,label='Outflux')\n",
|
|
||||||
"axs2.plot(t_vec,Q_in_vec,label='Influx')\n",
|
"axs2.plot(t_vec,Q_in_vec,label='Influx')\n",
|
||||||
"axs2.plot(t_vec,Q_boundary_tur,label='Flux Turbine')\n",
|
"axs2.plot(t_vec,Q_boundary_res,label='Outflux')\n",
|
||||||
"axs2.set_ylim(-2*Tur_Q_nenn,+2*Tur_Q_nenn)\n",
|
"axs2.scatter(t_vec[::200],Q_boundary_tur[::200],label='Flux Turbine',c='g',marker='+')\n",
|
||||||
"axs2.set_xlabel(r'$t$ [$\\mathrm{s}$]')\n",
|
"axs2.set_xlabel(r'$t$ [$\\mathrm{s}$]')\n",
|
||||||
"axs2.set_ylabel(r'$Q$ [$\\mathrm{m}^3/\\mathrm{s}$]')\n",
|
"axs2.set_ylabel(r'$Q$ [$\\mathrm{m}^3/\\mathrm{s}$]')\n",
|
||||||
"axs2.legend()\n",
|
"axs2.legend()\n",
|
||||||
"\n",
|
"\n",
|
||||||
"fig2,axs2 = plt.subplots(1,1)\n",
|
"# fig2,axs2 = plt.subplots(1,1)\n",
|
||||||
"axs2.set_title('Min and Max Pressure')\n",
|
"# axs2.set_title('Min and Max Pressure')\n",
|
||||||
"axs2.plot(Pip_x_vec,pipe.get_lowest_pressure_per_node(disp_flag=True),c='red')\n",
|
"# axs2.plot(Pip_x_vec,pipe.get_lowest_pressure_per_node(disp_flag=True),c='red')\n",
|
||||||
"axs2.plot(Pip_x_vec,pipe.get_highest_pressure_per_node(disp_flag=True),c='red')\n",
|
"# axs2.plot(Pip_x_vec,pipe.get_highest_pressure_per_node(disp_flag=True),c='red')\n",
|
||||||
"axs2.set_xlabel(r'$x$ [$\\mathrm{m}$]')\n",
|
"# axs2.set_xlabel(r'$x$ [$\\mathrm{m}$]')\n",
|
||||||
"axs2.set_ylabel(r'$p$ ['+pUnit_conv+']')\n",
|
"# axs2.set_ylabel(r'$p$ ['+pUnit_conv+']')\n",
|
||||||
|
"\n",
|
||||||
|
"# fig2,axs2 = plt.subplots(1,1)\n",
|
||||||
|
"# axs2.set_title('Min and Max Fluxes')\n",
|
||||||
|
"# axs2.plot(Pip_x_vec,pipe.get_lowest_flux_per_node(),c='red')\n",
|
||||||
|
"# axs2.plot(Pip_x_vec,pipe.get_highest_flux_per_node(),c='red')\n",
|
||||||
|
"# axs2.set_xlabel(r'$x$ [$\\mathrm{m}$]')\n",
|
||||||
|
"# axs2.set_ylabel(r'$Q$ [$\\mathrm{m}^3/\\mathrm{s}$]')\n",
|
||||||
"\n",
|
"\n",
|
||||||
"fig2,axs2 = plt.subplots(1,1)\n",
|
|
||||||
"axs2.set_title('Min and Max Fluxes')\n",
|
|
||||||
"axs2.plot(Pip_x_vec,pipe.get_lowest_flux_per_node(),c='red')\n",
|
|
||||||
"axs2.plot(Pip_x_vec,pipe.get_highest_flux_per_node(),c='red')\n",
|
|
||||||
"axs2.set_xlabel(r'$x$ [$\\mathrm{m}$]')\n",
|
|
||||||
"axs2.set_ylabel(r'$Q$ [$\\mathrm{m}^3/\\mathrm{s}$]')\n",
|
|
||||||
"\n",
|
"\n",
|
||||||
"fig2.tight_layout()\n",
|
"fig2.tight_layout()\n",
|
||||||
"plt.show()"
|
"plt.show()"
|
||||||
@@ -331,10 +335,47 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": null,
|
"execution_count": 48,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": []
|
"source": [
|
||||||
|
"fig3,axs3 = plt.subplots(2,2)\n",
|
||||||
|
"axs3[0,0].set_title('Level and Volume reservoir')\n",
|
||||||
|
"axs3[0,0].plot(t_vec,level_vec,label='level')\n",
|
||||||
|
"axs3[0,0].set_xlabel(r'$t$ [$\\mathrm{s}$]')\n",
|
||||||
|
"axs3[0,0].set_ylabel(r'$h$ [m]')\n",
|
||||||
|
"x_twin_00 = axs3[0,0].twinx()\n",
|
||||||
|
"x_twin_00.set_ylabel(r'$V$ [$\\mathrm{m}^3$]')\n",
|
||||||
|
"x_twin_00.plot(t_vec,volume_vec)\n",
|
||||||
|
"axs3[0,0].legend()\n",
|
||||||
|
"\n",
|
||||||
|
"axs3[0,1].set_title('LA')\n",
|
||||||
|
"axs3[0,1].plot(t_vec,100*OL_LA_soll_vec,label='OL Target',c='b')\n",
|
||||||
|
"axs3[0,1].scatter(t_vec[::200],100*OL_LA_ist_vec[::200],label='OL Actual',c='b',marker='+')\n",
|
||||||
|
"axs2.plot(t_vec,100*UL_LA_soll_vec,label='UL Target',c='r')\n",
|
||||||
|
"axs2.scatter(t_vec[::200],100*UL_LA_ist_vec[::200],label='UL Actual',c='r',marker='+')\n",
|
||||||
|
"axs3[0,1].set_xlabel(r'$t$ [$\\mathrm{s}$]')\n",
|
||||||
|
"axs3[0,1].set_ylabel(r'$LA$ [%]')\n",
|
||||||
|
"axs3[0,1].legend()\n",
|
||||||
|
"\n",
|
||||||
|
"axs3[1,0].set_title('Fluxes')\n",
|
||||||
|
"axs3[1,0].plot(t_vec,Q_in_vec,label='Influx')\n",
|
||||||
|
"axs3[1,0].plot(t_vec,Q_boundary_res,label='Outflux')\n",
|
||||||
|
"axs3[1,0].scatter(t_vec[::200],Q_boundary_tur[::200],label='Flux Turbine',c='g',marker='+')\n",
|
||||||
|
"axs3[1,0].set_xlabel(r'$t$ [$\\mathrm{s}$]')\n",
|
||||||
|
"axs3[1,0].set_ylabel(r'$Q$ [$\\mathrm{m}^3/\\mathrm{s}$]')\n",
|
||||||
|
"axs3[1,0].legend()\n",
|
||||||
|
"\n",
|
||||||
|
"axs3[1,1].set_title('Pressure change vs t=0 at reservoir and turbine')\n",
|
||||||
|
"axs3[1,1].plot(t_vec,pressure_conversion(p_boundary_res-p_boundary_res[0],pUnit_calc, pUnit_conv),label='Reservoir')\n",
|
||||||
|
"axs3[1,1].plot(t_vec,pressure_conversion(p_boundary_tur-p_boundary_tur[0],pUnit_calc, pUnit_conv),label='Turbine')\n",
|
||||||
|
"axs3[1,1].set_xlabel(r'$t$ [$\\mathrm{s}$]')\n",
|
||||||
|
"axs3[1,1].set_ylabel(r'$p$ ['+pUnit_conv+']')\n",
|
||||||
|
"axs3[1,1].legend()\n",
|
||||||
|
"\n",
|
||||||
|
"fig3.tight_layout()\n",
|
||||||
|
"plt.show()"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"metadata": {
|
"metadata": {
|
||||||
|
|||||||
Reference in New Issue
Block a user