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

+ or - pEqn().flux()?

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

Like Tree1Likes
  • 1 Post By cfdopenfoam

Reply
 
LinkBack Thread Tools 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: 3
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,784
Rep Power: 22
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
__________________
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: 3
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: 3
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: 66
Rep Power: 4
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()

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
phi == pEqn.flux() rhoSimpleFoam David1 OpenFOAM Programming & Development 0 July 9, 2015 10:10
Difference between pEqn.flux and fvc::snGrad(p) ganeshv OpenFOAM Programming & Development 0 January 24, 2015 23:17
phi -= pEqn.flux() vs. linearInterpolate(U) & mesh.Sf() santiagomarquezd OpenFOAM Programming & Development 32 June 12, 2014 01:50
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 23:32.