CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (http://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Wrong operator in transonic pressure equation? (http://www.cfd-online.com/Forums/openfoam-programming-development/89144-wrong-operator-transonic-pressure-equation.html)

dohnie June 6, 2011 08:45

Wrong operator in transonic pressure equation?
 
Hello,
in my transonic simulations with reactingFoam my local continuity errors are far too high (~0.01).
I've stumbled upon the pressure equation: After the pEqn is solved, the flux is corrected. In the subsonic case:
Code:

        if (nonOrth == nNonOrthCorr)
        {
            phi += pEqn.flux();
        }

In the transonic case:
Code:

        if (nonOrth == nNonOrthCorr)
        {
            phi == pEqn.flux();
        }

Shouldn't the latter "==" operator be replaced by a "+=", too?

If not, who can explain it?

David1 July 10, 2015 12:07

I know I am replying on an old post, but have you found your answer?

I have a similar doubt with rhoSimpleFoam, where:
Quote:

phi == pEqn.flux();
in the transonic case and:
Quote:

phi -= pEqn.flux();
for subsonic flow

Horacio Aguerre July 11, 2015 22:16

Hello Florian,

Note that the method "flux()" is applied over the fvMatrix (pEqn). When solving with the transonic flag in true, the pEqn contains the advective term fvm::div(...). The whole continuity equation is assembled implicity in the pressure equation and then the flux can be calculated with pEqn.flux().

On the other hand, in subsonic cases the advective term is assembled eplicity with fvc::div(phi(or phiHByA)). The last term is not in the pEqn matrix (l.h.s part) and then the advective term must be taken in account to construct the phi flux as phi = phi + pEqn.flux() or phi = phiHByA + pEqn.flux()

hope it helps!


All times are GMT -4. The time now is 01:05.