# calulation of phi

 User Name Remember Me Password
 Register Blogs Members List Search Today's Posts Mark Forums Read

 July 28, 2021, 01:33 calulation of phi #1 New Member   Naive CFD Join Date: Jun 2021 Posts: 24 Rep Power: 3 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, 10:58 #2 Senior Member   Join Date: Apr 2020 Location: UK Posts: 450 Rep Power: 11 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.

 July 30, 2021, 11:04 #3 New Member   Naive CFD Join Date: Jun 2021 Posts: 24 Rep Power: 3 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, 11:29 #4 Senior Member   Join Date: Apr 2020 Location: UK Posts: 450 Rep Power: 11 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.

 July 30, 2021, 11:41 #5 New Member   Naive CFD Join Date: Jun 2021 Posts: 24 Rep Power: 3 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, 12:34 #6 Senior Member   Join Date: Apr 2020 Location: UK Posts: 450 Rep Power: 11 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?

 July 30, 2021, 12:39 #7 New Member   Naive CFD Join Date: Jun 2021 Posts: 24 Rep Power: 3 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, 12:50 #8 Senior Member   Join Date: Apr 2020 Location: UK Posts: 450 Rep Power: 11 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.

 July 30, 2021, 13:00 #9 New Member   Naive CFD Join Date: Jun 2021 Posts: 24 Rep Power: 3 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, 06:51 #10 Senior Member   Michael Alletto Join Date: Jun 2018 Location: Bremen Posts: 594 Rep Power: 11 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.

 Tags icofoam, openfoam cfd

 Thread Tools Search this Thread Search this Thread: Advanced Search Display Modes Linear Mode

 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 OffTrackbacks are Off Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post cvr OpenFOAM Programming & Development 10 April 20, 2020 04:14 jeanpinto24| OpenFOAM Pre-Processing 0 April 15, 2017 04:13 me.ouda OpenFOAM Programming & Development 0 January 18, 2017 09:05 sharonyue OpenFOAM Running, Solving & CFD 6 June 10, 2013 09:34 doug OpenFOAM Running, Solving & CFD 4 November 10, 2009 04:33

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

 Contact Us - CFD Online - Privacy Statement - Top