CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Post-Processing

Unable to plot residuals (Interfoam)

Register Blogs Community New Posts Updated Threads Search

Like Tree13Likes
  • 7 Post By Tobi
  • 6 Post By Tobi

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 9, 2018, 13:27
Default Unable to plot residuals (Interfoam) [Solved]
  #1
Member
 
Shafik Walakaka
Join Date: Oct 2017
Posts: 38
Rep Power: 9
walakaka is on a distinguished road
Hi everyone,

I am currently working on a two-phase 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 hagen-poiseuille 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
  • warning: skipping data with no valid points
  • unable to open display
  • x11 aborted

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
walakaka is offline   Reply With Quote

Old   February 10, 2018, 13:54
Default
  #2
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
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.
The King, haydii, Nikoonz and 4 others like this.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   February 10, 2018, 18:59
Default
  #3
Member
 
Shafik Walakaka
Join Date: Oct 2017
Posts: 38
Rep Power: 9
walakaka is on a distinguished road
Quote:
Originally Posted by Tobi View Post
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.
Hi Tobi,

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:
  • Why is there a momentumPredictor option in the interFoam solver compared to the simpleFoam solver (which has no momentum Predictor option and plots out ux, uy and uz residuals)
  • Would my residual plot be fully legitimate in showing that my simulation has converged if it only contains the plot for the residual of p_rgh?

Kind regards
Shaq
walakaka is offline   Reply With Quote

Old   February 10, 2018, 20:33
Default
  #4
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi,

  • in steady-state solvers the calculation (estimation) of the velocity field helps to go to the solution. Transient normally have the momentumPredictor flag. Its nothing than estimating the U field.
  • Yes, if p_rgh is converged, the fluxes are converged as well and thus the U field. Normally the momentumPredictior is needed if the viscosity ratio is large (e.g. in two phase flows). If one does not activate the momentum predictor, the tolerance for the pressure has to be set very strictly
EngMec, Bashar, Nikoonz and 3 others like this.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   February 18, 2018, 20:49
Default
  #5
Member
 
Shafik Walakaka
Join Date: Oct 2017
Posts: 38
Rep Power: 9
walakaka is on a distinguished road
Quote:
Originally Posted by Tobi View Post
Hi,

  • in steady-state solvers the calculation (estimation) of the velocity field helps to go to the solution. Transient normally have the momentumPredictor flag. Its nothing than estimating the U field.
  • Yes, if p_rgh is converged, the fluxes are converged as well and thus the U field. Normally the momentumPredictior is needed if the viscosity ratio is large (e.g. in two phase flows). If one does not activate the momentum predictor, the tolerance for the pressure has to be set very strictly
Thank you Tobi!

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 1e-7 or will a residual of magnitude below 1e-5 be reasonable?

Regards
Shafik

Last edited by walakaka; February 26, 2018 at 19:42.
walakaka is offline   Reply With Quote

Old   February 26, 2018, 19:42
Default
  #6
Member
 
Shafik Walakaka
Join Date: Oct 2017
Posts: 38
Rep Power: 9
walakaka is on a distinguished road
Quote:
Originally Posted by walakaka View Post
Thank you Tobi!

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 1e-7 or will a residual of magnitude below 1e-5 be reasonable?

Regards
Shafik
Has anyone got any info on this matter please?
walakaka is offline   Reply With Quote

Old   February 26, 2018, 19:59
Default Example!
  #7
Member
 
Shafik Walakaka
Join Date: Oct 2017
Posts: 38
Rep Power: 9
walakaka is on a distinguished road
Quote:
Originally Posted by walakaka View Post
Has anyone got any info on this matter please?
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.66809e-11, No Iterations 2
Phase-1 volume fraction = 0.517887 Min(alpha.water) = 0 Max(alpha.water) = 1.06837
MULES: Correcting alpha.water
MULES: Correcting alpha.water
Phase-1 volume fraction = 0.517887 Min(alpha.water) = -8.72144e-07 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.39327e-05, cumulative = -4.39327e-05
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.39253e-05, cumulative = -6.7858e-05
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.19552e-05, cumulative = -7.98132e-05
ExecutionTime = 12.26 s ClockTime = 12 s

Regards
Shaq
walakaka is offline   Reply With Quote

Old   March 7, 2018, 17:27
Default Pimplefoam residual
  #8
Member
 
Shafik Walakaka
Join Date: Oct 2017
Posts: 38
Rep Power: 9
walakaka is on a distinguished road
Quote:
Originally Posted by Tobi View Post
Hi,

  • in steady-state solvers the calculation (estimation) of the velocity field helps to go to the solution. Transient normally have the momentumPredictor flag. Its nothing than estimating the U field.
  • Yes, if p_rgh is converged, the fluxes are converged as well and thus the U field. Normally the momentumPredictior is needed if the viscosity ratio is large (e.g. in two phase flows). If one does not activate the momentum predictor, the tolerance for the pressure has to be set very strictly
Hi Tobi,

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
Attached Images
File Type: jpg residuals_re300.jpg (51.8 KB, 177 views)
walakaka is offline   Reply With Quote

Old   February 6, 2022, 08:59
Default velocity component residuals are missing (multiphaseEulerFoam)
  #9
New Member
 
saeed sangchooly
Join Date: Feb 2022
Posts: 17
Rep Power: 4
saeed sangchooly is on a distinguished road
Quote:
Originally Posted by Tobi View Post
Hi,

  • in steady-state solvers the calculation (estimation) of the velocity field helps to go to the solution. Transient normally have the momentumPredictor flag. Its nothing than estimating the U field.
  • Yes, if p_rgh is converged, the fluxes are converged as well and thus the U field. Normally the momentumPredictior is needed if the viscosity ratio is large (e.g. in two phase flows). If one does not activate the momentum predictor, the tolerance for the pressure has to be set very strictly
dear Tobi
I'm working with multiphaseEulerFoam solver with 3 phases I did set momentumPredictor to yes and I've also tried setting nUcorrectors to 0; but still I can't see the velocity component residuals. why is that? how can I fix this?

Last edited by saeed sangchooly; February 6, 2022 at 10:54.
saeed sangchooly is offline   Reply With Quote

Old   February 6, 2022, 17:57
Default
  #10
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Can you provide use the solver log file?
If you have the momentumPredictor activated, you have to see it. Maybe its related to the solver and the residual control function object (don't know how you are extracting your data) should give the velocity field. Otherwise, its a feature we would / could be implement in newer versions.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   February 7, 2022, 07:45
Post
  #11
New Member
 
saeed sangchooly
Join Date: Feb 2022
Posts: 17
Rep Power: 4
saeed sangchooly is on a distinguished road
Quote:
Originally Posted by Tobi View Post
Can you provide use the solver log file?
If you have the momentumPredictor activated, you have to see it. Maybe its related to the solver and the residual control function object (don't know how you are extracting your data) should give the velocity field. Otherwise, its a feature we would / could be implement in newer versions.
that's the point. there is no solving message for velocity in the log file:
this is what I get in log file:


(RAS bubble column tutorial in multiphaseEulerFoam):
Code:
PIMPLE: Iteration 1
MULES: Solving for alpha.air
MULES: Solving for alpha.water
air fraction, min, max = 0.293331 -2.33203e-178 1
water fraction, min, max = 0.706669 0 1
Phase-sum volume fraction, min, max = 1 1 1
MULES: Solving for alpha.air
MULES: Solving for alpha.water
air fraction, min, max = 0.293331 -6.74315e-178 1
water fraction, min, max = 0.706669 0 1
Phase-sum volume fraction, min, max = 1 1 1
Constructing momentum equations
smoothSolver:  Solving for e.air, Initial residual = 0.000387688, Final residual = 1.57809e-08, No Iterations 1
smoothSolver:  Solving for e.water, Initial residual = 1.45421e-06, Final residual = 4.86519e-11, No Iterations 1
air min/max T 300 - 350
water min/max T 300.159 - 350
GAMG:  Solving for p_rgh, Initial residual = 3.32827e-06, Final residual = 8.8626e-09, No Iterations 5


it seems that momentunPredictor can not be actually activated in multiphaseEulerFoam. because the solver gave no error that for example UFinal is undefined in fvSolution like other solvers.

thank you so much for your answer btw.
saeed sangchooly is offline   Reply With Quote

Old   February 7, 2022, 08:35
Default
  #12
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
You mix up a few things here. However, you are right, the momentum-prediction is not implemented: https://develop.openfoam.com/Develop...erFoam/UEqns.H

So probably, there is a reason why its not implemented or why we cannot use a prediction step prior to the pressure-equation. I am not familiar with multiphase flows.

However, UFinal, if you don't set the "*.Final" Relaxation, it is commonly 1. It should be a <lookupOrDefault> value. So I never had issues that "*.Final" is not defined in terms of relaxation factors. Furthermore, in the UEqns.H file, you can see that the relaxation of the matrix is commented. Hence, not used at all.


Note. In the Foundation version, there you have the relaxation included:

https://github.com/OpenFOAM/OpenFOAM...oam/pU/UEqns.H
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   February 9, 2022, 06:38
Post
  #13
New Member
 
saeed sangchooly
Join Date: Feb 2022
Posts: 17
Rep Power: 4
saeed sangchooly is on a distinguished road
Quote:
Originally Posted by Tobi View Post
You mix up a few things here. However, you are right, the momentum-prediction is not implemented: https://develop.openfoam.com/Develop...erFoam/UEqns.H

So probably, there is a reason why its not implemented or why we cannot use a prediction step prior to the pressure-equation. I am not familiar with multiphase flows.

However, UFinal, if you don't set the "*.Final" Relaxation, it is commonly 1. It should be a <lookupOrDefault> value. So I never had issues that "*.Final" is not defined in terms of relaxation factors. Furthermore, in the UEqns.H file, you can see that the relaxation of the matrix is commented. Hence, not used at all.


Note. In the Foundation version, there you have the relaxation included:

https://github.com/OpenFOAM/OpenFOAM...oam/pU/UEqns.H
you mean it's a bug in openFOAM8 (that momentum-prediction can not be implemented in multiphaseEulerFoam)?
is there any chance that other versions don't have this bug?
saeed sangchooly 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
plot residuals for parallel simulation with pimpleDyMFoam decibelle OpenFOAM Post-Processing 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


All times are GMT -4. The time now is 09:03.