# + or - pEqn().flux()?

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

 November 21, 2015, 15:50 + or - pEqn().flux()? #1 New Member   Algis Dziugys Join Date: Apr 2015 Posts: 10 Rep Power: 4 Hi, Why for some cases pEqn().flux() are subtracted, as for example:phi = phiHbyA - pEqn().flux() as in applications\solvers\incompressible\simpleFoam\pEq n.H, while for other cases are added, as for examplephi = phiHbyA + pEqn().flux() as in applications\solvers\compressible\rhoSimpleFoam\pE qn.H? Thanks in advance,

 November 21, 2015, 20:06 #2 Senior Member   Hrvoje Jasak Join Date: Mar 2009 Location: London, England Posts: 1,793 Rep Power: 23 If your pressure laplacian has a minus sign (-), then it's phi = phiHbyA + pEqn().flux() This is the case in compressible solvers. For incompressible solvers, the pressure laplacian has a positive sign and it's phi = phiHbyA - pEqn().flux() Hrv __________________ Hrvoje Jasak Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk

 November 22, 2015, 05:28 #3 New Member   Algis Dziugys Join Date: Apr 2015 Posts: 10 Rep Power: 4 Thank you very much.

 November 22, 2015, 09:38 #4 Senior Member   Hesam Join Date: Feb 2015 Posts: 139 Rep Power: 4 Hi, what is flux() function in phi -= pEqn.flux() ? thank u.

November 23, 2015, 01:00
does the + or - depend on how the pEqn is declared?
#5
Member

Karelke Yu
Join Date: Dec 2014
Posts: 77
Rep Power: 4
Quote:
 Originally Posted by hjasak If your pressure laplacian has a minus sign (-), then it's phi = phiHbyA + pEqn().flux() This is the case in compressible solvers. For incompressible solvers, the pressure laplacian has a positive sign and it's phi = phiHbyA - pEqn().flux() Hrv
hello Dr. jasak.

i wonder if the + or - operation depends on how the pEqn is declared.

i mean for the incompressible solver pimpleFoam, the pEqn is
Code:
```    fvScalarMatrix pEqn
(
fvm::laplacian(rAUf, p) == fvc::div(phiHbyA)
);```
thus the conservative face fluxes are constructed as
Code:
`phi = phiHbyA - pEqn.flux();`
then if i change the pEqn like
Code:
```    fvScalarMatrix pEqn
(
fvm::laplacian(rAUf, p) - fvc::div(phiHbyA)
);```
or
Code:
```    fvScalarMatrix pEqn
(
- fvm::laplacian(rAUf, p) + fvc::div(phiHbyA)
);```
then how the flux phi will be corrected to ensure conservative?

another question, for the shallowWaterFoam, the "pEqn" is
Code:
```fvScalarMatrix hEqn
(
fvm::ddt(h)
+ fvc::div(phiHbyA)
- fvm::laplacian(ghrAUf, h)
);```
with a temporal derivative, so how the hEqn.flux() will be calculated? and why the flux phi is corrected by
Code:
`phi = phiHbyA + hEqn.flux();`
the last question also post here.

thanks very much for your valuable time.

best,

karelke

 Tags peqn.flux()

 Thread Tools 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 On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post David1 OpenFOAM Programming & Development 0 July 9, 2015 10:10 ganeshv OpenFOAM Programming & Development 0 January 24, 2015 23:17 santiagomarquezd OpenFOAM Programming & Development 32 June 12, 2014 01:50 cheng1988sjtu OpenFOAM Running, Solving & CFD 4 November 21, 2012 16:08 ata OpenFOAM 2 January 24, 2011 23:31

All times are GMT -4. The time now is 19:23.