# Conservative Flux in (in-)compressible PimpleFoam

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

 March 30, 2022, 06:19 Conservative Flux in (in-)compressible PimpleFoam #1 New Member   Adrian Join Date: Mar 2022 Posts: 1 Rep Power: 0 Hello Everyone, i have recently gotten into CFD and i have been exploring the OpenFOAM source code a bit to better understand whats going on. Specifically, i have been looking into the incompressible/pimpleFoam and the compressible/rhoPimpleFoam solvers and i think by now i have a farely good grasp at what most of the code does. But there is one thing that strikes me as odd in the pressure equation sections of both solvers (pEqn.H): After the pressure equation is solved, in the last non-orthogonal corrector loop the conservative flux Code: phi is corrected. For the incompressible solver (pimpleFoam/pEqn.H) the corresponding code looks like this: Code: phi = phiHbyA - pEqn.flux(); which, from what i understand is equivalent to and becomes where the surface element [math] S = \Delta + k [\math]. This is all good and i get where it is coming from. The problem lies in the comparison to the compressible solver (rhoPimpleFoam/pEqn.H): Here, the correction to the conservative flux is written as Code: phi = phiHbyA + pEqn.flux(); so the sign of the Code:  pEqn.flux() is flipped. As i understand it, the Code: .flux() function should be functionally identical to the incompressible case, except that now the density is a factor: So if these equations are correct, then why is the sign for Code: pEqn.flux() flipped in the compressible solver? I hope this is the right forum for this question. Thx already in advance

 Tags pimplefoam, pressure and velocity, rhopimplefoam