Problem 20       Due 3/23/01

Piping Networks

  In this problem we explore what happens to the
temperature of a shower when you flush a "W.C.," to
use the polite British euphemism.  At Princeton
(unless they have updated the plumbing system since
I was there, anyway) whenever the W.C. got flushed
the temperature of the shower dramatically increased.
The problem was so bad that it was considered polite
to yell out "Flush!" before doing so, so that anyone
in the shower could jump out before being boiled
alive.  Actually, what usually happened was that
the flusher would forget, screams would ensue, and
the flusher would yell out "Sorry" just a little too
late for it to do any good.  In this problem we
explore the design of such a system.

We have the piping network depicted below:

                ******(6)
              **
      ****(2)****
    **           **
(1)*******(3)*******(4)******(5)

In this diagram, (1) is the source of water (far from
the bathroom), the paths 1-2 and 1-3 are the resistances
between the source and the bathroom, (2) is the cold
water node in the bathroom, (3) is the hot water node
in the bathroom, the paths 2-4 and 3-4 are the cold
and hot water shower valve resistances, (4) is the
mixer in the shower pipe (a node), (5) is the shower
itself (or the person being boiled), (6) is the W.C.,
the path 2-6 is the W.C. valve, and the path 4-5 is
the resistance due to the shower head (usually a low
flow rate beast with high resistance).

   There are three separate streams whose flow rate
needs to be determined.  They are Qt (the W.C. flow
rate), Qh (the hot water shower rate), and Qc (the
cold water shower rate.  If the temperature of the 
hot water is Th and the cold is Tc, then the temperature
of the shower is just:

Ts = (Qh*Th + Qc*Tc)/(Qh + Qc)

   We can solve this problem easily if we remember that
the pressure head loss along any path connecting two
nodes must be the same.  Thus we get the three eq'ns:

dptot= dp12 + dp26
dptot= dp13 + dp34 + dp45
dptot= dp12 + dp24 + dp45

  The pressure drops on each of the paths depend on
the square of the flow rate along that path.  Thus:

dp12= sign(qt+qc) * r12 * (qt + qc)^2;
dp13= sign(qh) * r13 * (qh)^2;
dp24= sign(qc) * r24 * (qc)^2;
dp26= sign(qt) * r26 * (qt)^2;
dp34= sign(qh) * r34 * (qh)^2;
dp45= sign(qh+qc) * r45 * (qh + qc)^2;

  One would usually expect all of the flows to go
from the left to the right.  For some values of
the resistances this will not be the case, and hot
water from the shower will actually flow backwards
through the cold water path 2-4 into the W.C. as well
as boiling the person in the shower!  To get this
part right you have to look at the direction of the
flow in determining the sign of the pressure drop.
The above expressions take this into account.  Note
that if Qc is negative, the expression for the temp
of the shower is incorrect, and the shower temp will
just be Th.

  We now give a few numbers:
dptot=50

th=125
tc=60

r12=20;
r13=20;

r24=20;
r34=5;

r45=10;

and, finally, the resistance for the W.C.:

If closed, r26 = infinity (say 10^10)
If open, r26 = 10

  The units of the above are a bit arbitrary, but
you can take the pressure to be in psig, the temps
to be in degrees F, and the resistances to be in
units of psig/(gal/min)^2.

  Write a Newton's method routine to calculate the 
temperature of the shower when the W.C. valve is
closed, and when it is open.  Show that if the
resistances from the source to the bathroom r12
and r13 are reduced the effect diminishes alot.  
This is why Princeton should replace its water
pipes!

  To make life alot easier, try taking the
derivatives to make up the Jacobian via a finite
difference scheme.  Write a separate matlab function
which returns as a vector the three equations whose
roots you are trying to find as a function of the
three element array of flow rates.  Then compute
the derivatives by changing the flow rates slightly
and recomputing the function values.  This is alot
easier than writing out each of the 9 derivatives
by hand!  Using a center difference technique it is
possible to compute the Jacobian in only a few lines
of matlab code.