CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   Question on Gravity (https://www.cfd-online.com/Forums/main/101859-question-gravity.html)

archdevil May 15, 2012 16:44

Question on Gravity
 
Hello everyone. I come up against a problem on gravity. I have setup a simple simulation of channel flow by using Fortran code, the water flows from inlet to outlet with a uniform velocity. If I don't take gravity into account, the result looks fine, only u component exists and the other two component, v and w should be zero. However, when I added the gravity into source term and the initial pressure was changed from constant to hydrostatic pressure, the downward velocity appeared, that is to say, w was not zero but a big number.
Why CFD code works fine without considering gravity and fails with considering gravity? In reality, the gravity exists.
Did anyone meet the same problem? Thanks in advance.

cdegroot May 15, 2012 21:38

Is this your own code? Sounds like there is an issue with either your boundary conditions or your continuity equation. It doesn't make sense to have a downward component to your velocity when there are solid walls. You would be violating conservation of mass or penetrating your walls if there was a downward component everywhere. Can you clarify if there is a downward component everywhere or just in certain areas.

archdevil May 16, 2012 08:52

Dear cdegroot, Thank you for your consideration. Yes, it is my own code, and the boundary conditions are imposed as follows: in x-direction, inlet and outlet; in y-direction, wall; in z-direction, bottom as wall and top as pressure outlet. If I take gravity into account, downward component should appear everywhere. Do you mean that gravity term should violate conservation of mass? It is so strange. In fact in 3d simulation, gravity term should be included in the govern equations, however, when it comes to numerical simulation, gravity will be neglected in many situations. What is the reason? If you don't consider the gravity, you will get the reasonable results, but if you consider the gravity as the real physics shows, you will get the wrong results.

evcelica May 16, 2012 10:16

If you have a wall at the bottom of the fluid, this wall will exert a force up on the fluid adjacent to it at the hydrostatic pressure of the fluid. This force will be the same as the force due to gravity and essentially it will net to zero everywhere. You have something wrong with your code, perhaps not including buoyancy forces between the fluid elements to cancel out the gravity?

archdevil May 16, 2012 11:01

Dear Erik, In my opinion, buoyancy forces is just caused by the difference of pressure. Because the initial distribution of pressure is given as hydrostatic pressure, buoyancy forces is taken into account. In fact, I setup another case, just give the initial pressure distribution as hydrostatic pressure but no gravity term was added to the code, then water will go upward!!!

cdegroot May 16, 2012 11:06

evcelica is correct. If there is a bottom wall you can't be getting downward flow because the buoyancy forces will be balanced by gravity and also as I mentioned before you would be violating conservation of mass. However, by your description above it sounds like you actually have the bottom and top of the channel open to the atmosphere. So it is more like flow between two parallel plates open to the environment on 4 surfaces.

Now, you are right that the case run without gravity and with gravity should be the same, but only in the case where gravity does not affect the physics of the flow. I am not sure yet if in your case it should or not. Do you solve an energy equation? Are there any buoyancy forces in your simulation? So you have three outlets in your simulation. Are they all considered as pressure outlets? What is the specified pressure at the outlets?

cdegroot May 16, 2012 11:09

Quote:

Originally Posted by archdevil (Post 361446)
Dear Erik, In my opinion, buoyancy forces is just caused by the difference of pressure. Because the initial distribution of pressure is given as hydrostatic pressure, buoyancy forces is taken into account. In fact, I setup another case, just give the initial pressure distribution as hydrostatic pressure but no gravity term was added to the code, then water will go upward!!!

If you have a hydrostatic pressure distribution and no gravity to counteract the upward force on the fluid, of course it will move upward. That is the correct result.

archdevil May 16, 2012 11:34

Dear cdegroot, I haven't solved the energy equation and there is no buoyancy force. You are right there are three outlet in the simulation and one of them is regarded as velocity inlet. As to pressure outlet boundary condition, we should not give the specified pressure, in fact, pressure outlet boundary condition means the gradient of physics variable in normal vector direction equals to zero. If we give the specified pressure at the boundary, that is not pressure outlet boundary condition, but pressure inlet boundary condition, right?

Although the bottom is wall, but for example, how to deal with the dam break problem? we should consider the effect of gravity, right? then what is the difference between dam break problem and open channel flow problem? why the former should take gravity into account and the later should neglect the gravity? in fact the govern equation of them is the same.

cdegroot May 16, 2012 11:52

Sorry, I read that the bottom was open as well, but no, just the inlet outlet and top. Yes you are correct that for your pressure outlets the gradient of the physics variable normal to the boundary is zero, but you need to do something with pressure as well. In Fluent for example, a pressure outlet has a uniform static pressure specified and enforces zero derivative normal to the boundary for velocity. I feel like the top boundary may be more appropriately treated as a pressure inlet. Read how Fluent imposes a pressure inlet, specifically how it treats hydrostatic head: https://www.sharcnet.ca/Software/Flu...ug/node239.htm.

You are right, there is no logical reason why including gravity in your simulation would cause it not to work properly. There is more likely an error in how you are treating the gravity term that is inconsistent with the actual physics of the flow or an issue with boundary conditions, most likely the top boundary.

archdevil May 16, 2012 13:31

Thank you very much. I will read the manual of Fluent and look into my code carefully.


All times are GMT -4. The time now is 16:24.