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

About interFoam

Register Blogs Community New Posts Updated Threads Search

Like Tree7Likes
  • 1 Post By Lookid
  • 5 Post By alexeym
  • 1 Post By alexeym

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 12, 2017, 04:55
Default About interFoam
  #1
Member
 
Lilian Chabannes
Join Date: Apr 2017
Posts: 58
Rep Power: 9
Lookid is on a distinguished road
Hi,

I'm using interFoam to observe the filling of an injection-molded piece.
I ran the simulation to my case and changed boundary conditions.
Case is still laminar due to high viscosity, 0.1 Pa.s
I let fvSolution the same as the damBreak tutorial, and just changed Co to 2 in controlDict.

Ran the simulation for 12h and got this :
https://drive.google.com/file/d/0B3B...ZsZWNxbzg/view

I also used an inlet velocity of 0.5m/s instead of 2m/s to have an higher timestep (for a first try).

So my goal is to reduce computational time.

First, what's the point of momentumPredictor in fvSolution ? It's set to 'no' in every interFoam tutorials.

Then, I think the idea to reduce computational is to use PIMPLE like it's clearly explained here :
https://www.researchgate.net/profile...-OpenFOAMR.pdf p.111 to 134

So fix a dt = 1e-4 for example, and run the simulation.

Here's fvSolution :

Code:
PIMPLE
{
    momentumPredictor   no;
    nOuterCorrectors    100;
    nCorrectors         2;
    nNonOrthogonalCorrectors 0;

    residualControl
    {
        p
        {
            tolerance 1e-4;
            relTol 0;
        }
    }
}

relaxationFactors
{
    fields
    {
        p                   0.4;
        pFinal                1;
    }
    equations
    {
        ".*" 1;
    }
}
Actually I don't really know what I'm doing here, and the solver is acting weird :
Code:
PIMPLE: iteration 5
DICPCG:  Solving for p_rgh, Initial residual = 0.00035798, Final residual = 1.49185e-05, No Iterations 8
smoothSolver:  Solving for alpha.water, Initial residual = 0.0572634, Final residual = 8.69432e-11, No Iterations 3
Phase-1 volume fraction = 2.78028e-05  Min(alpha.water) = 0  Max(alpha.water) = 1
time step continuity errors : sum local = 1.71275e-06, global = 2.04751e-07, cumulative = 2.84596e-06
MULES: Correcting alpha.water
DICPCG:  Solving for p_rgh, Initial residual = 9.61138e-05, Final residual = 4.77129e-06, No Iterations 23
MULES: Correcting alpha.water
time step continuity errors : sum local = 5.67374e-07, global = 1.66609e-07, cumulative = 3.01257e-06
PIMPLE: iteration 5
DICPCG:  Solving for p_rgh, Initial residual = 0.00035798, Final residual = 1.49185e-05, No Iterations 8
Phase-1 volume fraction = 2.78028e-05  Min(alpha.water) = 0  Max(alpha.water) = 1
smoothSolver:  Solving for alpha.water, Initial residual = 0.0572634, Final residual = 8.69432e-11, No Iterations 3
Phase-1 volume fraction = 2.78028e-05  Min(alpha.water) = 0  Max(alpha.water) = 1
DICPCG:  Solving for p_rgh, Initial residual = 9.61138e-05, Final residual = 4.77129e-06, No Iterations 23
time step continuity errors : sum local = 1.71275e-06, global = 2.04751e-07, cumulative = 2.84596e-06
MULES: Correcting alpha.water
time step continuity errors : sum local = 5.67374e-07, global = 1.66609e-07, cumulative = 3.01257e-06
PIMPLE: iteration 5
smoothSolver:  Solving for alpha.water, Initial residual = 0.0572634, Final residual = 8.69432e-11, No Iterations 3
Phase-1 volume fraction = 2.78028e-05  Min(alpha.water) = 0  Max(alpha.water) = 1
MULES: Correcting alpha.water
Phase-1 volume fraction = 2.78028e-05  Min(alpha.water) = 0  Max(alpha.water) = 1
MULES: Correcting alpha.water
DICPCG:  Solving for p_rgh, Initial residual = 9.61138e-05, Final residual = 4.77129e-06, No Iterations 23
time step continuity errors : sum local = 5.67374e-07, global = 1.66609e-07, cumulative = 3.01257e-06
PIMPLE: iteration 5
MULES: Correcting alpha.water
DICPCG:  Solving for p_rgh, Initial residual = 0.000169515, Final residual = 7.36703e-06, No Iterations 10
smoothSolver:  Solving for alpha.water, Initial residual = 0.0572634, Final residual = 8.69432e-11, No Iterations 3
Phase-1 volume fraction = 2.78028e-05  Min(alpha.water) = 0  Max(alpha.water) = 1
Phase-1 volume fraction = 2.78028e-05  Min(alpha.water) = 0  Max(alpha.water) = 1
time step continuity errors : sum local = 8.71585e-07, global = 1.58682e-07, cumulative = 3.17125e-06
MULES: Correcting alpha.water
MULES: Correcting alpha.water
Phase-1 volume fraction = 2.78028e-05  Min(alpha.water) = 0  Max(alpha.water) = 1
DICPCG:  Solving for p_rgh, Initial residual = 6.56967e-05, Final residual = 3.25154e-06, No Iterations 15
DICPCG:  Solving for p_rgh, Initial residual = 0.000169515, Final residual = 7.36703e-06, No Iterations 10
time step continuity errors : sum local = 3.88283e-07, global = 1.43527e-07, cumulative = 3.31478e-06
EDIT : Ow this is because 4 processor that there's 4 PIMPLE iteration, so it's not wierd

If there's a way to optimize computational time I'd be glad to know how to
vivek05 likes this.

Last edited by Lookid; May 12, 2017 at 06:03.
Lookid is offline   Reply With Quote

Old   May 12, 2017, 09:58
Default
  #2
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
As you can see in output, you do not solve for p, you solve for p_rgh. So

Code:
    residualControl
    {
        p
        {
            tolerance 1e-4;
            relTol 0;
        }
    }
is not used (and you PIMPLE loop goes till 100 iterations, or at least should go).

relaxationFactors are also a little bit strange.
alexeym is offline   Reply With Quote

Old   May 12, 2017, 10:35
Default
  #3
Member
 
Lilian Chabannes
Join Date: Apr 2017
Posts: 58
Rep Power: 9
Lookid is on a distinguished road
Hello again alexeym ,

Yes right.

About relaxationFactors, how are you supposed to chose them ? I just put random values actually
Lookid is offline   Reply With Quote

Old   May 12, 2017, 14:05
Default
  #4
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

In general, people agree on the following:

- There should be no relaxation on final iteration. This can be achieved by setting relaxation factor to 1 or just removing relaxation factor from dictionary (faster variant).

- There are several mentions in presentations, that for optimal performance sum of relaxation factor for U equation and for p field should be 1.

- For PISO (or PIMPLE), in general, there is no need in relaxation.

So you start from no relaxation, if your solution diverges, you add relaxation for diverging equations. BUT relaxation is not a solution for incorrectly posed BCs.

Momentum predictor can be useful in certain problems. Though it introduces solution of additional equation, and seems to increase computation time, this step can improve convergence in pressure, so finally simulation with momentum predictor could run faster, than one without it.

And finally not only PIMPLE settings affect computation speed (in fact, PIMPLE dictionary is the last place to go, to improve speed). Mesh and linear solver settings have greater influence.
alexeym is offline   Reply With Quote

Old   May 13, 2017, 06:00
Default
  #5
Member
 
Lilian Chabannes
Join Date: Apr 2017
Posts: 58
Rep Power: 9
Lookid is on a distinguished road
Quote:
Originally Posted by alexeym View Post
- For PISO (or PIMPLE), in general, there is no need in relaxation.
Ah ? quoting this book, p.128 :
https://www.researchgate.net/profile...-OpenFOAMR.pdf

Quote:
To make the PIMPLE algorithm work fine, stable and more robust, we
have to think about the SIMPLE method (outer correction loop). As we already
mentioned in section 11.1, the method is not consistent and hence, we are forced to
use the under-relaxation technique; note that under-relaxation is not always necessary
especially for Co < 1 and non-stiff problems.
And the goal here is to have higher timestep, so higher Co.

My mesh is already quite coarse, I can't reduce its size.

I don't know if I'll mange to improve the calculation time, but I'd like to understand better how things work.
Lookid is offline   Reply With Quote

Old   May 13, 2017, 09:51
Default
  #6
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
OK. Let's wait for Herr Holzmann (aka Tobi), at least he can comment on his PDF.

Here are little comments on mesh and Courant number.

1. I used mesh in terms of mesh quality, not resolution. You can have two meshes with the same resolution and same shape, one perfectly orthogonal and another with high degree of non-orthogonality. Calculation on the highly non-orthogonal mesh will be rather slow and unpleasant thing.

2. Your aims are not quite clear. You need to reduce computation time or you need to get meaningful results? In the first case go with upwind schemes, use high Courant number, increase value of tolerances for linear solvers, increase value for convergence residuals. You will obtain certain results. Can we trust them? I doubt.
Tobi likes this.
alexeym is offline   Reply With Quote

Old   May 13, 2017, 11:18
Default
  #7
Member
 
Lilian Chabannes
Join Date: Apr 2017
Posts: 58
Rep Power: 9
Lookid is on a distinguished road
Quote:
Originally Posted by alexeym View Post
1. I used mesh in terms of mesh quality, not resolution. You can have two meshes with the same resolution and same shape, one perfectly orthogonal and another with high degree of non-orthogonality. Calculation on the highly non-orthogonal mesh will be rather slow and unpleasant thing.

2. Your aims are not quite clear. You need to reduce computation time or you need to get meaningful results?
1. Yes, I tried my best with sHM to have the least non-orthogonality possible and homogeneous mesh to avoid a very small cell that would explode the Co.
Question about this, let's imagine you have a perfect orthogonal mesh with one cell that is 100 times smaller than the others, Co will be based on the small one, right ? So using a high Co in this case may lead to good results.

2. Both . For the purpose I have now, the goal is just to have an idea of how the flow is propagating, so I'll try with your tips next week to reduce computation time and see if I obtain different results
Lookid 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
interFoam vs. simpleFoam channel flow comparison DanM OpenFOAM Running, Solving & CFD 12 January 31, 2020 15:26
interFoam (HELYX-OS) pressure boundary conditions SFr OpenFOAM Running, Solving & CFD 8 June 23, 2016 16:36
k-e & GAMG interFoam Schemitisation Stability Issue JFM OpenFOAM Running, Solving & CFD 3 December 1, 2015 05:58
interFoam in parallel gooya_kabir OpenFOAM Running, Solving & CFD 0 December 9, 2013 05:09
Open Channel Flow using InterFoam type solver sxhdhi OpenFOAM Running, Solving & CFD 3 May 5, 2009 21:58


All times are GMT -4. The time now is 21:48.