|
[Sponsors] |
Scheme Programming: problem writing "set!" for multiple variables |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
June 16, 2016, 13:05 |
Scheme Programming: problem writing "set!" for multiple variables
|
#1 |
New Member
Negar Saeidi
Join Date: Dec 2015
Location: Sudbury, ON, Canada
Posts: 18
Rep Power: 10 |
Hello all,
I am using Scheme to control Flow Rate Weighting with time for my outlets with outflow boundary condition. I have managed to write the code for controlling only one outlet. Now I want to extend my code as it can control more than one outlet. My code is attached as a txt file! I can read it successfully but when I run it, I receive this error in text user interface: Error: set!: not a symbol Error Object: (flow-wt-1 flow-wt-2) Can anybody tell me what am I doing wrong? |
|
June 16, 2016, 15:58 |
|
#2 |
New Member
Negar Saeidi
Join Date: Dec 2015
Location: Sudbury, ON, Canada
Posts: 18
Rep Power: 10 |
If anybody interested I sorted out my problem. Here is the code:
(define flow-wt-1 0.0) (define flow-wt-2 0.0) (define run1 ( lambda(flow-time) (set! flow-time (/ flow-time 10)) (if (< flow-time 181) (set! flow-wt-1 '1.0) (set! flow-wt-1 '0.0)) (ti-menu-load-string (format #f "def bc outflow 6 ~a" flow-wt-1)) (ti-menu-load-string (format #f "def bc outflow 7 ~a" flow-wt-1)) ) ) (define run2 ( lambda(flow-time) (set! flow-time (/ flow-time 10)) (if (> flow-time 180) (set! flow-wt-2 '1.0) (set! flow-wt-2 '0.0)) (ti-menu-load-string (format #f "def bc outflow 8 ~a" flow-wt-2)) ) ) It needs to be called in the Execute Commands by defining two commands at each time steps: (run1 ( rpgetvar 'flow-time)) and (run2 ( rpgetvar 'flow-time)) Last edited by nsaeidi; June 29, 2016 at 15:39. |
|
Tags |
outflow bc, scheme files, set! |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problem using Central differencing scheme with LES in CFX | selvam2487 | CFX | 8 | April 11, 2016 14:15 |
Need HELP in writing UDF for a dynamic mesh problem | farrux | Fluent UDF and Scheme Programming | 0 | July 3, 2015 03:53 |
Differencing Scheme for Advection Problem | Simon Smokes | Main CFD Forum | 2 | April 8, 2015 11:59 |
A problem about AUSM scheme! | hitleo | Main CFD Forum | 0 | May 30, 2005 09:05 |
problem about numerical scheme in LES. | libin | Main CFD Forum | 4 | July 1, 2004 05:32 |