CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   Journal for fluent: Scheme programming (https://www.cfd-online.com/Forums/fluent-udf/81520-journal-fluent-scheme-programming.html)

beguxa October 29, 2010 00:32

Journal for fluent: Scheme programming
 
I am writing a journal file to take images at a large no of iso-surface planes. The planes are named as "X_0.5", "X_0.6", and so on. I want to automate the process by writing a journal file i.e. write a loop (do or for) and in each loop I want to specify the name of the iso-surface at which image has to be taken. But the main problem is I do not know how to pass on the name of the iso-surface as a string to the fluent text-command. Any ideas how to do that in a loop in scheme program?
Algo would be like:

do (start at i=0, increment by 0.1, till 1)
S= "concatenation of ("x_0." and "i") ;;; How to do it in fluent
/display/set/contours/surfaces
"S" ;;; How to do it in fluent
/display/hard-copy
"S".jpg ;;; How to do it in fluent
end
Thanks in advance.

dmoroian November 3, 2010 15:38

Fluent implements a scripting language called scheme. There are some examples on the wiki (my favorite: http://www.cfd-online.com/Wiki/Fluen...environment.3F).
Please complete the examples with your own findings.

dmoroian November 3, 2010 15:39

Fluent Scheme
 
Fluent implements a scripting language called scheme. There are some examples on the wiki (my favorite: http://www.cfd-online.com/Wiki/Fluen...environment.3F).
Please complete the examples with your own findings.

vaibhavsingal July 18, 2014 01:01

Fluent scheme for automated iso surface creation & saving images of velocity contours
 
(Do ((x 0 (+ x 0.1))) ((> x 1))
(Ti-menu-load-string (format #f "surface/iso-surface z-coordinate z-plane-~a () () ~a" x x))
)

The above scheme will create iso-surfaces from z=0 to z=1 at an interval of 0.1. and the name of the planes will be z-plane-0.1, z plane-0.2,....and so on. you can modify the start, end and interval of the iso surfaces in the first line of the scheme.
Also, you can change the name of the plane in the 3rd line. And if you want the iso surface of x or y plane instead of z, you can do so by changing z-coordinate to x-coordinate or y-coordinate respectively. Remember x used in the above scheme is just a variable and not x plane. :)

vaibhavsingal July 18, 2014 01:08

Fluent scheme for automated iso surface creation & saving images of velocity contours
 
And if you further want to save the contours images, here is the scheme for that..

(Do ((x 0 (+ x 0.1))) ((> x 1))
(Ti-menu-load-string (format #f "surface/iso-surface z-coordinate z-plane-~a () () ~a" x x))
)

(Do ((x 0 (+ x 0.1))) ((> x 1))
(Ti-menu-load-string (format #f "display/set/contours surface z-plane-~a ()" x))

(Ti-menu-load-string (format #f "display/contour/velocity-magnitude 0 60"))

(Ti-menu-load-string (format #f "display/save-picture/cont-plane-%4n.jpg"))
)


This is an example of saving velocity contours at z plane 0, 0.1, 0.2,.....0.9 & 1 where min and max maginutde of velocity is 0 and 60 m/s.

:)

syavash August 26, 2014 19:41

Quote:

Originally Posted by vaibhavsingal (Post 502081)
And if you further want to save the contours images, here is the scheme for that..

(Do ((x 0 (+ x 0.1))) ((> x 1))
(Ti-menu-load-string (format #f "surface/iso-surface z-coordinate z-plane-~a () () ~a" x x))
)

(Do ((x 0 (+ x 0.1))) ((> x 1))
(Ti-menu-load-string (format #f "display/set/contours surface z-plane-~a ()" x))

(Ti-menu-load-string (format #f "display/contour/velocity-magnitude 0 60"))

(Ti-menu-load-string (format #f "display/save-picture/cont-plane-%4n.jpg"))
)


This is an example of saving velocity contours at z plane 0, 0.1, 0.2,.....0.9 & 1 where min and max maginutde of velocity is 0 and 60 m/s.

:)

Dear vaibhav

Would you give us further elaboration on the format in this statement:
"surface/iso-surface z-coordinate z-plane-~a () () ~a" x x))
I need to understand what ~a, (), (), and ~a stand for? Why you have specified two of "~a" and "x"??
Thank you.

syavash August 26, 2014 20:16

Quote:

Originally Posted by syavash (Post 507921)
Dear vaibhav

Would you give us further elaboration on the format in this statement:
"surface/iso-surface z-coordinate z-plane-~a () () ~a" x x))
I need to understand what ~a, (), (), and ~a stand for? Why you have specified two of "~a" and "x"??
Thank you.

I examined it manually in Fluent!

"~a" stands for random variable, like % in C language.
"()" means that we simply press "enter" and do not specify any names.
"x" at the end of line is the same loop variable and two of "x" correspond to two of "~a".

ngonbadipoor@yahoo.com March 13, 2017 14:48

scheme for iso surface/line creation
 
Quote:

Originally Posted by vaibhavsingal (Post 502080)
(Do ((x 0 (+ x 0.1))) ((> x 1))
(Ti-menu-load-string (format #f "surface/iso-surface z-coordinate z-plane-~a () () ~a" x x))
)

The above scheme will create iso-surfaces from z=0 to z=1 at an interval of 0.1. and the name of the planes will be z-plane-0.1, z plane-0.2,....and so on. you can modify the start, end and interval of the iso surfaces in the first line of the scheme.
Also, you can change the name of the plane in the 3rd line. And if you want the iso surface of x or y plane instead of z, you can do so by changing z-coordinate to x-coordinate or y-coordinate respectively. Remember x used in the above scheme is just a variable and not x plane. :)

Hi
I want create lines which are intersection of some iso-surfaces(eg. what you created before) and wall boundary condition. is that possible with scheme you mentioned?
is there any scheme?
thanks

aeroramji@gmail.com April 26, 2017 02:38

Hi
 
I have read all your discussions. I think this is the correct platform where I can clarify my doubts.

I have created 150 iso-surfaces in fluent file using GUI command along x-coordinate.

I am supposed to use those 150 iso-surfaces in another fluent file without creating them once again where i have changed the Reynolds number.

Is there any way to do so using programming?

Please help me in this regard.

FluidWarrior October 24, 2017 01:13

Scripted CFD Simulations
 
Hi,
the most powerful proceed is to use your own scripts, as you can see here, which includes also a Bibliography of useful sites:
https://www.researchgate.net/publica...t_and_ParaVIEW

Have a nice day!


All times are GMT -4. The time now is 00:43.