|
[Sponsors] |
November 9, 2011, 14:42 |
Two conditions in Fluent journal files
|
#1 |
Member
Martin H.
Join Date: May 2009
Posts: 31
Rep Power: 17 |
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)) ))) Code:
If filenumber <100 then file name = file-00 i else if file number < 1000 file name = file-0 i else file name = file- Any ideas? Thanks |
|
November 9, 2011, 16:24 |
|
#2 |
Senior Member
|
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 |
|
November 9, 2011, 17:09 |
|
#3 |
Member
Martin H.
Join Date: May 2009
Posts: 31
Rep Power: 17 |
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 |
|
November 10, 2011, 00:07 |
|
#4 |
Member
Join Date: Apr 2009
Posts: 46
Rep Power: 17 |
Paste the error message.
or just use casename as following: Code:
(define casename "file-~04d.cas" i) ;; |
|
November 10, 2011, 03:55 |
|
#5 |
Member
Martin H.
Join Date: May 2009
Posts: 31
Rep Power: 17 |
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 |
|
November 10, 2011, 06:31 |
|
#6 |
Member
Martin H.
Join Date: May 2009
Posts: 31
Rep Power: 17 |
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 ))) |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
journal files and SCHEME | Hugo | FLUENT | 2 | October 26, 2017 10:25 |
few quesions on ANSYS ICEMCFD and FLUENT | Prakash.Paudel | ANSYS | 0 | August 12, 2010 13:07 |
critical error during installation of openfoam | Fabio88 | OpenFOAM Installation | 21 | June 2, 2010 04:01 |
Open Channel Boundary Conditions via journal | Matteo | FLUENT | 0 | January 21, 2008 12:05 |
Journal files | FP Mie | FLUENT | 0 | January 24, 2001 13:46 |