Mathematics 263                                 Laboratory 9                                    November 17, 1993
	  
Name: _____________________________   Lab Partner: ___________________________
	  
Consulted with:  ____________________________________________________________

Storage Tank Design*

*This laboratory is adapted from:  "Storage Tank Design," by L. J. Gray, SIAM Review, 33, #2 (1991), pp. 271–274.

The object of this lab is to find the volume of fluid in a storage tank used at a chemical processing plant given the level of the fluid in the tank.

Part 1:  Setting up the Problem (No Computer)

The storage tank consists of a cylindrical pipe of radius r and length L that has been elevated to an angle q from the horizontal (See Figure 1 below).  The piped is capped at both ends.  The operator must be able to continuously monitor the volume of fluid in the tank, and the easiest measurement is the level of the fluid, indicated by h in Figure 1.  In order to design a gauge that takes the quantity h as input and gives the volume of the tank as its readout, one must find a function V(h) that will give the volume as a function of fluid height.  (The values of r, L, and q are constants when working with any particular tank.)

From this figure we can see that, if q is a small angle and the length L is short, the fluid level can intersect the left cap and the right cap of the tank.  On the other hand, for large angles and long lengths, the fluid level will always be above the left cap when it intersects the right cap.  Find a relationship between q, L and r that characterizes tanks for which the fluid level can intersect both caps at once.  (This isn't trivial, but think about the "transition case" when the level intersects the bottom of the right cap and the top of the left cap.  Draw a picture, and you can figure it out.)  Write your relationship below.

We will assume that the dimensions of our storage tank satisfy this relationship. Notice that in the "natural" coordinate system used in Figure 1, the equation for the plane indicating the fluid level is simple (z = h), but the equation for the cylindrical walls of the tank is not obvious (and is complicated).  We will introduce a new system of coordinates that makes the cylinder's (the more complicated object's) equation easier, although the fluid level's equation will become more complicated.  In the coordinate system will use to solve the problem, the cylinder will be horizontal, with the y-axis falling along its bottom (See Figure 2).

Find the equation for the cylinder in these new coordinates.  Find the equations for the left cap and the right cap as well. Write the three equations below. (The equations depend on the constants r and L as well as the variables x, y, and z.)

If we call the coordinates of Figure 1 (x', y', z'), the new coordinates (x, y, z) are related to the old ones by the equations

Use these equations to find the new coordinates for the labeled point in Figure 1.  Also, find the normal vector for the fluid level.  Use these pieces of information to find the equation for the plane containing the fluid level in the new coordinates. Write all three answers below.

Now we have equations for all the surfaces that bound the fluid in the tank.  We wish to integrate the constant function 1 over the region in space filled by the fluid to find its volume.

Part 2: The Integral: Case (a)

Consider first the case when the tank is nearly empty, and the fluid level is so low that it doesn't intersect the right cap of the tank. This case is shown in Figure 2(a).  We will set up the integral using dV = dx dy dz.  The cylinder forms the front and back walls of the region containing the fluid. Solve the cylinder's equation for the variable x to find the limits of integration.  Write them below.

Now consider the outline of the region containing fluid in the yz-plane.  Sketch the region below, and label its boundaries.

From your sketch,  set up the remaining limits of integration.  Remember, we want to integrate dy dz.  Write the full triple integral below.

Insert your limits into the command given here, and evaluate it.  (This may take a few minutes, especially on the older machines.)  Give q the name th in Mathematica, or the command after this one won't work.

vol = Integrate[1,{y,ymin,ymax},{z,zmin,zmax},
                  {x,xmin,xmax}]

It is hard to see that this result is a function of h, with so many constants in the expression.  Consider the case of a tank with r = 3 meters, L = 8 meters, and q = π/6 radians.  The following command substitutes in these values.

V1[h_] = Simplify[N[ vol /. {r->3, L->8, th->Pi/6} ]]

Write the results of your integration, and the function V1(h) below.

Finally, for what values of h does this integral give the volume of fluid in the storage tank?  Remember our assumption that we are treating case (a) in Figure 2.  Give your answer in terms of q, L and r.

Figure out the limits on h for the function V1(h), and plot the function over that domain.

Part 3:  Cases (b) and (c)

Set up and evaluate the integral for case (b) in Figure 2.  Once you have evaluated the integrals, substitute in the specific values given above for the dimensions of the storage tank.  Determine the range of h values for which each integral is valid, and plot the particular function over that interval.  Next treat case (c).  (There is an easy way.)  Prepare your results in a summary you could hand to an engineer designing the gauge circuitry that will execute the volume function.

Technical Report

Finding the volume of a storage tank from the fluid level

We seek a closed form for the volume of fluid contained in a storage tank based on the height of the fluid above the lowest point in the tank.  The geometry of the tank is shown in Figure 1 of the lab handout.  We assume that the cylindrical tank has radius 3 meters, length 8 meters, and is inclined from horizontal by an angle of π/6. Our work shows the vloume can be defined as a function of the height h by cases:

If the height is no more than 4 meters (h ≤ 4), the volume is:

If the height is between 4 and 3√3 ≈ 5.19615 (4 ≤ h ≤ 5.19615), then the volume is:

Finally, if the height is between 3√3 and 4 + 3√3 ≈ 9.19615 (5.19615 ≤ h ≤ 9.19615) then the volume is:

As a check of the accuracy of these functions, I plotted them over the entire range of heights (0 ≤ h ≤ 9.19615).  The plot below shows that the functions met smoothly at the end points.

Below are the Mathematica calculations that substantiate these definitions.

vol = Integrate[1,{z,0,h/Cos[th]},{y,0,(h - Cos[th]z)/Sin[th]},
            {x,-Sqrt[r^2 - (z - r)^2],Sqrt[r^2 - (z - r)^2]}]

V1[h_] = Simplify[N[ vol /. {r->3, L->8, th->Pi/6} ]]

plot1 = Plot[V1[h],{h,0,4}];

vol2 = Integrate[1,{z,0,(h - Sin[th]L)/Cos[th]},
           {y,0,L},
           {x,-Sqrt[r^2 - (z - r)^2],Sqrt[r^2 - (z - r)^2]}] +
       Integrate[1,{z,(h - Sin[th]L)/Cos[th],h/Cos[th]},
           {y,0,(h - Cos[th]z)/Sin[th]},
           {x,-Sqrt[r^2 - (z - r)^2],Sqrt[r^2 - (z - r)^2]}]

V2[h_] = Simplify[N[Expand[ vol2 /. {r->3, L->8, th->Pi/6} ]]]

coef1 = Coefficient[V2[h],(5.196152422706632*h - 1.*h^2)^(1/2)]

coef2 = Coefficient[V2[h],
(-36.78460969082653 + 13.19615242270663*h - 1.*h^2)^(1/2)]

coef3 = Coefficient[V2[h],
ArcTan[(6.598076211353316 - 1.*h)/
 (-36.78460969082653 + 13.19615242270663*h - 1.*h^2)^(1/2)]]

coef4 = Coefficient[V2[h],
ArcTan[(1.154700538379252*((5.196152422706632 - 1.*h)*h)^(1/2)*
(-3. + 1.154700538379252*h))/
(-6.928203230275508*h + 1.333333333333333*h^2)]]

coef5 = V2[h] - coef1 (5.196152422706632*h - 1.*h^2)^(1/2) - 
coef2 (-36.78460969082653 + 13.19615242270663*h -
1.*h^2)^(1/2) -
coef3 ArcTan[(6.598076211353316 - 1.*h)/
(-36.78460969082653 + 13.19615242270663*h - 1.*h^2)^(1/2)] -
coef4 ArcTan[(1.154700538379252*((5.196152422706632 -
1.*h)*h)^(1/2)*(-3. + 1.154700538379252*h))/
(-6.928203230275508*h + 1.333333333333333*h^2)]//Expand

N[coef5 + coef1 (5.196152422706632*h - 1.*h^2)^(1/2) + 
coef2 (-36.78460969082653 + 13.19615242270663*h -
1.*h^2)^(1/2) +
coef3 ArcTan[(6.598076211353316 - 1.*h)/
(-36.78460969082653 + 13.19615242270663*h - 1.*h^2)^(1/2)] +
coef4 ArcTan[(1.154700538379252*((5.196152422706632 -
1.*h)*h)^(1/2)*(-3. + 1.154700538379252*h))/
(-6.928203230275508*h + 1.333333333333333*h^2)]]

plot2 = Plot[V2[h],{h,4,3Sqrt[3]}];

N[3Sqrt[3]]

V3[h_] = Simplify[N[ 72Pi - V1[4 + 3Sqrt[3] - h] ]]

plot3 = Plot[V3[h],{h,3Sqrt[3],3Sqrt[3] + 4}];

Show[plot1,plot2,plot3,AxesLabel->{"h","Volume"}];