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

Conservative Flux in (in-)compressible PimpleFoam

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 30, 2022, 06:19
Question Conservative Flux in (in-)compressible PimpleFoam
  #1
New Member
 
Adrian
Join Date: Mar 2022
Posts: 1
Rep Power: 0
LateinCecker is on a distinguished road
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


\phi_f  = \boldsymbol S_f \cdot \left( \frac{H(\boldsymbol U)}{A_P} \right)_f -  \underbrace{\boldsymbol S_f \cdot \left( \frac{\boldsymbol \nabla  p}{A_P} \right)_f}_{\text{pEqn.flux}}


and becomes


\phi_f  = \boldsymbol S_f \cdot \left( \frac{H(\boldsymbol U)}{A_P} \right)_f -  \left( \bigl| \frac{\boldsymbol \Delta}{(A_p)_f} \bigr| \, \frac{p_N -  p_P}{d} + \frac{\boldsymbol k}{(A_p)_f} \cdot (\boldsymbol \nabla p)_f  \right)


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 \rho is a factor:


\phi_f =  \boldsymbol S_f \cdot \left( \rho \, \frac{H(\boldsymbol U)}{A_P}  \right)_f - \underbrace{\boldsymbol S_f \cdot \left( \rho \,  \frac{\boldsymbol \nabla p}{A_P} \right)_f}_{\text{pEqn.flux}}


\phi_f  = \rho_f \, \boldsymbol S_f \cdot \left( \frac{H(\boldsymbol U)}{A_P}  \right)_f - \left( \bigl| \left( \frac{\rho}{A_p} \right)_f \boldsymbol  \Delta \bigr| \, \frac{p_N - p_P}{d} + \left( \frac{\rho}{A_p} \right)_f  \boldsymbol k \cdot (\boldsymbol \nabla p)_f \right)


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
LateinCecker is offline   Reply With Quote

Reply

Tags
pimplefoam, pressure and velocity, rhopimplefoam


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
solver crashing hrishikeshsivanandan OpenFOAM 7 March 6, 2021 01:18
Flux splitting for compressible flow using finite difference method Amr Emad Ezzat Main CFD Forum 2 February 10, 2020 05:13
Question about adaptive timestepping Guille1811 CFX 25 November 12, 2017 17:38
Error - Solar absorber - Solar Thermal Radiation MichaelK CFX 12 September 1, 2016 05:15
Basic Nozzle-Expander Design karmavatar CFX 20 March 20, 2016 08:44


All times are GMT -4. The time now is 11:09.