CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Fluent UDF and Scheme Programming

Journal for fluent: Scheme programming

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

Reply
 
LinkBack Thread Tools Display Modes
Old   October 29, 2010, 00:32
Default Journal for fluent: Scheme programming
  #1
New Member
 
Annon
Join Date: Apr 2010
Posts: 16
Rep Power: 6
beguxa is on a distinguished road
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.
beguxa is offline   Reply With Quote

Old   November 3, 2010, 15:38
Default
  #2
Senior Member
 
dmoroian's Avatar
 
Dragos
Join Date: Mar 2009
Posts: 644
Rep Power: 10
dmoroian is on a distinguished road
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 is offline   Reply With Quote

Old   November 3, 2010, 15:39
Default Fluent Scheme
  #3
Senior Member
 
dmoroian's Avatar
 
Dragos
Join Date: Mar 2009
Posts: 644
Rep Power: 10
dmoroian is on a distinguished road
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 is offline   Reply With Quote

Old   July 18, 2014, 01:01
Default Fluent scheme for automated iso surface creation & saving images of velocity contours
  #4
New Member
 
Vaibhav Singal
Join Date: Jul 2014
Posts: 2
Rep Power: 0
vaibhavsingal is on a distinguished road
(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 is offline   Reply With Quote

Old   July 18, 2014, 01:08
Default Fluent scheme for automated iso surface creation & saving images of velocity contours
  #5
New Member
 
Vaibhav Singal
Join Date: Jul 2014
Posts: 2
Rep Power: 0
vaibhavsingal is on a distinguished road
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.

vaibhavsingal is offline   Reply With Quote

Old   August 26, 2014, 19:41
Default
  #6
Senior Member
 
Syavash
Join Date: Apr 2010
Location: Tehran, Karaj
Posts: 176
Rep Power: 6
syavash is on a distinguished road
Quote:
Originally Posted by vaibhavsingal View Post
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 is offline   Reply With Quote

Old   August 26, 2014, 20:16
Default
  #7
Senior Member
 
Syavash
Join Date: Apr 2010
Location: Tehran, Karaj
Posts: 176
Rep Power: 6
syavash is on a distinguished road
Quote:
Originally Posted by syavash View Post
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".
syavash 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
journal files and SCHEME Hugo FLUENT 1 June 6, 2007 10:41
Journal file for for NITA scheme using LES anindya FLUENT 5 August 6, 2006 11:54
Integrating Scheme with a FLUENT journal file Pete Willemsen FLUENT 0 May 19, 2006 17:00
help needed about phase change Yanhu Guo Main CFD Forum 4 January 23, 2001 23:16
Experimental Repository for UDFs, Journal Files and Scheme Scripts Jonas Larsson FLUENT 0 March 5, 2000 15:36


All times are GMT -4. The time now is 18:04.