|
[Sponsors] |
Calling a cell with its reference id and obtain it's temperature |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
August 25, 2020, 13:00 |
Calling a cell with its reference id and obtain it's temperature
|
#1 |
Senior Member
AH
Join Date: Apr 2014
Posts: 287
Rep Power: 0 |
Any tips please? Scheme please.
Need to call a cell with its id and obtain it's temperature. Can be in a loopz starting with cell 1, then next cell, .. |
|
August 26, 2020, 01:07 |
|
#2 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
what is cell ID from your point of view?
this is a code to get temperature of all cells in the domain Code:
#include "udf.h" DEFINE_ADJUST(adjust_temp, domain) { Thread *t; cell_t c; real T thread_loop_c (t,domain) { begin_c_loop (c,t) { C_UDMI(c,t,0) = C_T(c,t); } end_c_loop (c,t) } }
__________________
best regards ****************************** press LIKE if this message was helpful |
|
August 26, 2020, 06:29 |
|
#3 |
Senior Member
AH
Join Date: Apr 2014
Posts: 287
Rep Power: 0 |
Thanks Alexander
This will have all cells referenced cell 1, cell 2, ..... Some how I have to pass each cell to TUI , and then allow Scheme take an action. I am looking at a while loop in a Scheme, which calls a cell number and then loops. " In TUI Scheme GET cell 1 temperature (if (cell 1 temperature>0) (k-ϵ RNG) (k-ϵ)) next cell reference .... " That is Scheme reads the UDF and then take an action to switch between k-e and k-e RNG. Just found this on the web for a scheme while loop. Can use this to call in UDF, and then get cell 1 temperature, and then loop for next cells. The 5 " (define i 5) (define f (lambda (x) (if (not (= i 0)) (begin (display i) (set! i (- i 1)) (x x)) 'done))) " Here is another example, the count to 10 is not applicable. The figure 10 can be equal to the number of cells in the fluid domain. The (newline) and (display x) are not necessary. " (define x 0) (while (<= x 10) (display "x is ") (display x) (newline) (newline) (set! x (+ x 1)) ) " Last edited by visitor; August 27, 2020 at 07:02. Reason: Just adding more examples. |
|
August 26, 2020, 13:20 |
|
#4 |
Senior Member
AH
Join Date: Apr 2014
Posts: 287
Rep Power: 0 |
Dear Alexander, posting #2.
Actually i think it's alot easier if i can convert your C++ UDF into a Scheme. I am new to Scheme, but something similar to the above, but without define. Keep it an open continuous loop. I will try something, but i am totally new to Scheme.😑 |
|
|
|