|
[Sponsors] |
August 13, 2012, 14:52 |
Get residual in UDF
|
#1 |
New Member
Erica
Join Date: Jul 2012
Location: Mountain View, CA
Posts: 14
Rep Power: 14 |
Hi, does anyone know if there's a way to access the most recent residual values in define macros? I'm trying to write an Execute at End macro that checks whether the solution is properly converged or is just moving on to the next time step after reaching its maximum number of iterations.
Thanks! |
|
June 21, 2016, 04:59 |
|
#2 |
New Member
Join Date: Sep 2015
Posts: 9
Rep Power: 11 |
Hi,
I am seeking for the same thing! did you find any way? |
|
June 21, 2016, 06:55 |
|
#3 |
Senior Member
Bruno Machado
Join Date: May 2014
Posts: 271
Rep Power: 13 |
This is a piece of a code I found on internet. You can use rpsetvar and rpgetvar to obtain the
Code:
(let ((old-rc client-read-case)) (set! client-read-case (lambda args (apply old-rc args) (if (cx-gui?) (begin ;; Do your customization here (rpsetvar 'residuals/plot? #t) (rpsetvar 'residuals/settings '( (continuity #t 0 #f 0.001) (x-velocity #t 0 #f 0.001) (y-velocity #t 0 #f 0.001) (z-velocity #t 0 #f 0.001) (energy #t 0 #f 1e-06) (k #t 0 #f 0.001) (epsilon #t 0 #f 0.001))) (rpsetvar 'mom/relax 0.4) (rpsetvar 'pressure/relax 0.5) (rpsetvar 'realizable-epsilon? #t) (cxsetvar 'vector/style "arrow") ;; You can add more settings here |
|
June 22, 2016, 21:04 |
|
#4 | |
New Member
Join Date: Sep 2015
Posts: 9
Rep Power: 11 |
Quote:
Do you think there might be any UDF-way? Because I am not good much at Scheme Programming. |
||
June 23, 2016, 09:39 |
|
#5 | |
Senior Member
Bruno Machado
Join Date: May 2014
Posts: 271
Rep Power: 13 |
Quote:
RP_Get_Integer("XXXXXXXXXX") RP_Get_Double("XXXXXXXXXX") RP_Get_Real("XXXXXXXXXX") |
||
June 23, 2016, 18:05 |
|
#6 |
New Member
Join Date: Sep 2015
Posts: 9
Rep Power: 11 |
Thanks a lot!
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
High Courant Number @ icoFoam | Artex85 | OpenFOAM Running, Solving & CFD | 11 | February 16, 2017 14:40 |
Extrusion with OpenFoam problem No. Iterations 0 | Lord Kelvin | OpenFOAM Running, Solving & CFD | 8 | March 28, 2016 12:08 |
Orifice Plate with a fully developed flow - Problems with convergence | jonmec | OpenFOAM Running, Solving & CFD | 3 | July 28, 2011 06:24 |
Differences between serial and parallel runs | carsten | OpenFOAM Bugs | 11 | September 12, 2008 12:16 |
Unknown error | sivakumar | OpenFOAM Pre-Processing | 9 | September 9, 2008 13:53 |