|
[Sponsors] |
July 28, 2021, 02:33 |
calulation of phi
|
#1 |
New Member
Naive CFD
Join Date: Jun 2021
Posts: 25
Rep Power: 5 |
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? |
|
July 30, 2021, 11:58 |
|
#2 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 736
Rep Power: 14 |
Try research Rhie Chow or momentum interpolation and you'll see why phi must be calculated from the latter, not the former.
|
|
July 30, 2021, 12:04 |
|
#3 |
New Member
Naive CFD
Join Date: Jun 2021
Posts: 25
Rep Power: 5 |
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. |
|
July 30, 2021, 12:29 |
|
#4 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 736
Rep Power: 14 |
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. |
|
July 30, 2021, 12:41 |
|
#5 |
New Member
Naive CFD
Join Date: Jun 2021
Posts: 25
Rep Power: 5 |
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 |
|
July 30, 2021, 13:34 |
|
#6 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 736
Rep Power: 14 |
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(); Does that help? |
|
July 30, 2021, 13:39 |
|
#7 |
New Member
Naive CFD
Join Date: Jun 2021
Posts: 25
Rep Power: 5 |
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),
|
|
July 30, 2021, 13:50 |
|
#8 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 736
Rep Power: 14 |
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! |
|
July 30, 2021, 14:00 |
|
#9 |
New Member
Naive CFD
Join Date: Jun 2021
Posts: 25
Rep Power: 5 |
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 |
|
July 31, 2021, 07:51 |
|
#10 |
Senior Member
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 616
Rep Power: 16 |
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 |
|
Tags |
icofoam, openfoam cfd |
|
|
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 05:14 |
Question about phi | jeanpinto24| | OpenFOAM Pre-Processing | 0 | April 15, 2017 05:13 |
Correction procedure on a non-orthogonal skewed Mesh | me.ouda | OpenFOAM Programming & Development | 0 | January 18, 2017 10:05 |
mixerVesselAMI2D's mass is not balancing | sharonyue | OpenFOAM Running, Solving & CFD | 6 | June 10, 2013 10:34 |
Turbulence Model phi vs phi_ | doug | OpenFOAM Running, Solving & CFD | 4 | November 10, 2009 05:33 |