|
[Sponsors] |
September 20, 2007, 22:45 |
residual storage in FLUENT
|
#1 |
Guest
Posts: n/a
|
residual storage in FLUENT?
i can't find residual values in my dat files,what's wrong??? can anyone tell me why? thanks a lot! |
|
September 21, 2007, 06:08 |
Re: residual storage in FLUENT
|
#2 |
Guest
Posts: n/a
|
you need to tell fluent to store the residuals in the dat file.
|
|
September 21, 2007, 06:11 |
Re: residual storage in FLUENT
|
#3 |
Guest
Posts: n/a
|
how to tell fluent to store the residuals in the dat file?
i'm not so familar with the TUI,can you tell me? |
|
September 21, 2007, 07:08 |
Re: residual storage in FLUENT
|
#4 |
Guest
Posts: n/a
|
The following steps can be used to write the solution residuals to a text file.
1. Read the case/data files in FLUENT. 2. Read the Scheme file (init.scm) using the File-->Read-->Scheme command. The content of the Scheme file should be as follows (please copy the content between the dashed line into a text file and save it as 'init.scm'): -------------------------------------------------------------- (define port) (set! port (open-output-file "residuals.dat")) (do ((i 0 (+ i 1))) ((= i (length (solver-residuals)))) (format port "~a ~2t" (car (list-ref (solver-residuals) i))) ) (newline port) --------------------------------------------------------------- 3. Set the following execute command at every iteration using Solve --> Execute Commands: file read-journal residual.jou The content of the journal file (residual.jou) should be as follows (please copy the content between the dashed line into a text file and save it as 'residual.jou'): --------------------------------------------------------------- (do ((i 0 (+ i 1))) ((= i (length (solver-residuals)))) (format port "~a ~2t" (cdr (list-ref (solver-residuals) i))) ) (newline port) --------------------------------------------------------------- 4. Now compute the solution using the Solve->Iterate command. This will write out a text file ('residuals.dat') containing the solution residual history. |
|
September 22, 2007, 00:48 |
Re: residual storage in FLUENT
|
#5 |
Guest
Posts: n/a
|
thanks a lot!
that really works well! but how to write these scheme command lines? or must i learn the scheme language? i have some german document,but i don't say german... any suggestions? |
|
September 24, 2007, 22:02 |
Re: residual storage in FLUENT
|
#6 |
Guest
Posts: n/a
|
new question:
now i have to execute the storage process through TUI, but it interrupts with the following error message: Error: A journal is currently open for input or output. You cannot read and write a journal at the same time, or read two journals simultaneously. Error Object: #f can anybody give me some advices? urgent sophie |
|
September 24, 2007, 22:17 |
Re: residual storage in FLUENT
|
#7 |
Guest
Posts: n/a
|
now i want to describe me error exactly:
i want to store the residual which print in console to be a file,but my process is executed though TUI,i write these commands in my journal file: ;-------------------------------------------------------------- (define port) (set! port (open-output-file "residuals.dat")) (do ((i 0 (+ i 1))) ((= i (length (solver-residuals)))) (format port "~a ~2t" (car (list-ref (solver-residuals) i))) ) (newline port) (cx-gui-do cx-activate-item "MenuBar*SolveMenu*Execute Commands...") (cx-gui-do cx-set-integer-entry "Execute Commands*IntegerEntry1(Defined Commands)" 1) (cx-gui-do cx-activate-item "Execute Commands*IntegerEntry1(Defined Commands)") (cx-gui-do cx-set-toggle-button "Execute Commands*Frame2*Table2*CheckButton6" #f) (cx-gui-do cx-activate-item "Execute Commands*Frame2*Table2*CheckButton6") (cx-gui-do cx-set-text-entry "Execute Commands*Frame2*Table2*TextEntry10" "(do ((i 0 (+ i 1))) ((= i (length (solver-residuals)))) (format port "~a ~2t" (cdr (list-ref (solver-residuals) i))) ) (newline port)") (cx-gui-do cx-activate-item "Execute Commands*PanelButtons*PushButton1(OK)") (cx-gui-do cx-activate-item "Solution Initialization*PanelButtons*PushButton2(Cancel)") solve/initialize/compute-defaults/pressure-far-field solve/iterate 20 ;--------------------------------------------------- but the error message: Error: eval: unbound variable Error Object: ~a Warning: An error or interrupt occurred while reading the journal file. Some commands may not have been completed. if i change the line contain ~a to be: (cx-gui-do cx-set-text-entry "Execute Commands*Frame2*Table2*TextEntry10" "file read-journal residual.jou") and in the content of the residual.jou is as follows ;--------------------------------------------------------------- (do ((i 0 (+ i 1))) ((= i (length (solver-residuals)))) (format port "~a ~2t" (cdr (list-ref (solver-residuals) i))) ) (newline port) ;--------------------------------------------------------------- the error message: file read-journal Error: A journal is currently open for input or output. You cannot read and write a journal at the same time, or read two journals simultaneously. Error Object: #f residual.jou invalid command [residual.jou] can you give me some advices? thanks a lot! sophie |
|
May 12, 2014, 03:24 |
|
#8 |
New Member
mostafa
Join Date: Jan 2014
Posts: 1
Rep Power: 0 |
i have this problem too. there is any alternative for using "" in scheme?
|
|
April 5, 2016, 23:22 |
How to add time step or time flow before the residuals??
|
#9 | |
New Member
Abdullatif A. Gari
Join Date: Feb 2016
Posts: 3
Rep Power: 10 |
Quote:
================= Thank you very much. Doing the above commands writes a list of residuals without the time flow or time step. Is there a way to do that? How to add time step or time flow before the residuals?? (Either one) |
||
April 6, 2016, 10:02 |
|
#10 |
Senior Member
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,758
Rep Power: 66 |
You can just edit the scheme so far and tell it to print the time-step and flow-time. The scheme variable names for these are time-step and flow-time.
|
|
April 6, 2016, 13:29 |
|
#11 | |
New Member
Abdullatif A. Gari
Join Date: Feb 2016
Posts: 3
Rep Power: 10 |
Quote:
(do ((i 0 (+ i 1))) ((= i (length (flow-time, solver-residuals)))) (format port "~a ~2t" (car (list-ref (solver-residuals) i))) ) (newline port) |
||
June 5, 2017, 12:22 |
|
#12 | |
Member
Rosario Arnau
Join Date: Feb 2017
Location: Spain
Posts: 57
Rep Power: 9 |
Quote:
Did it work? I have tried with: (do ((i 0 (+ i 1))) ((= i (length (flow-time, solver-residuals)))) (format port "~a ~2t" (car (list-ref (flow-time, solver-residuals) i))) ) (newline port) and (do ((i 0 (+ i 1))) ((= i (length (time-step, solver-residuals)))) (format port "~a ~2t" (car (list-ref (time-step, solver-residuals) i))) ) (newline port) and always get the same error: Error: eval: unbound variable Error Object: time-step Error: eval: unbound variable Error Object: flow-time Last edited by rarnaunot; June 5, 2017 at 13:01. Reason: New knowledge |
||
June 5, 2017, 18:02 |
|
#13 |
Senior Member
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,758
Rep Power: 66 |
Btw folks, in Fluent v18 residuals are available as a report so that you don't need these silly workarounds to write the residuals to a file. You still need a reader though.
|
|
June 6, 2017, 07:23 |
|
#14 | |
Member
Rosario Arnau
Join Date: Feb 2017
Location: Spain
Posts: 57
Rep Power: 9 |
Quote:
I was searching for it in 18 version. I guess it may be on: Report Files> Create a new Report File > New Report Definitions..... but how to get the residuals of the continuity, velocities and my different UDS? Should I create my own Report with DEFINE_REPORT_DEFINITION_FN ? Last edited by rarnaunot; June 6, 2017 at 07:28. Reason: New knowledge |
||
June 6, 2017, 10:06 |
|
#15 | |
Senior Member
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,758
Rep Power: 66 |
Quote:
solve/set/expert n y n n (the defaults are n n n n) This enable access to the cell residuals and then defining reports or using solution data export. A sum over all cells I think is what the Fluent window output is using (it might be another averaging operation), you should test it if you want to be sure. This approach really should be doable in versions before 18 as well. |
||
June 6, 2017, 10:17 |
|
#16 |
Member
Rosario Arnau
Join Date: Feb 2017
Location: Spain
Posts: 57
Rep Power: 9 |
Sorry! Maybe I didn't explain myself correctly. As u said, I want to copy to a file the plotted residuals or the numbers appearing in the command window, for example:
iter continuity x-velocity y-velocity z-velocity uds-0 uds-1 uds-2 uds-3 uds-4 time/iter ! 116 solution is converged 116 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 4.5547e-08 6.3906e-07 4.5547e-08 5.2988e-08 1.5437e-08 0:00:00 20 117 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 4.3878e-08 1.5746e-03 4.3878e-08 2.5311e-04 4.0493e-05 0:00:00 19 ! 118 solution is converged 118 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 4.5545e-08 6.3959e-07 4.5545e-08 5.0686e-08 1.2597e-08 0:00:00 18 |
|
January 18, 2018, 08:55 |
|
#17 |
New Member
Join Date: Aug 2015
Posts: 13
Rep Power: 11 |
Dear rarnaunot,
I have the exact same issue as you. I'm currently using Fluent v18.2 with the following lines in my journal file: /solve/set/expert yes no no /plot/residuals-set/plot-to-file "Residuals.txt" This only creates an empty text file as you mentioned. Besides, I have also tried the work around with the scheme file (described at several places on this forum) but it also doesn't work. In this case I get a text file with only one line of residuals that gets re-written at every iteration as described in the second part of my post: Saving the residuals in a dat file from TUI Any help would be greatly appreciated here. Cheers, EmiS |
|
January 27, 2018, 23:45 |
|
#18 |
Member
Abdulaziz Abutunis
Join Date: Aug 2014
Posts: 43
Rep Power: 12 |
Hi EmiS,
I have the same problem and wonder if you have figured it out. If so would you please share your thoughts. Regards, Aziz |
|
January 31, 2018, 18:38 |
|
#19 |
New Member
Join Date: Aug 2015
Posts: 13
Rep Power: 11 |
Dear Aziz,
Sorry I still haven't figured out how to save the residuals properly in a text file from the TUI journal. The "poor-man" solution I'm using is to save the log history into a text file and use a Python script to parse through the file, save the information about the residuals and plot it. EmiS |
|
February 1, 2018, 01:19 |
|
#20 |
Member
Abdulaziz Abutunis
Join Date: Aug 2014
Posts: 43
Rep Power: 12 |
Thank you EmiS for your reply I really appreciate it
|
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
alphaEqn.H in twoPhaseEulerFoam | cheng1988sjtu | OpenFOAM Bugs | 15 | May 1, 2016 17:12 |
Velocity blows up suddenly after 30,000+ iterations | lordvon | OpenFOAM Running, Solving & CFD | 15 | October 19, 2015 14:52 |
Moving mesh | Niklas Wikstrom (Wikstrom) | OpenFOAM Running, Solving & CFD | 122 | June 15, 2014 07:20 |
Low Mach number Compressible jet flow using LES | ankgupta8um | OpenFOAM Running, Solving & CFD | 7 | January 15, 2011 14:38 |
MRFSimpleFoam amp cyclic patches | david | OpenFOAM Running, Solving & CFD | 36 | October 21, 2008 22:55 |