CFD Online Logo CFD Online URL
Home > Forums > Fluent UDF and Scheme Programming

variables is scheme

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

LinkBack Thread Tools Display Modes
Old   April 14, 2011, 13:00
Question variables is scheme
New Member
Join Date: Mar 2011
Posts: 27
Rep Power: 8
ali hemmati is on a distinguished road
I have problem with using variables in loops. The problem is how to define a global variable which can get a value in loop. It may seem silly, but running the following code, I found that Fluent deletes value of any variable just after the loop runs for the second time.
(define x)
(do (( cntr 0 (+ cntr 1) )) ((> cntr 10))
  (if (= cntr 0)
      (define x 10))
      (define x (+ x 1))
      (display x))
How can I define variable 'x' ?

Last edited by ali hemmati; April 15, 2011 at 07:53.
ali hemmati is offline   Reply With Quote

Old   July 20, 2011, 00:41
fox000002's Avatar
Join Date: Apr 2009
Posts: 46
Rep Power: 10
fox000002 is on a distinguished road
(define x) 
 (do (( cntr 0 (+ cntr 1) )) ((> cntr 10))  
   (if (= cntr 0)    
      (set! x 10)   
        (set! x (+ x 1))
        (display x)) ))
fox000002 is offline   Reply With Quote


global variable, scheme, set a value

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
AUSM scheme ? Central Scheme boling Main CFD Forum 7 January 7, 2016 03:41
how to understand high resolution scheme and high order scheme iilw1314 Main CFD Forum 3 September 30, 2010 10:43
Implementation of QUICK scheme Romuald Skoda Main CFD Forum 10 August 3, 2010 12:23
Definition of limiter function for central dirrerencing scheme sebastian_vogl OpenFOAM Running, Solving & CFD 0 January 5, 2009 12:08
extrapolation in MUSCL scheme Chandra Main CFD Forum 6 February 14, 2007 12:21

All times are GMT -4. The time now is 05:29.