|
[Sponsors] |
Get Zone-ID and Change the B.C. with a Journal File |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
November 26, 2020, 05:07 |
Get Zone-ID and Change the B.C. with a Journal File
|
#1 |
New Member
Ataberk
Join Date: Nov 2019
Posts: 14
Rep Power: 7 |
Hello guys,
I have difficulty to import the zone-ids . I tried to write this kind of journal file. My aim is to find zone ids which are written in the flowVector and change their boundary conditions wall to the interface. This has to be in do loop. Here is my code: (define flowVector (vector "ch_channel_alt" "ch_channel_ust" "ch_plate_alt" "ch_plate_ust" "dhw_channel_alt" "dhw_channel_ust" "dhw_plate1_alt" "dhw_plate1_ust" "dhw_plate2_alt" "dhw_plate2_ust")) (define length (vector-length flowVector)) (do ((f 0 (+ f 1))) ((> f length)) (begin (define fV (vector-ref flowVector f)) (define c1 (zone-name->id 'fV)) /define/boundary-conditions/modify-zones/zone-type c1 interface)) And also here is my output: Error: eval: unbound variable Error Object: /define/boundary-conditions/modify-zones/zone-type Error: eval: invalid function Error Object: 10 Thanks! |
|
November 26, 2020, 06:20 |
|
#2 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
You are mixing journal file and scheme.
The line where you modify the zone should also be in scheme. There is a Fluent-specific scheme command to send text to the TUI, I forgot the name but it is in the help. Use that one. |
|
November 26, 2020, 06:45 |
|
#3 | |
New Member
Ataberk
Join Date: Nov 2019
Posts: 14
Rep Power: 7 |
Quote:
I tried to write this code instead of using /define/boundary... (ti-menu-load-string (format #f "/define/boundary-conditions/modify-zones/zone-type ~a" c1)) Probably, I have some mistakes in this code. But, I am not sure where they are. |
||
November 26, 2020, 19:18 |
|
#4 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
looks like, there is no operations with "vector" in fluent compilation
Code:
(define (make-new-rpvar name default type)(rp-var-define name default type #f)) (make-new-rpvar 'flowVector '(ch_channel_alt ch_channel_ust ch_plate_alt ch_plate_ust dhw_channel_alt dhw_channel_ust dhw_plate1_alt dhw_plate1_ust dhw_plate2_alt dhw_plate2_ust) 'string-list) (do ((i 0 (1+ i)) (j (rpgetvar 'flowVector) (cdr j))) ((null? j)) ; if j is '(), just end the loop (begin (ti-menu-load-string (format #f "define boundary-conditions modify-zones zone-type ~a\n" (zone-name->id (car j))) ) ) )
__________________
best regards ****************************** press LIKE if this message was helpful |
|
Tags |
ansys, fluent, journal, scheme, zone-id |
|
|