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

Pressure equation in NS

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 2, 2021, 11:11
Default Pressure equation in NS
  #1
Senior Member
 
mohammad
Join Date: Sep 2015
Posts: 279
Rep Power: 12
mostanad is on a distinguished road
Hi everyone
I have a question about pressure in NSE. I am looking at an algorithm in immersed boundary method which shows me the following equations for pressure correction;
1-




which is a Poisson equation for pressure correction.
However, I have another procedure as well for pressure equation in OpenFOAM as follows:
2-



So as you see the procedure in the first method is really straightforward. On the other hand, the pressure equation in the second method (OpenFOAM) uses some fluid variables from velocity equation that is not suitable for my case. Indeed I have a field with different viscosity at different cells, and using pressure equation leads to a wrong solution for pressure like this:


viscosity:




pressure:



So can anyone tell me what is the difference between these methods? Are these methods the same for my case?
mostanad is offline   Reply With Quote

Old   October 4, 2021, 01:32
Default
  #2
Senior Member
 
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,285
Rep Power: 34
arjun will become famous soon enougharjun will become famous soon enough
Quote:
Originally Posted by mostanad View Post
Hi everyone
I have a question about pressure in NSE. I am looking at an algorithm in immersed boundary method which shows me the following equations for pressure correction;
1-




Here you will not have density in the equation. You just have dt.



Quote:
Originally Posted by mostanad View Post
So can anyone tell me what is the difference between these methods? Are these methods the same for my case?


Before the difference,

The U interpolated to face is NOT U = A^-1 H - A^-1 grad P

it is

U = A^-1 H - (control volume) A^-1 grad P

Where A is diagonal of momentum matrix.

Now this is how openfoam writes it. In practice this is achieved by replacing A^-1 H as U current estimate of velocity

So the way openfoam does is that it first create a variable



U_rc = U current estimate - (control volume) A^-1 grad P


Interpolate this variable to face centers and calculate the mass imblance to calculate the continuity source term.

Fluent, Starccm etc do not create this intermediate variable U_rc they directly calculate flux by above formula on faces (so they are essentially same method, openfoam does not do different Rie and Chow method).

Now about the main difference with the fractional solver that you wrote above.

You can actually only keep the transient term of Ap from momentum equation diagonal , which will be ( control volume ) / dt and still use the openfoam (or fluent etc formula).

It works because i have done so successfully. You can get then

U_rc = U current estimate - dt grad P,

which is same as your fractional solver formula and it does work good.
arjun is offline   Reply With Quote

Old   October 4, 2021, 03:50
Default
  #3
Senior Member
 
mohammad
Join Date: Sep 2015
Posts: 279
Rep Power: 12
mostanad is on a distinguished road
Quote:
Originally Posted by arjun View Post


Here you will not have density in the equation. You just have dt.

Yes. But this is actual pressure value. In OF it will be divided by density.


Quote:
Originally Posted by arjun View Post


Before the difference,

The U interpolated to face is NOT U = A^-1 H - A^-1 grad P

it is

U = A^-1 H - (control volume) A^-1 grad P

Where A is diagonal of momentum matrix.

Now this is how openfoam writes it. In practice this is achieved by replacing A^-1 H as U current estimate of velocity

So the way openfoam does is that it first create a variable



U_rc = U current estimate - (control volume) A^-1 grad P


Interpolate this variable to face centers and calculate the mass imblance to calculate the continuity source term.

Fluent, Starccm etc do not create this intermediate variable U_rc they directly calculate flux by above formula on faces (so they are essentially same method, openfoam does not do different Rie and Chow method).

I didn't tell anything about this. You are right. In different software you can find different implementations. However, OF just takes off-diagonal elements in momentum matrix system as H.


Quote:
Originally Posted by arjun View Post
Now about the main difference with the fractional solver that you wrote above.

You can actually only keep the transient term of Ap from momentum equation diagonal , which will be ( control volume ) / dt and still use the openfoam (or fluent etc formula).

It works because i have done so successfully. You can get then

U_rc = U current estimate - dt grad P,

which is same as your fractional solver formula and it does work good.

Again my question is something else. Why in the first method, the projection is so clear and without any viscosity/density dependent variables? But in the second method, for the pressure equation, OF deals with a set of fluid properties!
mostanad is offline   Reply With Quote

Old   October 4, 2021, 04:02
Default
  #4
Senior Member
 
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,285
Rep Power: 34
arjun will become famous soon enougharjun will become famous soon enough
Quote:
Originally Posted by mostanad View Post
Yes. But this is actual pressure value. In OF it will be divided by density.
No it will not. The end formula will not have density there. If you have you are doing something off. (it might even work because air density is 1.22 so division and multiplication just slightly scale the things. But your pressure shall be off in the end.

(if you mean the pressure in OF is divided by density then the placement of density shall remove that division so you shall have -den * ( grad (p/ den) ) NOT -grad( p/den) / den that you wrote. )

Quote:
Originally Posted by mostanad View Post

I didn't tell anything about this. You are right. In different software you can find different implementations. However, OF just takes off-diagonal elements in momentum matrix system as H.
As far as I remember from openfoam code the use current velocity to make the velocity and for Ap or A here, i am not sure what they do. Traditionally we use diagonal (they shall be also).

You should double check here.


Quote:
Originally Posted by mostanad View Post

Again my question is something else. Why in the first method, the projection is so clear and without any viscosity/density dependent variables? But in the second method, for the pressure equation, OF deals with a set of fluid properties!

Your question was what is the difference between the two approach. The difference is one is ignoring the convection and diffusion term contribution to momentum equation diaginal when constructing pressure equation.

Now if question is WHY then, the answer lies in the timeline of development of the schemes.

Now we know that dt or A^-1 is just an approaximation to Schur compliment for Navier stokes equation. BAAACK then we did not know this. So the difference in approaches.
arjun is offline   Reply With Quote

Old   October 4, 2021, 04:27
Default
  #5
Senior Member
 
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,747
Rep Power: 66
LuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura about
I don't think it's really about neglecting the convection and diffusion terms...


It seems to me like the first one is explicitly assuming a constant viscosity and constant density fluid. Otherwise density would be inside the divergence operator and there would be another convection term. Even for incompressible flows (divergence free velocity field) there would still be a viscous (viscosity containing) term. There's also a negative sign missing in the 1st equation and inconsistent labeling in the 2nd equation. So not only do I not like whoever wrote the 1st set of equations, I wouldn't trust them either.

Anyway, that's why the projection is "so clear" and without any viscosity and density dependent variables.
LuckyTran is offline   Reply With Quote

Old   October 4, 2021, 04:59
Default
  #6
Senior Member
 
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,285
Rep Power: 34
arjun will become famous soon enougharjun will become famous soon enough
Quote:
Originally Posted by LuckyTran View Post

It seems to me like the first one is explicitly assuming a constant viscosity and constant density fluid.
Tascflow and Earlier versions of CFX did this. They had a formula where they just summed assuming these things constant to assemble Ap. (in 1990s).

The formula for Ap then comes out to be

(control volume)/ dt + Sum of (convectiona and diffusion fluxes assuming constant density and viscosity).
arjun is offline   Reply With Quote

Old   October 4, 2021, 11:47
Default
  #7
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,849
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
I don't understand the question ... in the first method u** depends on the viscosity...
FMDenaro is offline   Reply With Quote

Old   October 4, 2021, 20:08
Default
  #8
Senior Member
 
mohammad
Join Date: Sep 2015
Posts: 279
Rep Power: 12
mostanad is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
I don't understand the question ... in the first method u** depends on the viscosity...

The question is that how the simple equations in first method can be the same as second one?
mostanad is offline   Reply With Quote

Old   October 4, 2021, 21:14
Default
  #9
Senior Member
 
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,747
Rep Power: 66
LuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura about
Quote:
Originally Posted by mostanad View Post
The question is that how the simple equations in first method can be the same as second one?

u** usually denotes the true, unknown solution to the momentum equation with the correct pressure field.


Regardless of whether u** is the true solution or the predictor using the guessed pressure field, they're both solutions to the momentum equation with a viscous term. Your pressure corrector therefore always contains some dependence on viscosity, at least inheriting some from the velocity predictor.
LuckyTran is offline   Reply With Quote

Old   October 4, 2021, 21:30
Default
  #10
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,849
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by mostanad View Post
The question is that how the simple equations in first method can be the same as second one?
The first method (the equation has to be written has div grad p ) is for a finite difference method while OF illustrates the method for a general finite volume method
FMDenaro is offline   Reply With Quote

Old   October 5, 2021, 02:12
Default
  #11
Senior Member
 
mohammad
Join Date: Sep 2015
Posts: 279
Rep Power: 12
mostanad is on a distinguished road
Quote:
Originally Posted by LuckyTran View Post
u** usually denotes the true, unknown solution to the momentum equation with the correct pressure field.


Regardless of whether u** is the true solution or the predictor using the guessed pressure field, they're both solutions to the momentum equation with a viscous term. Your pressure corrector therefore always contains some dependence on viscosity, at least inheriting some from the velocity predictor.
Ok. But how can we get rid of this dependence? I have a pressure-velocity coupling algorithm and it sucks when I impose a very high viscosity in a part of domain. The problem is regarding the pressure.
mostanad is offline   Reply With Quote

Old   October 5, 2021, 02:14
Default
  #12
Senior Member
 
mohammad
Join Date: Sep 2015
Posts: 279
Rep Power: 12
mostanad is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
The first method (the equation has to be written has div grad p ) is for a finite difference method while OF illustrates the method for a general finite volume method
Ok. you mean when the pressure correction method is in a simple form, it is actually solved using FDM. But the second method that comes from OF is based on FVM. Am I right?
mostanad is offline   Reply With Quote

Old   October 5, 2021, 02:21
Default
  #13
Senior Member
 
mohammad
Join Date: Sep 2015
Posts: 279
Rep Power: 12
mostanad is on a distinguished road
Quote:
Originally Posted by arjun View Post
No it will not. The end formula will not have density there. If you have you are doing something off. (it might even work because air density is 1.22 so division and multiplication just slightly scale the things. But your pressure shall be off in the end.

(if you mean the pressure in OF is divided by density then the placement of density shall remove that division so you shall have -den * ( grad (p/ den) ) NOT -grad( p/den) / den that you wrote. )



As far as I remember from openfoam code the use current velocity to make the velocity and for Ap or A here, i am not sure what they do. Traditionally we use diagonal (they shall be also).

You should double check here.





Your question was what is the difference between the two approach. The difference is one is ignoring the convection and diffusion term contribution to momentum equation diaginal when constructing pressure equation.

Now if question is WHY then, the answer lies in the timeline of development of the schemes.

Now we know that dt or A^-1 is just an approaximation to Schur compliment for Navier stokes equation. BAAACK then we did not know this. So the difference in approaches.

Dear Arjun,
My question still refers to imposing higher viscosity inside the particle, or making the solution independent from inside the particle.

As I saw in the papers, IBMs (like Breugem) using the first method for pressure-velocity correction doesn't have any violated pressure field from NSE. However, the second method in OF gives rise to an irregular pressure field.
mostanad is offline   Reply With Quote

Old   October 5, 2021, 03:22
Default
  #14
Senior Member
 
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,285
Rep Power: 34
arjun will become famous soon enougharjun will become famous soon enough
Quote:
Originally Posted by mostanad View Post
Dear Arjun,
My question still refers to imposing higher viscosity inside the particle, or making the solution independent from inside the particle.
This was the question in last thread. The problem is that you keep mixing things. If you want to solve problem you need NOT to be focused on so many things at one time.

So let me ask you this question:

What is immersed boundary doing here for you?




------------------------
Immersed boundary is used to enforce the velocity usually. So question is are you using it this way here?
arjun is offline   Reply With Quote

Old   October 5, 2021, 06:28
Default
  #15
Senior Member
 
mohammad
Join Date: Sep 2015
Posts: 279
Rep Power: 12
mostanad is on a distinguished road
Quote:
Originally Posted by arjun View Post
This was the question in last thread. The problem is that you keep mixing things. If you want to solve problem you need NOT to be focused on so many things at one time.

So let me ask you this question:

What is immersed boundary doing here for you?




------------------------
Immersed boundary is used to enforce the velocity usually. So question is are you using it this way here?

I don't believe in this. It is used to have a correct pressure and velocity fields corresponding to a solid object in the fluid field. This can be obtained using a suitable forcing approach.



I can understand a number of immersed boundary methods like direct-forcing (Breugem or Uhlmann) or Ghost cell. However, the current immersed boundary method I am using now has some steps still unclear to me. That is my problem.

Can I write for you this Immersed Boundary method to help me in understanding that? This is the key part of my problem. There is no paper describing this method in terms of CFD on internet.

Cheers,
Mohammad
mostanad is offline   Reply With Quote

Old   October 5, 2021, 11:55
Default
  #16
Senior Member
 
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,285
Rep Power: 34
arjun will become famous soon enougharjun will become famous soon enough
So you did not answer the question poised.

Usually immersed boundary is to force the motion of solid body to the fluid domain in the backgroud.

That is it is used to impose the velocity field.

Now if you impose the velocity field, why do you need viscosity for?

Velocity in the immersed region is decided by the body and is fixed. The viscosity is needed to solve the fluid flow equation.



[QUOTE=mostanad;813622
I can understand a number of immersed boundary methods like direct-forcing (Breugem or Uhlmann) or Ghost cell. However, the current immersed boundary method I am using now has some steps still unclear to me. That is my problem.
[/QUOTE]




Quote:
Originally Posted by mostanad View Post

Can I write for you this Immersed Boundary method to help me in understanding that? This is the key part of my problem. There is no paper describing this method in terms of CFD on internet.
You can so that it becomes clear what you are talking about. The immersed boundary and viscosity usually do not go together.

There must be something ,missing here.
arjun is offline   Reply With Quote

Old   October 5, 2021, 14:24
Default
  #17
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,849
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by mostanad View Post
Ok. you mean when the pressure correction method is in a simple form, it is actually solved using FDM. But the second method that comes from OF is based on FVM. Am I right?



You wrote the first method in a form suitable for FD method.


However, this is not the key in your question. The pressure equation has a source term that depends on the convection, the dependence of the diffusive term can be disregarded if the velocity is divergence-free and divergence and laplacian commute (far from the solid boundary).
The BC for the pressure equation requires to prescribe the normal velocity component on the surface of the body. Therefore your IBM need to fulfill this condition while the normal component of the pressure gradient is not required.
FMDenaro is offline   Reply With Quote

Old   October 5, 2021, 21:24
Default
  #18
Senior Member
 
mohammad
Join Date: Sep 2015
Posts: 279
Rep Power: 12
mostanad is on a distinguished road
Quote:
Originally Posted by arjun View Post
So you did not answer the question poised.

Usually immersed boundary is to force the motion of solid body to the fluid domain in the backgroud.

That is it is used to impose the velocity field.

Now if you impose the velocity field, why do you need viscosity for?

Velocity in the immersed region is decided by the body and is fixed. The viscosity is needed to solve the fluid flow equation.










You can so that it becomes clear what you are talking about. The immersed boundary and viscosity usually do not go together.

There must be something ,missing here.
OK, missing point:


I need viscosity as I am changing my solver (which was working for Newtonian smoothly) to a non-Newtonian vicoplastic fluid. As you see in the following equation, the viscosity is obtained using the strain-rate:



The Newtonian solver, which was working properly, is as follows:


1- Solving NSE in the entire region with fluid properties (viscosity) and Pimple algorithm. The result of previous time step is used as the initial values (previous region for particle)

2- Imposing the new solid body velocity in the new position.

3- Correcting pressure and velocity fields using the first pressure method (simple Poisson equation)

4- Finding forces from stress on particle and solving a Newtonian law for having the new velocity/position of the particle in the next time step. We just calculate it here. Imposing is done in next time step at step 3.









As you see the first step assumes constant viscosity for all the regions. However, when it comes to viscoplastic non-Newtonian fluid, you should have the viscosity inside the particle based on its strain-rate, which results in a high viscosity. This makes trouble for me.


Furthermore, I don't know why this method is working even for Newtonian. If I know that, making a change for non-Newtonian case becomes easier.



If you feel any point is still unclear, please let me know.
mostanad is offline   Reply With Quote

Old   October 6, 2021, 01:50
Default
  #19
Senior Member
 
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,285
Rep Power: 34
arjun will become famous soon enougharjun will become famous soon enough
So this time you answered. Before I answer I wish to ask, what do you mean by getting into trouble?

I understand that results are not okay then, but I expect the solver to diverge too (when the bubbles have higher viscosity).
arjun is offline   Reply With Quote

Old   October 6, 2021, 02:06
Default
  #20
Senior Member
 
mohammad
Join Date: Sep 2015
Posts: 279
Rep Power: 12
mostanad is on a distinguished road
Quote:
Originally Posted by arjun View Post
So this time you answered. Before I answer I wish to ask, what do you mean by getting into trouble?

I understand that results are not okay then, but I expect the solver to diverge too (when the bubbles have higher viscosity).

No. divergence doesn't happen. For Newtonian case, it gives an appropriate drag value coming from pressure gradient and viscous term. This gives rise to a correct terminal velocity for particle. On the other hand, when the viscosity gets high value inside the particle in non-Newtonian viscoplastic case because of low strain-rate, the pressure is not correct, so the drag is not good, then terminal velocity is incorrect. Just recall my previous thread when I had pressure values inside the particle.



I think now you know more than any one else about my problem, as the other persons don't want to hear/understand my issue! It's about 6 months and I got stuck into this issue. Nobody knows why!
mostanad is offline   Reply With Quote

Reply


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
Pressure fields in FOAM, p field, total pressure, etc. Tobi OpenFOAM Post-Processing 9 March 25, 2022 02:33
viscosity udf don't use correct temperature and strain rate rezvani Fluent UDF and Scheme Programming 8 May 27, 2021 06:40
question regarding LES of pipe flow - pimpleFoam Dan1788 OpenFOAM Running, Solving & CFD 37 December 26, 2017 15:42
The correction on pressure equation of SIMPLE algorithm in MRFSimpleFOAM solver renyun0511 OpenFOAM Running, Solving & CFD 0 November 10, 2010 02:47
Hydrostatic pressure in 2-phase flow modeling (CFX4.2) HB &DS CFX 0 January 9, 2000 14:19


All times are GMT -4. The time now is 14:12.