Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disappearing viscosity term in the discrete version of Poisson-pressure equation #77

Open
Beramos opened this issue Oct 14, 2020 · 10 comments

Comments

@Beramos
Copy link

Beramos commented Oct 14, 2020

Thank you for this great course! I have been using this course to teach CFD-concepts in Belgium.

I'm stuck with the following question. In video lecture 11, a poisson equation is obtained to correct for the divergence in the velocity.

image

However in notebook 14 the discretised pressure-Poisson equation looks completely different than the one obtained
in the video lecture: https://youtu.be/ZjfxA3qq2Lg?t=1647

My question is: what happened in between the curved brackets in the video lecture and equation 13 in the notebook.

@Beramos Beramos changed the title Disappearing viscosity term in the Poisson-pressure equation in the discrete version Disappearing viscosity term in the discrete version of Poisson-pressure equation Oct 14, 2020
@piyueh
Copy link
Member

piyueh commented Oct 14, 2020

Hi @Beramos
If you were asking about the viscous term in the pressure Poisson equation, then that tern is zero due to the divergence-free condition.

Theoretically speaking, the conservation of mass in the previous time step should already be satisfied, i.e., . So when we apply divergence to the discretized mementum equation shown in this course, the viscous term becomes .

@Beramos
Copy link
Author

Beramos commented Oct 15, 2020

I'm not convinced by that statement since the whole point is that div(un) should be zero but is not zero due to numerical erros? That why we enforce div(un+1) to be zero through the Poisson-pressure equation.
image

I'm aware I'm being annoying but I'm looking for a sound explanation for my students 👼

@labarba
Copy link
Member

labarba commented Oct 15, 2020

@Beramos
Copy link
Author

Beramos commented Oct 15, 2020

@labarba, Thanks for taking the time to respond.
I've seen the post in my quest to better understanding the rationale.

Quoting your response:

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.

Based on which criterium did you decide to keep some of the divergence terms

image

So assuming div(un) = 0 (which is not the ensured) the viscosity term = 0 and I assume if you expand the convective term there is a second div(un) you can drop to end up with,

image

@labarba
Copy link
Member

labarba commented Oct 15, 2020

The pressure Poisson equation has caused a great deal of arguments in CFD. There are some subtle issues with it.

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.

@labarba
Copy link
Member

labarba commented Oct 15, 2020

But there are several variations on this...

Historically, two papers independently introduced a pressure equation to solve incompressible Navier-Stokes: Harlow & Welch (1965), and Chorin (1968).

Chorin proposes a fractional step approach whereby the N-S eq is solved in two steps: (1) ignore the pressure term in the momentum equation, and get a "temporary velocity", u⃗⋆ ; (2) correct this velocity by accounting for the pressure gradient and continuity. This leads to another Poisson equation for pressure that looks like this:
chorinPPE

Harlow & Welch work with fully discretized equations, and keep ALL the terms with divergence of velocity. They say that, in principle, the PPE without all the divergence terms could be used, but they add:

"In practice [the use of all the terms] is desirable in that the solution of [the discrete PPE] need not be nearly so accurately derived to keep the accumulation of compressional discrepancy to a sufficiently low level. Since [the PPE] is solved by an iterative procedure, there is considerable economy in computer usage resulting from any process which decreases the required accuracy of solution. Tests have shown, however, that with a very stringent convergence requirement, the cumulative results of a calculation are independent of whether [all divergence terms are kept or ignored in the PPE]."

Another paper that illustrates the "confusion regarding the use of a Poisson equation for pressure" is Roache (1988). He addresses the important question of boundary conditions, as well as adding that:

... a significant advantage of the MAC method [by Harlow & Welch] is that incomplete iterative convergence can be prevented from introducing non-linear instability by the ingenious device of retaining a time derivative for the dilatation, which in the continuum is identically zero, and setting the dilatation to zero at the advanced time step."

In conclusion, we could have neglected all the divergence terms in the equation used for Steps 11 and 12, and you would have been happy. Instead we left one term; we could have left them all, but that would have been a lot more work for you.

@Beramos
Copy link
Author

Beramos commented Oct 15, 2020 via email

@labarba
Copy link
Member

labarba commented Oct 15, 2020

Out of curiosity, what course do you teach, and how many students is this reaching? We get very little glimpse into hour our public materials are used, and it is satisfying to know about it...

@piyueh
Copy link
Member

piyueh commented Oct 15, 2020

@Beramos Thanks for this question. It motivated me to re-visit the original paper from Harlow and Welch. I agree with @labarba.

Harlow, F. H., & Welch, J. E. (1965). Numerical calculation of time‐dependent viscous incompressible flow of fluid with free surface. The physics of fluids, 8(12), 2182-2189.

Harlow and Welch suggested keeping all divergence-related terms at time n because it is then unnecessary to solve the pressure accurately. Also, the error accumulation in time caused by nonzero divergence can be contained -- when solving the divergence-free at n+1 (i.e., solving the PPE), we always consider and relieve the divergence error introduced from time n.

However, assume that 1). we solve the pressure accurately, 2). discretized boundary conditions are divergence-free, and 3). initial conditions are also divergence-free. The divergence can then also be assumed to be zero. It should not matter how many divergence-related terms of time step n we drop from the original PPE. Harlow and Welch mentioned this.

We assume the divergence at n is zero, and then drop them. But we actually do not solve the pressure to an extremely accurate state. Then the divergence-free assumption is invalid. This does sound somehow odd. However, for me, I'll say it's just a numerical error. Every numerical scheme has its limitations, assumptions, approximations, and numerical errors. And I feel like the dropped non-free divergence is just one of them.

The step 11 drops only the divergence term in the viscous term but keeps the one in the temporal derivative. I guess the reason is the implementation difficulty due to the boundary nodes. This is an entry-level teaching material, so it tries to keep things simple. And by considering at least one divergence term, it may still give the desired stability property (I think. No proof.).

@Beramos
Copy link
Author

Beramos commented Oct 16, 2020

@piyueh @labarba Thank you for the clarification. The 12 steps to Navier-Stokes course is a module in a practical, advanced modelling course taught at the faculty of bio-science engineering at Ghent University, Belgium. This year there are 20 students taking this course. I've been using your course material since last year and it has been a pleasure using it since it is very self-explanatory. I've added a couple of things, like implicit methods (using the method of lines as an example) but it is mostly your course material.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants