CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   Parametric analysis in fluent (https://www.cfd-online.com/Forums/fluent/38069-parametric-analysis-fluent.html)

Nikhil September 30, 2005 22:55

Parametric analysis in fluent
 
I want to run a fluent simulation with a physical property (eg. thermal conductivity) that is varying over a range. Is there a way to run multiple simulations by invoking a loop so that different case files are made and corresponding data files are written for this varying physical property in one go! Is there a way for me to not to repeat the same process everytime i change a physical property?

Jason October 3, 2005 08:46

Re: Parametric analysis in fluent
 
If you can figure out the TUI command to change the properties, then you can write a journal file that will do this for you. In the fluent users guide, you can look at the section on running Fluent in batch mode... this will get you started... there's a list of TUI commands, or you can just try things in the fluent window... if you hit return you will get a list of submenus that are available... quick example:

If you hit return one of the menus you will notice is "solve" so type "solve" to see what's available under that... there you'll see "initialize", and under initialize you'll find fmg-initialization... to get to the top menu type "/" (without the " marks). From the top menu (or in your .jou file) you can access fmg initialization using:

/solve/initialize/fmg-initialization

Also, any unique character(s) that represents the menu or command you are trying to access can be used... from the top menu, the only submenu that starts with "s" is solve... and within solve, only initialize starts with "i"... so a shorter way of accessing fmg initialization is:

s i fmg

Try things out in the TUI to see if they work... also, some things require responses (like fmg asks if you want to initialize, so the actual command would be "s i fmg yes")

Like I said, try things out in the TUI... anything you can type into the TUI will work in a journal.

Once you have a journal written, you can run it by going to File->Read->Journal

Another option is that after you read your case you can go to File->Write->Journal and Fluent will record the commands you perform to a text file. Then you can open this file and see the commands fluent used... these can be different then the TUI commands though because they are based on the GUI inputs instead.

I think there's a way to write loops using "scheme" language, but I'm not sure how to do it. If there's not too many commands, then you can just copy each setup after the other so it would look something like:

; rc stands for read case rc case1.cas ; it stands for iterate it 1000 ; wd stands for write data (wc would be write case) wd case1.dat (change setting) it 1000 wd case2.dat (change setting) it 1000 wd case3.dat ; exit fluent exit yes

Hope this helps, and good luck, Jason

Nikhil October 7, 2005 15:38

Re: Parametric analysis in fluent
 
Hi jason, Your advice on running fluent in batch mode really helped. I am trying to figure out on how to invoke a loop using scheme language....but presently I will opt for the simpler method. I will definitely post if i could do anything using scheme. thanks.

Chris Bailey October 12, 2005 13:59

Re: Parametric analysis in fluent
 
For what it is worth, here's an example of writing a scheme loop. This one will do iterations and generate a few graphs each time it runs (4 times).

Scheme is interesting to learn. It is written mostly using parentheses, which good Scheme programmers ignore. The language was developed to write Fibonnaci sequence generators, but it is unpopular because Scheme textbooks always use Fibonnaci sequence generation as an example, so the only problem it's good for has already been solved.

The loop I mentioned:

(define (iterate_and_graph)

(ti-menu-load-string "/solve/iterate 50 ")

(ti-menu-load-string "/display/close-window 0 ")

(ti-menu-load-string "/display/close-window 1 ")

(ti-menu-load-string "/display/close-window 2 ")

(ti-menu-load-string "/display/close-window 3 ")

(ti-menu-load-string "/display/open-window 0 ")

(ti-menu-load-string "/display/vector velocity pressure , , , , ")

(ti-menu-load-string "/display/open-window 1 ")

(ti-menu-load-string "/display/set/contours/filled-contours? n ")

(ti-menu-load-string "/display/contour stream-function , , ")

(ti-menu-load-string "/display/open-window 2 ")

(ti-menu-load-string "/display/set/contours/filled-contours? y ")

(ti-menu-load-string "/display/contour temperature , , ")

(ti-menu-load-string "/display/open-window 3 ")

(ti-menu-load-string "/display/set/contours/filled-contours? y ")

(ti-menu-load-string "/display/contour mass-imbalance , , ")

)

;

(define iterate_graphs

(lambda (n)

(do ((i n (- i 1)))

((zero? i))

(iterate_and_graph)

)))

;

(iterate_graphs 4)


taherehaghjou November 22, 2010 05:53

hi
 
I have to do repititive simulation too. Actually I want to find the best solution which fitts the experimental results. Can anybody help me?


All times are GMT -4. The time now is 20:12.