CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT

Saving the residuals in a dat file from TUI

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By EmiS

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 31, 2016, 11:44
Default Saving the residuals in a dat file from TUI
  #1
New Member
 
Join Date: Aug 2015
Posts: 13
Rep Power: 11
EmiS is on a distinguished road
Hello,

I'm trying to save the residual monitor (with continuity, x/y/z-velocity for example) in a *.dat file.
I'm using ANSYS 17.0 with the TUI.

From the documentation "ANSYS Fluent Text Command List".(Nov. 2013), I saw that in the menu /solve/monitors/ there are the following sub-menus:
force/
residual/
statistic/
surface/
volume/

Unfortunately in my version (v 17.0) I don't see the sub-menu /residual/
These are the entries I see (in my version) in /solve/monitors/
force/
statistic/
volume/
surface/
set-average-over

Does anyone observe the same "issue"? Do you know if this sub-menu has migrated somewhere else in the tree?

Thank you very much for your help.

EmiS
namsivag likes this.
EmiS is offline   Reply With Quote

Old   November 24, 2016, 09:19
Default
  #2
New Member
 
Join Date: Aug 2015
Posts: 13
Rep Power: 11
EmiS is on a distinguished road
Dear All,

I have tried to save the Residual values in a text file using only TUI commands from a Journal file in order to postprocess, later on, the convergence graph in Matlab.
Based on the instructions coming from this page: http://www.eureka.im/1087.html, I have written the following command in my journal file:
/solve/execute-commands/add-edit save_residuals 1 "iteration" "(define port)(set! port (open-output-file "Residuals.dat"))(do ((i 0 (+ i 1))) ((= i (length (solver-residuals))))(format port "~a ~2t" (cdr (list-ref (solver-residuals) i))))(newline port)"

The problem is that the text file gets re-written at each iteration with the new values of the residuals (the old ones don't appear). It seems that the "newline port" command is not executed.
On the console window this is what I see:

(define port)
port
(set! port (open-output-file "Residuals.dat"))
port
(do ((i 0 (+ i 1))) ((= i (length (solver-residuals))))(format port "~a ~2t" (cdr (list-ref (solver-residuals) i))))
#f
(newline port)

I'm suspicious about the "#f", but I don't exactly what what it stands for.

Can anyone give me a hint on this issue?
Or if it is not the proper way to go, can someone comment on what should be done (to write the proper command in a TUI Journal file that would save the residuals in a text file)?

Thank you very much.

EmiS.
EmiS is offline   Reply With Quote

Old   December 15, 2022, 13:58
Default
  #3
New Member
 
Luigi Cutrone
Join Date: Mar 2009
Location: Italy
Posts: 3
Rep Power: 17
lcutrone is on a distinguished road
following the tutorial in http://www.eureka.im/1087.html
try this for init.scm
--------------------
(define port)
(set! port (open-output-file "residuals.dat"))

(format port "~a ~2t" 'Iterations )
(do
((i 0 (+ i 1)))
((= i (length (solver-residuals))))
(format port "~a ~2t" (car ( list-ref (solver-residuals) i)))
)
(newline port)
--------------------
and this for residual.jou
--------------------
(format port "~a ~2t" (%iterate 0) )
(do
((i 0 (+ i 1)))
((= i (length (solver-residuals))))
(format port "~a ~2t" (cdr (list-ref (solver-residuals) i)))
)
(newline port)

--------------------
lcutrone is offline   Reply With Quote

Old   December 16, 2022, 10:48
Default
  #4
New Member
 
Zhang Haosen
Join Date: Jun 2020
Posts: 7
Rep Power: 6
zimao is on a distinguished road
Did you have the case initialized before issuing the command? Maybe it's because there is no data about the residual.
zimao is offline   Reply With Quote

Old   December 18, 2022, 03:07
Default
  #5
New Member
 
Luigi Cutrone
Join Date: Mar 2009
Location: Italy
Posts: 3
Rep Power: 17
lcutrone is on a distinguished road
Yes, you need to initialize the case, then you can load the Scheme file (init.scm) and start the run, during with you can execute the journal file.
essentially, the init.scm open the file and write the titles, whereas the residual.jou write the residuals during the iterations.

L
lcutrone is offline   Reply With Quote

Reply

Tags
dat file, journal file, residuals fluent, tui


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
what is swap4foam ?? AB08 OpenFOAM 28 February 2, 2016 02:22
[Other] How to use finite area method in official OpenFOAM 2.2.0? Detian Liu OpenFOAM Meshing & Mesh Conversion 4 November 3, 2015 04:04
SparceImage v1.7.x Issue on MAC OS X rcarmi OpenFOAM Installation 4 August 14, 2014 07:42
[OpenFOAM] Annoying issue of automatic "Rescale to Data Range " with paraFoam/paraview 3.12 keepfit ParaView 60 September 18, 2013 04:23
friction forces icoFoam ofslcm OpenFOAM 3 April 7, 2012 11:57


All times are GMT -4. The time now is 12:52.