missed stageing
This commit is contained in:
@@ -71,6 +71,9 @@ class Francis_Turbine:
|
|||||||
def get_current_Q(self):
|
def get_current_Q(self):
|
||||||
# return the flux through the turbine, based on the current pressure in front
|
# return the flux through the turbine, based on the current pressure in front
|
||||||
# of the turbine and the Leitapparatöffnung
|
# of the turbine and the Leitapparatöffnung
|
||||||
|
if self.p < 0:
|
||||||
|
self.Q = 0
|
||||||
|
else:
|
||||||
self.Q = self.Q_n*(self.LA/self.LA_n)*np.sqrt(self.p/self.p_n)
|
self.Q = self.Q_n*(self.LA/self.LA_n)*np.sqrt(self.p/self.p_n)
|
||||||
return self.Q
|
return self.Q
|
||||||
|
|
||||||
@@ -114,7 +117,13 @@ class Francis_Turbine:
|
|||||||
LA_diff = self.LA-LA_soll # calculate the difference to the target LA
|
LA_diff = self.LA-LA_soll # calculate the difference to the target LA
|
||||||
LA_diff_max = self.d_LA_max_dt*self.dt # calculate the maximum change in LA based on the given timestep
|
LA_diff_max = self.d_LA_max_dt*self.dt # calculate the maximum change in LA based on the given timestep
|
||||||
LA_diff = np.sign(LA_diff)*np.min(np.abs([LA_diff,LA_diff_max])) # calulate the correct change in LA
|
LA_diff = np.sign(LA_diff)*np.min(np.abs([LA_diff,LA_diff_max])) # calulate the correct change in LA
|
||||||
self.set_LA(self.LA-LA_diff,display_warning=False) # set new LA
|
|
||||||
|
LA_new = self.LA-LA_diff
|
||||||
|
if LA_new < 0.:
|
||||||
|
LA_new = 0.
|
||||||
|
elif LA_new > 1.:
|
||||||
|
LA_new = 1.
|
||||||
|
self.set_LA(LA_new,display_warning=False)
|
||||||
|
|
||||||
def set_steady_state(self,ss_flux,ss_pressure):
|
def set_steady_state(self,ss_flux,ss_pressure):
|
||||||
# calculate and set steady state LA, that allows the flow of ss_flux at ss_pressure through the
|
# calculate and set steady state LA, that allows the flow of ss_flux at ss_pressure through the
|
||||||
|
|||||||
@@ -38,10 +38,7 @@
|
|||||||
"A_pipe = D**2/4*np.pi # pipeline area\n",
|
"A_pipe = D**2/4*np.pi # pipeline area\n",
|
||||||
"h_pipe = 105 # hydraulic head without reservoir [m] \n",
|
"h_pipe = 105 # hydraulic head without reservoir [m] \n",
|
||||||
"alpha = np.arcsin(h_pipe/L) # Höhenwinkel der Druckrohrleitung \n",
|
"alpha = np.arcsin(h_pipe/L) # Höhenwinkel der Druckrohrleitung \n",
|
||||||
"n = 50 # number of pipe segments in discretization\n",
|
"n = 50 # number of pipe segments in discretization # initial flow velocity [m/s]\n",
|
||||||
"# consider replacing Q0 with a vector be be more flexible in initial conditions\n",
|
|
||||||
"# Q0 = Q_nenn # initial flow in whole pipe [m³/s]\n",
|
|
||||||
"# v0 = Q0/A_pipe # initial flow velocity [m/s]\n",
|
|
||||||
"f_D = 0.014 # Darcy friction factor\n",
|
"f_D = 0.014 # Darcy friction factor\n",
|
||||||
"c = 500. # propagation velocity of the pressure wave [m/s]\n",
|
"c = 500. # propagation velocity of the pressure wave [m/s]\n",
|
||||||
"# consider prescribing a total simulation time and deducting the number of timesteps from that\n",
|
"# consider prescribing a total simulation time and deducting the number of timesteps from that\n",
|
||||||
@@ -95,12 +92,7 @@
|
|||||||
"initial_pressure_turbine = pipe.get_current_pressure_distribution()[-1]\n",
|
"initial_pressure_turbine = pipe.get_current_pressure_distribution()[-1]\n",
|
||||||
"\n",
|
"\n",
|
||||||
"T1 = Francis_Turbine(Q_nenn,p_nenn,closing_time,timestep=dt)\n",
|
"T1 = Francis_Turbine(Q_nenn,p_nenn,closing_time,timestep=dt)\n",
|
||||||
"T1.set_steady_state(initial_flux,initial_pressure_turbine)\n",
|
"T1.set_steady_state(initial_flux,initial_pressure_turbine)\n"
|
||||||
"\n",
|
|
||||||
"\n",
|
|
||||||
"# display the attributes of the created reservoir and pipeline object\n",
|
|
||||||
"# V.get_info(full=True)\n",
|
|
||||||
"# pipe.get_info()"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user