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

Get Zone-ID and Change the B.C. with a Journal File

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By AlexanderZ

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 26, 2020, 05:07
Default 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
berkozaydin is on a distinguished road
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!
berkozaydin is offline   Reply With Quote

Old   November 26, 2020, 06:20
Default
  #2
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
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.
pakk is offline   Reply With Quote

Old   November 26, 2020, 06:45
Default
  #3
New Member
 
Ataberk
Join Date: Nov 2019
Posts: 14
Rep Power: 7
berkozaydin is on a distinguished road
Quote:
Originally Posted by pakk View Post
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.
Thanks a lot!
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.
berkozaydin is offline   Reply With Quote

Old   November 26, 2020, 19:18
Default
  #4
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
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))) )
	)
)
berkozaydin likes this.
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Reply

Tags
ansys, fluent, journal, scheme, zone-id


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



All times are GMT -4. The time now is 06:17.