CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   Solving momentum Equation from known pressure field (https://www.cfd-online.com/Forums/main/237232-solving-momentum-equation-known-pressure-field.html)

Deep111090 July 6, 2021 19:13

Solving momentum Equation from known pressure field
 
Hi All,
This may sound a bit naive but i have been stuck upon this question for few days.
I am solving a 2D lid driven flow using SIMPLE algorithm. Till now, I have a working code which give accurate results with respect to benchmark values.
But as i am experimenting with this. i decided to feed a known pressure field into the the discretized momentum equations to solve for the velocity field. (omitting the solution of Poisson equations for pressure). However, starting from random velocity fields with known boundary conditions, I am only able to achieve convergence up-to Reynolds number of 100 and beyond that the solution does not converge and gives inaccurate velocity fields even if i feed correct pressure field.



I tried same thing in openFOAM by modifying the solver to omit the pressure calculation step and feed the correct pressure field as initial condition. The result remains the same, the solution converges upto 100 Reynolds number beyond that the solution does not converge.
I was wondering what can be the reason behind this.

Thanks in advance.
PS: if my question is not clear please feel free to ask for more details.

FMDenaro July 7, 2021 05:02

The best way to do this kind of test is using the exact Taylor solution.
However, you need to think of the pressure gradient as a known term in the momentum but you no longer solve the continuity equation. This is the issue.

sbaffini July 7, 2021 07:37

Pressure and velocity boundary conditions are usually interlinked and you can't just skip one of them. Also, the continuity preserving mass flux in the momentum equations is based on the pressure. As a matter of fact, you are just using a random wrong modification of an algorithm

What you are trying to do just works at low Re number because viscosity is high enough to sustain what you are trying to do.

Follow the Filippo suggestion and you'll see that you're having 0-th order accuracy even when velocity converges.

Besides this, a random velocity field initialization is not, in general, guaranteed to converge even if using the correct algorithm. The higher the Re, the more true this becomes.

Continuum July 7, 2021 09:23

Quote:

Originally Posted by Deep111090 (Post 807648)
Hi All,
This may sound a bit naive but i have been stuck upon this question for few days.
I am solving a 2D lid driven flow using SIMPLE algorithm. Till now, I have a working code which give accurate results with respect to benchmark values.
But as i am experimenting with this. i decided to feed a known pressure field into the the discretized momentum equations to solve for the velocity field. (omitting the solution of Poisson equations for pressure). However, starting from random velocity fields with known boundary conditions, I am only able to achieve convergence up-to Reynolds number of 100 and beyond that the solution does not converge and gives inaccurate velocity fields even if i feed correct pressure field.



I tried same thing in openFOAM by modifying the solver to omit the pressure calculation step and feed the correct pressure field as initial condition. The result remains the same, the solution converges upto 100 Reynolds number beyond that the solution does not converge.
I was wondering what can be the reason behind this.

Thanks in advance.
PS: if my question is not clear please feel free to ask for more details.


Good morning,


First, I think your question is entirely clear. Second, I was in a situation to run this test since I had a Ghia comparison simulation setup at Re 100. I used the solved pressure field, disabled the pressure solution and then initialized just the uv velocities to 0 m/s. My CFD code uses a PPE formulation (non-FOAM). Anyway, it did solve rapidly using the fixed pressure field.



then I set the lid velocity at x4, so Re ~ 400. Same approach. Get P field, init uv = 0, solve just uv momentum (in this case w is solved but the domain is 2D).



To my surprise, I am seeing exactly as you've noted.


I'd have to give some thought as to the reasons.



I cannot load an image of the v field but it looks discontinuous like shock waves.


Regards

Continuum July 7, 2021 09:25

Quote:

Originally Posted by sbaffini (Post 807697)
Pressure and velocity boundary conditions are usually interlinked and you can't just skip one of them. Also, the continuity preserving mass flux in the momentum equations is based on the pressure. ...


Agree with this assertion. Also, the PPE source includes an evolving -DIV(v)/dt term. Thinking that the P field must be corrected in situ with the momentum solution.


Regards

sbaffini July 7, 2021 09:49

Quote:

Originally Posted by Continuum (Post 807706)
Good morning,


First, I think your question is entirely clear. Second, I was in a situation to run this test since I had a Ghia comparison simulation setup at Re 100. I used the solved pressure field, disabled the pressure solution and then initialized just the uv velocities to 0 m/s. My CFD code uses a PPE formulation (non-FOAM). Anyway, it did solve rapidly using the fixed pressure field.



then I set the lid velocity at x4, so Re ~ 400. Same approach. Get P field, init uv = 0, solve just uv momentum (in this case w is solved but the domain is 2D).



To my surprise, I am seeing exactly as you've noted.


I'd have to give some thought as to the reasons.



I cannot load an image of the v field but it looks discontinuous like shock waves.


Regards

Note that your approach is indeed very legitimate and sound (yet there might certainly be other difficulties in general). You use a pressure which is, indeed, the exact numerical solution for your code and grid. We don't know where Deep111090 took its initial pressure from.

Random initialization vs a constant also is kind of a main difference.

Yet, it is unclear to me what you both mean by convergence. Are we taliking about machine epsilon difference with a regular solution or what?

In the end, you both should know what algorithms you are using and how, exactly, a fixed initial pressure affects them. In general, my expectation, is that it is not guaranteed at all to converge to the right solution.

In general, if the current pressure correction is not making the current mass flow divergence free (and it can't if it doesn't come from the pressure solved with the current vleocity field) I see a problem.

Continuum July 7, 2021 09:55

Quote:

Originally Posted by sbaffini (Post 807710)
...
Yet, it is unclear to me what you both mean by convergence. Are we taliking about machine epsilon difference with a regular solution or what?


Sorry, not clear. The v field is solving properly but does not look like the proper field when P, u, v solved in unison. My solver is an ADI based methodology with parabolized PPE so there is no iteration - only time based marching. I solved at a nominal CFD of 1.0.


I tried this simulation since I've seen this in general. the PPE is slow to converge. In general, I have found no way to speed the pressure solution along side the momentum solution. Without any backing mathematics, I'd say that this has converged to an unrealistic solution, sort of like a quasi-steady point, unrealistic of course.



Interesting find.


Regards

Deep111090 July 7, 2021 11:46

Thanks, Fillipo, Sbaffini, and Continuum for quick and apt responses.
I am convinced that not solving continuity is the issue. However, I am not sure why this fact is a problem at higher Reynolds numbers and gives correct velocity values at lower Re.
I will reiterate that first I run a simulation at a particular Reynolds number and save the corresponding pressure field. After this, I start my test by disabling the pressure solution step as I am feeding the pressure field obtained earlier as an input to momentum equations. So my approach is similar to what was used by @Continuum. Regarding random initialization of the velocity field with known boundary conditions, I have tried all zero values to initialize the velocity as well.

As Sbaffini said at a lower Reynolds number the viscous effects are high enough to sustain what I am doing and give correct results. This sounds correct but warrants a question of why these high viscous effects circumvent the need to solve continuity equation.
Also Sbaffini, sorry I used the term convergence rather loosely, what it meant was that at higher Reynolds numbers the velocity fields that i obtained from correct pressure fields (pressure field being obtained and saved earlier by SIMPLE for given Reynolds number) are not correct. These velocity fields have discontinuities as @continuum suggested.
Thanks again.

sbaffini July 7, 2021 11:59

Quote:

Originally Posted by Deep111090 (Post 807723)
Thanks, Fillipo, Sbaffini, and Continuum for quick and apt responses.
I am convinced that not solving continuity is the issue. However, I am not sure why this fact is a problem at higher Reynolds numbers and gives correct velocity values at lower Re.
I will reiterate that first I run a simulation at a particular Reynolds number and save the corresponding pressure field. After this, I start my test by disabling the pressure solution step as I am feeding the pressure field obtained earlier as an input to momentum equations. So my approach is similar to what was used by @Continuum. Regarding random initialization of the velocity field with known boundary conditions, I have tried all zero values to initialize the velocity as well.

As Sbaffini said at a lower Reynolds number the viscous effects are high enough to sustain what I am doing and give correct results. This sounds correct but warrants a question of why these high viscous effects circumvent the need to solve continuity equation.
Also Sbaffini, sorry I used the term convergence rather loosely, what it meant was that at higher Reynolds numbers the velocity fields that i obtained from correct pressure fields (pressure field being obtained and saved earlier by SIMPLE for given Reynolds number) are not correct. These velocity fields have discontinuities as @continuum suggested.
Thanks again.

Ok, I didn't get that from your first post. So, if I now understand correctly, you are saying that using that pressure solution (hopefully a fully converged one to machine precision), there are cases that produce correct answers (low Re) and cases which don't (high Re)? Could you qualify how you check the correctness? Do you have an error norm with respect to the velocity field which is the companion solution of the used pressure?

Very roughly speaking, an explanation could be: at least for incompressible flows, the pressure adapts to the dominant term in the momentum equations. For high Re number this is the convective term (that also depends from pressure because of typical Rhie-Chow treatment). For low Re cases it is the diffusive term. So, assume convective term is negligible, what you have is iterations on the velocity field until the diffusive term balances a fixed source term (the pressure gradient).

Deep111090 July 7, 2021 12:12

Thanks Sbaffini, for checking correctness, (Sorry, this sounds repetitive.)
Simulation 1: I run a simulation that gives me velocity field and pressure field up to machine precision.
Simulation 2: Now I use this pressure from simulation 1 to obtain velocity field with same boundary conditions, with pressure solution disabled so just using the momentum equations.
Checking correctness 3: The velocity fields that are obtained in simulation 2 are checked against the ones obtained from simulation 1. Ideally, that should match because they are corresponding to the same pressure field. In my case, they match exactly for low Reynolds number and do not match or even look the same at higher Reynolds number.
On a different note, these are also checked against the work of Ghia et. al. for benchmarking.

sbaffini July 7, 2021 12:29

Quote:

Originally Posted by Deep111090 (Post 807728)
In my case, they match exactly for low Reynolds number

So, within machine precision? Or do you have any other quantification of the difference?

If it is so, than the dominance of the viscous effects might be the explanation. Together with the fact that this specific case only has wall boundary conditions so, overall, continuity is also preserved.

One way to prove this would be to redo the experiment without the convective term alltogether.

Or, differently, to compare the convective terms in the two solutions (might be more cumbersone in a finite volume context). Indeed, one scenario is the one with negligible convection. The other one is with self-balanced, but not completely negligible, convection. Probably, this case is a mixture of both. That is, low-Re seems a mandatory requirement for things to work, but probably would not work by itself in all the cases.

Deep111090 July 7, 2021 12:35

Thanks Sbaffin,Yes machine precision is the only measure.
This seems like a good hypothesis, I will try to do it again with the your suggestions and get back.

arjun July 7, 2021 13:13

Quote:

Originally Posted by Deep111090 (Post 807648)


I tried same thing in openFOAM by modifying the solver to omit the pressure calculation step and feed the correct pressure field as initial condition. The result remains the same, the solution converges upto 100 Reynolds number beyond that the solution does not converge.
I was wondering what can be the reason behind this.

Thanks in advance.
PS: if my question is not clear please feel free to ask for more details.



Very hard to tell what happening it there but in my code Wildkatze when flow model was developed from benchmark solution, i also first solved momentum with given pressure field and had absolutely no problems getting converged results. If pressure is fixed then momentum actually works much easy.


My guess is that the fluxes in your case are not okay thus you face issues.

Deep111090 July 7, 2021 13:18

Hi Arjun, Thanks for the response.Can you share some more details about the flow that you were solving. Also, what was the Reynolds number of the flow you were solving. Also is it possible for you to share your code.

arjun July 7, 2021 13:35

Quote:

Originally Posted by Deep111090 (Post 807732)
Hi Arjun, Thanks for the response.Can you share some more details about the flow that you were solving. Also, what was the Reynolds number of the flow you were solving. Also is it possible for you to share your code.


I used this https://onlinelibrary.wiley.com/doi/...fld.1650190502

But it should not matter. If it matters then something is wrong somewhere.


As I mentioned momentum is much much easier to solve from given pressure field than to get pressure from velocity.

arjun July 7, 2021 23:25

Quote:

Originally Posted by spiceagent11 (Post 807764)
he solution converges upto 100 Reynolds number beyond that the solution does not converge.
I was wondering what can be the reason behind this.


If it is so Reynolds number dependent then the convection scheme is at fault. (assuming there is no bug).

FMDenaro July 8, 2021 02:14

To understand the issue I suggest to consider the Hodge decomposition

a + Grad p = a*

At the steady state, if you provide the correct discrete pressure gradient field it must balance convection and diffusion terms, discretized with the same operators.

sbaffini July 8, 2021 04:29

Quote:

Originally Posted by FMDenaro (Post 807776)
To understand the issue I suggest to consider the Hodge decomposition

a + Grad p = a*

At the steady state, if you provide the correct discrete pressure gradient field it must balance convection and diffusion terms, discretized with the same operators.

Even if the approach is based on:

1) A non pressure-free method (where GRAD(p_n) is used in first advancing u_n to u*)?

2) A mass flux that, for a given velocity field, is mass preserving only if based on the pressure correction for the current flow field u*?

My doubt, in these conditions, is on the practical reachability of the same steady state achieved with the correct algorithm and independently from the case.

Analytical solutions are nice, but typically hide certain exact balances between terms (e.g., in the Taylor solution the pressure gradient always balances the convective term) which might mask some issues.

FMDenaro July 8, 2021 04:35

Quote:

Originally Posted by sbaffini (Post 807790)
Even if the approach is based on:

1) A non pressure-free method (where GRAD(p_n) is used in first advancing u_n to u*)?

2) A mass flux that, for a given velocity field, is mass preserving only if based on the pressure correction for the current flow field u*?

My doubt, in these conditions, is on the practical reachability of the same steady state achieved with the correct algorithm and independently from the case.

Analytical solutions are nice, but typically hide certain exact balances between terms (e.g., in the Taylor solution the pressure gradient always balances the convective term) which might mask some issues.

No Paolo, I am talking about the discretized Hodge decomposition at the steady state. If you provide the discrete pressure gradient that satisfies

Div Grad p = Div a*

With the correct BCs you should be able to solve for V.

arjun July 8, 2021 04:43

Quote:

Originally Posted by sbaffini (Post 807790)
Even if the approach is based on:

1) A non pressure-free method (where GRAD(p_n) is used in first advancing u_n to u*)?

2) A mass flux that, for a given velocity field, is mass preserving only if based on the pressure correction for the current flow field u*?

My doubt, in these conditions, is on the practical reachability of the same steady state achieved with the correct algorithm and independently from the case.

Analytical solutions are nice, but typically hide certain exact balances between terms (e.g., in the Taylor solution the pressure gradient always balances the convective term) which might mask some issues.


Speaking only for Finite Volume Collocated solvers, the pressure only ends up in fluxes via dissipation like Rie and Chow dissipation for example. The way it does is that for smooth pressure the dissipation should theoritically be 0.


What it means is that pressure gradient is only source term (from pressure) in momentum equation. One should be able to get the velocity field for this source term ( -grad of P).

Now due to descretization errors the dissipation is not 0 but it is very small. If it is not small then one need to fix his code.


All times are GMT -4. The time now is 06:42.