|
[Sponsors] |
UDF to access only one phase in mixture domain |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
July 4, 2020, 05:11 |
UDF to access only one phase in mixture domain
|
#1 |
Senior Member
Arun raj.S
Join Date: Jul 2011
Posts: 210
Rep Power: 16 |
Hello everyone,
I would like to access only one phase in the mixture domain. I have written the UDF. However, I do not know if my code is right? Could someone clarify? Can anyone explain what the following code is doing? I have attached only a part of code that I am interested in. Thread *t, Thread **pt; Thread **st; Domain *d, *pd, *sd; DEFINE_SOURCE --------- { mp_thread_loop_c (t, d, st) if (FLUID_THREAD_P(t)) { Thread *sp = st[phase_ID]; begin_c_loop (c, t) { if(C_T(c, t)>tsat) { source = C_VOF(c, sp)*fabs(C_T(c, t)*1000; dS[eqn] = 0.0; } else if(C_T(c, t)<=tsat) { source = -C_VOF(c, sp)*fabs(C_T(c, t)*1000; dS[eqn] = 0.0; } else { source = 0.0; dS[eqn] = 0.0; } } end_c_loop (c, t) } |
|
July 5, 2020, 22:18 |
|
#2 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
you've cut code too much to get full explanation
define_source is a macro to apply source to any zone. It already has cell/thread loop. mp_thread_loop_c is macro which loops through all cell threads (at the mixture level) within the mixture domain and provides the pointers of the phase-level (cell) threads associated with each mixture-level thread. so using mp_thread_loop_c in define_source is not a good idea from my point of view (but I've never tested it). To avoid it you may use define_adjust or analog macros and save calculated source to UDMIs C_VOF(c, sp) is concentration of certain phase in the cell Read Ansys FLuent Customization manual
__________________
best regards ****************************** press LIKE if this message was helpful |
|
|
|