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

+ or - pEqn().flux()?

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By hjasak
  • 1 Post By cfdopenfoam

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 21, 2015, 15:50
Default + or - pEqn().flux()?
  #1
New Member
 
Algis Dziugys
Join Date: Apr 2015
Posts: 10
Rep Power: 11
Algis is on a distinguished road
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 example
phi = phiHbyA + pEqn().flux()
as in applications\solvers\compressible\rhoSimpleFoam\pE qn.H?

Thanks in advance,
Algis is offline   Reply With Quote

Old   November 21, 2015, 20:06
Default
  #2
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33
hjasak will become famous soon enough
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
Ehsanrah likes this.
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   November 22, 2015, 05:28
Default
  #3
New Member
 
Algis Dziugys
Join Date: Apr 2015
Posts: 10
Rep Power: 11
Algis is on a distinguished road
Thank you very much.
Algis is offline   Reply With Quote

Old   November 22, 2015, 09:38
Question
  #4
Senior Member
 
Hesam
Join Date: Feb 2015
Posts: 139
Rep Power: 11
rapierrz is on a distinguished road
Hi,

what is flux() function in phi -= pEqn.flux() ?

thank u.
rapierrz is offline   Reply With Quote

Old   November 23, 2015, 01:00
Default does the + or - depend on how the pEqn is declared?
  #5
Member
 
Karelke Yu
Join Date: Dec 2014
Posts: 96
Rep Power: 12
cfdopenfoam is on a distinguished road
Quote:
Originally Posted by hjasak View Post
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
wayne14 likes this.
cfdopenfoam is offline   Reply With Quote

Reply

Tags
peqn.flux()


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
Difference between pEqn.flux and fvc::snGrad(p) ganeshv OpenFOAM Programming & Development 1 January 19, 2022 06:13
phi -= pEqn.flux() vs. linearInterpolate(U) & mesh.Sf() santiagomarquezd OpenFOAM Programming & Development 33 October 15, 2019 11:24
phi == pEqn.flux() rhoSimpleFoam David1 OpenFOAM Programming & Development 0 July 9, 2015 11:10
pEqn.flux() cheng1988sjtu OpenFOAM Running, Solving & CFD 4 November 21, 2012 16:08
pEqn.flux() ata OpenFOAM 2 January 24, 2011 23:31


All times are GMT -4. The time now is 07:57.