|
[Sponsors] |
November 10, 2019, 04:37 |
Help correct udf
|
#1 |
New Member
WANG LU
Join Date: Sep 2019
Posts: 22
Rep Power: 7 |
I want to find the interface of the VOF model.
My code as follows: DEFINE_EXECUTE_AT_END(climbing_high) { real cymax = 0.0; cell_t c; real z[ND_ND]; Domain *subdomain= Get_Domain(3); Thread *t; FILE *fout1; thread_loop_c(t,subdomain) { begin_c_loop(c,t) { if (C_VOF(c,t) ==0.9) { C_CENTROID(z,c,t); if (cymax < z[1]) cymax = z[1]; } } end_c_loop(c, t) } fout1 = fopen("Vertex on Y axis.txt", "a"); fprintf(fout1, "%g,%g\n", CURRENT_TIME, cymax); fclose(fout1); Message("\n Vertex on Y axis = %g\n", cymax); The result as follow: Vertex on Y axis = 0 I don't know what's wrong.Please help me. |
|
November 11, 2019, 00:21 |
|
#2 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
if (C_VOF(c,t) ==0.9) statement is not efficient, I believe you will never have exactly 0.9 in any cell
that's why your cymax is always 0 on the other hand, you are trying to access cymax from outside of the loop -> so you will have only 1 (last) value, which is 0
__________________
best regards ****************************** press LIKE if this message was helpful |
|
November 11, 2019, 04:01 |
|
#3 |
New Member
WANG LU
Join Date: Sep 2019
Posts: 22
Rep Power: 7 |
Dear AlexanderZ:
Thank you for your answer and your help again.I am so luck to get your help. Best wishes! WangLu |
|
Tags |
udf |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Dynamic contact angle issue: fluent UDF couldn't set the correct contact angle | FelixJJ | FLUENT | 2 | October 20, 2021 03:39 |
udf for correct adjacent cell T | Adam_PHD | Fluent UDF and Scheme Programming | 8 | February 27, 2018 03:33 |
Fluent Radiation/porous media | Schmitt pierre-Louis | FLUENT | 26 | September 1, 2016 11:29 |
how to correct the error of (c) file after the compile of udf? | mokrane | FLUENT | 0 | April 23, 2015 14:40 |
how can I correct the udf? | happyrabbit | FLUENT | 9 | January 28, 2011 10:50 |