|
[Sponsors] |
April 14, 2011, 14:00 |
variables is scheme
|
#1 |
New Member
Ali
Join Date: Mar 2011
Posts: 27
Rep Power: 15 |
Hello,
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. Code:
(define x) ;;loop (do (( cntr 0 (+ cntr 1) )) ((> cntr 10)) (if (= cntr 0) (begin (define x 10)) (begin (define x (+ x 1)) (display x)) ) ) Last edited by ali hemmati; April 15, 2011 at 08:53. |
|
July 20, 2011, 01:41 |
|
#2 |
Member
Join Date: Apr 2009
Posts: 46
Rep Power: 17 |
Code:
(define x) ;;loop (do (( cntr 0 (+ cntr 1) )) ((> cntr 10)) (if (= cntr 0) (set! x 10) (begin (set! x (+ x 1)) (display x)) )) |
|
Tags |
global variable, scheme, set a value |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
how to understand high resolution scheme and high order scheme | iilw1314 | Main CFD Forum | 7 | April 12, 2022 13:29 |
Implementation of QUICK scheme | Romuald Skoda | Main CFD Forum | 11 | November 6, 2017 22:20 |
AUSM scheme ? Central Scheme | boling | Main CFD Forum | 7 | January 7, 2016 03:41 |
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 |