|
[Sponsors] |
May 12, 2017, 05:55 |
About interFoam
|
#1 |
Member
Lilian Chabannes
Join Date: Apr 2017
Posts: 58
Rep Power: 9 |
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; } } 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 If there's a way to optimize computational time I'd be glad to know how to Last edited by Lookid; May 12, 2017 at 07:03. |
|
May 12, 2017, 10:58 |
|
#2 |
Senior Member
|
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; } } relaxationFactors are also a little bit strange. |
|
May 12, 2017, 11:35 |
|
#3 |
Member
Lilian Chabannes
Join Date: Apr 2017
Posts: 58
Rep Power: 9 |
Hello again alexeym ,
Yes right. About relaxationFactors, how are you supposed to chose them ? I just put random values actually |
|
May 12, 2017, 15:05 |
|
#4 |
Senior Member
|
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. |
|
May 13, 2017, 07:00 |
|
#5 | ||
Member
Lilian Chabannes
Join Date: Apr 2017
Posts: 58
Rep Power: 9 |
Quote:
https://www.researchgate.net/profile...-OpenFOAMR.pdf Quote:
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. |
|||
May 13, 2017, 10:51 |
|
#6 |
Senior Member
|
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. |
|
May 13, 2017, 12:18 |
|
#7 | |
Member
Lilian Chabannes
Join Date: Apr 2017
Posts: 58
Rep Power: 9 |
Quote:
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 |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
interFoam vs. simpleFoam channel flow comparison | DanM | OpenFOAM Running, Solving & CFD | 12 | January 31, 2020 16:26 |
interFoam (HELYX-OS) pressure boundary conditions | SFr | OpenFOAM Running, Solving & CFD | 8 | June 23, 2016 17:36 |
k-e & GAMG interFoam Schemitisation Stability Issue | JFM | OpenFOAM Running, Solving & CFD | 3 | December 1, 2015 06:58 |
interFoam in parallel | gooya_kabir | OpenFOAM Running, Solving & CFD | 0 | December 9, 2013 06:09 |
Open Channel Flow using InterFoam type solver | sxhdhi | OpenFOAM Running, Solving & CFD | 3 | May 5, 2009 22:58 |