Thursday, June 14, 2012

(06xx2012) Water Leakage Analysis


Purpose:

Since the pressure chamber is suffering from water leakage, it will be useful to analyze the area of the leakage  the purpose of this program is to present an automatic analysis on the severity of leakage.




import java.util.*;
public class flowrate 

{

    public static void main (String[] args)
    {
     
     
     double height, volume, time, diameter, rate, velocity, area;
     
     
     
     Scanner scan = new Scanner (System.in);
     
     int choice;
     
     
     System.out.println("This program will provide calculation for the severity of the leakage around the given parameter: ");
     
     System.out.println("1. Lid: ");
     

     System.out.println("2. Leakage around user defined height: ");
     
     
     choice = scan.nextInt();
     
     
     if (choice == 1)
     {
      
      System.out.println("Please indicate the height of water: ");
      height = scan.nextDouble();
      System.out.println("Please indicate the time it takes to drain the pipe: ");
      time = scan.nextDouble();
      System.out.println("Please indicate the diameter of pipe: ");
      diameter = scan.nextDouble();
      
      
      volume = (diameter / 2) * (diameter / 2) * Math.PI;
      
      rate = volume / time;
      
      
      
      
      velocity = Math.sqrt(2*9.81*height);
      
      
      area = rate / velocity;
      
      
      System.out.println("The area of the leakage is around: " +area +"cm square");
      
      
      
      
      
     } 
     
     
     
     
     
    }
 
 
 





public static void waiting (int n)
{
    
    long t0, t1;

    t0 =  System.currentTimeMillis();

    do{
        t1 = System.currentTimeMillis();
    }
    while (t1 - t0 < n);
}

}



(06xx2012) Testing V

Purpose:

After we have secure a majority of water leakage by applying the inner tube configuration we tested a new pressure sensor. Unfortunately we experienced a structural failure on the lid after achieving 60kPa of pressure. We have recorded the pressure in the following video and graph.


Video:


Figure 1: Pressure vs Time 



Figure 2: Pressure vs Time on different interval




Analysis and Uncertainty


Table 1: Recorded Pressure and Height
Pressure (kPa)
Height (m)
61.5 ± 5
6 ± 0.3




Figure 3: Pressure vs Time with Linear Fitting



We have recorded a maximum pressure of 61.5 kPa and a corresponding height of 6 meter, by the equation:
 P = P0 + ρgh
We should get:
P/h = ρg

Therefore we can compare experimental ρg with theoretical value

Table 2: Comparison of Experimental and Theoretical Data
Experimental ρg (N/m3)
Theoretical ρg (N/m3)
Error (%)
10250 ± 488
9810
4.49%


Uncertainty = Largest value of ρg - smallest value of ρg

Our experimental uncertainty is within the range with the theoretical value. Our experimental value is also within 5% of the theoretical value.

We attribute our errors to the pressure sensor. The pressure sensor that we utilized in this project is design for gas pressure and not for fluid and therefore we believe that the majority of our error can be attributed to the sensor.


A theoretical model is provide below:



from pylab import *
import re

x = arange(0,1,.01)
y = 101325*x/(9810)

plot(x,y)

xlabel('Pressure (atm)')
ylabel('Depth (m)')


title(r'$Pressure(h)$')


show()




Figure 4: Theoretical Height vs. Pressure





(06xx2012) Testing IV


Purpose:

This is a pilot test to examine the integrity and strength of the entire design.




Figure1: Apparatus Configuration


Figure 2: Deformation of Water Pressure


Figure 3: Deformation on the Piping



Figure 4: Perspective of the Deformation


Conclusion:

We discovered that the structural strength of the lid is not able to withstand an addition of one atmosphere.





(06xx2012) Computational Model: Pressure Change

Purpose: 

Due to cohesion and adhesion properties of water, a container of water does not level off at the breaking point between gas and liquid. Instead, it forms a parabolic shape around the breaking point known as meniscus. The small change in height can cause a change in pressure, therefore it is necessary to account for these behaviors.





Figure 1: A view of cohesion properties in water and Mercury



Figure 2: Reading of Meniscus




Solution:


One way of accounting the pressure change is to make a triangle approximation of the change in height. The volume of the parabola would be accounted by using a triangle rotating around z - axis. This will create a larger pressure change, as x*tan15 > x2  for values around zero, and we justify this by arguing that the integrity of a structure should account for at least five percent change around threshold for force and pressure.

Below is a visual representation of the triangle approximation.


from __future__ import division>
from visual import *
from time import clock







tri = Polygon( [(-20,0), (0,0.267949192*20), (0,0)] )




"""

p = paths.circle( pos=(10,4,2), radius=10 )
#tri=shapes.triangle(pos=(0,2), length=4)


extrusion(pos=p, shape=tri, color=color.yellow)


"""

tri = Polygon( [(-3,0), (0,0.267949192*3), (0,0)] )




p = paths.circle( pos=(0,0,-10), radius=10 )
#tri=shapes.triangle(pos=(0,2), length=4)


extrusion(pos=p, shape=tri, color=color.yellow)




Figure 3: Simulated meniscus using triangle rotating around z - axis


Analysis and Uncertainty:

The triangle approximation can be mathematically expressed by :

y = x * tan(θ)
x = the radius of the circle
θ = to the angle of elevation from the lowest point of meniscus to the highest point of meniscus


The theoretical change of height is approximated by a parabola :

y = x4
or
y = x2


The uncertainty for this approximation would therefore be expressed by:

Δy = x * tan(θ) -  x2


% error = {(x * tan(θ) -  x2) / x2} * 100



The uncertainty remain small for small values of x, and our approximation is justified.




Sunday, June 3, 2012

(06xx2012) Meniscus Simulation Attempt



This is a programming attempt to deal with the visual simulation of a meniscus using python xy

Below is the coding:





from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
import numpy as np

fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
"""
u = np.linspace(0, 2 * np.pi, 100)
v = np.linspace(0, np.pi, 100)
"""


x = arange(1,2,0.5)
y=2
z=3

ax.plot_surface(x, y, z,  rstride=10, cstride=10, color='b')

plt.show()


"""
x = 0 to r

y = 0 to r

z = sqrt x^2 + Y ^2



x = 10 * np.outer(np.cos(u), np.sin(v))
y = 10 * np.outer(np.sin(u), np.sin(v))
z = 10 * np.outer(np.ones(np.size(u)), np.cos(v))

"""


(05312012) Computation Model: Pressure vs Depth



One of the goal of this project is to provide a computational model that describes the behavior of our apparatus. In this program I have set up the theoretical depth needed to achieve in order to acquire a pressure of 2 atmosphere.The development is relatively simple as I just implement the equation P = P0 + ρgh into the coding.
 


Figure 1: Pressure versus Depth







// Comment
from pylab import *
import re

x = arange(0,10.3,.01)
y = 1+(9810*x/101325)

plot(x,y)

xlabel('Depth (m)')
ylabel('Pressure (atm)')

"""
title(r'$Pressure Depth$')
"""

title(r'$Pressure(h)$')
"""
k = re.sub(r"(\w)([A-Z])", r"\1 \2", "WordWordWord")
title(r'$re.sub(r"(\w)([A-Z])", r"\1 \2", "WordWordWord")$')
"""



show()

(05202012) Blog Formatting Tool

Formatting codes in blogs can be really tedious and confusing as program code syntax differs greatly from daily speech. Therefore I have being trying to resolve this problem since I begin the computational aspect of the project. Fortunately, solutions to resolved the problem has already existed on the internet. I have implemented one of the many solutions provide on the net to perfect the blog, so if anyone would like to contribute to the computational model in the future, please use this page as a reference. All credit goes to craftyfella


http://www.craftyfella.com/2010/01/syntax-highlighting-with-blogger-engine.html



// Comment
public class Testing {
public Testing() {
}
 
public void Method() {
/* Another Comment
on multiple lines */
int x = 9;
}
}

(05xx2012) Construction

Purpose:

We started the lid construction by modifying pvc pipes and sanding off the edges for fitting. We followed the design as displayed below




Figure 1: Modification on the length of pvc

  • First we modified the pvc by cutting the unwanted parts.




Figure 2: Preparation for the modification





Figure 3: Cutting the PVC




Figure 4: PVC modification





Figure 5: Sanding of PVC

  • We sand the pvc to make sure not to obstruct the fitting 



Figure 6: Sanding of PVC to ensure fitting




Figure 7: Lid Assembly

  • We construct the lid  piping by joining the water piping with a joint that connects to a t-shape pvc


Figure 8: Preliminary testing of Pressure Chamber


  • We test the basic function of the assembly and found that the pvc is water tight but the lid is not



Figure 9: Two meter configuration 


Conclusion:

We have started to modifying the pvc pipe and attached it to the lid assembly. We also tested the integrity of the entire system and found that the pvc is water tight.

temp constuction 1


Purpose:

We finalized the design, and beginning testing the concepts and fundamentals of the project.



Figure 1: Finalized design

Figure 2: Finalized design and lid assembly components


Figure 3: Components of Pressure Sensor



Figure 4: Bulk Head fitting

Figure 5: Pressure Sensor testing

Figure 6: Testing on the concepts of the project

Conclusion:

We finalized our design and perform a preliminary test.