M2-1 2023

pdf

School

University of British Columbia *

*We aren’t endorsed by this school

Course

303

Subject

Mechanical Engineering

Date

Apr 3, 2024

Type

pdf

Pages

8

Uploaded by ColonelKnowledge9001

Report
Name: Amanda Braunstein Markman Student Number: 63481444 1 CIVL 303 – Assignment M2-1 1. PYTHON (Streamline around a cylinder) a. The maximum velocity due to an incident velocity of 1m/s is 2.0 m/s. It is exhibited by the streamline plot, which shows specific colours as a function of the intensity of speed. b. The maximum velocity due to an incident velocity of 0.5m/s is 1.0 m/s. It is exhibited by the streamline plot, which displays certain colours as a function of speed intensity. c. The maximum absolute velocity occurs in four locations due to the geometry of the uniform flow and the location of the cylinder where the epicentre is located at the origin. The cartesian maximum velocity (X = 0 , Y = -40) and (X = 0, Y= -40), and the polar coordinates for the maximum velocity (X = 40, Y= PI/2) and (X= 40, Y= 3PI/2).
Name: Amanda Braunstein Markman Student Number: 63481444 2 d. When the grid size changes, the plot becomes harder to see. This is a plot with grid size of 50 units. e. The magnitudes of the velocities are observed to be discrete increments of change, with the intensity scale labelled on the side.
Name: Amanda Braunstein Markman Student Number: 63481444 3 2. EPANET a. The junctions 3,4,5 and 6 all have the capacity for the PHD. b. The percentage of the day in which junction 4’s pressure is above 50 psi is not enough to install a fire hydrant since only 41.6% of the day is above 50psi (10 hours / 24 hours * 100% = 41.6%)
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Name: Amanda Braunstein Markman Student Number: 63481444 4 c. The elevation of Node 9 connecting Node 6 by 3000ft 10’’ pipe at a slope of 0.8% is given by the following relation: 𝑧 𝑁𝑜?? 9 = 𝑧 𝑁𝑜?? 9 + 3000 ( 0.8 100 ) = 674 𝑓𝑡 The pressure was only over 50 psi for 17 hours out of 24 hours*100, or 70.83% of the day, as seen in the table below. Consequently, the conditions won't be satisfied. Below are the junction 9 graph and table. Full Network Schematic is shown below:
Name: Amanda Braunstein Markman Student Number: 63481444 5 APPENDIX # -*- coding: utf-8 -*- """ Created on Sat Nov 4 13:59:11 2023 @author: amand """ import numpy as np import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec def calculate_velocity(R, S_flow, x_range, y_range): X, Y = np.meshgrid(x_range, y_range) U_numer = (R**2 * (Y**2 - X**2) + (X**2 + Y**2)**2) U_denom = (X**2 + Y**2)**2 U = S_flow * U_numer / U_denom V_numer = 2 * R**2 * X * Y V_denom = (X**2 + Y**2)**2 V = S_flow * V_numer / V_denom U[np.sqrt(X**2 + Y**2) < R] = np.nan V[np.sqrt(X**2 + Y**2) < R] = np.nan Z = np.sqrt(U**2 + V**2)
Name: Amanda Braunstein Markman Student Number: 63481444 6 Z = np.nan_to_num(Z) max_velocity = np.max(Z) return X, Y, U, V, Z, max_velocity def plot_streamlines_and_contours(X, Y, U, V, Z, title, xlabel, ylabel): fig = plt.figure(figsize=(10, 10)) gs = gridspec.GridSpec(nrows=3, ncols=2, height_ratios=[1, 1, 1]) ax = fig.add_subplot(gs[0, 1]) stream = ax.streamplot(X, Y, U, -V, density=1, arrowsize=1, linewidth=1, minlength=0.2, color=Z, cmap=plt.cm.rainbow) plt.title(title, fontsize=16) plt.xlabel(xlabel, fontsize=10) plt.ylabel(ylabel, fontsize=10) fig.colorbar(stream.lines, label="Streamline Velocities (m/s)") pier = plt.Circle((0, 0), radius=R, fc='grey') plt.gca().add_patch(pier) plt.show() # Q 1 a) R = 40 S_flow_a = 1 x_range = np.arange(-100, 101, 1) y_range = np.arange(-100, 101, 1)
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Name: Amanda Braunstein Markman Student Number: 63481444 7 X_a, Y_a, U_a, V_a, Z_a, max_velocity_a = calculate_velocity(R, S_flow_a, x_range, y_range) plot_streamlines_and_contours(X_a, Y_a, U_a, V_a, Z_a, "Flow Lines of Water around a Pier (a)", "X Direction (m)", "Y Direction (m)") # Q 1 b) S_flow_b = 0.5 X_b, Y_b, U_b, V_b, Z_b, max_velocity_b = calculate_velocity(R, S_flow_b, x_range, y_range) plot_streamlines_and_contours(X_b, Y_b, U_b, V_b, Z_b, "Flow Lines of Water around a Pier (b)", "X Direction (m)", "Y Direction (m)") # Q 1 c) # The graphs are from a and b for this part # Q 1 d) x_range_d = np.arange(-100, 101, 50) y_range_d = np.arange(-100, 101, 50) X_d, Y_d, U_d, V_d, Z_d, max_velocity_d = calculate_velocity(R, S_flow_a, x_range_d, y_range_d) plot_streamlines_and_contours(X_d, Y_d, U_d, V_d, Z_d, "Flow Lines of Water around a Pier (d)", "X Direction (m)", "Y Direction (m)") # Q 1 e) x_range_e = np.arange(-100, 101, 1) y_range_e = np.arange(-100, 101, 1)
Name: Amanda Braunstein Markman Student Number: 63481444 8 X_e, Y_e, U_e, V_e, Z_e, max_velocity_e = calculate_velocity(R, S_flow_a, x_range_e, y_range_e) fig = plt.figure(figsize=(10, 10)) contour = plt.contourf(X_e, Y_e, Z_e, 10) plt.title("Color Contours of Flow Lines around a Pier (e)", fontsize=16) plt.xlabel("X Direction (m)", fontsize=10) plt.ylabel("Y Direction (m)", fontsize=10) plt.colorbar(contour, label="Streamline Velocities (m/s)") plt.show()