CFD Online Logo CFD Online URL
Home > Forums > OpenFOAM Programming & Development

Different implementation pEqn.H in pimpleFoam vs interPhaseChangeFoam

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

LinkBack Thread Tools Display Modes
Old   November 28, 2015, 14:10
Default Different implementation pEqn.H in pimpleFoam vs interPhaseChangeFoam
New Member
Daniel Rodriguez Calvete
Join Date: Mar 2012
Location: Ferrol (A Coruņa) Spain
Posts: 9
Rep Power: 6
DanielRCalvete is on a distinguished road

I am confusing about the implementation of pEqn.H in pimpleFoam vs interPhaseChangeFoam:

From Non-orthogonal pressure corrector loop, pimpleFoam is written:

// Non-orthogonal pressure corrector loop
while (pimple.correctNonOrthogonal())
    // Pressure corrector
    fvScalarMatrix pEqn
        fvm::laplacian(rAUf, p) == fvc::div(phiHbyA)

    pEqn.setReference(pRefCell, pRefValue);


    if (pimple.finalNonOrthogonalIter())
        phi = phiHbyA - pEqn.flux();

#include "continuityErrs.H"

// Explicitly relax pressure for momentum corrector

U = HbyA - rAU*fvc::grad(p);
Since in interPhaseChangeFoam is:

    while (pimple.correctNonOrthogonal())
        fvScalarMatrix p_rghEqn
            fvc::div(phiHbyA) - fvm::laplacian(rAUf, p_rgh)
          - (vDotvP - vDotcP)*(pSat - rho*gh) + fvm::Sp(vDotvP - vDotcP, p_rgh)

        p_rghEqn.setReference(pRefCell, pRefValue);


        if (pimple.finalNonOrthogonalIter())
            phi = phiHbyA + p_rghEqn.flux();

            U = HbyA + rAU*fvc::reconstruct((phig + p_rghEqn.flux())/rAUf);

    p == p_rgh + rho*gh;

    if (p_rgh.needReference())
        p += dimensionedScalar
            pRefValue - getRefCellValue(p, pRefCell)
        p_rgh = p - rho*gh;
Two main differents and questions:

1) In pimpleFoam U is solved outside the while condition, since in interPhaseChangeFoam is inside it.
My firts thought was that the U is not solved in interPhaseChangeFoam if we set nonOrthogonalCorrector = 0, what is very strange. But seing the solutionControl Class (in particular solutionControlI.H) I find that is added 1 to nNonOrthCorr, therefore I guess that non-Othogonal correction is solved at least one. My questions are:

a) am I correct on this?

b) is any difference in the final solution between putting U reconstruction inside or outside the [CODE] "while" ?

2) In interPhaseChangeFoam the p.relax() does not exist, therefore if we use pimple Loops outerCorr > 1, it is not applied relaxion factors.

c) Does anybody knows why is not p.relax() in the code, or if I miss somewhere where is applied it?

Thank you to anyone who can help me.

DanielRCalvete is online now   Reply With Quote

Old   December 4, 2015, 11:37
Senior Member
Daniel Witte
Join Date: Nov 2011
Posts: 141
Rep Power: 7
danny123 is on a distinguished road
Hello DanielRCalvete,

Logically thinking I would guess the following:

1. The Pimple solver was designed before the interPhaseChangeFoam solver
2. You cannot call pEqn.flux() without pEqn being solved

So, this explains why there is that if-clause to calculate phi at the end of each pEq solving loop. If you set the number of nonOrthogonal corrections to -1, the call pEqn.flux() will lead to an error. I do not know why you would do this, but some people apparantly did.

Later, interPhaseChangeFoam was made and the same issue has been found about U. Look at the different code for U.


danny123 is offline   Reply With Quote


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
implementation of mapFields into parallel transient case simpomann OpenFOAM Pre-Processing 4 August 2, 2016 04:41
Implementation of Temperature Eqn in InterPhaseChangeFoam Jibran OpenFOAM Running, Solving & CFD 14 June 17, 2015 10:47
Implementation of pimpleFoam to incorporate pollutant dispersion None OpenFOAM Programming & Development 0 April 24, 2014 03:04
InterPhaseChangeFoam ERROR shipman OpenFOAM Running, Solving & CFD 37 March 23, 2014 13:43
Implementation issues of fvSchemes / laplacianScheme, in particular gaussLaplacianSch thomek OpenFOAM Programming & Development 0 October 18, 2010 05:10

All times are GMT -4. The time now is 08:44.