|
[Sponsors] |
February 10, 2021, 07:47 |
Fluent data structure
|
#1 |
Senior Member
Join Date: May 2012
Posts: 546
Rep Power: 15 |
EDIT: I realize now that perhaps this should be moved to a different section on the forum.
Hi, I am looking at the data structure, i.e. Domain, Thread and Cell. For a fluid simulation with only one zone (the fluid) I assume that we have one Thread of interest if we wish to manipulate cell values (the Thread corresponding to the fluid zone). What puzzles me a bit is how this is explained in almost all examples: Code:
/***************************************************************** UDF for initializing phase volume fraction ******************************************************************/ #include "udf.h" /* domain pointer that is passed by INIT function is mixture domain */ DEFINE_INIT(my_init_function, mixture_domain) { int phase_domain_index; cell_t cell; Thread *cell_thread; Domain *subdomain; real xc[ND_ND]; /* loop over all subdomains (phases) in the superdomain (mixture) */ sub_domain_loop(subdomain, mixture_domain, phase_domain_index) { /* loop if secondary phase */ if (DOMAIN_ID(subdomain) == 3) /* loop over all cell threads in the secondary phase domain */ thread_loop_c (cell_thread,subdomain) { /* loop over all cells in secondary phase cell threads */ begin_c_loop_all (cell,cell_thread) { C_CENTROID(xc,cell,cell_thread); if (sqrt(ND_SUM(pow(xc[0] - 0.5,2.), pow(xc[1] - 0.5,2.), pow(xc[2] - 0.5,2.))) < 0.25) /* set volume fraction to 1 for centroid */ C_VOF(cell,cell_thread) = 1.; else /* otherwise initialize to zero */ C_VOF(cell,cell_thread) = 0.; } end_c_loop_all (cell,cell_thread) } } } Code:
d_mix = Get_Domain(1); /* Mixture domain */ d_liq = Get_Domain(2); /* Liquid domain (primary fluid) */ d_gas = Get_Domain(3); /* Gas domain */ zone_ID = 3; /* This must be checked explicitly in the Fluent GUI to correspond to the fluid zone */ t_mix = Lookup_Thread(d_mix, zone_ID); t_liq = THREAD_SUB_THREAD(t_mix, PHASE_DOMAIN_INDEX(d_liq)); t_gas = THREAD_SUB_THREAD(t_mix, PHASE_DOMAIN_INDEX(d_gas)); Code:
begin_c_loop(c,t_mix) { C_VOLUME(c,t_mix) = v_mix; C_VOLUME(c,t_liq) = v_liq; C_VOLUME(c,t_gas) = v_gas; // v_mix = v_liq = v_gas <--- from testing this seems to be true // This is reasonable, but it is also reasonable if v_liq and v_gas // were undefined and only the v_mix was defined C_VOF(c,t_gas) = vf_gas; C_VOF(c,t_liq) = vf_liq; // vf_gas != vf_liq <--- this is also true from testing, and it seems reasonable } end_c_loop(c,t_mix) Last edited by Simbelmynė; February 10, 2021 at 07:56. Reason: Wrong part of the forum |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
looking for a smart interface matlab fluent | chary | FLUENT | 24 | June 18, 2021 09:07 |
The accuracy of exported solution data in FLUENT | ALBATTROSS | FLUENT | 0 | November 30, 2020 11:04 |
chemkin thermal data and default fluent thermal data | Weiqiang Liu | FLUENT | 0 | May 20, 2020 02:57 |
[General] Fluent 2019R1 -> Paraview: Problem exporting data | Fabio88 | ParaView | 0 | August 30, 2019 04:00 |
Reading Additional Data Quantities from Fluent into Tecplot | fremder | Tecplot | 9 | December 16, 2016 15:35 |