do loop in Fluent journal file.
Hi,
Is there anybody know how to use a do loop in fluent journal file? I need it to convert lots of result files for fieldview. Thanks. caterchen |
Re: do loop in Fluent journal file.
Hi!
You're in trouble. I think there is no way to do loop in journal file...I can tell you that posprocessing of the reslts can be preety frustrating because of that:(( MATEUS |
Re: do loop in Fluent journal file.
Hello,
Fluent's command language is scheme, quite strange in its syntax but loops are possible. A do-loop will look like: (let loop ((i 5)) // start value for i = 5 // (begin ( .... your code) (loop (+ i 5)) // increment of i = 5 // ) Maybe you should also refer to some scheme-examples at fluentusers.com best regards Markus |
Hi
i know its a very old post but if u can help i would be thankful. i would like to know if i can open a case-data file using scheme file(i know how to do it in a journal file, i want to do it in scheme because i want to make use of the do loop). Many thanks for replying. with regards Quote:
|
1 Attachment(s)
Hi chandrasekhar,
I don't know how to insert strings in a scheme loop, but I'll suggest another approach: generate a journal file with another software. For example, I'm on Windows and I use AutoHotkey, a wonderful intuitive open-source utility with which you can script and automate a whole bunch of things (http://www.autohotkey.com/). Moreover, the Help of AutoHotkey is very detailed with a lot of examples (like the Matlab's Help). Here's an AutoHotkey script that generates a journal file (jou.jou) and would satisfy your needs, easy to understand: Code:
FileDelete, jou.jou ; delete the file before writing a new one |
Hi Chandrasekhar,
To automate post processing it is very useful to use scheme file in ANSYS Fluent. Here is an example of how to read case file, similarly you can do for case and data file using appropriate TUI commands. Code:
Or case-file-10.cas.gz , case-file-20.cas.gz , case-file-30.cas.gz ,....... |
wow thanks guys for the immediate response, was not really expecting it so soon. thank you
|
Hi
i tried using the scheme file with the code which gave, there was an error "Error: WorkBench Error: Could not handle command Error Object: #f". do you by any chance know what this means. Many thanks for replying. with regards Quote:
|
For example, the following scheme loads the 3 following files:
fluent_1.cas.gz fluent_2.cas.gz fluent_3.cas.gz Code:
(do ((x 1 (+ x 1))) ((> x 3)) |
Hi,
The scheme program which I have given in my previous comment works in both the cases, With the slash (\) and with out the slash. If you want to write file name in " " (quote) then you have to give a \ before the use of quote sign (if you are using format # f, if format # f is not used then you should not give a \ ). The error might have occurred because there might not be case file in existence with the specified name in your working directory. And in my script I have specified that do loop will run until x<10, when x becomes equal to 11 it will stop. You may specify the number equal to your number of case files. Chandrasekhar could you pl. post a snap shot of your error, it might be helpful to understand your error. |
Quote:
(define (recursion i j) (if (>= i j) (display i) (begin (display i) (recursion (+ 1 i) j)))) output: 12345 |
Error: CAR: invalid argument [1]: wrong type [not a pair]
Found the solution: there should be a an additional "i" at the end of the code (i i) to match the number of ~a's
Hi! I'm trying to create surface monitors along the height of a pipe and save them. I want to create many of them. So, I have successfully created the surfaces using a Do-loop, but somehow the almost same code does not seem to work for making of the monitors. Can you please tell me what's the error in the following code? (Do ((i 0 (+ i 1000))) ((> i 50)) (Ti-menu-load-string (format #f "/solve/monitors/surface/set-monitor h-~a "Vertex Average" air vof (h-~a) no no yes "h~a" 1 yes flow-time"i i)) ) But I'm not really that good at scheme programming! Thank You :) |
Hi Katja,
The condition (> i 50 ) which you are using is the culprit here. If you want to create 50 monitors then make the condition as (> i 50000) because your increment of i is 1000. Also you are using i inside ti-menu-load-string for three times so at the end of bracket you will have to write i three times. Like this - (Do ((i 0 (+ i 1000))) ((> i 50000)) (Ti-menu-load-string (format #f "/solve/monitors/surface/set-monitor h-~a "Vertex Average" air vof (h-~a) no no yes "h~a" 1 yes flow-time"i i i)) ) Thanks, Sanket |
All times are GMT -4. The time now is 23:51. |