How to access only one phase in multiphase model by UDF
Hello guys,
I am trying to write an UDF to write data (cell volume, spec diss rate) only for one phase in multiphase (vof) model. However, either I get all cells or a segmentation violation error. I tried different methods to access only primary_phase by threads or domains, but I do not have any success. Could you help me please... For checking, used a quader with 8000 cells, patched to water in 4000 cells. I did and didnt run some iterations, nothing helps... This UDF writes cell volume of all cells, not only primary phase If I switch C_VOLUME to C_D for spec diss rate, a seg viol error aoccurs. Code:
#include "udf.h" This UDF writes C_VOF for all cells, not only primary phase eventhough C_VOF(c,pt[1]) Code:
#include "udf.h" Eventhough if(C_VOF(cell,subthread) = 1) Code:
#include "udf.h" Examplers for parallelizing are here: http://www.fluentusers.com/fluent/do...df/node231.htm I do not know how I can to this when using a loop over domains or threads, since the size of the array needs to be send from nodes to host... If I check the udf, it seems very clear to me: I define a domain, then a subdomain, then I define a thread by using subdomain for lookup... That means, in thread it is supposed to point to thread in subdomian, or better to thread in domain with phase index 0... However, C_VOLUME can be written, but C_D or C_VOF causes a seg viol error... Actually, the task seems very easy to me. Write cell values from cells which are associated with primary phase. I have tried different methods to access one phase only. However, I am at one's wit' end... Any help is much appreaciated. Thanks, Sören |
Quote:
Try this code: Code:
DEFINE_INIT(my_init_function, domain) |
All times are GMT -4. The time now is 18:41. |