Graphics Reference
In-Depth Information
pressure is calculated as shown in Equation (12.2), where p is the density of the fluid, g
represents gravity, and p 0 is atmospheric pressure:
(12.2)
With the pressure in each column available, we can calculate a delta pressure be-
tween two neighboring columns. The delta pressure is then applied across the virtual pipe
between the two columns, which causes acceleration of the fluid flow through the pipe. If
there is a large pressure delta across the pipe, the acceleration is greater than that from a
small delta. This relationship is shown in Equation (12.3), where c is the cross section of
the virtual pipe connecting columns and m is the mass of the fluid in the column, which can
be calculated from the volume of the fluid and its density:
(12.3)
If we assume that the flow through the pipe is constant over a time interval, the flow
through the virtual pipe can be calculated as shown in Equation (12.4), where Q is the flow
through the pipe:
(12.4)
This can be used to calculate the total flow through every virtual pipe, which es-
sentially specifies the total change in volume in a fluid column for a given period of time
when all pipes for a fluid column are considered together. This is demonstrated in Equation
(12.5), which uses an average of the previous and current flow rates over each virtual pipe:
(12.5)
With a change in volume available to us, we can use Equation (12.1) to determine the
change in height for a water column. This is ultimately what drives the entire simulation—
a difference in fluid heights between neighboring col-
umns causes a fluid flow between them, which ulti-
mately causes a fluid flow between columns, which
subsequently alters the volume of the fluid in the col-
umns and their corresponding heights. The process is
repeated over and over again to deliver a time varying
simulation that provides realistic changes in the sur-
face of the fluid. A sample pair of neighboring col-
umns is provided in Figure 12.2, which visually shows
the parameters of our equations.
Figure 12.2. A graphical depiction
of the important parameters in our
simulation.
Search WWH ::




Custom Search