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

residual storage in FLUENT

Register Blogs Community New Posts Updated Threads Search

Like Tree16Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 20, 2007, 22:45
Default residual storage in FLUENT
  #1
sophie
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!
  Reply With Quote

Old   September 21, 2007, 06:08
Default Re: residual storage in FLUENT
  #2
Joe
Guest
 
Posts: n/a
you need to tell fluent to store the residuals in the dat file.
  Reply With Quote

Old   September 21, 2007, 06:11
Default Re: residual storage in FLUENT
  #3
sophie
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?

  Reply With Quote

Old   September 21, 2007, 07:08
Default Re: residual storage in FLUENT
  #4
mAx
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.
  Reply With Quote

Old   September 22, 2007, 00:48
Default Re: residual storage in FLUENT
  #5
sophie
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?
  Reply With Quote

Old   September 24, 2007, 22:02
Default Re: residual storage in FLUENT
  #6
sophie
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
mostafadehghani.62 likes this.
  Reply With Quote

Old   September 24, 2007, 22:17
Default Re: residual storage in FLUENT
  #7
sophie
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

  Reply With Quote

Old   May 12, 2014, 03:24
Default
  #8
New Member
 
mostafa
Join Date: Jan 2014
Posts: 1
Rep Power: 0
mostafadehghani.62 is on a distinguished road
i have this problem too. there is any alternative for using "" in scheme?
mostafadehghani.62 is offline   Reply With Quote

Old   April 5, 2016, 23:22
Default 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
agari is on a distinguished road
Quote:
Originally Posted by mAx
;145582
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.

=================
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)
agari is offline   Reply With Quote

Old   April 6, 2016, 10:02
Default
  #10
Senior Member
 
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,751
Rep Power: 66
LuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura about
Quote:
Originally Posted by agari View Post
=================
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)
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.
rarnaunot likes this.
LuckyTran is offline   Reply With Quote

Old   April 6, 2016, 13:29
Default
  #11
New Member
 
Abdullatif A. Gari
Join Date: Feb 2016
Posts: 3
Rep Power: 10
agari is on a distinguished road
Quote:
Originally Posted by LuckyTran View Post
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.
Thanks. But not familiar with c++ prog so where to put it? Like this:

(do ((i 0 (+ i 1))) ((= i (length (flow-time, solver-residuals)))) (format port "~a ~2t" (car (list-ref (solver-residuals) i))) ) (newline port)
rarnaunot likes this.
agari is offline   Reply With Quote

Old   June 5, 2017, 12:22
Default
  #12
Member
 
Rosario Arnau
Join Date: Feb 2017
Location: Spain
Posts: 57
Rep Power: 9
rarnaunot is on a distinguished road
Quote:
Originally Posted by agari View Post
Thanks. But not familiar with c++ prog so where to put it? Like this:

(do ((i 0 (+ i 1))) ((= i (length (flow-time, solver-residuals)))) (format port "~a ~2t" (car (list-ref (solver-residuals) i))) ) (newline port)
Hello!

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
rarnaunot is offline   Reply With Quote

Old   June 5, 2017, 18:02
Default
  #13
Senior Member
 
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,751
Rep Power: 66
LuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura about
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.
rarnaunot and KaLium like this.
LuckyTran is offline   Reply With Quote

Old   June 6, 2017, 07:23
Default
  #14
Member
 
Rosario Arnau
Join Date: Feb 2017
Location: Spain
Posts: 57
Rep Power: 9
rarnaunot is on a distinguished road
Quote:
Originally Posted by LuckyTran View Post
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.
Thaks! Really good news!

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
rarnaunot is offline   Reply With Quote

Old   June 6, 2017, 10:06
Default
  #15
Senior Member
 
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,751
Rep Power: 66
LuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura about
Quote:
Originally Posted by rarnaunot View Post
Thaks! Really good news!

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 ?
Oops. I might have confused myself after glancing at the original post. I was thinking you could write all cell residuals as a data file... by using
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.
LuckyTran is offline   Reply With Quote

Old   June 6, 2017, 10:17
Default
  #16
Member
 
Rosario Arnau
Join Date: Feb 2017
Location: Spain
Posts: 57
Rep Power: 9
rarnaunot is on a distinguished road
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
rarnaunot is offline   Reply With Quote

Old   January 18, 2018, 08:55
Default
  #17
New Member
 
Join Date: Aug 2015
Posts: 13
Rep Power: 11
EmiS is on a distinguished road
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
EmiS is offline   Reply With Quote

Old   January 27, 2018, 23:45
Default
  #18
Member
 
Abdulaziz Abutunis
Join Date: Aug 2014
Posts: 43
Rep Power: 12
ama294 is on a distinguished road
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
ama294 is offline   Reply With Quote

Old   January 31, 2018, 18:38
Default
  #19
New Member
 
Join Date: Aug 2015
Posts: 13
Rep Power: 11
EmiS is on a distinguished road
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
EmiS is offline   Reply With Quote

Old   February 1, 2018, 01:19
Default
  #20
Member
 
Abdulaziz Abutunis
Join Date: Aug 2014
Posts: 43
Rep Power: 12
ama294 is on a distinguished road
Thank you EmiS for your reply I really appreciate it
ama294 is offline   Reply With Quote

Reply


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
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


All times are GMT -4. The time now is 23:26.