cleanup old files
This commit is contained in:
@@ -1,171 +0,0 @@
|
||||
import numpy as np
|
||||
|
||||
#importing pressure conversion function
|
||||
import sys
|
||||
import os
|
||||
current = os.path.dirname(os.path.realpath(__file__))
|
||||
parent = os.path.dirname(current)
|
||||
sys.path.append(parent)
|
||||
from functions.pressure_conversion import pressure_conversion
|
||||
|
||||
|
||||
class Druckrohrleitung_class:
|
||||
# units
|
||||
acceleration_unit = r'$\mathrm{m}/\mathrm{s}^2$'
|
||||
angle_unit = '°'
|
||||
area_unit = r'$\mathrm{m}^2$'
|
||||
density_unit = r'$\mathrm{kg}/\mathrm{m}^3$'
|
||||
flux_unit = r'$\mathrm{m}^3/\mathrm{s}$'
|
||||
length_unit = 'm'
|
||||
pressure_unit = 'Pa'
|
||||
time_unit = 's'
|
||||
velocity_unit = r'$\mathrm{m}/\mathrm{s}$' # for flux and pressure propagation
|
||||
volume_unit = r'$\mathrm{m}^3$'
|
||||
|
||||
acceleration_unit_print = 'm/s²'
|
||||
angle_unit_print = '°'
|
||||
area_unit_print = 'm²'
|
||||
density_unit_print = 'kg/m³'
|
||||
flux_unit_print = 'm³/s'
|
||||
length_unit_print = 'm'
|
||||
pressure_unit_print = 'Pa'
|
||||
time_unit_print = 's'
|
||||
velocity_unit_print = 'm/s' # for flux and pressure propagation
|
||||
volume_unit_print = 'm³'
|
||||
|
||||
|
||||
# init
|
||||
def __init__(self,total_length,diameter,number_segments,pipeline_angle,Darcy_friction_factor,rho=1000,g=9.81):
|
||||
self.length = total_length
|
||||
self.dia = diameter
|
||||
self.n_seg = number_segments
|
||||
self.angle = pipeline_angle
|
||||
self.f_D = Darcy_friction_factor # = Rohrreibungszahl oder flow coefficient
|
||||
self.density = 1000
|
||||
self.g = g
|
||||
|
||||
self.dx = total_length/number_segments
|
||||
self.l_vec = np.arange(0,(number_segments+1)*self.dx,self.dx)
|
||||
|
||||
# initialize for get_info method
|
||||
self.c = '--'
|
||||
self.dt = '--'
|
||||
|
||||
# setter
|
||||
def set_pressure_propagation_velocity(self,c):
|
||||
self.c = c
|
||||
self.dt = self.dx/c
|
||||
|
||||
def set_number_of_timesteps(self,number_timesteps):
|
||||
self.nt = number_timesteps
|
||||
if self.c == '--':
|
||||
raise Exception('Please set the pressure propagation velocity before setting the number of timesteps.')
|
||||
else:
|
||||
self.t_vec = np.arange(0,self.nt*self.dt,self.dt)
|
||||
|
||||
def set_initial_pressure(self,pressure,input_unit = 'Pa'):
|
||||
p,_ = pressure_conversion(pressure,input_unit,target_unit=self.pressure_unit)
|
||||
if np.size(p) == 1:
|
||||
self.p0 = np.full_like(self.l_vec,p)
|
||||
elif np.size(p) == np.size(self.l_vec):
|
||||
self.p0 = p
|
||||
else:
|
||||
raise Exception('Unable to assign initial pressure. Input has to be of size 1 or' + np.size(self.l_vec))
|
||||
|
||||
#initialize the vectors in which the old and new pressures are stored for the method of characteristics
|
||||
self.p_old = self.p0.copy()
|
||||
self.p = np.empty_like(self.p_old)
|
||||
|
||||
def set_initial_flow_velocity(self,velocity):
|
||||
if np.size(velocity) == 1:
|
||||
self.v0 = np.full_like(self.l_vec,velocity)
|
||||
elif np.size(velocity) == np.size(self.l_vec):
|
||||
self.v0 = velocity
|
||||
else:
|
||||
raise Exception('Unable to assign initial velocity. Input has to be of size 1 or' + np.size(self.l_vec))
|
||||
|
||||
#initialize the vectors in which the old and new velocities are stored for the method of characteristics
|
||||
self.v_old = self.v0.copy()
|
||||
self.v = np.empty_like(self.v_old)
|
||||
|
||||
def set_boundary_conditions_next_timestep(self,v_reservoir,p_reservoir,v_turbine,input_unit_pressure = 'Pa'):
|
||||
rho = self.density
|
||||
c = self.c
|
||||
f_D = self.f_D
|
||||
dt = self.dt
|
||||
D = self.dia
|
||||
p_old = self.p_old[-2] # @ second to last node (the one before the turbine)
|
||||
v_old = self.v_old[-2] # @ second to last node (the one before the turbine)
|
||||
self.v_boundary_res = v_reservoir
|
||||
self.v_boundary_tur = v_turbine
|
||||
self.p_boundary_res,_ = pressure_conversion(p_reservoir,input_unit_pressure,target_unit=self.pressure_unit)
|
||||
self.p_boundary_tur = p_old+rho*c*v_old-rho*c*f_D*dt/(2*D)*abs(v_old)*v_old
|
||||
self.v[0] = self.v_boundary_res.copy()
|
||||
self.v[-1] = self.v_boundary_tur.copy()
|
||||
self.p[0] = self.p_boundary_res.copy()
|
||||
self.p[-1] = self.p_boundary_tur.copy()
|
||||
|
||||
# getter
|
||||
def get_info(self):
|
||||
new_line = '\n'
|
||||
|
||||
# :<10 pads the self.value to be 10 characters wide
|
||||
print_str = (f"The pipeline has the following attributes: {new_line}"
|
||||
f"----------------------------- {new_line}"
|
||||
f"Length = {self.length:<10} {self.length_unit_print} {new_line}"
|
||||
f"Diameter = {self.dia:<10} {self.length_unit_print} {new_line}"
|
||||
f"Number of segemnts = {self.n_seg:<10} {new_line}"
|
||||
f"Number of nodes = {self.n_seg+1:<10} {new_line}"
|
||||
f"Length per segment = {self.dx:<10} {self.length_unit_print} {new_line}"
|
||||
f"Pipeline angle = {self.angle:<10} {self.angle_unit_print} {new_line}"
|
||||
f"Darcy friction factor = {self.f_D:<10} {new_line}"
|
||||
f"Density of liquid = {self.density:<10} {self.density_unit_print} {new_line}"
|
||||
f"Pressure wave vel. = {self.c:<10} {self.velocity_unit_print} {new_line}"
|
||||
f"Simulation timesteps = {self.dt:<10} {self.time_unit_print } {new_line}"
|
||||
f"Number of timesteps = {self.nt:<10} {new_line}"
|
||||
f"----------------------------- {new_line}"
|
||||
f"Velocity and pressure distribution are vectors and are accessible by the .v and .p attribute of the pipeline object")
|
||||
|
||||
print(print_str)
|
||||
|
||||
|
||||
def get_boundary_conditions_next_timestep(self,target_unit_pressure ='bar'):
|
||||
print('The pressure at the reservoir for the next timestep is', '\n', \
|
||||
pressure_conversion(self.p_boundary_res,self.pressure_unit_print,target_unit_pressure), '\n', \
|
||||
'The velocity at the reservoir for the next timestep is', '\n', \
|
||||
self.v_boundary_res, self.velocity_unit, '\n', \
|
||||
'The pressure at the turbine for the next timestep is', '\n', \
|
||||
pressure_conversion(self.p_boundary_tur,self.pressure_unit_print,target_unit_pressure), '\n', \
|
||||
'The velocity at the turbine for the next timestep is', '\n', \
|
||||
self.v_boundary_tur, self.velocity_unit)
|
||||
|
||||
|
||||
def timestep_characteristic_method(self):
|
||||
#number of nodes
|
||||
nn = self.n_seg+1
|
||||
rho = self.density
|
||||
c = self.c
|
||||
f_D = self.f_D
|
||||
dt = self.dt
|
||||
D = self.dia
|
||||
|
||||
for i in range(1,nn-1):
|
||||
self.v[i] = 0.5*(self.v_old[i-1]+self.v_old[i+1])+0.5/(rho*c)*(self.p_old[i-1]-self.p_old[i+1]) \
|
||||
-f_D*dt/(4*D)*(abs(self.v_old[i-1])*self.v_old[i-1]+abs(self.v_old[i+1])*self.v_old[i+1])
|
||||
|
||||
self.p[i] = 0.5*rho*c*(self.v_old[i-1]-self.v_old[i+1])+0.5*(self.p_old[i-1]+self.p_old[i+1]) \
|
||||
-rho*c*f_D*dt/(4*D)*(abs(self.v_old[i-1])*self.v_old[i-1]-abs(self.v_old[i+1])*self.v_old[i+1])
|
||||
|
||||
self.p_old = self.p.copy()
|
||||
self.v_old = self.v.copy()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,187 +0,0 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 1,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"#imports\n",
|
||||
"import numpy as np\n",
|
||||
"import matplotlib.pyplot as plt\n",
|
||||
"from pressure_conversion import pressure_conversion"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 2,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"#define constants\n",
|
||||
"\n",
|
||||
"g = 9.81 # gravitational acceleration [m/s²]\n",
|
||||
"\n",
|
||||
"L = 1000 # length of pipeline [m]\n",
|
||||
"rho = 1000 # density of water [kg/m³]\n",
|
||||
"D = 1 # pipe diameter [m]\n",
|
||||
"Q0 = 2 # initial flow in whole pipe [m³/s]\n",
|
||||
"h = 20 # water level in upstream reservoir [m]\n",
|
||||
"n = 10 # number of pipe segments in discretization\n",
|
||||
"nt = 500 # number of time steps after initial conditions\n",
|
||||
"f_D = 0.01 # Darcy friction factor\n",
|
||||
"c = 400 # propagation velocity of the pressure wave [m/s]"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 3,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# preparing the discretization and initial conditions\n",
|
||||
"\n",
|
||||
"dx = L/n # length of each pipe segment\n",
|
||||
"dt = dx/c # timestep according to method of characterisitics\n",
|
||||
"nn = n+1 # number of nodes\n",
|
||||
"pl_vec = np.arange(0,nn*dx,dx) # pl = pipe-length. position of the nodes on the pipeline\n",
|
||||
"t_vec = np.arange(0,nt*dt,dt) # time vector\n",
|
||||
"\n",
|
||||
"v0 = Q0/(D**2/4*np.pi)\n",
|
||||
"p0 = (rho*g*h-v0**2*rho/2)\n",
|
||||
"\n",
|
||||
"# storage vectors for old parameters\n",
|
||||
"v_old = np.full(nn,v0)\n",
|
||||
"p_old = p0-(f_D*pl_vec/D*rho/2*v0**2) # ref Wikipedia: Darcy Weisbach\n",
|
||||
"\n",
|
||||
"# storage vectors for new parameters\n",
|
||||
"v_new = np.zeros_like(v_old)\n",
|
||||
"p_new = np.zeros_like(p_old)\n",
|
||||
"\n",
|
||||
"# storage vector for time evolution of parameters at node 1 (at reservoir)\n",
|
||||
"p_1 = np.zeros_like(t_vec)\n",
|
||||
"v_1 = np.zeros_like(t_vec)\n",
|
||||
"\n",
|
||||
"# storage vector for time evolution of parameters at node N+1 (at valve)\n",
|
||||
"p_np1 = np.full_like(t_vec,p0)\n",
|
||||
"v_np1 = np.full_like(t_vec,v0)\n",
|
||||
"\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 4,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"%matplotlib qt\n",
|
||||
"# plotting preparation\n",
|
||||
"\n",
|
||||
"fig1,axs1 = plt.subplots(2,1)\n",
|
||||
"axs1[0].set_title('Pressure distribution in pipeline')\n",
|
||||
"axs1[1].set_title('Velocity distribution in pipeline')\n",
|
||||
"\n",
|
||||
"lo_00, = axs1[0].plot(pl_vec,p_old,marker='.')\n",
|
||||
"lo_01, = axs1[1].plot(pl_vec,v_old,marker='.')\n",
|
||||
"axs1[0].set_ylim([-20*p0,20*p0])\n",
|
||||
"axs1[1].set_ylim([-2*v0,2*v0])\n",
|
||||
"fig1.tight_layout()\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 5,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"for it in range(1,nt):\n",
|
||||
"\n",
|
||||
" # set boundary conditions\n",
|
||||
" v_new[-1] = 0 # in front of the instantaneously closing valve, the velocity is 0\n",
|
||||
" p_new[0] = p0 # hydrostatic pressure from the reservoir\n",
|
||||
"\n",
|
||||
" # calculate the new parameters at first and last node\n",
|
||||
" v_new[0] = v_old[1]+1/(rho*c)*(p0-p_old[1])-f_D*dt/(2*D)*abs(v_old[1])*v_old[1]\n",
|
||||
" p_new[-1] = p_old[-2]+rho*c*v_old[-2]-rho*c*f_D*dt/(2*D) *abs(v_old[-2])*v_old[-2]\n",
|
||||
"\n",
|
||||
" # calculate parameters at second to second-to-last nodes \n",
|
||||
" #equation 2-30 plus 2-31 (and refactor for v_i^j+1) in block 2\n",
|
||||
"\n",
|
||||
" for i in range(1,nn-1):\n",
|
||||
" v_new[i] = 0.5*(v_old[i-1]+v_old[i+1])+0.5/(rho*c)*(p_old[i-1]-p_old[i+1]) \\\n",
|
||||
" -f_D*dt/(4*D)*(abs(v_old[i-1])*v_old[i-1]+abs(v_old[i+1])*v_old[i+1])\n",
|
||||
"\n",
|
||||
" p_new[i] = 0.5*rho*c*(v_old[i-1]-v_old[i+1])+0.5*(p_old[i-1]+p_old[i+1]) \\\n",
|
||||
" -rho*c*f_D*dt/(4*D)*(abs(v_old[i-1])*v_old[i-1]-abs(v_old[i+1])*v_old[i+1])\n",
|
||||
" \n",
|
||||
"\n",
|
||||
" # prepare for next loop\n",
|
||||
" # use .copy() to avoid that memory address is overwritten and hell breaks loose :D\n",
|
||||
" #https://www.geeksforgeeks.org/array-copying-in-python/\n",
|
||||
" p_old = p_new.copy()\n",
|
||||
" v_old = v_new.copy()\n",
|
||||
"\n",
|
||||
" lo_00.set_ydata(p_new)\n",
|
||||
" lo_01.set_ydata(v_new)\n",
|
||||
" \n",
|
||||
" fig1.suptitle(str(it))\n",
|
||||
" fig1.canvas.draw()\n",
|
||||
" fig1.tight_layout()\n",
|
||||
" plt.pause(0.001)\n",
|
||||
"\n",
|
||||
" # store parameters of node 1 (at reservoir)\n",
|
||||
" p_1[it] = p_new[0]\n",
|
||||
" v_1[it] = v_new[0]\n",
|
||||
" # store parameters of node N+1 (at reservoir)\n",
|
||||
" p_np1[it] = p_new[-1]\n",
|
||||
" v_np1[it] = v_new[-1]"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 6,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"fig2,axs2 = plt.subplots(2,2)\n",
|
||||
"axs2[0,0].plot(t_vec,p_1)\n",
|
||||
"axs2[0,1].plot(t_vec,v_1)\n",
|
||||
"axs2[1,0].plot(t_vec,p_np1)\n",
|
||||
"axs2[1,1].plot(t_vec,v_np1)\n",
|
||||
"axs2[0,0].set_title('Pressure Reservoir')\n",
|
||||
"axs2[0,1].set_title('Velocity Reservoir')\n",
|
||||
"axs2[1,0].set_title('Pressure Turbine')\n",
|
||||
"axs2[1,1].set_title('Velocity Turbine')\n",
|
||||
"fig2.tight_layout()\n",
|
||||
"plt.show()"
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3.8.13 ('Georg_DT_Slot3')",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
},
|
||||
"language_info": {
|
||||
"codemirror_mode": {
|
||||
"name": "ipython",
|
||||
"version": 3
|
||||
},
|
||||
"file_extension": ".py",
|
||||
"mimetype": "text/x-python",
|
||||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.8.13"
|
||||
},
|
||||
"orig_nbformat": 4,
|
||||
"vscode": {
|
||||
"interpreter": {
|
||||
"hash": "84fb123bdc47ab647d3782661abcbe80fbb79236dd2f8adf4cef30e8755eb2cd"
|
||||
}
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 2
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
#importing Druckrohrleitung
|
||||
import sys
|
||||
import os
|
||||
current = os.path.dirname(os.path.realpath('Main_Programm.ipynb'))
|
||||
parent = os.path.dirname(current)
|
||||
sys.path.append(parent)
|
||||
from functions.pressure_conversion import pressure_conversion
|
||||
from Turbinen.Turbinen_class_file import Francis_Turbine
|
||||
|
||||
class Kraftwerk_class:
|
||||
def __init__(self):
|
||||
self.turbines = []
|
||||
|
||||
def add_turbine(self,turbine):
|
||||
self.turbines.append(turbine)
|
||||
|
||||
def print_info(self):
|
||||
for turbine in self.turbines:
|
||||
turbine.get_info(full=True)
|
||||
@@ -1,105 +0,0 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 1,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import sys\n",
|
||||
"import os\n",
|
||||
"from Kraftwerk_class_file import Kraftwerk_class\n",
|
||||
"\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 Turbinen.Turbinen_class_file import Francis_Turbine"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 2,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"[<Turbinen.Turbinen_class_file.Francis_Turbine object at 0x0000018A94FDDE80>, <Turbinen.Turbinen_class_file.Francis_Turbine object at 0x0000018A94FDDEE0>]\n",
|
||||
"Turbine has the following attributes: \n",
|
||||
"----------------------------- \n",
|
||||
"Type = Francis \n",
|
||||
"Nominal flux = 0.85 m³/s \n",
|
||||
"Nominal pressure = 108.09 mWS\n",
|
||||
"Nominal LA = 100.0 % \n",
|
||||
"Closing time = 500 s \n",
|
||||
"Current flux = -1.0 m³/s \n",
|
||||
"Current pipe pressure = -1.0 mWS \n",
|
||||
"Current LA = -1.0 % \n",
|
||||
"Simulation timestep = -1.0 s \n",
|
||||
"----------------------------- \n",
|
||||
"\n",
|
||||
"Turbine has the following attributes: \n",
|
||||
"----------------------------- \n",
|
||||
"Type = Francis \n",
|
||||
"Nominal flux = 0.85 m³/s \n",
|
||||
"Nominal pressure = 108.09 mWS\n",
|
||||
"Nominal LA = 100.0 % \n",
|
||||
"Closing time = 500 s \n",
|
||||
"Current flux = -1.0 m³/s \n",
|
||||
"Current pipe pressure = -1.0 mWS \n",
|
||||
"Current LA = -1.0 % \n",
|
||||
"Simulation timestep = -1.0 s \n",
|
||||
"----------------------------- \n",
|
||||
"\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"#Turbine\n",
|
||||
"Q_nenn = 0.85 # m³/s\n",
|
||||
"p_nenn = pressure_conversion(10.6,'bar','Pa')\n",
|
||||
"closing_time = 500 #s\n",
|
||||
"\n",
|
||||
"T1 = Francis_Turbine(Q_nenn,p_nenn,closing_time)\n",
|
||||
"T2 = Francis_Turbine(Q_nenn,p_nenn,closing_time)\n",
|
||||
"\n",
|
||||
"KW = Kraftwerk_class()\n",
|
||||
"KW.add_turbine(T1)\n",
|
||||
"KW.add_turbine(T2)\n",
|
||||
"\n",
|
||||
"print(KW.turbines)\n",
|
||||
"\n",
|
||||
"KW.print_info()"
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3.8.13 ('Georg_DT_Slot3')",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
},
|
||||
"language_info": {
|
||||
"codemirror_mode": {
|
||||
"name": "ipython",
|
||||
"version": 3
|
||||
},
|
||||
"file_extension": ".py",
|
||||
"mimetype": "text/x-python",
|
||||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.8.13"
|
||||
},
|
||||
"orig_nbformat": 4,
|
||||
"vscode": {
|
||||
"interpreter": {
|
||||
"hash": "84fb123bdc47ab647d3782661abcbe80fbb79236dd2f8adf4cef30e8755eb2cd"
|
||||
}
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 2
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -1,90 +0,0 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 2,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import numpy as np\n",
|
||||
"from Turbinen_class_file import Francis_Turbine\n",
|
||||
"from mpl_toolkits import mplot3d\n",
|
||||
"import matplotlib.pyplot as plt\n",
|
||||
"%matplotlib widget\n",
|
||||
"\n",
|
||||
"#importing pressure conversion function\n",
|
||||
"import sys\n",
|
||||
"import os\n",
|
||||
"current = os.path.dirname(os.path.realpath('messy.ipynb'))\n",
|
||||
"parent = os.path.dirname(current)\n",
|
||||
"sys.path.append(parent)\n",
|
||||
"from functions.pressure_conversion import pressure_conversion"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 4,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"The current attributes are: \n",
|
||||
"----------------------------- \n",
|
||||
"Current flux = -1.0 m³/s \n",
|
||||
"Current pipe pressure = -1.0 mWS \n",
|
||||
"Current LA = -1.0 % \n",
|
||||
"----------------------------- \n",
|
||||
"\n",
|
||||
"The current attributes are: \n",
|
||||
"----------------------------- \n",
|
||||
"Current flux = -1.0 m³/s \n",
|
||||
"Current pipe pressure = -1.0 mWS \n",
|
||||
"Current LA = -1.0 % \n",
|
||||
"----------------------------- \n",
|
||||
"\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"Q_nenn = 0.85\n",
|
||||
"p_nenn = pressure_conversion(10.6,'bar','Pa')\n",
|
||||
"Untertweng1 = Francis_Turbine(Q_nenn,p_nenn)\n",
|
||||
"Untertweng2 = Francis_Turbine(Q_nenn,p_nenn)\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"turbines = [Untertweng1,Untertweng2]\n",
|
||||
"for turbine in turbines:\n",
|
||||
" turbine.get_info()"
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3.8.13 ('Georg_DT_Slot3')",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
},
|
||||
"language_info": {
|
||||
"codemirror_mode": {
|
||||
"name": "ipython",
|
||||
"version": 3
|
||||
},
|
||||
"file_extension": ".py",
|
||||
"mimetype": "text/x-python",
|
||||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.8.13"
|
||||
},
|
||||
"orig_nbformat": 4,
|
||||
"vscode": {
|
||||
"interpreter": {
|
||||
"hash": "84fb123bdc47ab647d3782661abcbe80fbb79236dd2f8adf4cef30e8755eb2cd"
|
||||
}
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 2
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
,11.4,11.2,11,10.8,10.6,10.4,10.2,10,9.8
|
||||
0,0,0,0,0,0,0,0,0,0
|
||||
0.05,44.6719225,43.934144,43.3914212,43.005945,42.7411852,42.5620659,42.4351104,42.3285595,42.2124611
|
||||
0.1,93.5257218,92.1813802,91.0120507,89.9819869,89.0566946,88.2030946,87.3896575,86.5865116,85.7655241
|
||||
0.15,142.455373,140.502298,138.703994,137.026824,135.438371,133.907593,132.404945,130.902474,129.373898
|
||||
0.2,191.35358,188.792245,186.365298,184.041241,181.789769,179.581903,177.390108,175.188376,172.952294
|
||||
0.25,240.112708,236.946245,233.893698,230.92573,228.014163,225.132101,222.254034,219.355912,216.415204
|
||||
0.3,288.625576,284.85976,281.187353,277.581187,274.01522,270.464644,266.905977,263.31713,259.677456
|
||||
0.35,336.786234,332.429439,328.145567,323.909615,319.697669,315.487006,311.256165,306.985012,302.654777
|
||||
0.4,384.490739,379.553866,374.669505,369.814802,364.967956,360.108307,355.216403,350.274048,345.264331
|
||||
0.45,431.637894,426.134271,420.662881,415.202987,409.734875,404.239922,398.700655,393.100789,387.425251
|
||||
0.5,478.129951,472.075209,466.032607,459.983487,453.910176,447.796055,441.625591,435.384378,429.059145
|
||||
0.55,523.873268,517.285198,510.689413,504.069281,497.409128,490.694283,483.911113,477.047044,470.090565
|
||||
0.6,568.778912,561.677293,554.548395,547.377555,540.151033,532.856054,525.480827,518.014558,510.447451
|
||||
0.65,612.763186,605.169605,597.529525,589.830179,582.059697,574.207132,566.262474,558.216649,550.061519
|
||||
0.7,655.7481,647.685753,639.558081,631.354134,623.063835,614.677994,606.188309,597.587364,588.868614
|
||||
0.75,697.661758,689.155243,680.565018,671.881864,663.097416,654.204159,645.195426,636.065384,626.809013
|
||||
0.8,738.438667,729.51377,720.487263,711.35157,702.099947,692.726469,683.226022,673.594278,663.827671
|
||||
0.85,778.019972,768.703447,759.267942,749.707427,740.016685,730.191293,720.227602,710.122707,699.874419
|
||||
0.9,816.35361,806.672962,796.856534,786.899741,776.798797,766.550685,756.153132,745.604572,734.904109
|
||||
0.95,853.394385,843.377654,833.208949,822.885029,812.403437,801.762466,790.961126,779.999101,768.876705
|
||||
1,889.103974,878.779525,868.287549,857.626044,846.793778,835.790258,824.615682,813.270891,801.757325
|
||||
|
@@ -1,33 +0,0 @@
|
||||
from matplotlib.pyplot import fill
|
||||
import numpy as np
|
||||
from scipy.interpolate import interp2d
|
||||
|
||||
#importing pressure conversion function
|
||||
import sys
|
||||
import os
|
||||
current = os.path.dirname(os.path.realpath(__file__))
|
||||
parent = os.path.dirname(current)
|
||||
sys.path.append(parent)
|
||||
from functions.pressure_conversion import pressure_conversion
|
||||
|
||||
class Francis_turbine_class:
|
||||
def __init__(self,CSV_name='Durchflusskennlinie.csv'):
|
||||
csv = np.genfromtxt(CSV_name,delimiter=',')
|
||||
n_rows,_ = np.shape(csv)
|
||||
self.raw_csv = np.append(csv,np.zeros([n_rows,1]),axis = 1)
|
||||
|
||||
def extract_csv(self,CSV_pressure_unit='bar'):
|
||||
ps_vec,_ = pressure_conversion(self.raw_csv[0,1:],CSV_pressure_unit,'Pa')
|
||||
self.raw_ps_vec = np.flip(ps_vec)
|
||||
self.raw_LA_vec = self.raw_csv[1:,0]
|
||||
self.raw_Qs_mat = np.fliplr(self.raw_csv[1:,1:])/1000. # convert from l/s to m³/s
|
||||
|
||||
def get_Q_fun(self):
|
||||
Q_fun = interp2d(self.raw_ps_vec,self.raw_LA_vec,self.raw_Qs_mat,bounds_error=False,fill_value=None)
|
||||
return Q_fun
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,22 +0,0 @@
|
||||
L = 535 m dn 800 mm
|
||||
478 m dn 1000 mm
|
||||
Ersatzdurchmesser
|
||||
|
||||
h_pipe
|
||||
|
||||
h 851.78 Pegel + Leitungsgefälle
|
||||
Leitungsgefälle: 113
|
||||
|
||||
Fläche 4.25x10.5 + 30m² = 74 m²
|
||||
Pegelminimum: 851.18 m
|
||||
|
||||
Unterwasserpegel 738.56
|
||||
Gesamtfallhöhe = 851.78-738.56
|
||||
|
||||
Rohrreibung: 0.014 f_D = lambda
|
||||
c = 500 m/s
|
||||
|
||||
Q_0 = 100%*0.75+30%*0.75
|
||||
Q_extrem = 30%*0.75
|
||||
|
||||
Q = LA*Q_nenn*sqrt(H/H_n)
|
||||
Reference in New Issue
Block a user