|
[Sponsors] |
How to plot local residuals' field (for each cell) ? OF 5.x |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
April 18, 2018, 13: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: 9 |
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 semi-inconclusive 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, 05:10 |
|
#2 |
New Member
manu ebn
Join Date: Aug 2015
Location: Switzerland
Posts: 18
Rep Power: 11 |
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 cell-values 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, 14:13 |
|
#3 | |
Senior Member
Deep
Join Date: Oct 2017
Posts: 180
Rep Power: 9 |
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, 21:39 |
How to plot local residuals' field (for each cell) ? OF 5.x
|
#4 |
Senior Member
abdikerim kurbanaliev
Join Date: Jun 2010
Location: Kyrgyzstan, Osh
Posts: 121
Rep Power: 16 |
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/Unofficial-Extend...FoamResidual.C Regards, Kerim |
|
June 11, 2018, 07:22 |
|
#5 | |
Senior Member
Deep
Join Date: Oct 2017
Posts: 180
Rep Power: 9 |
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, 11: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, 08:23 |
|
#7 | |
Senior Member
Deep
Join Date: Oct 2017
Posts: 180
Rep Power: 9 |
Quote:
Indeed. However, I haven't found any solution so far. Will update this if I do. |
||
October 4, 2018, 08:55 |
|
#8 |
Senior Member
Yann
Join Date: Apr 2012
Location: France
Posts: 1,200
Rep Power: 28 |
Hi!
I didn't have a chance to try it yet, but the residuals function object seems to do the job in openFoam-v1806 according to the releases notes : https://www.openfoam.com/releases/op...esidual-fields Not sure it's available in the foundation branch though, I didn't check. |
|
October 4, 2018, 09:26 |
|
#9 | |
New Member
Miguel
Join Date: Apr 2018
Posts: 2
Rep Power: 0 |
Quote:
|
||
October 4, 2018, 09:58 |
|
#10 | |
Senior Member
Deep
Join Date: Oct 2017
Posts: 180
Rep Power: 9 |
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, 10:28 |
|
#11 | |
Senior Member
Yann
Join Date: Apr 2012
Location: France
Posts: 1,200
Rep Power: 28 |
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, 11:02 |
|
#12 | |
Senior Member
Deep
Join Date: Oct 2017
Posts: 180
Rep Power: 9 |
Quote:
Alright, that's about it then. |
||
October 9, 2018, 01:47 |
|
#13 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
Hi all,
to sum up, the information of the discussed residual object function is presented here https://www.openfoam.com/releases/op...esidual-fields
__________________
Keep foaming, Tobias Holzmann |
|
January 24, 2019, 06:47 |
|
#14 |
New Member
Gerhard
Join Date: Mar 2017
Posts: 26
Rep Power: 9 |
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 Post-Processing" 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? |
|
October 19, 2023, 19:55 |
For OpenFOAM-11
|
#15 |
New Member
Sam Mallinson
Join Date: Aug 2013
Posts: 6
Rep Power: 13 |
For OpenFOAM-11, the command is
postProcess -func residuals -fields '(U p)' |
|
December 20, 2023, 11:58 |
|
#16 |
Member
Pedro Gouveia
Join Date: Oct 2022
Location: Portugal
Posts: 64
Rep Power: 4 |
Hey, I used that command but it just creates a .dat file with three lines:
# Residuals # Time 100 (this is the timestep on which I am trying to calculate the residuals) Am I doing something wrong? Do I need to have any "residual" file in /system or controlDict? |
|
March 5, 2024, 11:09 |
|
#17 |
Member
Pedro Gouveia
Join Date: Oct 2022
Location: Portugal
Posts: 64
Rep Power: 4 |
||
March 5, 2024, 12:27 |
|
#18 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
You don't provide any information.
For the ESI-Opencfd v2312 version, you can see that there is an optional parameter one can set to write out the volScalarFields https://develop.openfoam.com/Develop...type=heads#L67 Tobi
__________________
Keep foaming, Tobias Holzmann |
|
March 5, 2024, 12:37 |
|
#19 | |
Member
Pedro Gouveia
Join Date: Oct 2022
Location: Portugal
Posts: 64
Rep Power: 4 |
Quote:
I am using OF11, incompressibleFluid solver running a steady state. I want to plot a coutour of residual field of pressure and velocity. However the command sugested above does not work for me. That is what I was asking. At the moment I am not able to swap to ESI version. Is there any way to do it in the foundation version? |
||
June 18, 2024, 11:39 |
|
#20 |
New Member
Michael Henzinger
Join Date: Aug 2023
Location: Wels, Austria
Posts: 1
Rep Power: 0 |
I believe there is no such thing as "writeResidualFields" in the OF 11 Version. If you want to have it there, you need to create a custom function object.
The Source guide https://cpp.openfoam.org/v11/classFo...residuals.html is a good way to start looking for a way to implement this kind of function object. If you have no coding experience, it will take up some time. But it is definitely possible. |
|
Tags |
openfoam 5.x, pyfoam, residual, residual field |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Moving mesh | Niklas Wikstrom (Wikstrom) | OpenFOAM Running, Solving & CFD | 122 | June 15, 2014 07:20 |
Help for the small implementation in turbulence model | shipman | OpenFOAM Programming & Development | 25 | March 19, 2014 11:08 |
FvMatrix coefficients | shrina | OpenFOAM Running, Solving & CFD | 10 | October 3, 2013 15:38 |
AMI interDyMFoam for mixer nu problem | danny123 | OpenFOAM Programming & Development | 8 | September 6, 2013 03:34 |
Convergence moving mesh | lr103476 | OpenFOAM Running, Solving & CFD | 30 | November 19, 2007 15:09 |