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

Different implementation pEqn.H in pimpleFoam vs interPhaseChangeFoam

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By danny123

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

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

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

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

    pEqn.setReference(pRefCell, pRefValue);

    pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));

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

#include "continuityErrs.H"

// Explicitly relax pressure for momentum corrector
p.relax();

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

Code:
    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);

        p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter())));

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

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

    p == p_rgh + rho*gh;

    if (p_rgh.needReference())
    {
        p += dimensionedScalar
        (
            "p",
            p.dimensions(),
            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.

Regards,
DanielRCalvete is offline   Reply With Quote

Old   December 4, 2015, 11:37
Default
  #2
Senior Member
 
Daniel Witte
Join Date: Nov 2011
Posts: 148
Rep Power: 15
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.

Regards,

Daniel
Ramzy1990 likes this.
danny123 is offline   Reply With Quote

Reply


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
implementation of mapFields into parallel transient case simpomann OpenFOAM Pre-Processing 4 August 2, 2016 05:41
Implementation of Temperature Eqn in InterPhaseChangeFoam Jibran OpenFOAM Running, Solving & CFD 14 June 17, 2015 11:47
Implementation of pimpleFoam to incorporate pollutant dispersion None OpenFOAM Programming & Development 0 April 24, 2014 04: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 06:10


All times are GMT -4. The time now is 18:50.