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

Setting a parameter as bound in a loop

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 14, 2019, 11:10
Default Setting a parameter as bound in a loop
  #1
New Member
 
Frank Richter
Join Date: Oct 2018
Posts: 13
Rep Power: 7
FrankR is on a distinguished road
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
FrankR is offline   Reply With Quote

Old   February 14, 2019, 21:10
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
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]
)
best regards
AlexanderZ is offline   Reply With Quote

Old   February 15, 2019, 03:55
Default
  #3
New Member
 
Frank Richter
Join Date: Oct 2018
Posts: 13
Rep Power: 7
FrankR is on a distinguished road
Dear AlexanderZ

thank you for your advice.

Sincerely

FrankR
FrankR is offline   Reply With Quote

Reply

Tags
loop, variable definition


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
question about fluid2 parameter setting Mike Wang FLOW-3D 1 November 3, 2017 03:41
using chemkin JMDag2004 OpenFOAM Pre-Processing 2 March 8, 2016 22:38
[snappyHexMesh] determining displacement for added points CFDnewbie147 OpenFOAM Meshing & Mesh Conversion 1 October 22, 2013 09:53
Expert Parameter for compressible transient ioannis CFX 0 November 2, 2005 19:28
CFX TASCflow - while-endwhile loop ina macro Deepak Ganga CFX 0 September 6, 2003 22:21


All times are GMT -4. The time now is 08:37.