|
[Sponsors] | |||||
How to calculate phase area with UDF in 2D VOF problem |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|
|
#1 |
|
New Member
Lagos
Join Date: Mar 2017
Posts: 7
Rep Power: 10 ![]() |
Hello dear CFD experts.
I have been trying to calculate the area of secondary phase (droplet) using User Defined Function for a 2D problem without success. The MACRO I am using is DEFINE_ADJEST. This is the code that I have written: #include "udf.h" #include "sg_mphase.h" #include "sg_mem.h" #define PI 3.142 DEFINE_ADJUST(my_adjust,d) { real x[ND_ND]; real total_volume=0; real area, radius, diam; real z = 1000000; int phase_domain_index; cell_t c; Thread *t; Domain *subdomain, *mixture_domain=Get_Domain(1); sub_domain_loop(subdomain, mixture_domain, phase_domain_index) { /* loop if secondary phase */ if (DOMAIN_ID(subdomain) == 3) { thread_loop_c (t,subdomain) { /* loop over all cells in secondary phase cell threads */ begin_c_loop(c,t) { C_CENTROID(x,c,t); if (C_VOF(c,t)>0.97){ total_volume+=C_VOLUME(c,t)*C_VOF(c,t); } } end_c_loop(c,t) } } } area = total_volume/z; radius = sqrt(2*area/PI); diam = 2*radius; printf("Diameter: %g\n", area); } Thnaks in advance for your contributions |
|
|
|
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Error SIGSEGV using VOF and UDF | JERC_UTFSM | Fluent UDF and Scheme Programming | 14 | November 8, 2021 00:17 |
| Problem with reference area | alfaben | STAR-CCM+ | 3 | April 21, 2020 10:46 |
| Phase velocity in VOF model UDF | baechtel | Fluent UDF and Scheme Programming | 2 | August 4, 2019 12:17 |
| problem in definition of secondary phase volume fraction in UDF | hadii | FLUENT | 9 | July 20, 2016 05:46 |
| two phase vof problem, problem with thermophysical properties | karthik1414 | OpenFOAM | 4 | March 15, 2011 08:49 |