|
[Sponsors] |
UDF to track the interface in VOF method in Ansys Fluent |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
July 6, 2021, 06:02 |
UDF to track the interface in VOF method in Ansys Fluent
|
#1 |
New Member
radin hosseini
Join Date: Nov 2017
Posts: 7
Rep Power: 9 |
I want to write a UDF to track the interface (in VOF model) on a boundary and find the location of the interface on that boundary at each timestep. I have developed the following code:
DEFINE_EXECUTE_AT_END(Interface_tracker) { Domain *d; face_t f; FILE *fp; d = Get_Domain(1); int zone_ID = 6; Thread *t = Lookup_Thread(d,zone_ID); real FC[2]; real ti = CURRENT_TIME; real alpha; begin_f_loop(f,t) { F_CENTROID(FC,f,t); alpha = C_VOF(f,t); if(alpha == 0.5) { fprintf(fp,"f%d %g %g %g\n", ti, FC[0], FC[1]); } } end_c_loop(f,t) } when I am interpreting it I face the following error: Error: C:/Users/radin/AppData/Local/Temp/interfacetracker.txt.28068.0.c: line 19: parse error. Error: C:/Users/radin/AppData/Local/Temp/interfacetracker.txt.28068.0.c: line 20: parse error. Error: C:/Users/radin/AppData/Local/Temp/interfacetracker.txt.28068.0.c: line 22: parse error. Error: C:/Users/radin/AppData/Local/Temp/interfacetracker.txt.28068.0.c: line 23: parse error. Error: C:/Users/radin/AppData/Local/Temp/interfacetracker.txt.28068.0.c: line 24: parse error. Error: C:/Users/radin/AppData/Local/Temp/interfacetracker.txt.28068.0.c: line 26: t: undeclared variable Can anyone tell me where is my mistake?? all the best |
|
July 6, 2021, 12:31 |
|
#2 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
Can you tell which line is line 19 in your code?
__________________
"The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform" is NOT the error after compiling. It is the error after loading. To see compiler errors, look at your screen after you click "build". |
|
July 6, 2021, 14:33 |
|
#3 |
New Member
radin hosseini
Join Date: Nov 2017
Posts: 7
Rep Power: 9 |
||
July 6, 2021, 17:11 |
|
#4 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
Possible mistake: you declared a variable after assigning a variable. In older dialects of c, that is not allowed.
This is a declaration: Code:
int zone_ID = 6; Code:
d = Get_Domain(1); You would make it much easier for yourself if you would compile: you get better error messages.
__________________
"The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform" is NOT the error after compiling. It is the error after loading. To see compiler errors, look at your screen after you click "build". |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Radiation in semi-transparent media with surface-to-surface model? | mpeppels | CFX | 11 | August 22, 2019 08:30 |
UDF Defining in ANSYS FLUENT 16.2 in Win 10 | Sadegh.A | Fluent UDF and Scheme Programming | 11 | February 15, 2017 15:45 |
Error - Solar absorber - Solar Thermal Radiation | MichaelK | CFX | 12 | September 1, 2016 06:15 |
How to apply heat flux at the interface when using VOF method? | princekar | FLUENT | 0 | November 15, 2015 08:47 |
An error has occurred in cfx5solve: | volo87 | CFX | 5 | June 14, 2013 18:44 |