Water Rocket 3 - Program "rockfor"

Consider the three forces applied to the rocket leading to the upward acceleration, the upward velocity and finally the height attained. These are the thrust force Fthrust, the frictional drag force Fdrag, and the weight of the rocket, as shown in the diagram below. In this exercise we wish to determine the upward velocity of the rocket throughout its flight.

We first summarize the relevant equations developed in the first exercise in Page 1 and Page 2 of the Analysis section. Note that all of this analysis is relevant to the upwards thrust phase of the rocket flight, while the water is being exhausted through the nozzle by the compressed air.

The basic rocket force equation:

The thrust force in terms of the water expelled through the nozzle:

Bernoulli's equation, relating the pressure applied by the compressd air to the velocity of the exhausting water:

Note that the resulting thrust force is twice the pressure difference times the nozzle area:

The adiabatic expansion process relating the pressure to the volume of the compressed air, which was developed in the section on Adiabatic Expansion Analysis:

The volume variation of the compressed air due to the water escaping through the nozzle is given by:

We now continue with the analysis in order to resolve the various items in equation 1 above

The total mass of the rocket (ignoring the mass of the compressed air) is given by:

The frictional drag force is given by:

where:
Cd - the coefficient of drag for the rocket (reflecting streamlining, surface roughness etc.)
Abottle - the projected area of the rocket normal to the direction of flight [m2]
- the density of the outside air [assume = 1.2 kg/m3]
u is the upwards velocity [m/s]
Note the construct
u |u|, (u multiplied by the absolute value of u). This is to ensure that the drag force will always be opposed to the upward velocity, whether positive or negative, while retaining the magnitude u2.

Thus we can now evaluate the acceleration by rewriting equation 1 above as follows:


where:
a is the upwards acceleration of the rocket [m/s2]
Note that equation 10 is valid for the thrust phase. During the projectile phase when all the water has been exhausted
Fthrust = 0 and the mass m reduces to Ms - the mass of the rocket solid parts (shell + payload).

Equation 10 is the differential equation for the upward velocity of the rocket as a function of time t. It cannot be solved explicity since the velocity u is deeply embedded in a nonlinear manner in the equation, hence we resort to a numerical solution. Once again we replace the derivative by a first order difference method, as follows:

This leads to the algorithm for evaluating the velocity as a function of time as the basis for the new method findvelo as follows:

The Computer Program "rockfor"

There are two separate issues to be resolved in this week's program exercise:

In the previous program rockvol we used the while loop to do the numerical integration - however in this program we will use for loops in both the main function and the new method findvelo, as shown in the structure diagram below. Both loops are counter controlled rather than conditional, for which the for loop is more suited.

A typical execution is shown below, with the input data shown in italics. Please be sure to enter your data in the same order as this solution shown below (which is available to test in the programs directory of condor) since the exercises are checked automatically using a data file for input. Your source code solution named rockfor.cpp together with your header file named rockfor.h should be in your home directory before 10:00 am of the due date.

Values to define a new water rocket [Nielsen values]:
enter rocket + payload solid mass in grams [120]
43
 value entered is 43grams
 enter total volume in cc [1250]
591
 value entered is 591 cc
enter diameter of nozzle in cm [0.9]
0.4
 value entered is 0.4cm
enter fill ratio (water/total volume) [0.35]
0.3
 value entered is 0.3
enter charge gage pressure in atm [5]
4
 value entered is 4atm
enter drag coefficient Cd [0.3]
0.3
 value entered is 0.3
enter outside diameter of bottle in cm [11.3]
8
 value entered is 8cm
Water rocket initialized as follows:
Solid mass[gm]: 43, total volume[liters]: 0.591
absolute charge pressure[kPa]: 500
initial air charge volume[liters]: 0.4137
Nozzle free flow area [sq.cm]: 0.125664
Bottle cross sect. area [sq.cm]: 50.2655
Density - water: 1000kg/m^3, outside air: 1.2kg/m^3
Ratio of specific heat capacities for air (k): 1.4
Drag coefficient: 0.3
gravity acceleration: 9.807m/s^2
enter the max time to test (sec)
6
value entered is 6(s)
enter the number of points to evaluate
21
21 points entered
   time(s)     velocity(m/s)
      0.00           0.00
      0.30          11.66
      0.60          29.60
      0.90          22.44
      1.20          17.02
      1.50          12.72
      1.80           9.05
      2.10           5.70
      2.40           2.69
      2.70          -0.30
      3.00          -3.21
      3.30          -6.01
      3.60          -8.60
      3.90         -10.97
      4.20         -13.01
      4.50         -14.69
      4.80         -16.10
      5.10         -17.33
      5.40         -18.24
      5.70         -19.00
      6.00         -19.58

Wow - 29.6 m/s maximum velocity in 0.6 seconds? That's 67 mph!