# CFD Python: 12 steps to Navier-Stokes

We announce the public release of online educational materials for self-learners of CFD using IPython Notebooks: the CFD Python Class!

Update!(Jan.2014) CFD Python has a new home on GitHub

### Some background

This post describes the first practical module of Prof. Barba's **Computational Fluid Dynamics** class, as taught between 2010 and 2013 at Boston University. The module is called **"12 steps to Navier-Stokes equations"** (yes, it's a tongue-in-check allusion of the recovery programs for behavioral problems). It was inspired by the ideas of Dr. Rio Yokota, who was a post-doc in Barba's lab, and has been refined by Prof. Barba and her students over several semesters teaching the course.

*The course is for beginners.* It assumes only basic programming skills —the concepts of iterations, function calls and so on— and builds immediate hands-on experience via this module and several others that come after. In the future, we hope to publish materials for the other modules also (e.g., convection schemes with Burgers equation, Euler equations and shock-tube problem, and others).

We use Python for this class, and those engineering students that are dependent on Matlab just have to bite the bullet and learn Python. (The reasons for this are many and would be subject for another blog post!)

Prof. Barba has a long track record of sharing educational materials freely online. Recordings of her lectures for the CFD course were made available first on iTunesU in 2010. Then, in 2012, she decided to use the flipped classroom model and re-posted the videos on YouTube, after editing for length and with some additions.

The new *CFD Python* class notebooks are her latest free online materials!

### Instructions

The simplest way to enjoy these materials is to view each lesson online (follow the links below), as rendered by the IPython Notebook Viewer. In that case, you could follow along and write your own version of the programs to run with your local Python installation.

But you can also **download** the whole collection of Notebooks from the CFD Python GitHub repository. If you have a full distribution of the Python "ecosystem," then navigate to the directory where you've downloaded the collection, and launch the IPython Notebook with the following command on the terminal:

`ipython notebook`

### Description of the practical module

This module has been proved in the classroom for four consecutive years. It has brought several dozen students to develop their own 2D Navier-Stokes finite-difference solver from scratch in just over a month (with two class meetings per week). The module consists of the following steps (links are to the individual IPython Notebooks):

**Steps 1–4 are in one dimension:**

(i) linear convection with a step-function initial condition (IC) and appropriate boundary conditions (BC);

with the same IC/BCs:

(ii) nonlinear convection, and

(iii) diffusion only;

with a saw-tooth IC and periodic BCs

(iv) Burgers' equation.

**Steps 5–10 are in two dimensions:**

(v) linear convection with square function IC and appropriate BCs;

(vi) nonlinear convection, with the same IC/BCs

(vii) diffusion only, with the same IC/BCs;

(viii) Burgers' equation;

(ix) Laplace equation, with zero IC and both Neumann and Dirichlet BCs;

(x) Poisson equation in 2D.

**Steps 11–12 solve the Navier-Stokes equation in 2D:**

(xi) cavity flow;

(xii) channel flow.

Students are instructed to follow these steps one by one, without skipping any! The most important step is #1, in fact. Everything builds from there.

We know that self-learners around the world have already started following this "12-step program" using the videos on iTunesU and YouTube since 2010. In fact, at least two students have blogged about their experience: DaFeda in Norway (June 2011) and Sidafa Conde at UMass-Dartmouth (January 2012).

And clearly the contributions of Suraj Shankar to the Matlab Central file exchange were also result of his following the class online.

Prof. Barba often receives emails of appreciation from students in far-away places who are learning with her free online materials. And in 2012, she opened her CFD Piazza class to off-campus students, resulting in **about 180 students "auditing"** and participating in the online class discussions —this effort resulted in Prof. Barba being featured in the Piazza Blog as "Innovator of the Week" in April 2012.

We hope that the

CFD Pythonseries will help a new cohort of students and self-learners gain basic CFD skills. Let us know what you think!

### Acknowledgements

- Prof. Lorena Barba's educational program is supported by NSF via CAREER award #1149784

Looks great, Gil and Prof. Barba! I might have to give iPython notebooks a try. One thing I noticed, is that the animations didn't work for me. It could just be a browser/operating system bug (Chrome/Ubuntu)... Additionally, it might be helpful to people to point out the odd-even decoupling that occurs in Step 11 with the pressure field. I know that was a great learning point for me.

Thanks for leaving a comment, Will. I was debating whether to include a discussion of the issue of collocated versus staggered grid. Maybe it could be subject of a separate notebook (rather than adding it to Step 11). We'll think about it !

Great effort. From a previous student who took this course, it is a great way to get introduced to the joy of CFD. I am now doing fundamental research in CFD due to this eye opening course.

I'm so glad to hear from you, Brad. I knew you had gone to graduate school but I did not know you were working in CFD! This is of course gratifying to hear. Best of luck in your research and thanks for leaving a comment!

Great material. I'd like to implement it in my class. However, I'd like to have a Spanish version. Are you interested? How can I contact you?

My best regards,

Francisco

Hi Francisco -- you've just contacted me

If you want to translate these, go ahead! You can send me email if you want to discuss further. I'm glad you find this material useful.

These are fantastic! I've been trying to learn python but it's tough to find interesting projects to learn it with. Have you given any thought to having a lesson or two on 3D CFD? Every class I've ever taken does one and two, but never three. I'd love some help making that jump.

This is great....i am learning CFD....this material will really help me...thanx..and i want basics of CFD so how should i contact you??

[...] University’s Prof. Lorena Barba has released 12 Steps to Navier-Stokes, a self-paced introductory CFD course presented in the form of IPython Notebooks. [Regrettably, I [...]

Lorena, this is fantastic! Thanks a lot for sharing. If you have any problems with SymPy, please don't hesitate to ask us (for example on the sympy mailinglist). I'll be very happy to help make it do what you need.

I'll keep that in mind, and thanks! We are developing more educational notebooks but haven't yet used more SymPy. I have a project in mind where SymPy will feature more prominently, though … I just need the time!

Professor Barba,

I am a graduate student currently trying to teach myself CFD. I have spent this week working through your CFD Python course. I must say, this course has been a blessing. It has made learning CFD fun and straightforward. Thank you very much for being awesome!

Are you interested in active feedback regarding the course? I ran into a few snags and, provided you are interested, I would like to bring them to your attention. If this is the case, then can I perhaps contact you via email?

Thanks again

Hi Jonathan,

Thanks for leaving a comment and I'm glad this has been helpful to you! Please do send any feedback you have, and I'll be happy to introduce modifications to the lessons to improve them with your feedback.

professor Baraba!

This is terrific! thank you for making learning fun!

These are very good for me and I think for every body. I had many book and pdf lecture about CFD, but i couldn't understand them very well. At the moment, i have CFD course in my university and i am very good in that because I saw your course.

At the end i have a question, could you please help me about Boundary Element Method, because I want to use to this method in my thesis.

I am looking for your help, please.

Thank you so much

Hello Hassani — Thanks for your comment!

I don't have materials on BEM, even though we actually use BEM in our research activities. However, as a basic foundation, you might find value in the AeroPython series, which builds up the skills to write a panel method:

https://github.com/barbagroup/AeroPython

When I add a blog post about that, I'd be glad to get a comment about how (if) you used them.

Dear prof, can you please separate course on finite volume method only. That would help us lot.

thank you,

Abhay

Dear Prof, Can you please take a course on CFD finite volume method separately. This will help us a lot.

thank you,

Abhay

It's certainly among my aspirations to provide more CFD materials online, and FVM is one of the important topics. But given my many teaching and research obligations, it will have to wait until I teach another on-campus CFD course.

But there are some new materials coming soon in the form of IPython Notebooks, so keep checking back!

These are fantastic!

Thank you so much

These are fantastic!

Hi Francisco, in case you are still interested we have already translated the module. Of course, you can use it in your class and let us know how was it!

https://bitbucket.org/franktoffel/cfd-python-class-es

Thank you so much for the excellent work!

It was a pleasure! We would like to speak more languages 😉

[...] Teaching CFD to Beginners with IPython Notebooks (Lorena A. Barba) [...]

Thank you prof Barba for this wonderful work... much much helpful it has been. I have been following all the videos uploaded on youtube: starting from Lecture Zero to Lecture 28, which stups abruptly and I can not find any further lectures, which i guess would be on FEM and FVM. I tried mailing you about the same but couldnt get u. Please help me on how to find furtherlectures after Lecture No.28(CFD ME702)

Thanks for your comment and I'm glad that the videos on iTunes U and YouTube have been helpful to you.

Although I did cover some basics of FVM in that course, I never got to making the videos for that topic. Until I teach CFD again (on campus), I might not find a reason to develop more videos. But when I do, I'll remember to include FVM, for sure.

I hope you are making progress with learning Python and CFD. And thanks for leaving a comment!

CFD in 3D gets very computationally intensive and almost inevitably requires parallel computing. By the time you are ready to work in 3D, you are an expert. There are many steps to get there, and I have a long list of IPython-Notebook-powered lessons planned to help in that growth!

Thanks for this learning material.

Thank you so much Prof. Barba for these powerful lessons. We gradually learn how to code and solve numerically some of the classical equations in physics. It was a good initiation for us in CFD using the programming language Python. Formerly I find it too scary to write programs in computers but now I feel more confident to go ahead and discover the beauty of the computational world. I would like to ask you if you have other lessons using different schemes such as the spectral method. Thank you again for making these lessons for us!!

Thanks, Abdallah.

There will be more lessons using convection schemes for Burgers and Euler equations, but I've no plans to write some on spectral methods. Perhaps when I teach a numerical methods class (if I do!) … in the meantime, you might enjoy AeroPython:

https://github.com/barbagroup/AeroPython

I'll write a blog post soon about how I am using the AeroPython notebooks in an Aerodynamics class at GW.

Hi Lorena, I'm a PhD student in Australia, doing long-term geodynamic modelling, and these tutorials are fantastic. Very clear and enjoyable.

Thanks very much!

Thanks for taking the time to leave a comment, Luke!

I'm very glad the materials are helpful to you. There are more notebooks coming, but it's been hard to find the time to finally finish and release them. I'll announce on Twitter when I do.

Great tutorials.. It was very helpful. I was wondering if it is possible to provide some tutorials on immersed boundary method?

Hi Rajib,

Thanks for your comment. I'm glad you find these helpful. Next time I teach this class, I will add new materials. For the time being, you might be interested to look at our research code called "cuIBM" and the technical report on figshare documenting its verification & validation. Search our Publications.

Hello Prof. Barba! I find your website really fascinating and helpful especially for following the iTunes U course. I am just starting too learn CFD and I have a question about the codes of the early steps (1 - 3) I can't find where are the boundary conditions that according to the videos should be u(0,t) = 0 and u(2,t) = 0 in the code, so I would like to know in which part of the code are the BCs? Thanks in advance!

Ah, to be honest, we are just ignoring the BCs in the code for steps 1 to 3. This means that the code is only valid while the wave does not hit the right boundary, but we just went for a simple code here. It would probably be a good idea to add at least an explanation about this.

Thanks for the comment!

Congratulations, it's a very good material for learning and teaching cfd, and python is a wonderful selection to introduce concepts without getting lost in details related to programming.

This is one of the most awesome lessons in the world!!Exactly what i want!!!And you published it online for free!!!Really appreciate... And i will try to let more people around me to know your work^_^

Well, you really sound happy to find *study materials* online

Hi Lorena,

In Step 6 the 2D non-linear convection equation becomes a pair of coupled equations. The linear version, on the other hand, is written with only one independent variable. I don't quite follow the maths here, could you explain how you get there, is there a derivation somewhere I could look at?

Wonderful tutorial, thanks very much.

Hello, Dan.

I'm glad you find these useful.

Did you see the YouTube lesson that goes over the derivation? This might help ...

http://youtu.be/tUg_dE3NXoY

Hi Prof. Lorena, I am really enjoying your lessons and this is being very helpful to me. I have a question about the discretized pressure-Poisson eqn: Why the discretized pressure-Poisson eqn in the step 11 is differente than that found at the end of the youtube video lesson 11? In the step 11 it looks like a descretized version of the the continuous pressure-Poisson eqn plus the term rho*d/dt(du/dx + dv/dy), which should be equal to zero to satisfy continuity in the continuous case.

Hi Robson,

Thanks for your comment and I'm glad the lessors are helpful to you.

Ah, you touch on a subtle issue that—among others—makes the Poisson equation the source of lots of arguments.

First, we have to be careful when we are dealing with the *continuum* and *discretized* equations.

In the video lesson 11, we write out the 2D momentum equation component-wise, apply the divergence operator, write out all the terms, and cancel out the terms with Del(u) because they are zero by continuity. For the *continuum equations*, the momentum and continuity equations imply the following pressure-Poisson equation (see screenshot attached)…

This derivation is the easiest to understand and follow, and that's why we do it in the lesson. But we have to realize that in the *discrete equations* we cannot be sure that the divergence of the velocity is zero, because of possible numerical errors. So we keep the divergence terms —at least some of them— and we don't' eliminate the time derivative term.

We work with a semi-discretized form of the momentum equation (in vector form) towards the end of video lesson 11, and we kept all the terms with divergence, viewing the pressure-Poisson equation as a correction. But there are many versions of this!

Hi Robson,

Thanks for your comment and I'm glad the lessors are helpful to you.

Ah, you touch on a subtle issue that—among others—makes the Poisson equation the source of lots of arguments.

First, we have to be careful when we are dealing with the *continuum* and *discretized* equations.

In the video lesson 11, we write out the 2D momentum equation component-wise, apply the divergence operator, write out all the terms, and cancel out the terms with Del(u) because they are zero by continuity. For the *continuum equations*, the momentum and continuity equations imply the following pressure-Poisson equation (see screenshot attached)…

This derivation is the easiest to understand and follow, and that's why we do it in the lesson. But we have to realize that in the *discrete equations* we cannot be sure that the divergence of the velocity is zero, because of possible numerical errors. So we keep the divergence terms —at least some of them— and we don't' eliminate the time derivative term.

We work with a semi-discretized form of the momentum equation (in vector form) towards the end of video lesson 11, and we kept all the terms with divergence, viewing the pressure-Poisson equation as a correction. But there are many versions of this!

(trying the comment again, to attach the image)

The image now, second try ...

Hi Prof. Lorena,

Thank you for reply.

I saw that from the semi-discretized form of the momentum equation (1) to the semi-discretized form of the pressure-Poisson equation (2), it is disconsidered the high order derivatives terms (3) (attached). If this is correct, which is the assumption to disconsider this terms?

I'm also curious why the terms mentioned by the guest author are dropped. I understand how I could rearrange the equation to get all of the dropped terms as products of divergence, but since we're attempting to ensure that divergence is zero, this elimination does not make sense to me.

You mention in your videos that the viscosity term is small, and can often be ignored, which eliminates some of the terms, but not all of them. Even with the elimination of the viscosity terms, I still see the terms in the attached image.

Thanks for taking the time to post these lessons, I've found them very helpful.

Edit: Apparently, no image. Here's a link: http://i.imgur.com/bCkTPgZ.png

Here is my take on it ...

You have the continuous Poisson eq for pressure, and the plan is to use it for two purposes, 1 - to compute p, and 2 - to enforce the continuity eq. So, by writing the update eqs for un+1 and vn+1 and then deriving the Poisson eq from them you get the additional term, the divergence of un and vn, and by setting the divergence of un+1 and vn+1 to 0, that gives a variation of the Poisson eq which forces the divergence of the calculated values un+1,vn+1 to be 0. So, it's an ad hoc approach to enforcing the continuity equation with p. Thus the continuity eq is driving the calculation of p.

Hi prof. Lorena,

thank you so much for your work. I really enjoyed myself studying this application of numerical analysis, and I had the occasion to brush up long forgotten skills.

Could I ask you which are the implications behind using an implicit scheme for the time derivation? I'd really like to implement a backward Euler, a Crank-Nicolson, or even a Runge-Kutta! Could you recommend me some articles that deals with this problem, any book or online resource?

Thank you.

Hi Jared,

Coming soon, we'll have several other lessons on numerical methods, as I'll be teaching that class in the Fall'14 semester. Everything will be open on the web, and you'll be able to follow our course. Keep an eye out for announcements!

Thank you! I can't wait!

You can make comments on our new home on Github, using either an Issue or a pull request. Enjoy!

I am having trouble getting plots to show inline. Could someone tell me where I could find help with this?

Got it - love these lessons! Thank you!

Glad you solved it, and glad you're liking the lessons. There'll be more coming this Fall semester, when I teach an numerical methods course, so stay tuned!

Your course is amazing and I'm learning a lot. But I have some doubts.

In the lesson 11, when you obtain the graphic, I have noticed that you delete

even rows. Could you explain why? I think it must be the decoupling between

velocity and pressure. Is really like this?These rows are deleted later, but

what is the implication of keeping on the integration domain?

Hi Alberto,

Are you referring to this line?

plt.quiver(X[::2,::2],Y[::2,::2],u[::2,::2],v[::2,::2])

The quiver function is drawing the arrows that show the velocity throughout the cavity. Every other arrow is skipped because otherwise there are so many arrows on the plot that it's hard to see what's happening with the pressure contours below.

Hi Prof. Barba,

I made it to the 12th step, i.e. completed step 11 in MATLAB, and am reporting in as directed. Truly a wonderul series of lessons. Innovative in important ways - a course in CFD with actual computations ! Making MATLAB/Python integral to the course is the only way to go IMO. The 'flipped classroom' has got to be a huge improvement over past practices.

A comment: I was quite sure this thing was not going to work as I when I modified some of the early projects, like setting c=-1 in step 1, the thing blew up, so since the fluid goes every which I way in step 11 I figured something would blow up. But, it worked like a charm. What happened?

Also, my goal is step 13, the backward facing step. That was my CFD goal from the start, and I'm feeling pretty close. The sim for step 11 seems very robust. I'm thinking I can modify the geometry on step 11, give it a dp/dx = 0 and u some appropriate profile at the inlet (do I have to specify dp/dy?), and dp/dx = du/dx = 0 (again I'd like to let dp/dy float) at outlet, and it should work. Suggestions? The backward facing step would be a very impressive demonstration. I don't see step 12 as contributing so I'm thinking I'll skip that step.

Thanks for your great and innovative course.

Hi Joe,

You're right that in Step 11, the flow

moves in all directions. The backward-difference scheme is used

throughout the domain, and one would expect it to be unstable in regions

where the flow velocity is negative. But in the full Navier-Stokes

equations, we not only have the convection terms, but also the diffusion

terms due to the viscosity. The dissipation caused by the viscous terms

can ameliorate the instabilities due to a forward-difference stencil

for the convection term, and overall the numerical scheme is stable.

You can try this out yourself by performing a stability

analysis of the 1-D linear convection-diffusion equation: du/dt +

c(du/dx) = nu(d^2u/dx^2). Discretize the convection term using a

forward-difference stencil, and the diffusion term using a central

difference stencil, and use an explicit time-stepping scheme. You will

find that this scheme is conditionally stable. [An interesting special

case is when you perform this discretization on a uniform grid and choose

nu = c*dx. Compare this expression for u_i^{n+1} with the expression

obtained when a backward-difference stencil is used]

However, it is possible that the numerical scheme can end

up unstable in certain parts of the domain. One common way to ensure

that it is conditionally stable everywhere in the domain is using a

technique called "upwinding". The discretization scheme used at each

grid point is dynamically chosen depending on the sign of the velocity

at that point. If c>0, a backward-difference scheme is used, and if

c<0, a forward difference scheme is used. This can change for each

grid point and at each time step. The time step size dt will still need to

satisfy the CFL condition and other stability criteria, but upwinding

will ensure that the scheme is never unconditionally unstable at any

point.

Thanks

[...] This demo solves the incompressible Navier-Stokes equations. It illustrates how to: 6.1. Equation and solution method¶ We consider the incompressible Navier-Stokes equations on a domain. ME 702 - Computational Fluid Dynamics (Lecture "zero", part 1) CFD Python: 12 steps to Navier-Stokes :: Lorena A. Barba Group. [...]

[...] CFD Python (July 2013) [...]

Dr Barba,

Good Afternoon. I appreciate your philanthropic idea. I was curious to run one of your code (linear convection) in the compiler prescribed by this website, but the it doesn't display the graph you made.

Thanks a lot.

Sandip

Either select the part of the code and run the lines selectively

OR add plt.show() at the end... Probably you will get it...

Hello all,

I just came across this course and have just begun the same. I have completed step 1 and 2 . I have certain concern before I proceed further.

In step 1 when I created no, of grids points to be large, I got some weird curve. My question is how do I know whether the solution is correct or not??

hi professor Lorena

here is the problem on lid driven cavity

unit square with u = 0 and v = 0 on all sides but the top side where u =1 and v = 0

and kinematic viscosity as 0.01

using CDS2 for convection term and explicit euler scheme for time

i have seen your lessons but im not good at python would you help me with matlab

Hi, I need analytical solving of fluid flow in a cylindrical channel, it must be simplest model of flow, and it isn't important to choose what BC or other quantities. I just want to know the solving process of flow in a channel. Can you help me?

I really appreciate that you posted these; however, I was going back through step 4 and did the derivative by hand (double-checked with wolfram alpha) and I found that u(0) = -u(2*pi) [including after double checking with wolfram alpha] whereas it is posted in step 4 that u(0) = u(2*pi) for the given expression of phi. Can anyone explain i) how u(0) does equal u(2*pi) for the expression of u and phi [given in step 4], ii) they are off by a sign but it is somehow okay, or iii) what typo may exist in the expressions of u and phi given in step 4?

Also, I'm fairly certain that the later plot of step 8 displays the state somewhere around cycle 480 whereas nt=120; it's hard to say for certain my code is equivalent since the time-stepping piece is rather involved but this is what I had found when I was copy pasting the notebook commands and cleaning them up as well.

First of all, thank you for all these posts. But there is a problem with the link of the Burgers' equation (step 4) as it does not work. It would be great if you upload it again.

Thank you.

Hello Professor, I just joined this group, fortunately found on "Google Search". Can you please explain Lattice Boltzmann Method just like that " 12 steps to Navier-Stokes"?

However, this will be very useful to learn CFD specially using Python as a programming language.

Will you please guide me how to compute Aerodynamic forces of an obstacle (square or circular cylinder) in a fluid through a self generated code?

Hi dear Barba,

Thank you for this work.

I have a small remark. Please correct me if I'm wrong.

In your scripts, when you comment presPoissPeriodic an presPeriodic functions, I think you inverted variable x and y.

This doesn't affect the code.

Best regards,

Mehrez

Dear Lorena,

Thank you for sharing your work, it's awesome. But I'm having a hard time understanding your 2D implementation. In every of the notebooks I can see that the u is initialised as:

u = np.ones((ny,nx))

This means that the rows of the u array are related to the y direction and the columns are related to the x direction.

Furthermore when (for example) the 2D linear burger equation is solved you are using the following expression:

c*dt/dx*(un[i,j] - un[i-1,j])

To evaluate the derivative in the x-direction. As far as I'm concerned the rows of un, do have the information of the y axis,

and thus you should be using dy instead of dx. This problem is not raised up because you are using the same dimensions and subdivisions for

the x and y axis, but whenever this is changed there will be some errors.

Problem could be solved changing the u initialisation to:

u = np.ones((nx,ny))

Although the plots should be using the transposed of u in order to get the right axis.

Hope I'm wrong with my comments, but I've been thinking about this for a long time and I just cannot see if I'm making a mistake.

Thank you very much

i was just wondering how you can attach units to this... the pressure graph in the final step seems to be centered around 0... So really is what you are representing here the deviation from the ambient pressure?

Hi again, I just belatedly did step12 the channel flow, and it seems a little cooler if instead of imposing that constant F forcing function and going through all the trouble of the periodic boundary conditions, instead specify a Neumann bc for pressure at the left and right boudaries, say dp/dx = -F, and also Neumann bcs for u at the left and right boundaries, du/dx = 0, and you're good to go, plus you get the pressure levels appearing if you do a contour plot.

I get a lot of great information from this blog. Thanks for sharing this valuable information to our vision. You have posted a trust worthy blog keep sharing.

Python Training Institutes in Chennai

I've lost count on how many times I've visited this module. And everytime it's like the first time

Thank you not just for making my academic life richer, but also for contributing to the good of knowledge. That's the true purpose of a real teacher.

Thanks for sharing. It is a great initiative. God bless you.

Many thanks for your lessons, Prof.

I notice that the 2D geometry boundary here is rectangular. And I am wondering whether it is difficult to deal with the complicated boundary such as a laval nozzle? Is there much difference between FDM and FVM discretization?

Thank you Prof. Lorena for this information by the way I was listening to you talking about flight snakes at Universidad Técnica Federico Santa María last Monday.

Jorge Solar Olivares.

Master Sc degree Candidate. UTFSM.

Thanks for your lessons, mam. It had been a gateway for my coding in cfd. It provides me missing link between the my subject knowledge and programming skill.

Mam, In the 11th step of cfd-python "Cavity flow, with Navier Stokes", the pressure equation (3rd equation) is missing a term,

- delta t term (the time difference of velocities)

Can you please help me through this.

(I'm noting it because, your material is awesome and I feel, it shouldn't have any flaws.

secondly, in your lecture video: you mentioned that term as d/dt(du/dx+dv/dy), but in executing we take it as 1/dt(du/dx+dv/dy).

Dear Professor Lorena Barba, this is amazing lecture series to learn CFD from the very basics all for free !. I have been going through lectures and seem to be adding new things to my learning. Thanks for this !. I wish I could have also understood Python coding with the pseudocodes you discuss in lectures. I could not install it on my windows system and need help manual if there is any.

Hola Lore! Infinitas gracias por compartir todo este conocimiento! Para los que estamos empezando es super útil y estimulante (y hay poca gente en la web que comparta código, y menos con explicación) Un beso grande desde Argentina. Ramiro

Great utility! thanks for sharing! in step 1 ln3, with the code as it is in the notebook dx is being defined as an integer where it should be a float right? (1.0 instead of 1)

Please can some one help me to implement the R13 moments equations in matlab. Thank you so much in advance.

For burger equation, I am getting results as follows. Orange is computational one after 20 time steps and blue is our saw tooth profile. That is how our burger equation has to represent the saw tooth profile but in the website, your scales are different. it starts with something like 2.8 or 2.9 insted of 4. Correct me please.I have coded in C.

Thank you Prof. Barba.

Your videos allow me to pursue my passion, while I toil to pay bills.

I'm not sure if this will get a reply ... BUT, the pressure poisson equation in Step 11 has a few terms which seem to magically appear in the discretized form ... can someone explain to me where the "... 1/dt*[(u_i+1,j - u_i-1,j)/2/dx + (v_i,j+1 - v_i,j-1)/2/dy ..." comes from? I do not see analogous terms in the PDE.