Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations The Obturator on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mathematical model for flow in interconnected tanks 1

Status
Not open for further replies.

mecheng050

Mechanical
Oct 24, 2007
9
Hello there! This is one of my first posts on this forum, I usually figure out engineering problems myself but this time I am facing a strange situation with a series of interconnected containers all exchanging water.

I am explaining:

There is, lets say 5 containers all the same size, same volume standing side by side (Imagine cylindrical storage tanks). All containers are tied together by a common drain and each container is connected to the neighbor containers by small pipes.

The purpose of the piping is to allow water being collected into any container to be discharged to all other containers and prevent overflooding.

Now lets say we flood a container (it could be any of them) at a faster rate than what the piping can drain, the water level in this container will raise and when we stop filling this container, the level will drop down due to water being drained to all other containers.

My goal is to develop a mathematical model to plot the water level in individual containers VS time for a certain inflow (GPM) and determine if the container being filled will overflow before the water is drained to other containers.

So far I developped a ODE for the container being filled and also developped flow balance equations taking into account every port or inlet/outlet of every containers. I also developed a ODE for every container before & after the container being filled. I wonder if its necessary.


The ODE for the container being filled looks like this:

delta_v/delta_t = -outflow + inflow

where inflow is the inflow, and outflow is the sum of all ports assumed to be discharging.

delta_v = delta_h * w * d (where w & d are the width & depth of the container).

Isolating delta_h/delta_t will give an ODE for the container being filled.


NExt I formulated flow balance equations for all containers using parametric form (i.e. N being the filled container and N-1 being the previous container, and N+1 being the next one....) because there could be up to 20 containers side by side...

All pipe friction losses to be ignored.

Just to be sure I am on the good road, what you guys would do? See the attached sketch it will help to

understand. Arrows indicate bi-directional pipes so water can flow in either directions...

Thanks!!
 
Replies continue below

Recommended for you

If you ignore resistance to flow (including friction), then the problem is trivial--any liquid flowing in will immediately flow out at the inflow rate if it is not constrained. Outflow increases without bound if there is no constraining force.

David
 
I agree. I realize I did not explain very well what I was searching to do. Of course, no restrictions the flow will be as high as the inflow is... Same with hydraulics: no resistance no pressure.

I guess I need to consider viscous forces as well as inertia forces. Piping losses could be taken into account. Thats not a big concern, once I have my working mathematical model I will include pipe losses into it.

Do you have a suggestion for me? :)

Thanks!!
 
unless this is a homework problem, it seems unlikely that you would rely on a theoretical determination of a maximum flow rate and level rather than design the system properly. Make the interconnecting pipes larger diameter than then the inflow pipe. Install level sensors in each tank. Adjust the fill rate so that the tanks do not overflow. Provide a valve to reduce the fill rate if necessary. How about connecting the inflow pipe to a manifold so that water does not have to flow through the tanks but through the manifold instead?
 
Hey cvg, thanks for your reply!

its not really a homework problem as the system is already put in place and I am looking in getting a model to apply to different case scenarios.

You suggestions are interesting but would not likely apply as for example, the inflow is actually the sum of rain and pipe burst that could occur, releasing important amount of water...

Thats why I cant assume a distribution header.
 
Still trivial. If they all have skyward openings equal to the container x-sectional area and are all filling with rainwater, they all fill at the same rate (within reason), hence there is no variation in liquid level, and consequently, no flow between vessels.

But to follow along with your intention to solve the general case and perhaps only filling one vessel, you should be looking at the classic "Three Reservoir Problem", seen here,


Once the flowrates are established for two similar cases representing states of the reservoirs at different times, each with a sufficiently small variation of levels to allow the use of a constant average flowrate during an assumed time step, the approximate actual time step needed to reach each successive state can be easily determined.

17-1058074210T.gif
 
Thanks BigInch for replying!

You are talking about rain water in your post. I understand no flow will be generated because elevations are all the same. But what about the pipe burst? Elevation in container X will increase suddenly (and very rapidly) generating a flow between this container and the other containers because of the Delta H (differntial of head).

The drainage function will start at the moment a Delta H will happen.

Does it still appear trivial?

Maybe I am over thinking this...?
 
Read the second half of my post addressing the non-trivial aspects of the solution to the general problem. If you have a burst pipe, make the hole using a forth reservoir with zero elevation as the liquid level.



17-1058074210T.gif
 
I will try the 3 reservoir scenario and see what happens. I will post back! In the meantime, how could I simplify the following setup:

lets say you have 3 reservoirs, A, B & C.

B is discharging to A & C via a Wye (split) pipe just like in the 3 reservoir setup but at the same time you have a direct line between B & A and also a direct line between B & C (lines in red)

I want to simplify this using parallel and series simplifications.

(See attachment)
 
 http://files.engineering.com/getfile.aspx?folder=36c6dc17-4249-4ec3-ae97-aae9ec4aedee&file=3-reservoirs.JPG
The only way to "simplify" would be to make an "equivalent pipe" for each parallel pipe pair (or parallel segments of pipe). The parallel pipes must have the same starting point and ending point, so you would have to "morph" your diagram a bit. But the extra segments you'd have to add to be able to replace parallel pipes with equivalents would add significant complications.

An equivalent pipe is a ficticious pipe of some imaginiary length, diameter and roughness that gives the same head loss at the same total flowrate of any two (or more) real parallel pipes. If lengths of both parallel pipes are equal, then the equivalent pipe should also be of the same imaginary length. If roughness is equal too, then you can approximate to just finding a pipe that has an imaginary diameter which will give a x-sectional area of flow equal to the sum of the area of the two parallel pipes. Once you have that you replace the real parallel pipe pairs with the imaginary pipes and solve.

You'd also have to break A-B into segments you could make parallel with A-D-B, call those a-d & d-b1,
and B-C into B-D-C, call those b-d2 & d-c
you could then make equivalent pipes from A-D & d-b1

d-b1, D-B and b-d2 would make one equivalent pipe from those 3 segments
then D-C and d-c would combine into another equivalent pipe

It would seem that you wouldn't gain much by trying that "simplification".

Rather than try working with all those equivalent pipes, I think it would be easier to include QA-B and QB-C in similar equations as given in that reference and just solve the straight forward problem mathematically.

17-1058074210T.gif
 
Seems that I was not too off track by having concerns over this simplification.... In fact I also think this will not give much benefit.

Anyways, I am very visual and do not understand what you mean by " If you have a burst pipe, make the hole using a forth reservoir with zero elevation as the liquid level."

Do you mean modeling the burst pipe as a reservoir (elev. =0) pouring into the other containers? So it would be a 4 container problem?

Also, QA-B & QB-C in the equations of the 3 reservoir problem are not discharging independently of QA-B/C (the wye connection)?

Worst case scenario I can use the boundary conditions to solve this but what do you think?
 
I think the approach taken for modeling by considering the 3-reservoirs problem is correct. However do not forget that in your case the discharged from the filling tank (the main tank that is being filled by the water from the burst pipeline) is a function of the raised water level. Higher level of water in the tank means higher flow rate to other tanks through the connecting pipes.

delta_v/delta_t = -outflow + inflow
delta_v = delta_h * w * d

Assuming a constant inflow, the outflow is a function of t and h both. This makes your modeling more complex especially when you link the adjacent tank to the next tank in the row (connecting N+1 to N+2) and try to solve the ODE of each tank simultaneously at each time step.

Enough saying about the dark side, and perhaps not possible to go with practical solutions of cvg, here's my suggestion:

Use Epanet (it's free) and model your system in Extended simulation model. you can model all your tank by giving the exact dimensions. Then put up the connecting pipes with their sizes and friction factors and assign arbitrary water levels in the tanks (not necessarily equal). Now consider the incoming flow (put it as fixed point demand) to tank N and run the model and there you go. you can plot the water level variations in all tanks during the time. You can even investigate more complex scenarios by using control command panel in Epanet. For example, stop the incoming flow at time X and see how long it takes to have a stabilized system.

Please let us know if this works.
 
waterpipe, thanks for replying! I guess I will need some clarifications for using EPANET correctly.

Basically, here's what I did to model my system:

First I built the system using tanks and pipelines. I specified all frictions and other properties of the piping.

Rain fall: I used an open reservoir with 34ft of head (atmospheric pressure) and a pump sized at 2GPM@34ft. The 2GPM comes from the expected rainfall x surface area. This is connected directly to the tank symbolizing the vessel I want to model. Every tank has an independent rainfall setup (reservoir+pump).

Then I modeled the pipe burst by adding a second reservoir and pump independently attached to the vessel experiencing the burst. The reservoir has 70ft of head (because I am expecting 30PSI) and the pump is set at 1800GPM (assumption) and 70ft head.

because I am expecting variable rainfall during the day, I created a pattern with different multipliers throughout the 24hr period and assigned this pattern to the pumps symbolizing rainfall. I also created a pattern representing the pipe burst and this pattern is set at 0 from time_0 to 23hrs, and at 23hrs has a value of 1 until 24hr.

When I run the simulation, it complains that pump #X open but exceeds maximum flow at XX:XX:XXhrs (for every time increment)

All results (charts, graphs) are also blank...

Anybody has a clue what I did wrong?
 
 http://files.engineering.com/getfile.aspx?folder=4ccdb5e0-23e4-47ec-a211-5b4869525e8b&file=system.JPG
this system sounds suspiciously like an underground stormwater retention system. As such, you have rainfall, runoff, and stormwater flowing into underground "tanks". EPANET is possibly not the best tool for this analysis since it is designed to analyze domestic water systems, typically under pressure. SWMMM might be a better (free) tool or any number of commercial softwares that are designed to analyze stormwater systems.
 
Its not a stormwater retention system but only a feature part of an industrial facility. I agree if EPANET (that was new to me until this morning) is centered around pressurized systems, it could generate potential problems and will have certain pitfalls as well. SWMMM (also completely new to me) might be abetter choice.

I really wonder what would be the best hand method to solve this problem? Was I that far with my ODE at the beginning? I realize hand calcs are wayyy slower than computerized simulations, but at least I could understand the hydraulics phenomenon much better.

I will retry EPANET and also give SWMMM a try and post back my results.
 
I think you were exactly right with your ODE formulation. I really just suggested a slightly alternate approach to handling the time component, or the transient analysis part; to analyze it as a series of steady state conditions close enough together so that you could use an average flowrate to find the time it would take to reach the next state. The only physical difference between "yours" and "mine" is the number of pipes in the 3 reservoir problem, and you probably already have those extra equations formed up in your ODEs already. "My way" I believe is the same way EPAnet would analyze it and that's the same way you would have to do it using EPAnet, you'd just be doing it by hand. Moving from one steady state case to another steady state case. As I understand it, EPAnet won't do true transient simulations, but you can make it "morph" between steady state conditions, as long as the timesteps are small.

17-1058074210T.gif
 
Hi lpallard,

Getting back from the new year holidays, I am giving some points in blue regarding your Epanet model after repeating each section of your previous comment.
Just one note before the comments. Considering your description of the system, the connecting pipes between the reservoirs (tanks or containers) will be fully filled by water when they are passing water from one tank to another in thee condition that water level is higher in the first tank than the adjacent tank (so there 's a water flow from the first tank to the second tank). This means that connecting pipes are pressurized and there's not a free surface flow in them. In other word, if the flow is free surface in the connecting pipe, this would mean that water level is below your pipe crown in the first reservoir and there is no overflow concern. I stated this to point out that Epanet is an appropriate tool for analyzing the system consisting of reservoirs and their connecting pipes. Now getting to your model:

"Rain fall: I used an open reservoir with 34ft of head (atmospheric pressure) and a pump sized at 2GPM@34ft. The 2GPM comes from the expected rainfall x surface area. This is connected directly to the tank symbolizing the vessel I want to model. Every tank has an independent rainfall setup (reservoir+pump)."
You can replace the open reservoir and the pump (that are used to model the rain fall) with a node connected to your tank via a short, large diameter pipe (a dummy pipe). Assign the 2 GPM as the input flow (negative demand) to the node.

Then I modeled the pipe burst by adding a second reservoir and pump independently attached to the vessel experiencing the burst. The reservoir has 70ft of head (because I am expecting 30PSI) and the pump is set at 1800GPM (assumption) and 70ft head.
Again here, replace the external reservoir and pump with a node and assign 1800GPM as input to the node.

"because I am expecting variable rainfall during the day, I created a pattern with different multipliers throughout the 24hr period and assigned this pattern to the pumps symbolizing rainfall. I also created a pattern representing the pipe burst and this pattern is set at 0 from time_0 to 23hrs, and at 23hrs has a value of 1 until 24hr."

Assign these pattern to your node demand in a time extended model. This way you can control the inflows to your tanks as you want.

Now, you've avoided using pumps and extra tanks in your model and I guess you should have what you're looking for. At least you won't get the previous error since there's no pump in your model!
Keep us updated on this.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor