Jump to content
  • Advertisement
Sign in to follow this  
coder0xff

Fluid flow rate calculation

This topic is 4481 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am planning on implementing a hydraulics simulator. What do I need and how do I calculate the rate of flow through a pipe with an arbitrary radius (meters) at an arbitrary pressure (pascals)?

Share this post


Link to post
Share on other sites
Advertisement
I perused through the wiki entry, and though most was gibberish to me, I did notice a link to another wiki entry called potential flow (which was also gibberish). Is this what I should be researching? I don't need anything fancy like turbulent flow. I am going for a plausible simulation of hydraulic machinery, not a prediction. This is, after all, for a game. :-)

Share this post


Link to post
Share on other sites
The first equation (under the heading 'Incompressible') is probably want you want.

Share this post


Link to post
Share on other sites
In the wikipedia article the first sentence is:

Bernoulli's principle states that in fluid flow, an increase in velocity occurs simultaneously with decrease in pressure.

What I am looking for the opposite: an increase in velocity occurs simultaneously with an increase in pressure (gradient).

Bernoullis's principle may have relevance, but I don't know what to do with it. I personally don't need to know the pressure of the fluid on the walls of the pipe (unless it is needed to determine maximum flow at a given pressure gradient) or take into account the effect of gravity or thermodynamics. Is there a simple, 'C' friendly equation for this?

Share this post


Link to post
Share on other sites
Jos Stam and Mark Harris have articles on how to model fluid flow on the CPU and GPU.

Share this post


Link to post
Share on other sites
Quote:
Original post by coder0xff
In the wikipedia article the first sentence is:

Bernoulli's principle states that in fluid flow, an increase in velocity occurs simultaneously with decrease in pressure.

What I am looking for the opposite: an increase in velocity occurs simultaneously with an increase in pressure (gradient).

Bernoullis's principle may have relevance, but I don't know what to do with it. I personally don't need to know the pressure of the fluid on the walls of the pipe (unless it is needed to determine maximum flow at a given pressure gradient) or take into account the effect of gravity or thermodynamics. Is there a simple, 'C' friendly equation for this?


Bernoulli's equation is exactly what you want for this type of problem. It is extremely easy. I suggest that you actually do a search for Bernoulli's equation using google if you are having trouble with the concepts rather than blowing it off and trying to get people to provide code that you can cut-and-paste without any understanding.

Share this post


Link to post
Share on other sites
You might want to try searching for "energy equation for fluid flow" as well. It's basically the same deal as Bernoulli's, just some fluid mechanics books use the different name.

If you're trying to roughly simulate hydraulic systems, this IS what you use. You need the pressure "on the walls" as you put it to find the force acting on the pistons in your system! That's what makes things...go.

Same thing for flow rate through a pipe, although you also need "continuity equation" to go along with the energy equation there. They can all be applied with very simple algebra so long as you are not trying to derive where they come from.

Share this post


Link to post
Share on other sites
Even if you are deriving where they come from - conservation of energy and conservation of mass - it isn't that complex.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!