|
[Sponsors] |
how to get coordinate of liquid/gas interface using UDF? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
January 14, 2019, 07:03 |
how to get coordinate of liquid/gas interface using UDF?
|
#1 |
New Member
Jun Yin
Join Date: Jan 2019
Posts: 5
Rep Power: 7 |
hello everyone:
I was trying to get coordinate from the whole domain and I am successful with the following code. #include "udf.h" DEFINE_ON_DEMAND(on_demand) { real x[ND_ND],x1,y1,z1; int ID = 2; cell_t c; Domain *d = Get_Domain(1); Thread *t; thread_loop_c(t,d) { begin_c_loop(c,t) { C_CENTROID(x,c,t); x1 = x [0]; y1 = x [1]; z1 = x [2]; Message(" %f,%f,%f\n",x1,y1,z1); } end_c_loop(c,t) } } But when I add the IF code to the UDF, it always comes an error in Fluent. my goal is trying to get coordinate at gas/liquid interface. But it can not work with the following UDF. Someone can help me with this? DEFINE_ON_DEMAND(on_demand) { real x[ND_ND],x1,y1,z1; int ID = 2; cell_t c; Domain *d = Get_Domain(1); Thread *t; thread_loop_c(t,d) { begin_c_loop(c,t) { if(C_VOF(c,t)>0 && C_VOF(c,t)<1) { C_CENTROID(x,c,t); x1 = x [0]; y1 = x [1]; z1 = x [2]; Message(" %f,%f,%f\n",x1,y1,z1); } } end_c_loop(c,t) } } |
|
January 14, 2019, 22:43 |
|
#2 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
what kind of error did you get?
may be the problem is in the brackets? Code:
if ((C_VOF(c,t)>0) && (C_VOF(c,t)<1)) |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
sliding mesh problem in CFX | Saima | CFX | 46 | September 11, 2021 08:38 |
Wrong flow in ratating domain problem | Sanyo | CFX | 17 | August 15, 2015 07:20 |
GETVAR Error in Multiband Monte Carlo Radiation Simulation with Directional Source | silvan | CFX | 3 | June 16, 2014 10:49 |
Radiation interface | hinca | CFX | 15 | January 26, 2014 18:11 |
An error has occurred in cfx5solve: | volo87 | CFX | 5 | June 14, 2013 18:44 |