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

Two conditions in Fluent journal files

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   November 9, 2011, 13:42
Default Two conditions in Fluent journal files
  #1
Member
 
Martin H.
Join Date: May 2009
Posts: 31
Rep Power: 7
bobmalaria is on a distinguished road
hi,

I have an FLUENT journal file I use for post-processing.

The journal reads in cas and dat files I auto-saved and performs a certain action.
the files are in the format

bla-bla-bla-0050.cas
.
.
.
bla-bla-bla-0120.cas

so basically a number increasing in increments of 10. This causes probelms when I read the file.

Code:
(define (my-post-proc);;name of the journal-function
;;
(define nstart 50);; time-step # for the 1st data set
(define nsave 10) ;; auto-save frequency
(define ndata 100) ;; # of data-sets
(do ((i nstart (+ nsave i)))((= i (+ nstart (* ndata nsave))))
(if (< i 100)
(define basename "file-00") ;;Filename prefixfor the data files
((if (< i 100)(define basename "file-0")(define basename "file-")))
)
(begin
(ti-menu-load-string(format #f "f rcd ~a~d.cas" basename i))
)))
As you can see the variable i holds the current file number. What I was trying to do is

Code:
If filenumber <100
then
file name = file-00 i
else
if file number < 1000
file name = file-0 i
else
file name = file-
while this works fine with the < 100 condition only, the second if loop causes an error.

Any ideas? Thanks
bobmalaria is offline   Reply With Quote

Old   November 9, 2011, 15:24
Default
  #2
Senior Member
 
Amir's Avatar
 
Amir
Join Date: May 2009
Location: Shiraz, Iran
Posts: 732
Blog Entries: 1
Rep Power: 13
Amir is on a distinguished road
Hi Martin,

why didn't you use another program (journal generator) for this purpose? (Any other languages which can generate expanded journal file; I usually use FORTRAN)

Bests,
__________________
Amir
Amir is offline   Reply With Quote

Old   November 9, 2011, 16:09
Default
  #3
Member
 
Martin H.
Join Date: May 2009
Posts: 31
Rep Power: 7
bobmalaria is on a distinguished road
hi amir,

the problem ist not the generation of the journal file itself.
it needs to be in the scheme language for fluent to understand, doesn't it?

my problem is basically in the syntax of scheme in fluent. usually scheme understands (case) as well but fluent does not.

cheers
bobmalaria is offline   Reply With Quote

Old   November 9, 2011, 23:07
Default
  #4
Member
 
fox000002's Avatar
 
Join Date: Apr 2009
Posts: 46
Rep Power: 7
fox000002 is on a distinguished road
Paste the error message.

or just use casename as following:

Code:
(define casename "file-~04d.cas" i) ;;
fox000002 is offline   Reply With Quote

Old   November 10, 2011, 02:55
Default
  #5
Member
 
Martin H.
Join Date: May 2009
Posts: 31
Rep Power: 7
bobmalaria is on a distinguished road
thanks fox,

actually i know this notation from other tools like ffmpg in linux. did not know this works in scheme. I will try it later today.

Cheers
bobmalaria is offline   Reply With Quote

Old   November 10, 2011, 05:31
Default
  #6
Member
 
Martin H.
Join Date: May 2009
Posts: 31
Rep Power: 7
bobmalaria is on a distinguished road
Hi,

it finally worked. i had to define the basename outside of the loop and then construct the filename inside of the loop

(define (po);;name of the journal-function
(define basename "file-")
(define nstart 50);; time-step # for the 1st data set
(define nsave 10) ;; auto-save frequency
(define ndata 1) ;; # of data-sets
(do ((i nstart (+ nsave i)))((= i (+ nstart (* ndata nsave))))
(begin
(ti-menu-load-string(format #f "f rcd ~a~04d" basename i))
;;other things
;;more other things
)))
bobmalaria is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
few quesions on ANSYS ICEMCFD and FLUENT Prakash.Paudel ANSYS 0 August 12, 2010 12:07
critical error during installation of openfoam Fabio88 OpenFOAM Installation 21 June 2, 2010 03:01
Open Channel Boundary Conditions via journal Matteo FLUENT 0 January 21, 2008 11:05
journal files and SCHEME Hugo FLUENT 1 June 6, 2007 10:41
Journal files FP Mie FLUENT 0 January 24, 2001 12:46


All times are GMT -4. The time now is 16:02.