|
[Sponsors] |
June 7, 2012, 01:15 |
multiphase udf
|
#1 |
New Member
Join Date: Dec 2009
Posts: 10
Rep Power: 17 |
Hi....
I am writing udf for multiphase flow to access the phase level data (primary phase). I tried two ways to define the problem. Giving below both the udfs I'st udf #include "udf.h" DEFINE_EXECUTE_AT_END (calculate_water_flow_rate) { int phase_domain_index = 0; Domain *subdomain; real total_flow_rate=0; face_t f; subdomain = Get_Domain(2); int ID = 6; Thread *thread = Lookup_Thread(subdomain,ID); thread_loop_f(thread,subdomain) { begin_f_loop_all(f,thread) { total_flow_rate += F_FLUX(f,thread); } end_f_loop_all(f,thread) } printf("flow rate of water at outlet: %g/n", total_flow_rate); } In here, I have to access the phase level info (for primary phase, water) at outlet (ID - 6). So used the lookup_thread utility to find the approrpiate phase level thread. Then I intend to estimate total flow rate of water going out from outlet faces. So looped over all the faces in the outlet thread. The udf compiles . It gives some value which does not match with that calculated by fluent in the outlet boundary. Is there any method by which I can read the outlet flowrate directly. 2nd UDF is.... #include "udf.h" DEFINE_EXECUTE_AT_END (calculate_water_flow_rate) { int phase_domain_index = 0; Domain *mixture_domain; Domain *subdomain; real total_flow_rate=0; face_t f; mixture_domain = Get_Domain(1); subdomain = Get_Domain(2); int ID = 6; Thread *mixture_thread = Lookup_Thread(mixture_domain,ID); Thread *subthread = THREAD_SUB_THREAD(mixture_thread,phase_domain_inde x); thread_loop_f(subthread,subdomain) { begin_f_loop_all(f,subthread) { total_flow_rate += F_FLUX(f,subthread); } end_f_loop_all(f,subthread) } printf("flow rate of water at outlet: %g/n", total_flow_rate); } In here, tried to dig the same info using THREAD_SUB_THREAD loop. First used the lookup thread utility to find out the mixture thread at outlet (ID - 6). Then using thread sub thread loop, accessed the phase level thread for primary pahse. In both cases, I get some value of otlet water flow. I am not sure if either of the approaches is adequate for the case. Need inputs about udfs.... Thanks |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF for coal combustion in multiphase flow | niisha24 | Fluent UDF and Scheme Programming | 13 | September 19, 2022 05:01 |
How to access only one phase in multiphase model by UDF | wersoe | Fluent UDF and Scheme Programming | 1 | January 4, 2017 08:11 |
Multiphase udf | ak2009 | Main CFD Forum | 0 | June 5, 2012 16:52 |
Multiphase Mass transfer UDF issue | therandomestname | FLUENT | 0 | April 21, 2011 15:51 |
UDF for multiphase flow | ROOZBEH | FLUENT | 3 | April 7, 2004 18:54 |