added initialization by LA to turbine and Kraftwerk-class

This commit is contained in:
Brantegger Georg
2022-09-13 15:18:57 +02:00
parent a78e62f032
commit 5a99574e1e
3 changed files with 40 additions and 26 deletions

View File

@@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 41,
"execution_count": 24,
"metadata": {},
"outputs": [],
"source": [
@@ -24,7 +24,7 @@
},
{
"cell_type": "code",
"execution_count": 42,
"execution_count": 25,
"metadata": {},
"outputs": [],
"source": [
@@ -83,7 +83,8 @@
"Res_dt = Pip_dt/Res_nt # [s] harmonised timestep of reservoir time evolution\n",
"\n",
" # for general simulation\n",
"flux_init = (OL_T1_Q_nenn+OL_T2_Q_nenn) # [m³/s] initial flux through whole system for steady state initialization \n",
"# flux_init = (OL_T1_Q_nenn+OL_T2_Q_nenn) # [m³/s] initial flux through whole system for steady state initialization \n",
"OL_LAs_init = [1.,0.3] # [vec] initial guide vane openings of OL-KW\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",
"nt = int(simTime_target//Pip_dt) # [1] Number of timesteps of the whole system\n",
@@ -92,20 +93,12 @@
},
{
"cell_type": "code",
"execution_count": 43,
"execution_count": 26,
"metadata": {},
"outputs": [],
"source": [
"# create objects\n",
"\n",
"# Upstream reservoir\n",
"reservoir = Ausgleichsbecken_class(Res_area_base,Res_area_out,Res_dt,pUnit_conv,Res_level_crit_lo,Res_level_crit_hi,rho)\n",
"reservoir.set_steady_state(flux_init,level_init)\n",
"\n",
"# pipeline\n",
"pipe = Druckrohrleitung_class(Pip_length,Pip_dia,Pip_head,Pip_n_seg,Pip_f_D,Pip_pw_vel,Pip_dt,pUnit_conv,rho)\n",
"pipe.set_steady_state(flux_init,reservoir.get_current_pressure())\n",
"\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_T2 = Francis_Turbine(OL_T2_Q_nenn,OL_T2_p_nenn,OL_T2_closingTime,Pip_dt,pUnit_conv)\n",
@@ -114,7 +107,17 @@
"KW_OL.add_turbine(OL_T1)\n",
"KW_OL.add_turbine(OL_T2)\n",
"\n",
"KW_OL.set_steady_state(flux_init,OL_T1_p_nenn)\n",
"KW_OL.set_steady_state_by_LA(OL_LAs_init,OL_T1_p_nenn)\n",
"\n",
"flux_init = KW_OL.get_current_Q()\n",
"\n",
"# Upstream reservoir\n",
"reservoir = Ausgleichsbecken_class(Res_area_base,Res_area_out,Res_dt,pUnit_conv,Res_level_crit_lo,Res_level_crit_hi,rho)\n",
"reservoir.set_steady_state(flux_init,level_init)\n",
"\n",
"# pipeline\n",
"pipe = Druckrohrleitung_class(Pip_length,Pip_dia,Pip_head,Pip_n_seg,Pip_f_D,Pip_pw_vel,Pip_dt,pUnit_conv,rho)\n",
"pipe.set_steady_state(flux_init,reservoir.get_current_pressure())\n",
"\n",
"# downstream turbines\n",
"UL_T1 = Francis_Turbine(UL_T1_Q_nenn,UL_T1_p_nenn,UL_T1_closingTime,Pip_dt,pUnit_conv)\n",
@@ -124,12 +127,12 @@
"KW_UL.add_turbine(UL_T1)\n",
"KW_UL.add_turbine(UL_T2)\n",
"\n",
"KW_UL.set_steady_state(flux_init,pipe.get_current_pressure_distribution()[-1])\n"
"KW_UL.set_steady_state_by_flux(flux_init,pipe.get_current_pressure_distribution()[-1])\n"
]
},
{
"cell_type": "code",
"execution_count": 44,
"execution_count": 27,
"metadata": {},
"outputs": [],
"source": [
@@ -186,7 +189,7 @@
"\n",
"# UL KW\n",
"UL_T1_LA_soll_vec = np.full_like(t_vec,UL_T1.get_current_LA()) # storing the target value of the guide vane opening\n",
"UL_T1_LA_soll_vec[np.argmin(np.abs(t_vec-105)):] -= 0.1\n",
"UL_T1_LA_soll_vec[np.argmin(np.abs(t_vec-105)):] -= 0.25\n",
"\n",
"UL_T2_LA_soll_vec = np.full_like(t_vec,UL_T2.get_current_LA()) # storing the target value of the guide vane opening\n",
"UL_T2_LA_soll_vec[np.argmin(np.abs(t_vec-105)):] = 0.\n",
@@ -200,7 +203,7 @@
},
{
"cell_type": "code",
"execution_count": 45,
"execution_count": 28,
"metadata": {},
"outputs": [],
"source": [
@@ -222,7 +225,7 @@
},
{
"cell_type": "code",
"execution_count": 46,
"execution_count": 29,
"metadata": {},
"outputs": [],
"source": [
@@ -264,7 +267,7 @@
},
{
"cell_type": "code",
"execution_count": 47,
"execution_count": 30,
"metadata": {},
"outputs": [],
"source": [
@@ -350,7 +353,7 @@
},
{
"cell_type": "code",
"execution_count": 48,
"execution_count": 31,
"metadata": {},
"outputs": [],
"source": [
@@ -416,7 +419,7 @@
},
{
"cell_type": "code",
"execution_count": 49,
"execution_count": 32,
"metadata": {},
"outputs": [],
"source": [
@@ -464,7 +467,7 @@
},
{
"cell_type": "code",
"execution_count": 50,
"execution_count": 33,
"metadata": {},
"outputs": [
{