|
[Sponsors] |
Need help to read a TSV file with Scheme code. |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
June 29, 2016, 17:04 |
Need help to read a TSV file with Scheme code.
|
#1 |
New Member
Negar Saeidi
Join Date: Dec 2015
Location: Sudbury, ON, Canada
Posts: 18
Rep Power: 10 |
Hello everybody,
I need some help to write a Scheme code that will take inputs from a TSV file at every time step of my FLUENT simulation and assign those values to OutFlow boundary conditions. To be more clear, I want it to read first line of the TSV file at the first time step and assign each value in the line to each Outflow boundary condition. The same for second line at the second time step, until the simulation is over. Here is a piece of code that I wrote which doesn't work: (define n 0.0) (with-input-from-file "doors.txt" (define run (lambda (flow-time) (set! n (/ flow-time 10)) ;10 is the size of time-steps (let iter (n list)) (let ((a b c) (string-split line #\space))) (ti-menu-load-string (format #f "def bc outflow 6 ~a" a)) (ti-menu-load-string (format #f "def bc outflow 7 ~a" b)) (ti-menu-load-string (format #f "def bc outflow 8 ~a" c)) ) ) ) I'd really appreciate your comments and advices. Regards, |
|
July 5, 2016, 15:15 |
|
#2 |
New Member
Negar Saeidi
Join Date: Dec 2015
Location: Sudbury, ON, Canada
Posts: 18
Rep Power: 10 |
I have got to this point:
(define a 0.0) (define b 0.0) (define c 0.0) (define RUN (with-input-from-file "doorstatesnegar.txt" (lambda () (let (line (read-line)) (if (not (eof-object? line)) (let (((a b c) (string-split line #\space))) ) ) ) ) (ti-menu-load-string (format #f "def bc outflow 6 ~a" a)) (ti-menu-load-string (format #f "def bc outflow 7 ~a" b)) (ti-menu-load-string (format #f "def bc outflow 8 ~a" c)) (newline) ) ) And this is the error that I receive: Error: let syntax: binding is not a list Error Object: line Any ideas? |
|
Tags |
reading tsv files, scheme files, scheme programming |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[OpenFOAM.org] Error creating ParaView-4.1.0 OpenFOAM 2.3.0 | tlcoons | OpenFOAM Installation | 13 | April 20, 2016 18:34 |
[OpenFOAM.org] Compile OF 2.3 on Mac OS X .... the patch | gschaider | OpenFOAM Installation | 225 | August 25, 2015 20:43 |
[swak4Foam] Error bulding swak4Foam | sfigato | OpenFOAM Community Contributions | 18 | August 22, 2013 13:41 |
[swak4Foam] build problem swak4Foam OF 2.2.0 | mcathela | OpenFOAM Community Contributions | 14 | April 23, 2013 14:59 |
DecomposePar links against liblamso0 with OpenMPI | jens_klostermann | OpenFOAM Bugs | 11 | June 28, 2007 18:51 |