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

What is "pimple.correctNonOrthogonal" in the pEqn.H file ??

Register Blogs Community New Posts Updated Threads Search

Like Tree5Likes
  • 1 Post By harshad88
  • 1 Post By snak
  • 1 Post By snak
  • 1 Post By snak
  • 1 Post By dlahaye

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 27, 2014, 22:03
Default What is "pimple.correctNonOrthogonal" in the pEqn.H file ??
  #1
New Member
 
Harshad Lalit
Join Date: May 2013
Posts: 26
Rep Power: 13
harshad88 is on a distinguished road
Hello all,

My pEqn.H reads
Code:
while (pimple.correctNonOrthogonal())
    {
        fvScalarMatrix pEqn
        (
            fvm::ddt(psi, p)
          + fvc::div(phiHbyA)
          - fvm::laplacian(rho*rAU, p)
         ==
            fvOptions(psi, p, rho.name())
        );

        fvOptions.constrain(pEqn);

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

        if (pimple.finalNonOrthogonalIter())
        {
            phi = phiHbyA + pEqn.flux();
        }
    }
I would like to know what is the term pimple.correctNonOrthogonal. Under what conditions does the while loop get executed. Is pimple.correctNonOrthogonal a boolean operator or something ??

As a side question what is meant by the term pimple.finalNonOrthogonalIter . Under what conditions is this if statement executed ??

I really request someone to help me on this. Thanks a ton !
nepomnyi likes this.
harshad88 is offline   Reply With Quote

Old   July 28, 2014, 04:40
Default
  #2
Senior Member
 
shinji nakagawa
Join Date: Mar 2009
Location: Japan
Posts: 113
Blog Entries: 1
Rep Power: 18
snak is on a distinguished road
Hi,

pimple is an object based on a pimpleControl class.
pimpleControl pimple(mesh);

pimpleControl Class Reference
http://foam.sourceforge.net/docs/cpp/a01837.html

The pimpleControl class is derived from a solutionControl class.
correctNonOrthogonal() function is a member of the solutionControl class.

bool correctNonOrthogonal()
Non-orthogonal corrector loop.
Definition at line 70 of file solutionControlI.H.

good luck,
nepomnyi likes this.
snak is offline   Reply With Quote

Old   July 28, 2014, 22:21
Default
  #3
New Member
 
Harshad Lalit
Join Date: May 2013
Posts: 26
Rep Power: 13
harshad88 is on a distinguished road
Thanks for your reply Shinji. The link really helps :-)
harshad88 is offline   Reply With Quote

Old   February 21, 2023, 14:30
Default
  #4
Member
 
Ivan Nepomnyashchikh
Join Date: Sep 2019
Location: USA
Posts: 30
Blog Entries: 1
Rep Power: 6
nepomnyi is on a distinguished road
For those reading @snak 's response in 2023 and unable to open the link, here are the links to the correctNonOrthogonal() function in OpenFOAM8 docs:
  1. nonOrthogonalSolutionControl.H - see line 110
  2. nonOrthogonalSolutionControl.C - see line 76
But to me - even though I'm thankful to @snak 's response - it doesn't explain anything and I, still, have no idea what correctNonOrthogonal() does.
nepomnyi is offline   Reply With Quote

Old   February 22, 2023, 10:57
Default
  #5
Senior Member
 
shinji nakagawa
Join Date: Mar 2009
Location: Japan
Posts: 113
Blog Entries: 1
Rep Power: 18
snak is on a distinguished road
Hi,

correctNonOrthogonal() judges whether non-orthogonal-corector-step is needed or not. It just returns true or false. Numerical works will be done in a solver (or pEqn.H) if correctNonOrthogonal() returns true in a while-loop.

If you specify where/what you don't understand, somebody will help you.
snak is offline   Reply With Quote

Old   February 22, 2023, 14:55
Default
  #6
Member
 
Ivan Nepomnyashchikh
Join Date: Sep 2019
Location: USA
Posts: 30
Blog Entries: 1
Rep Power: 6
nepomnyi is on a distinguished road
Thank you @snak.


First thing I don't understand is what non orthogonal corrector step is. A brief intelligible explanation in plain English would suffice. I don't need to go deep into the details here.


Second thing I don't understand is the following. I'm looking at line 26 in this pEqn.H file. We are going into the while loop only if pimple.correctNonOrthogonal() is True. But where exactly do we set it to True (or False)? I don't think we set in the input file. Then OpenFOAM must detemine the value for pimple.correctNonOrthogonal() itself. How does it do it? (Though, I think the answer to the first question can automatically answer this question.)


Thank you in advance.
Ivan
nepomnyi is offline   Reply With Quote

Old   February 23, 2023, 06:46
Default
  #7
Senior Member
 
shinji nakagawa
Join Date: Mar 2009
Location: Japan
Posts: 113
Blog Entries: 1
Rep Power: 18
snak is on a distinguished road
Hi Ivan,

here is the nice explanation about the non-orthogonal-correctors: https://www.simscale.com/docs/simula...al-correctors/

You decide On/Off and how many corrector-loop when you use OpenFOAM. Even in basic tutorials, nNonOrthogonalCorrectors setting is povided in system/fvSolution dictionary.

An official user guide explains it in "6.3 Solution and algorithm control" and "6.3.3 PISO and SIMPLE algorithms".
https://www.openfoam.com/documentati...l#x24-930006.3

"4.6 Solution and algorithm control" and "4.6.3 PISO, SIMPLE and PIMPLE algorithms"
https://doc.cfd.direct/openfoam/user...v10/fvsolution
nepomnyi likes this.
snak is offline   Reply With Quote

Old   February 24, 2023, 14:26
Default
  #8
Member
 
Ivan Nepomnyashchikh
Join Date: Sep 2019
Location: USA
Posts: 30
Blog Entries: 1
Rep Power: 6
nepomnyi is on a distinguished road
Thank you very much to @snack for the response.


For future readers, I would summarize it as follows.


  • Non orthogonality refers to non orthogonality of the mesh cells.
    • Orthogonality criterions, I believe, are known to everyone.
  • In the input file, the user asks OpenFOAM to check for non orthogonality and correct the mesh if necessary.
    • Thus, pimple.correctNonOrthogonal() is set to True initially and we get into the while loop.
  • In the first cycle of the loop, OpenFOAM calculates the non orthogonality criterion for the mesh, corrects the mesh and if the new mesh has the non orthogonality criterion below the threshold, the cycle repeats.
nepomnyi is offline   Reply With Quote

Old   February 25, 2023, 20:17
Default
  #9
Senior Member
 
shinji nakagawa
Join Date: Mar 2009
Location: Japan
Posts: 113
Blog Entries: 1
Rep Power: 18
snak is on a distinguished road
Hi Ivan,

Thank you for summarizing your understanding. It is really helpful to us and future readers. Unfortunately, there are some misunderstandings.

Usual PIMPLE algorithm does not check orthogonality and does not change mesh.

You tell OpenFOAM how many nonOrthogonal-correction loop is needed (using nNonOrthogonalCorrectors setting in fvSolution). Checking the non-orthogonality and deciding the nNonOrthogonalCorrectors number is user's task.

In non-orthogonal pressure corrector loop, several additional iterations of the pressure equation will be executed.

https://www.simscale.com/docs/simula...al-correctors/

https://develop.openfoam.com/Develop...oam/pEqn.H#L38


A correctNonOrthogonal() function counts how many times the loop is executed. It returns true if the number is below nNonOrthogonalCorrector.
nepomnyi likes this.
snak is offline   Reply With Quote

Old   February 25, 2023, 20:59
Default
  #10
Member
 
Ivan Nepomnyashchikh
Join Date: Sep 2019
Location: USA
Posts: 30
Blog Entries: 1
Rep Power: 6
nepomnyi is on a distinguished road
I see, thank you very much @snak!
Ivan
nepomnyi is offline   Reply With Quote

Old   December 11, 2023, 20:08
Default
  #11
Member
 
Santhosh
Join Date: Nov 2021
Posts: 44
Rep Power: 4
Santhosh91 is on a distinguished road
Hello all,


It is a very interesting tread. I just want to make sure of one thing.
The loop to correct the pressure term in the PISO loop:
while (pimple.correctNonOrthogonal())
{
fvScalarMatrixpdEqn
(
fvm::laplacian(rUAf, pd) == fvc::div(phi)
+ speciesMixture.Mflux()*(1/rho1-1/rho2)
);


Is valid even if there NonOrthogonal correctors is set to 0 right ?
In which case, the loop is performed one time to correct the pressure value according to the continuity equation.
Otherwise I don't see how the PISO loop operates,


Thanks for anyone who would take the time to help me here.


Santhosh91 is offline   Reply With Quote

Old   December 12, 2023, 03:52
Default
  #12
Senior Member
 
Domenico Lahaye
Join Date: Dec 2013
Posts: 736
Blog Entries: 1
Rep Power: 17
dlahaye is on a distinguished road
I humbly suggest that you run a small tutorial example for a limited (two or three ) iterations and inspect the output generated. This will allow you to verify your doubts on nNonOrthogonalCorrectors. Get in touch here in case that doubts remain.
dlahaye is offline   Reply With Quote

Old   December 12, 2023, 13:53
Default
  #13
Member
 
Santhosh
Join Date: Nov 2021
Posts: 44
Rep Power: 4
Santhosh91 is on a distinguished road
Hello dlahaye,


Appreciate the concise yet effective advice . So, just to clarify, the loop runs once if the non-Orthogonal corrector is set to 0, and increments by +1 for each additional corrector you introduce.


Regarding resources for coding in OpenFOAM, particularly with the interFoam solver, do you happen to know of any good guides or literature? I am trying to link the numerical model to the way it is coded in the OpenFOAM, but I'm struggling to find comprehensive material on this.

Thanks again for the help!


Sincerely,
Santhosh
Santhosh91 is offline   Reply With Quote

Old   December 13, 2023, 03:22
Default
  #14
Senior Member
 
Domenico Lahaye
Join Date: Dec 2013
Posts: 736
Blog Entries: 1
Rep Power: 17
dlahaye is on a distinguished road
Quote:
So, just to clarify, the loop runs once if the non-Orthogonal corrector is set to 0, and increments by +1 for each additional corrector you introduce.
I again suggest to check yourself. This might be the best school.

Quote:
Regarding resources for coding in OpenFOAM, particularly with the interFoam solver, do you happen to know of any good guides or literature? I am trying to link the numerical model to the way it is coded in the OpenFOAM, but I'm struggling to find comprehensive material on this.
To answer general question like this one, Google (or chatGTP?) is your best friend. Get back in touch with more specific questions.
dlahaye is offline   Reply With Quote

Old   December 13, 2023, 12:06
Default
  #15
Member
 
Santhosh
Join Date: Nov 2021
Posts: 44
Rep Power: 4
Santhosh91 is on a distinguished road
Hello dlahaye,


I just re-checked, the pressure is solved a certain number of times depending on the "nCorrecors" number for the PISO loop, but it does enter one time in the "pimple.correctNonOrthogonal()" since I see one repetition with 0 "nNonOrthogonalCorrector" and increase within this loop when I am incrementing the "nNonOrthogonalCorrectors" numbers.

For me it makes sense, otherwise how is the pressure solved ? Because that "while(pimple.CorrectNonOrthogonal)" loop is the only place where we have the continuity equation defined.


Concerning the second question, I was hoping there would be a good textbook or thesis that explain the implementation from numerical model equations into C++ code in OpenFoam :/


Thanks for your time and help!
Sincerely,
Santhosh
Santhosh91 is offline   Reply With Quote

Old   December 13, 2023, 15:50
Default
  #16
Senior Member
 
Domenico Lahaye
Join Date: Dec 2013
Posts: 736
Blog Entries: 1
Rep Power: 17
dlahaye is on a distinguished road
https://link.springer.com/book/10.10...-3-319-16874-6

among many others.
Santhosh91 likes this.
dlahaye 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
[Other] mesh airfoil NACA0012 anand_30 OpenFOAM Meshing & Mesh Conversion 13 March 7, 2022 17:22
centOS 5.6 : paraFoam not working yossi OpenFOAM Installation 2 October 9, 2013 01:41
[OpenFOAM] Annoying issue of automatic "Rescale to Data Range " with paraFoam/paraview 3.12 keepfit ParaView 60 September 18, 2013 03:23
"parabolicVelocity" in OpenFoam 2.1.0 ? sawyer86 OpenFOAM Running, Solving & CFD 21 February 7, 2012 11:44
ParaView Compilation jakaranda OpenFOAM Installation 3 October 27, 2008 11:46


All times are GMT -4. The time now is 16:51.