CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

calulation of phi

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree4Likes
  • 1 Post By Tobermory
  • 1 Post By Tobermory
  • 1 Post By Tobermory
  • 1 Post By mAlletto

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 28, 2021, 01:33
Default calulation of phi
  #1
New Member
 
Naive CFD
Join Date: Jun 2021
Posts: 24
Rep Power: 3
Deep111090 is on a distinguished road
Hi All ,

I am trying to understand the difference between two approaches to calculate 'phi':
a) phi = fvc::interpolate(U)&mesh.Sf();
b) phi = phiHby - pEqn.flux();


I understand that both approaches will give different value of phi if the solution is not yet converged as U may still be divergent. and approach b tries to correct the result.



But they also give different results at the end of the simulation even if the U is fully converged and divergence free.? Can anyone guide me to the reason of this?
Deep111090 is offline   Reply With Quote

Old   July 30, 2021, 10:58
Default
  #2
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 450
Rep Power: 11
Tobermory will become famous soon enough
Try research Rhie Chow or momentum interpolation and you'll see why phi must be calculated from the latter, not the former.
Deep111090 likes this.
Tobermory is offline   Reply With Quote

Old   July 30, 2021, 11:04
Default
  #3
New Member
 
Naive CFD
Join Date: Jun 2021
Posts: 24
Rep Power: 3
Deep111090 is on a distinguished road
Thanks Tobermory.

On those lines, if i interpolate U with rhie chow to faces explicitly and not in the spirit that Openfoam does that using latter (b). I think both fluxes should match. Can you provide me with some direction to how to implement rhie chow explicitly in openfoam not in the way it is done "in spirit" as in current code.
Deep111090 is offline   Reply With Quote

Old   July 30, 2021, 11:29
Default
  #4
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 450
Rep Power: 11
Tobermory will become famous soon enough
I don't quite follow your question, my friend. There is no other way to implement the method in OpenFOAM - method b) is the explicit way that it is done.

RC interpolation works by interpolating the cell-centre, pressure gradient-free velocities to face centre and subtracting the face centre pressure gradient, where the latter is calculated using a compact stencil and interpolated A coefficients. This turns out to be equivalent to just interpolating the cell-centre velocities but with an additional dissipative term that damps out checkerboarding effects. You'll sometimes see the RC approach called an added dissipation method - I think, in fact, that's what they called it (may be wrong).

Note that the additional dissipative term is effectively the difference between evaluating the pressure gradient with the compact stencil and with a standard approach, and is the difference between your methods a) and b).

For good references, start with the book by Ferziger & Peric (be aware that the terminology is slightly different) , but there's also a lot written on the forum about this. Good luck.
Deep111090 likes this.
Tobermory is offline   Reply With Quote

Old   July 30, 2021, 11:41
Default
  #5
New Member
 
Naive CFD
Join Date: Jun 2021
Posts: 24
Rep Power: 3
Deep111090 is on a distinguished road
Thanks Tobermory. Actually if it can make things a little clear, I read the OpenFOAMwiki explanation for simpleFOAM solver it says in section 2.3 that Rhie Chow is not implemented explicity but in the spirit. That where my question comes from, as what is difference between in spirit or explicit.
I am adding the link to the page https://openfoamwiki.net/index.php/S...am#cite_note-6
Deep111090 is offline   Reply With Quote

Old   July 30, 2021, 12:34
Default
  #6
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 450
Rep Power: 11
Tobermory will become famous soon enough
Yes, I think that wiki page is perhaps a little confusing on this point.

Is it trying to say that there is no explicit "rhieChowInterpolation()" function that is called to interpolate the cell centre velocities to the face centres, but that the method of RC is applied instead "implicitly"? That is correct, I guess, but not very insightful.

Again, returning to my earlier post - the RC method in OF can be summarised by the following 2 lines (SIMPLE method):
Code:
     // generate the pressure gradient free velocities, at face centre 
     surfaceScalarField phiHbyA("phiHbyA", fvc::flux(HbyA));
     // calculate the face flux by subtracting the pressure gradient calculated 
     // from a compact stencil with interpolated A coeff
     phi = phiHbyA - pEqn.flux();
There's quite a bit going on "under the bonnet" in the pEqn.flux(), and the wiki page is correct to draw attention to the fact that some clever footwork has been done with the manipulations of the matrix coeffs, but you can ignore that I think and just focus on the above two lines.

Does that help?
Tobermory is offline   Reply With Quote

Old   July 30, 2021, 12:39
Default
  #7
New Member
 
Naive CFD
Join Date: Jun 2021
Posts: 24
Rep Power: 3
Deep111090 is on a distinguished road
Thanks again..yes it indeed makes things clearer. I think what i need to do is study how this manipulation of the coefficients is equivalent to having a function rhiechowInterpolate(U),
Deep111090 is offline   Reply With Quote

Old   July 30, 2021, 12:50
Default
  #8
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 450
Rep Power: 11
Tobermory will become famous soon enough
Could I suggest that you have a good read of section "7.5.2 Treatment of Pressure for Colocated Variables" in Ferziger and Peric? Then read the following section on the implementation of the SIMPLE algorithm - beware though, some of the terminology is different to OpenFOAM, but just keep an eye on the main theme and you'll be ok.

It DOES take a lot of reading and head scratching to work it out ... I haven't seen a good description of it in print yet ... maybe I should try write something! It IS worth it though - just make sure you write yourself some notes as you go, since otherwise the hard found knowledge will evaporate rapidly like a summer fog!
Deep111090 likes this.
Tobermory is offline   Reply With Quote

Old   July 30, 2021, 13:00
Default
  #9
New Member
 
Naive CFD
Join Date: Jun 2021
Posts: 24
Rep Power: 3
Deep111090 is on a distinguished road
Thanks for pointing me to text. I will definitely take notes. I the mean time there is another thread that i started may be you can offer some insight into that. I am adding the link.
obtain velocity from pressure profile
Deep111090 is offline   Reply With Quote

Old   July 31, 2021, 06:51
Default
  #10
Senior Member
 
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 594
Rep Power: 11
mAlletto is on a distinguished road
If you want to know how to explicitly implement the Rhine and chow interpolation in openfoam it is explained in the book of https://www.springer.com/gp/book/9783319168739.

The book also explains quite well the numerics in OF
Deep111090 likes this.
mAlletto is offline   Reply With Quote

Reply

Tags
icofoam, openfoam cfd

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Question on ddtCorr(U, phi), fvcDdtUfCorr and pressure-velocity coupling cvr OpenFOAM Programming & Development 10 April 20, 2020 04:14
Question about phi jeanpinto24| OpenFOAM Pre-Processing 0 April 15, 2017 04:13
Correction procedure on a non-orthogonal skewed Mesh me.ouda OpenFOAM Programming & Development 0 January 18, 2017 09:05
mixerVesselAMI2D's mass is not balancing sharonyue OpenFOAM Running, Solving & CFD 6 June 10, 2013 09:34
Turbulence Model phi vs phi_ doug OpenFOAM Running, Solving & CFD 4 November 10, 2009 04:33


All times are GMT -4. The time now is 02:22.