CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   FOAM FATAL IO ERROR: keyword pcorrFinal is undefined in dictionary (https://www.cfd-online.com/Forums/openfoam-solving/185671-foam-fatal-io-error-keyword-pcorrfinal-undefined-dictionary.html)

akesm March 30, 2017 21:57

FOAM FATAL IO ERROR: keyword pcorrFinal is undefined in dictionary
 
Hello everyone :)

I have simulated a T-juction for oil and water. Now I wanted to make use of dynamic mesh refinement. So having my current case I am modifying "dynamicMeshDict" as
Code:

dynamicFvMesh dynamicRefineFvMesh;
  dynamicRefineFvMeshCoeffs
  {
      refineInterval 1;
      field alpha.water;
      lowerRefineLevel 0.001;
      upperRefineLevel 0.999;
      unrefineLevel 10;
      nBufferLayers 1;
      maxRefinement 2;
      maxCells 200000;
      correctFluxes (( phi none) (nHatf none) (rhoPhi none) (ghf none)  (phirb none)(rho*nuEff none));
      dumpLevel true;
  }

the "correctFluxes" line I tried to use the fluxes that I introduced in my "divSchemes" to be consistent.

Also in my "controlDict" I changed to "application interDyMFoam;"

Now when running the case with "interDyMFoam" I get the error that
FOAM FATAL IO ERROR:
keyword pcorrFinal is undefined in dictionary "/home../run/Tjunction/system/fvSolution.solvers"

But my fvsolution is as below:
Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  4.1                                  |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    location    "system";
    object      fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

solvers
{
    "alpha.water.*"
    {
        nAlphaCorr      2;
        nAlphaSubCycles 1;
        cAlpha          1;

        MULESCorr      yes;
        nLimiterIter    3;

        solver          smoothSolver;
        smoother        symGaussSeidel;
        tolerance      1e-8;
        relTol          0;
    }

    pcorr
    {
        solver          PCG;
        preconditioner  DIC;
        tolerance      1e-5;
        relTol          0;
    }

    p_rgh
    {
        solver          PCG;
        preconditioner  DIC;
        tolerance      1e-07;
        relTol          0.05;
    }

    p_rghFinal
    {
        $p_rgh;
        relTol          0;
    }

    U
    {
        solver          smoothSolver;
        smoother        symGaussSeidel;
        tolerance      1e-06;
        relTol          0;
    }
}

PIMPLE
{
    momentumPredictor  no;
    nOuterCorrectors    1;
    nCorrectors        3;
    nNonOrthogonalCorrectors 0;
    pRefCell 0;
    pRefValue 0;
}

relaxationFactors
{
    equations
    {
        ".*" 1;
    }
}


// ************************************************************************* //

I even do not have such a "pcorrFinal".

Where I have made a mistake you think?

akesm March 30, 2017 22:55

I solved the error by changing "pcorr" to the format "pcorr.*". But still don't know why this solved the issue. But now I am stuck in a error saying that
Solving for p_rgh, Initial residual = 1, Final residual = 0.0485562, No Iterations 185
#0 Foam::error:: printStack(Foam::Ostream&) at ??:?
#1 Foam::sigFpe::sigHandler(int) at ??:?
#2 ? in "/lib/x86_64-linux-gnu/libc.so.6"
#3 ? at tensorField.C:?
#4 ? at ??:?
#5 ? at ??:?
#6 ? at ??:?
#7 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#8 ? at ??:?
Floating point exception (core dumped)

floquation March 31, 2017 03:59

Quote:

Originally Posted by akesm (Post 643100)
I even do not have such a "pcorrFinal".

But that is exactly the problem.
You need the keyword pcorrFinal for the same reason that you need p_rghFinal: in the last iteration the "Final" version of the dictionary is used to give you better control over your simulation.

Your floating point exception (FPE) can have an infinite number of causes.
Start by checking whether your physical set-up is correct: boundary conditions, reasonable initial condition, mesh quality, etc.
Also check whether the FPE occurs when you do not use a dynamic mesh.

akesm March 31, 2017 15:11

Thanks for your reply.
To clarify that, I did not touch anything from my static mesh case that runs properly except those I mentioned above, so initial, boundary conditions mesh and all set up should be fine. Even if the same dynamic mesh case that I have now, I switch back to static mesh it runs perfectly, or even if I run it with interFoam instead of interDyMFoam it runs without error again.

Any guess that what is the issue?
Thanks

akesm March 31, 2017 15:36

I narrowed my investigation to the file "dynamicMeshDict".
there if I put the lower and upper intervals of
Code:

    lowerRefineLevel 0.001
    upperRefineLevel 0.999;

to be equal say both 0.1, or even 0.9, or any number, but both be equal, with interDyMFoam simulation runs perfectly with no error. So set up is fine I think

This is weird to me, why with for example 0.1 and 0.9 or 0.001 and 0.999 as above I get that error.

And this is my whole file
Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  4.1                                  |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    location    "constant";
    object      dynamicMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dynamicFvMesh  dynamicRefineFvMesh;

dynamicRefineFvMeshCoeffs
{
    // How often to refine
    refineInterval  1;

    // Field to be refinement on
    field          alpha.water;

    // Refine field inbetween lower..upper
    lowerRefineLevel 0.001;
    upperRefineLevel 0.999;

    // If value < unrefineLevel unrefine
    unrefineLevel  10;

    // Have slower than 2:1 refinement
    nBufferLayers  1;

    // Refine cells only up to maxRefinement levels
    maxRefinement  2;

    // Stop refinement if maxCells reached
    maxCells        200000;

    // Flux field and corresponding velocity field. Fluxes on changed
    // faces get recalculated by interpolating the velocity. Use 'none'
    // on surfaceScalarFields that do not need to be reinterpolated.
    correctFluxes
    (
        (phi none)
        (nHatf none)
        (rhoPhi none)
        (alphaPhi none)
        (ghf none)
    );

    // Write the refinement level as a volScalarField
    dumpLevel      true;
}

And my complete log file is
Code:

Starting time loop

Courant Number mean: 0.00889225 max: 0.0998565
Interface Courant Number mean: 0 max: 0
deltaT = 5.48246e-06
Time = 5.48246e-06

PIMPLE: iteration 1
Selected 202 cells for refinement out of 50750.
Refined from 50750 to 52164 cells.
Selected 0 split points out of a possible 202.
Execution time for mesh.update() = 0.25 s
DICPCG:  Solving for pcorr, Initial residual = 1, Final residual = 9.05312e-06, No Iterations 466
time step continuity errors : sum local = 1.35364e-10, global = 2.31923e-13, cumulative = 3.11643e-11
smoothSolver:  Solving for alpha.water, Initial residual = 1.50215e-05, Final residual = 6.51628e-09, No Iterations 1
Phase-1 volume fraction = 0.909086  Min(alpha.water) = 0  Max(alpha.water) = 1
MULES: Correcting alpha.water
MULES: Correcting alpha.water
Phase-1 volume fraction = 0.909086  Min(alpha.water) = 0  Max(alpha.water) = 1.00001
DICPCG:  Solving for p_rgh, Initial residual = 1, Final residual = 0.049169, No Iterations 383
#0  Foam::error::printStack(Foam::Ostream&) at ??:?
#1  Foam::sigFpe::sigHandler(int) at ??:?
#2  ? in "/lib/x86_64-linux-gnu/libc.so.6"
#3  ? at tensorField.C:?
#4  ? at ??:?
#5  ? at ??:?
#6  ? at ??:?
#7  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#8  ? at ??:?
Floating point exception (core dumped)


floquation April 1, 2017 10:04

If you set those two to the same value, then it does not refine. After all, it refines between X and X, but there exist no numbers between X and X.
Then, despite having a dynamic mesh, you do not actually have a dynamic mesh.

Personally, I use 0.1 and 0.9 in interDyMFoam.

Questions:
1) How come max Courant is not zero when you're only just starting?

Since it starts at 0.1, and you then refine twice, max Courant very likely becomes 0.4. Whereas this should still be fine, it might get becomes too large when the new velocities are calculated.

2) What happens when you reduce the initial dt by, say, a factor 10?

I also notice that you need a lot of iterations for pressure.

3) What happens when you add under-relaxation for PIMPLE?
4) Or what happens when you use PISO instead of PIMPLE (so nOuterCorrector=0)?

akesm April 3, 2017 17:07

Kevin,

Thanks for your comment, FYI, everything was fine, the issue was that I was simulating a 2d case, I switched to 3d (added cells in the 3rd direction) now it is working fine.

A H Gazi August 9, 2018 06:29

Quote:

Originally Posted by akesm (Post 643557)
Kevin,

Thanks for your comment, FYI, everything was fine, the issue was that I was simulating a 2d case, I switched to 3d (added cells in the 3rd direction) now it is working fine.




Hi..
For my understanding would you please tell me what change did you make with a example,that will be a great help for me.
thanks and regards.

A H Gazi August 10, 2018 07:58

Quote:

Originally Posted by A H Gazi (Post 702079)
Hi..
For my understanding would you please tell me what change did you make with a example,that will be a great help for me.
thanks and regards.






I have solved it.:)

krikre September 26, 2018 08:03

I was surprised to see the keyword pcorrFinal not being required for interFoam v3.0.1, but required on v6. I ran my case with the fvSolution from the damBreak tutorial.



If anyone can effortlesly shed some light on the pcorr field I'd apreciate it. But it's not urgent. I just think it would be nice to have it explained online. I did a bit of research but it's starting to take to much time for me.


"pcorr.*" didn't used to be required:
https://github.com/OpenFOAM/OpenFOAM...199e76f37eb4a6


I was looking for clues in the interFoams pEqn.H:

https://cpp.openfoam.org/dev/multiph...8H_source.html


I did a

Code:

grep -r 'pcorr' $FOAM_SRC
which lead me to
https://cpp.openfoam.org/dev/CorrectPhi_8C_source.html


I'm not sure if CorrectPhi.C is executed by interFoam.

B_R_Khan April 28, 2021 06:14

Quote:

Originally Posted by A H Gazi (Post 702229)
I have solved it.:)

Hi!

I am getting the same error of pcorrFinal not found when I switch my simulation from 2D to 3D. Any idea how you were able to solve it?

uribealdo November 19, 2021 10:43

Could you add the pcorrFinal tolerance:
 
In the fvSolution:

pcorr
{
solver PCG;
preconditioner
{
preconditioner GAMG;
tolerance 1e-5;
relTol 0;
smoother GaussSeidel;
nPreSweeps 0;
nPostSweeps 2;
nFinestSweeps 2;
cacheAgglomeration true;
nCellsInCoarsestLevel 10;
agglomerator faceAreaPair;
mergeLevels 1;
}
tolerance 1e-5;
relTol 0;
maxIter 50;
}

Add the next code: the tolerance can be the same.

pcorrFinal
{
$pcorr;
tolerance 5e-9;
relTol 0;
}

Dcn March 21, 2024 06:23

try changing the fvSolution from
Code:

pcorr
{
          solver PCG;
......
....
}

to

Code:

"pcorr.*"
{
          solver PCG;
......
......
}

and run again


All times are GMT -4. The time now is 02:25.