
[Sponsors] 
How to plot local residuals' field (for each cell) ? OF 5.x 

LinkBack  Thread Tools  Search this Thread  Display Modes 
April 18, 2018, 12:01 
How to plot local residuals' field (for each cell) ? OF 5.x

#1 
Senior Member
Deep
Join Date: Oct 2017
Posts: 180
Rep Power: 4 
Hello,
I was wondering if at all it is possible to do this. If yes, I could locate the problem areas in the mesh quickly whenever the run crashes. So I looked up on the forum and found mostly very old and semiinconclusive threads. So I am using OF 5.x version and I want to plot residuals for quantities like T, p, U for each cell in the domain and maybe view that in paraview. I came across this relatively recent thread, but this is not what I want. I have been doing this using gnuplot script. But this is average residual of each quantity with respect to time. I want it for each cell and of course for each time step. So that I can see exactly what's happening where in the field right before it crashes. I'm not sure if pyFoam can be used. If so, could you point me to latest resource compatible with OF 5 please (I found very old resources)? I am hoping someone could point me to correct tool/way to do this? 

May 9, 2018, 04:10 

#2 
New Member
manu ebn
Join Date: Aug 2015
Location: Switzerland
Posts: 18
Rep Power: 7 
Hi deep
Have you found a solution for this? I would like to have the same. All i found was the following thread: Residual Field OpenFOAM They calculate the residuals manually, by compiling a new solver. The solver calculates then the residuals based on the matrix equation: Ax = b where A is the coeff.matrix, x is the vector with the cellvalues and b stays for BC's. The residuals are defined as followed: r = b  Ax I tried to do the same, but one of the coefficients was to big (i think it was the convection term) and therefore i didnt get sufficient residuals. Best wishes Triggin 

May 17, 2018, 13:13 

#3  
Senior Member
Deep
Join Date: Oct 2017
Posts: 180
Rep Power: 4 
Quote:
Sorry I missed your post. It seems I missed another from a month ago! No, I haven't yet found any solution to this. However I don't have any sudden changes in variable values so exploring this has taken a back seat for now. However I'm definitely interested in finding a solution. The thread you've mentioned wasn't much useful. simpleFoamResidual gives me temporal residuals not spatial. For the record, with OF5.x the correct command is Code:
solverName postProcess func simpleFoamResidual 

June 9, 2018, 20:39 
How to plot local residuals' field (for each cell) ? OF 5.x

#4 
Member
abdikerim kurbanaliev
Join Date: Jun 2010
Location: Kyrgyzstan, Osh
Posts: 71
Rep Power: 12 
Dear Deep,
Were you able to solve this problem? I'm interested in it too. I found another links for that: 1. Local residuals. 2. https://github.com/UnofficialExtend...FoamResidual.C Regards, Kerim 

June 11, 2018, 06:22 

#5  
Senior Member
Deep
Join Date: Oct 2017
Posts: 180
Rep Power: 4 
Quote:
I have been through these before. Weren't much useful, especially because this is for 1.6 and OF has evolved a lot since then. For my purpose, Co was very high and I could plot a Co filed and it sufficed. So still looking for residuals... Code:
solverName postProcess func CourantNo 

October 3, 2018, 10:43 
Any new ideas?

#6 
New Member
Miguel
Join Date: Apr 2018
Posts: 2
Rep Power: 0 
Hi all,
Has any of you found some way of achieving this? I'm also struggling to represent a residual field for each time step. It would be super useful for finding the area of the simulation where the trouble begins... Cheers, Serra 

October 4, 2018, 07:23 

#7  
Senior Member
Deep
Join Date: Oct 2017
Posts: 180
Rep Power: 4 
Quote:
Indeed. However, I haven't found any solution so far. Will update this if I do. 

October 4, 2018, 07:55 

#8 
Senior Member
Yann
Join Date: Apr 2012
Location: France
Posts: 152
Rep Power: 10 
Hi!
I didn't have a chance to try it yet, but the residuals function object seems to do the job in openFoamv1806 according to the releases notes : https://www.openfoam.com/releases/op...esidualfields Not sure it's available in the foundation branch though, I didn't check. 

October 4, 2018, 08:26 

#9  
New Member
Miguel
Join Date: Apr 2018
Posts: 2
Rep Power: 0 
Quote:


October 4, 2018, 08:58 

#10  
Senior Member
Deep
Join Date: Oct 2017
Posts: 180
Rep Power: 4 
Quote:
That's interesting. It does look like there's a similar function for OF 5 as well as OF 6: https://github.com/OpenFOAM/OpenFOAM...ls/residuals.H When I had posted this question I was primarily working on a branch of OF 2.4.x. It didn't have functionObjects. However, am still not sure if this is the right utility that we are looking for. I tried it on a case and it doesn't write the residuals as suggested in the header file. Or perhaps am not using the it the right way (I added it in the controlDict file)? 

October 4, 2018, 09:28 

#11  
Senior Member
Yann
Join Date: Apr 2012
Location: France
Posts: 152
Rep Power: 10 
Quote:
residuals is quite an old functionObject. As far as I remember, it was already there in OF 2.3.x. But the original function only writes a dat file reporting the residuals in the postProcessing directory. What's new is the possibility to write residuals as a volume field. This new functionality seems to be specific to OF v1806 since the residuals functionObject source code in OF 6 lacks the writeFields option. 2 options for you : trying the residuals functionObject in OF v1806 or trying to compile the source code from the v1806 function in OF 6. 

October 4, 2018, 10:02 

#12  
Senior Member
Deep
Join Date: Oct 2017
Posts: 180
Rep Power: 4 
Quote:
Alright, that's about it then. 

October 9, 2018, 00:47 

#13 
Super Moderator

Hi all,
to sum up, the information of the discussed residual object function is presented here https://www.openfoam.com/releases/op...esidualfields
__________________
Keep foaming, Tobias Holzmann 

January 24, 2019, 05:47 

#14 
New Member
Gerhard
Join Date: Mar 2017
Posts: 15
Rep Power: 5 
Yes, this is exactly what I would also like to do.
Thanks for the thread you posted Tobi. It is great, but I just do not know how to implement this into OpenFOAM v5.0? The residuals functionObject in OF50 does not allow for writeFields to be set to true. The date of this "New and Improved PostProcessing" post was on 29/06/2018. OpenFOAM v5.0 is older. Is there thus a way to update it or something so that the new residuals functionObject comes into play? 

Tags 
openfoam 5.x, pyfoam, residual, residual field 
Thread Tools  Search this Thread 
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Moving mesh  Niklas Wikstrom (Wikstrom)  OpenFOAM Running, Solving & CFD  122  June 15, 2014 06:20 
Help for the small implementation in turbulence model  shipman  OpenFOAM Programming & Development  25  March 19, 2014 10:08 
FvMatrix coefficients  shrina  OpenFOAM Running, Solving & CFD  10  October 3, 2013 14:38 
AMI interDyMFoam for mixer nu problem  danny123  OpenFOAM Programming & Development  8  September 6, 2013 02:34 
Convergence moving mesh  lr103476  OpenFOAM Running, Solving & CFD  30  November 19, 2007 14:09 