CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

Solving momentum Equation from known pressure field

Register Blogs Community New Posts Updated Threads Search

Like Tree20Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 6, 2021, 20:13
Default Solving momentum Equation from known pressure field
  #1
New Member
 
Naive CFD
Join Date: Jun 2021
Posts: 25
Rep Power: 5
Deep111090 is on a distinguished road
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.
aerosayan likes this.
Deep111090 is offline   Reply With Quote

Old   July 7, 2021, 06:02
Default
  #2
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,897
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
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.
aerosayan and aero_head like this.
FMDenaro is offline   Reply With Quote

Old   July 7, 2021, 08:37
Default
  #3
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,195
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
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.
sbaffini is offline   Reply With Quote

Old   July 7, 2021, 10:23
Default
  #4
New Member
 
Continuum
Join Date: Aug 2009
Posts: 19
Rep Power: 17
Continuum is on a distinguished road
Quote:
Originally Posted by Deep111090 View Post
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 is offline   Reply With Quote

Old   July 7, 2021, 10:25
Default
  #5
New Member
 
Continuum
Join Date: Aug 2009
Posts: 19
Rep Power: 17
Continuum is on a distinguished road
Quote:
Originally Posted by sbaffini View Post
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
Continuum is offline   Reply With Quote

Old   July 7, 2021, 10:49
Default
  #6
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,195
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
Quote:
Originally Posted by Continuum View Post
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.
sbaffini is offline   Reply With Quote

Old   July 7, 2021, 10:55
Default
  #7
New Member
 
Continuum
Join Date: Aug 2009
Posts: 19
Rep Power: 17
Continuum is on a distinguished road
Quote:
Originally Posted by sbaffini View Post
...
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
sbaffini and aerosayan like this.
Continuum is offline   Reply With Quote

Old   July 7, 2021, 12:46
Default
  #8
New Member
 
Naive CFD
Join Date: Jun 2021
Posts: 25
Rep Power: 5
Deep111090 is on a distinguished road
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 likes this.
Deep111090 is offline   Reply With Quote

Old   July 7, 2021, 12:59
Default
  #9
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,195
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
Quote:
Originally Posted by Deep111090 View Post
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).
sbaffini is offline   Reply With Quote

Old   July 7, 2021, 13:12
Default
  #10
New Member
 
Naive CFD
Join Date: Jun 2021
Posts: 25
Rep Power: 5
Deep111090 is on a distinguished road
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.
Deep111090 is offline   Reply With Quote

Old   July 7, 2021, 13:29
Default
  #11
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,195
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
Quote:
Originally Posted by Deep111090 View Post
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.
sbaffini is offline   Reply With Quote

Old   July 7, 2021, 13:35
Default
  #12
New Member
 
Naive CFD
Join Date: Jun 2021
Posts: 25
Rep Power: 5
Deep111090 is on a distinguished road
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.
sbaffini likes this.
Deep111090 is offline   Reply With Quote

Old   July 7, 2021, 14:13
Default
  #13
Senior Member
 
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,291
Rep Power: 35
arjun will become famous soon enougharjun will become famous soon enough
Quote:
Originally Posted by Deep111090 View Post


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.
arjun is offline   Reply With Quote

Old   July 7, 2021, 14:18
Default
  #14
New Member
 
Naive CFD
Join Date: Jun 2021
Posts: 25
Rep Power: 5
Deep111090 is on a distinguished road
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.
Deep111090 is offline   Reply With Quote

Old   July 7, 2021, 14:35
Default
  #15
Senior Member
 
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,291
Rep Power: 35
arjun will become famous soon enougharjun will become famous soon enough
Quote:
Originally Posted by Deep111090 View Post
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 is offline   Reply With Quote

Old   July 8, 2021, 00:25
Default
  #16
Senior Member
 
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,291
Rep Power: 35
arjun will become famous soon enougharjun will become famous soon enough
Quote:
Originally Posted by spiceagent11 View Post
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).
Deep111090 likes this.
arjun is offline   Reply With Quote

Old   July 8, 2021, 03:14
Default
  #17
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,897
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
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.
arjun and Deep111090 like this.
FMDenaro is offline   Reply With Quote

Old   July 8, 2021, 05:29
Default
  #18
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,195
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
Quote:
Originally Posted by FMDenaro View Post
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.
Deep111090 likes this.
sbaffini is offline   Reply With Quote

Old   July 8, 2021, 05:35
Default
  #19
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,897
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by sbaffini View Post
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.
sbaffini and Deep111090 like this.
FMDenaro is offline   Reply With Quote

Old   July 8, 2021, 05:43
Default
  #20
Senior Member
 
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,291
Rep Power: 35
arjun will become famous soon enougharjun will become famous soon enough
Quote:
Originally Posted by sbaffini View Post
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.
Deep111090 likes this.
arjun is offline   Reply With Quote

Reply

Tags
cfd, lid driven cavity, simple algorithm


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Suppress twoPhaseEulerFoam energy AlmostSurelyRob OpenFOAM Running, Solving & CFD 33 September 25, 2018 18:45
Segmentation fault when using reactingFOAM for Fluids Tommy Floessner OpenFOAM Running, Solving & CFD 4 April 22, 2018 13:30
Free surface issues with interDyMFoam for hydroturbine oumnion OpenFOAM Running, Solving & CFD 0 October 6, 2017 15:05
chtMultiRegionSimpleFoam turbulent case Aditya Patil OpenFOAM Running, Solving & CFD 6 April 24, 2017 23:13
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 07:20


All times are GMT -4. The time now is 23:56.