CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   FVM; incompressible fluid, staggered grid, gravity problem (https://www.cfd-online.com/Forums/main/253974-fvm-incompressible-fluid-staggered-grid-gravity-problem.html)

Mathematician January 12, 2024 12:07

FVM; incompressible fluid, staggered grid, gravity problem
 
1 Attachment(s)
My problem is to simulate an incompressible fluid with certain cinematic viscosity in a staggered grid with ghost cells, and the computational domain looks like this; Attachment 98049
:confused::eek:

but there are ghost cells too.

My problem is the following; if I have the gravity source term in the navier stokes equation, and I suppose that the fluid is in the first row of the computational domain, do I have to solve only on the i,j cells where I suppose where the fluid is(at the top, the first row) and then maybe after I updated velocity update position and allow to solve only where the fluid goes? or maybe I have to diffuse and advect even outside the fluid? Do I need something external to solve the problem(intermolecular interactions)?
Info;chorin projection method (split local NS with additional timestep and then discretize) and SOR for pressure.

FMDenaro January 12, 2024 12:59

Quote:

Originally Posted by Mathematician (Post 863028)
My problem is to simulate an incompressible fluid with certain cinematic viscosity in a staggered grid with ghost cells, and the computational domain looks like this; Attachment 98049
:confused::eek:

but there are ghost cells too.

My problem is the following; if I have the gravity source term in the navier stokes equation, and I suppose that the fluid is in the first row of the computational domain, do I have to solve only on the i,j cells where I suppose where the fluid is(at the top, the first row) and then maybe after I updated velocity update position and allow to solve only where the fluid goes? or maybe I have to diffuse and advect even outside the fluid? Do I need something external to solve the problem(intermolecular interactions)?
Info;chorin projection method (split local NS with additional timestep and then discretize) and SOR for pressure.






The gravity term acts in the vertical component of the momentum equation, that is only in the fluid cells. It is computed in the prediction velocity of the projection method.

Mathematician January 12, 2024 13:17

Quote:

Originally Posted by FMDenaro (Post 863030)
The gravity term acts in the vertical component of the momentum equation, that is only in the fluid cells. It is computed in the prediction velocity of the projection method.

I did like that; I did like this; after a timestep (choosen so that the simulation is stable) I predict the velocity and then I make move the fluid in the new cells (by allowing the approximation of NS equations only on the permitted fluid cells), do I have to update the position (the fluid cells where I solve it?) I'm used to solve a problem where in the domain there's just everywhere fluid.
Last time I coded it it was kinda glitchy, maybe I need even to change the timestep since the velocity would change Reynolds would change and so the timestep should be re-newed?

FMDenaro January 12, 2024 13:30

Quote:

Originally Posted by Mathematician (Post 863032)
I did like that; I did like this; after a timestep (choosen so that the simulation is stable) I predict the velocity and then I make move the fluid in the new cells (by allowing the approximation of NS equations only on the permitted fluid cells), do I have to update the position (the fluid cells where I solve it?) I'm used to solve a problem where in the domain there's just everywhere fluid.
Last time I coded it it was kinda glitchy, maybe I need even to change the timestep since the velocity would change Reynolds would change and so the timestep should be re-newed?

You have to work in the Eulerian formulation, not the Lagrangian one.
Solve at each time step the same continuitą and momentum equations in all cells, nothing else.

Mathematician January 13, 2024 08:28

problem is my cell is 2d. If I solve everywhere it's like just a fluid being costantly "pushed" by a constant force. but my fluid is initially at the top and then falls and bounces

FMDenaro January 13, 2024 11:43

Quote:

Originally Posted by Mathematician (Post 863059)
problem is my cell is 2d. If I solve everywhere it's like just a fluid being costantly "pushed" by a constant force. but my fluid is initially at the top and then falls and bounces

I am not sure to understand, you have to explain more details about your flow problem.

Mathematician January 14, 2024 07:10

Here's a similar problem to understand my doubt(how do you simulate a fluid if the fluid is not intiially everywhere on the grid and so you can't solve everywhere on the grid, but maybe..)
I have a doubt; if you had an inlet in the left wall, would you need to solve everywhere? I mean if you knew that there's no fluid in the computational grid, but there's a costant inlet Uin = 3 m/s, in the left wall, if you solved everywhere you're basically assuming that the fluid is everywhere in the grid because you solve only where the fluid is (but in this problem the grid initially has no fluid (void, no atmosphere and for now no source terms). I think that in this case you should initially consider that the fluid is near the left wall, then wait a timestep dt (based on stability) and make the fluid move to the next column and diffuse only where the fluid is. If you considered the fluid to be everywhere, the problem would change since I'm considering that there's no fluid in all the cells initially. This is a similar problem to the gravity source term since you have to update the position and then solve again only where the fluid is.
Method for this problem (no source terms, Uinlet on the entire left wall, fluid is not everywhere on the grid, it's just entering the grid);
-Uinlet in the left wall.
-No fluid initially in the grid.
-Solve for the first column (near the left wall) (Having Uinlet you can find the U velocity of the first column ---based on BD conditions)
-Find a timestep dt stable
-Update the position of the fluid s = v*dt
-The fluid is going to go in the next column, but since the fluid has costant inlet you're going to solve in both first column and second column.
-Continue the process until the fluid is entirely in the computational grid.
Similar problem to the gravity source term problem since the fluid is initially considered to be at the top only and not everywhere in the grid.

FMDenaro January 14, 2024 07:31

Quote:

Originally Posted by Mathematician (Post 863093)
Here's a similar problem to understand my doubt(how do you simulate a fluid if the fluid is not intiially everywhere on the grid and so you can't solve everywhere on the grid, but maybe..)
I have a doubt; if you had an inlet in the left wall, would you need to solve everywhere? I mean if you knew that there's no fluid in the computational grid, but there's a costant inlet Uin = 3 m/s, in the left wall, if you solved everywhere you're basically assuming that the fluid is everywhere in the grid because you solve only where the fluid is (but in this problem the grid initially has no fluid (void, no atmosphere and for now no source terms). I think that in this case you should initially consider that the fluid is near the left wall, then wait a timestep dt (based on stability) and make the fluid move to the next column and diffuse only where the fluid is. If you considered the fluid to be everywhere, the problem would change since I'm considering that there's no fluid in all the cells initially. This is a similar problem to the gravity source term since you have to update the position and then solve again only where the fluid is.
Method for this problem (no source terms, Uinlet on the entire left wall, fluid is not everywhere on the grid, it's just entering the grid);
-Uinlet in the left wall.
-No fluid initially in the grid.
-Solve for the first column (near the left wall) (Having Uinlet you can find the U velocity of the first column ---based on BD conditions)
-Find a timestep dt stable
-Update the position of the fluid s = v*dt
-The fluid is going to go in the next column, but since the fluid has costant inlet you're going to solve in both first column and second column.
-Continue the process until the fluid is entirely in the computational grid.
Similar problem to the gravity source term problem since the fluid is initially considered to be at the top only and not everywhere in the grid.






First of all, if you have a fluid entering in some space (filled by air for example), you have to treat that adequately as fluid-air problem, that with two fluids. There is a plenty of literature about that.


If you instead have a single phase and you want to simulate fluid entering and interacting with the same fluid at the rest, you cannot use the incompressible flow model but the compressible one.

Mathematician January 14, 2024 07:32

No I was talking about an initially computational grid that is empty ( no air, void), but then there's the fluid inlet that "fills" the grid within time

FMDenaro January 14, 2024 13:42

Quote:

Originally Posted by Mathematician (Post 863096)
No I was talking about an initially computational grid that is empty ( no air, void), but then there's the fluid inlet that "fills" the grid within time


In the incompressible flow model, the pressure acts istantaneously, in a single time step the flow must cover the whole domain! You see easily that (single phase) Div v = 0 implies Int[S] n.v dS =0. Thus what enters into the domain must leave the domain.

Mathematician January 14, 2024 15:31

thanks for your answer.
So the gravity problem must be compressible(single phase in vacuum)? I noticed that the eulerian coordinate density rho(position, time) would not be constant since the fluid would move and therefore the density would change in position and time, being compressible.


All times are GMT -4. The time now is 04:46.