|
[Sponsors] |
February 14, 2019, 12:10 |
Setting a parameter as bound in a loop
|
#1 |
New Member
Frank Richter
Join Date: Oct 2018
Posts: 13
Rep Power: 8 |
Dear Community,
I need Scheme for programming for ANSYS FLUENT. How can I set a parameter imax = 3 and then use it as upper bound in a loop: (do ((i 1 (+ i 1)))((> i imax)) [do something here] ) This loop is run repeatedly in my script, thus a single definition of the upper bound would be extremely helpful. I experimented with the commands let and define, but to no avail. Thank you dearly, kind regards FrankR |
|
February 14, 2019, 22:10 |
|
#2 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
define your imax variable above this loop same way as you define any other rpvar
for example Code:
(define (make-new-rpvar name default type)(if (not (rp-var-object name))(rp-var-define name default type #f))) (make-new-rpvar 'imax 3 'int) (do ((i 1 (+ i 1)))((> i imax)) [do something here] ) |
|
February 15, 2019, 04:55 |
|
#3 |
New Member
Frank Richter
Join Date: Oct 2018
Posts: 13
Rep Power: 8 |
Dear AlexanderZ
thank you for your advice. Sincerely FrankR |
|
Tags |
loop, variable definition |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
question about fluid2 parameter setting | Mike Wang | FLOW-3D | 1 | November 3, 2017 04:41 |
using chemkin | JMDag2004 | OpenFOAM Pre-Processing | 2 | March 8, 2016 23:38 |
[snappyHexMesh] determining displacement for added points | CFDnewbie147 | OpenFOAM Meshing & Mesh Conversion | 1 | October 22, 2013 10:53 |
Expert Parameter for compressible transient | ioannis | CFX | 0 | November 2, 2005 20:28 |
CFX TASCflow - while-endwhile loop ina macro | Deepak Ganga | CFX | 0 | September 6, 2003 23:21 |