
[Sponsors] 
Algorithm to solve 2D incompressible NavierStokes isn't working 

LinkBack  Thread Tools  Search this Thread  Display Modes 
September 11, 2018, 18:52 
Algorithm to solve 2D incompressible NavierStokes isn't working

#1 
New Member
Join Date: Sep 2018
Posts: 4
Rep Power: 4 
I'm trying to figure out why the algorithm I've come up with to solve the 2D incompressible NavierStokes equations isn't working.
I'm using a finite difference discretized mesh on a square, with colocated velocity and pressure variables. I'm also using the Backwards Euler scheme for time advancement. The model I'm using is a simple driven cavity, with an initial velocity of zero inside the mesh and on all the boundaries except the top wall, which has an initial X velocity of 1 m/s. I discretize the velocity derivatives and second derivatives with central differences, and discretize the pressure derivative with backward differences. I also linearize the nonlinear terms by multiplying them by the velocities from the previous time step. So for example in the X momentum equation there is the term U*dU/dx, so I replace "U" with the U velocity from the previous step. To compute a time step, first I build a matrix and a righthand side representing the linear equations. This is done by looping through all of the mesh points and adding three rows for each mesh point; two for the X and Y momentum equations, and one for the continuity equation. I assume that the pressure gradient perpendicular to a boundary is zero. I also pin the pressure at one of the mesh points to be zero. Then I solve this system of linear equations to get the velocity and pressure values at the next time step. However this isn't working because the matrix has a rank that is always 1 less than the number of unknowns, so it doesn't have a unique solution. Should this algorithm work in principle, and I could just be missing one small thing that is causing the matrix to be rankdeficient by 1? Last edited by cactus man; September 11, 2018 at 20:27. Reason: Added information on how I linearized the nonlinear terms. 

September 11, 2018, 23:58 

#2 
New Member
Join Date: Apr 2015
Posts: 17
Rep Power: 7 
This sounds an awful lot like Step 11 of CFD Python: 12 steps to NavierStokes. Are you following this set of tutorials? Even if not, perhaps the code provided therein can help you pinpoint the error in your code.


September 12, 2018, 00:19 

#3  
New Member
Join Date: Sep 2018
Posts: 4
Rep Power: 4 
Quote:
I developed my algorithm as a way to answer the question "What velocity and pressure field at time 't + h' will result in a velocity gradient that when evolved backwards in time using the Backwards Euler method will result in the already known velocity field at time 't', and the velocity field satisfies the Continuity Equation?" But I'm not sure if that is exactly the correct question to be asking. Last edited by cactus man; September 12, 2018 at 00:23. Reason: clarification 

September 12, 2018, 01:58 

#4  
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 5,666
Rep Power: 60 
Quote:
What exactly are you doing? The NSE are not reversible in time. Furthermore, the Poisson equation for the pressure is nothing else that the continuity equation div v = 0. 

September 12, 2018, 03:19 

#5  
New Member
Join Date: Sep 2018
Posts: 4
Rep Power: 4 
Quote:


September 12, 2018, 03:54 

#6  
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 5,666
Rep Power: 60 
Quote:
When you work with the incompressible form of the NSE you have to consider that the pressure is only an auxiliary variable. In general, you can work using fully coupled method or some of the splittingbased method. To understand the matrix form of the full system, see Eq.(2) here http://www.ecs.umass.edu/mie/tcfd/Pa...ot_cfd2007.pdf the you can see the possible splitting methods. Note that in literature you can find a lot of fractional methods. 

Tags 
algorithm, incompressible, solver 
Thread Tools  Search this Thread 
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Filtered navier stokes equation..LES::  Palani Velladurai  Main CFD Forum  7  September 6, 2013 02:51 
Navier stokes compresible viscid flow fea, somebody can help?  Jose Choy  Main CFD Forum  3  October 24, 2003 02:28 
1d navier stokes equation  Robert  Main CFD Forum  0  December 20, 2002 02:14 
help: I am trying to solve Navier Stokes compressible and viscid flow  Jose Choy  Main CFD Forum  2  May 18, 2000 05:45 
any better way to solve 3D stokes flow?  Yangang Bao  Main CFD Forum  0  September 29, 1999 10:26 