
[Sponsors] 
February 9, 2018, 13:27 
Unable to plot residuals (Interfoam) [Solved]

#1 
Member
Shafik Walakaka
Join Date: Oct 2017
Posts: 38
Rep Power: 5 
Hi everyone,
I am currently working on a twophase laminar flow through a pipe. To check my mesh, I ran a simulation with only air through the pipe (alpha = 0) using the interFoam solver and the results matches the hagenpoiseuille equation. However, I am currently trying to plot the residuals using help from the forum in the following link: plot residuals The residual plot was successful in the past when I was using the simpleFoam solver. However, using the interFoam solver, I am getting an error message stating the following
Does anyone have any idea of what I am doing wrong? p/s: I also notice that in my log file, they are only solving for the p_rgh term and no ux,uy or uz term Kind regards Shaq Last edited by walakaka; February 28, 2018 at 15:04. Reason: solved 

February 10, 2018, 13:54 

#2 
Super Moderator

Hi,
you donīt solve for p, thus you have to grep for p_rgh if you want to get the residuals for p_rgh. In most cases there is no need to solve the momentum prediction. In your fvSolutions you momentumPredictor is false. Thats why you donīt see Ux, Uy and Uz residuals.
__________________
Keep foaming, Tobias Holzmann 

February 10, 2018, 18:59 

#3  
Member
Shafik Walakaka
Join Date: Oct 2017
Posts: 38
Rep Power: 5 
Quote:
Thanks for getting back to me. I had a look in the fvSolution folder and it is true that my momentumPredictor is set to "no". Could you kindly explain the following please:
Kind regards Shaq 

February 10, 2018, 20:33 

#4 
Super Moderator

Hi,
__________________
Keep foaming, Tobias Holzmann 

February 18, 2018, 20:49 

#5  
Member
Shafik Walakaka
Join Date: Oct 2017
Posts: 38
Rep Power: 5 
Quote:
I have another question: When not activating the momentum predictor, the solver only solves the residual for p_rgh. However, every time iteration has 3 p_rgh residuals, Which one should I take from each iteration? Also, if one does not activate the momentum predicture, what are the recommended tolerance for pressure residuals? Will it have to be below 1e7 or will a residual of magnitude below 1e5 be reasonable? Regards Shafik Last edited by walakaka; February 26, 2018 at 19:42. 

February 26, 2018, 19:42 

#6  
Member
Shafik Walakaka
Join Date: Oct 2017
Posts: 38
Rep Power: 5 
Quote:


February 26, 2018, 19:59 
Example!

#7 
Member
Shafik Walakaka
Join Date: Oct 2017
Posts: 38
Rep Power: 5 
For example, the logs below, Which residual do I grep for? The first, second or final one? Or do I grep for each of them in succession (even though they are the resultant value from 1 particular iteration)
PIMPLE: iteration 1 smoothSolver: Solving for alpha.water, Initial residual = 0.000529543, Final residual = 2.66809e11, No Iterations 2 Phase1 volume fraction = 0.517887 Min(alpha.water) = 0 Max(alpha.water) = 1.06837 MULES: Correcting alpha.water MULES: Correcting alpha.water Phase1 volume fraction = 0.517887 Min(alpha.water) = 8.72144e07 Max(alpha.water) = 1.06794 DICPCG: Solving for p_rgh, Initial residual = 1, Final residual = 0.880426, No Iterations 1001 time step continuity errors : sum local = 0.00204219, global = 2.39327e05, cumulative = 4.39327e05 DICPCG: Solving for p_rgh, Initial residual = 0.270516, Final residual = 0.753417, No Iterations 1001 time step continuity errors : sum local = 0.00579181, global = 2.39253e05, cumulative = 6.7858e05 DICPCG: Solving for p_rgh, Initial residual = 0.510678, Final residual = 0.1488, No Iterations 1001 time step continuity errors : sum local = 0.00170815, global = 1.19552e05, cumulative = 7.98132e05 ExecutionTime = 12.26 s ClockTime = 12 s Regards Shaq 

March 7, 2018, 17:27 
Pimplefoam residual

#8  
Member
Shafik Walakaka
Join Date: Oct 2017
Posts: 38
Rep Power: 5 
Quote:
I have used your advice and greped for p_rgh successfully, is there a command to only grep the final residual in every outer loop iteration? Because at the moment, my residual plot is plotting every single iteration (inner loop and outer loop) as shown in the attached file. Yaxis: residuals Xaxis: Iterations Kind regards Shafik 

Thread Tools  Search this Thread 
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
plot residuals for parallel simulation with pimpleDyMFoam  decibelle  OpenFOAM PostProcessing  8  June 6, 2017 05:39 
How to make a code parallel?  Bruno Machado  Fluent UDF and Scheme Programming  15  May 27, 2016 10:18 
Plot Residuals in each Outer Iteration using foamLog or PyFoam  coolcrasher  OpenFOAM Running, Solving & CFD  1  October 30, 2015 11:41 
[PyFoam] doesn't plot residuals  immortality  OpenFOAM Community Contributions  4  June 28, 2015 11:13 
plot of residuals  hawkeye321  OpenFOAM  5  December 7, 2012 10:05 