I'm having a hard time finding information on how to model/simulate this. I attached a couple files, both of which show an example tank & pump network. It's just nonsense that I made up for this post, but it shows what kind of system I'm trying to simulate.
I've been looking on the web to find information on how to do this, but I keep running into formulas that are way more complex than what I need to do. I just want to know what the pressure and flow is at any node in the system, with 80% or so accuracy. There's no need to consider fluid compression, and we can just use a constant for the resistance experienced through valves or narrowing pipes. We don't need to consider friction of fluid against piping. We can ignore heat. It's important to note, again, that I don't need complete accuracy, it's much more the behavior of the simulated system that is important.
I've tried this going in both directions, that is following a flow path down from the tanks/sources and propogating pressure changes through the system, and I've also tried it directly from the node in question, and considering that each node has a number of source nodes in terms of pressures and flows. Both of these simulated SW systems become highly erratic the further downstream from the pumps that you get, and the more on/off valves that I put into the system.
Even if you just told me where to look or what book to read, that would be a huge help. If there's example source code out there somewhere that does this, I will buy you a 60 oz beer of your choice.
Thanks in advance.
(post edit 4/12)
Thanks for the answers so far, I've ended up spending quite a bit of time looking around for a solution that already exists, because I was just convinced that many have run into this problem before, and knew that it was solvable in a general sense. Part of the reason I was so interested in a general solution is that I can rip through 12 more of these simulations that I have to do quickly and accurately if that's the case.
I've found another piece of software called EPAnet, which seems like a simpler solution than what was listed below, and I'm looking through their SDK at the moment and playing around with it. I'll keep you posted, the few that are interested ... this might not be a big deal to most, but to the few that it matters to it will be huge, so I'll write up what I find.
I've spent the last two days building a solid wrapper around the EPAnet programmer's toolkit, and making a scratch program that does some of the things I want to do. (Incidentally, I've broken a new record for the # of times in a day I can make LabVIEW crash quickly and silently.)
It's really quite complex underneath, and I'm delighted by how much mathematical power I can stand on. I don't think they've fleshed out all the issues, so I've been working around some of them. But it's looking like it's 80% chance so far that it's going to work for what I want.