first try at fixing convergence issues at turbine
This commit is contained in:
@@ -42,7 +42,7 @@
|
||||
"\n",
|
||||
"\n",
|
||||
"# pipeline\n",
|
||||
"L = 535.+478. # length of pipeline [m]\n",
|
||||
"L = (535.+478.) # length of pipeline [m]\n",
|
||||
"D = 0.9 # pipe diameter [m]\n",
|
||||
"A_pipe = D**2/4*np.pi # pipeline area\n",
|
||||
"h_pipe = 105 # hydraulic head without reservoir [m] \n",
|
||||
@@ -51,7 +51,7 @@
|
||||
"f_D = 0.014 # Darcy friction factor\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",
|
||||
"nt = 4500 # number of time steps after initial conditions\n",
|
||||
"nt = 9000 # number of time steps after initial conditions\n",
|
||||
"\n",
|
||||
"# derivatives of the pipeline constants\n",
|
||||
"dx = L/n # length of each pipe segment\n",
|
||||
@@ -184,6 +184,7 @@
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"error_vec = np.zeros_like(t_vec)\n",
|
||||
"# loop through time steps of the pipeline\n",
|
||||
"for it_pipe in range(1,pipe.nt+1):\n",
|
||||
"\n",
|
||||
@@ -218,6 +219,7 @@
|
||||
" p_boundary_tur[it_pipe] = pipe.get_current_pressure_distribution()[-1]\n",
|
||||
" v_boundary_res[it_pipe] = pipe.get_current_velocity_distribution()[0]\n",
|
||||
"\n",
|
||||
" error_vec[it_pipe] = abs(v_boundary_res[it_pipe]-V.get_current_outflux()/A_pipe)\n",
|
||||
"\n",
|
||||
" # perform the next timestep via the characteristic method\n",
|
||||
" pipe.timestep_characteristic_method()\n",
|
||||
@@ -288,6 +290,26 @@
|
||||
"fig2.tight_layout()\n",
|
||||
"plt.show()"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 10,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/plain": [
|
||||
"[<matplotlib.lines.Line2D at 0x1ac81d70af0>]"
|
||||
]
|
||||
},
|
||||
"execution_count": 10,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"plt.semilogy(t_vec,error_vec)"
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
|
||||
Reference in New Issue
Block a user