|
[Sponsors] |
May 25, 2015, 11:24 |
Error during interpreting UDF for VoF
|
#1 | |
Member
Rafal
Join Date: Aug 2013
Location: CK
Posts: 36
Rep Power: 13 |
Hello!
I want to write UDF which will return coordinates of specific VoF fraction - let say alpha from = 0.5 to 0.55. I wrote UDF with use of C_VOF(cell, pt[]) but there was an error message label "store_vof_norm" not found. Then I was try to interpret UDF from Ansys manual: Code:
/******************************************************************* This UDF is an implementation of the degassing boundary condition *******************************************************************/ #include "udf.h" #include "sg.h" #include "sg_mphase.h" #include "flow.h" #include "mem.h" #include "metric.h" DEFINE_SOURCE(degassing_source, cell, thread, dS, eqn) { real source; Thread *tm = THREAD_SUPER_THREAD(thread); source = -C_R(cell,thread)*C_VOF(cell,thread)/CURRENT_TIMESTEP ; C_UDMI(cell,tm,0) = source; dS[eqn] = -C_R(cell,thread)/CURRENT_TIMESTEP; return source; } DEFINE_SOURCE(x_prim_recoil, cell, tp, dS, eqn) { real source; Thread *tm = THREAD_SUPER_THREAD(tp); Thread *ts; ts = THREAD_SUB_THREAD(tm,1); source = -C_R(cell,ts)*C_VOF(cell,ts)/CURRENT_TIMESTEP*C_U(cell,tp); dS[eqn] =-C_R(cell,ts)*C_VOF(cell,ts)/CURRENT_TIMESTEP; return source; } DEFINE_SOURCE(x_sec_recoil, cell, ts, dS, eqn) { real source; Thread *tm = THREAD_SUPER_THREAD(ts); source = -C_R(cell,ts)*C_VOF(cell,ts)/CURRENT_TIMESTEP*C_U(cell,ts); dS[eqn] = -C_R(cell,ts)*C_VOF(cell,ts)/CURRENT_TIMESTEP; return source; } DEFINE_SOURCE(y_prim_recoil, cell, tp, dS, eqn) { real source; Thread *tm = THREAD_SUPER_THREAD(tp); Thread *ts; ts = THREAD_SUB_THREAD(tm,1); source = -C_R(cell,ts)*C_VOF(cell,ts)/CURRENT_TIMESTEP*C_V(cell,tp); dS[eqn] =-C_R(cell,ts)*C_VOF(cell,ts)/CURRENT_TIMESTEP; return source; } DEFINE_SOURCE(y_sec_recoil, cell, ts, dS, eqn) { real source; Thread *tm = THREAD_SUPER_THREAD(ts); source = -C_R(cell,ts)*C_VOF(cell,ts)/CURRENT_TIMESTEP*C_V(cell,ts); dS[eqn] = -C_R(cell,ts)*C_VOF(cell,ts)/CURRENT_TIMESTEP; return source; } DEFINE_SOURCE(z_prim_recoil, cell, tp, dS, eqn) { real source; Thread *tm = THREAD_SUPER_THREAD(tp); Thread *ts; ts = THREAD_SUB_THREAD(tm,1); source = -C_R(cell,ts)*C_VOF(cell,ts)/CURRENT_TIMESTEP*C_W(cell,tp); dS[eqn] =-C_R(cell,ts)*C_VOF(cell,ts)/CURRENT_TIMESTEP; return source; } DEFINE_SOURCE(z_sec_recoil, cell, ts, dS, eqn) { real source; Thread *tm = THREAD_SUPER_THREAD(ts); source = -C_R(cell,ts)*C_VOF(cell,ts)/CURRENT_TIMESTEP*C_W(cell,ts); dS[eqn] = -C_R(cell,ts)*C_VOF(cell,ts)/CURRENT_TIMESTEP; return source; } Quote:
|
||
May 25, 2015, 20:24 |
|
#2 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
Some macros require compiling the UDF instead of interpreting, try compiling your UDF. The examples provided in the UDF manual should work.
|
|
May 25, 2015, 21:20 |
|
#3 |
Member
Rafal
Join Date: Aug 2013
Location: CK
Posts: 36
Rep Power: 13 |
Thanks for reply. I'll try to do this tomorrow.
Update: It works! Thank you man! Last edited by vekh; May 26, 2015 at 07:24. |
|
March 16, 2017, 11:05 |
how to solve.
|
#4 |
New Member
Xuzhi Du
Join Date: Mar 2017
Posts: 3
Rep Power: 9 |
But how do you solve it. I also encountered such a problem.
|
|
March 17, 2017, 09:49 |
|
#5 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
The first post shows the problem.
The second post shows the solution. The third post confirms that the solution works. The fourth post is you, asking what is the solution. The fifth post is the one you are reading now. |
|
February 15, 2018, 03:08 |
store_vof_norm
|
#6 |
New Member
Meisam
Join Date: Oct 2017
Posts: 4
Rep Power: 9 |
Hello all,
I encountered the error " store_vof_norm" not found when interpreting my file in fluent 16.2 I also compiled the udf code successfully but I am still getting the same error when interpreting. can anyone help me to fix it ? Thank you in advance. |
|
February 15, 2018, 04:40 |
|
#7 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
The solution is to compile... which you have already done succesfully.
So, use the compiled version, and don't try the interpreted one. |
|
February 16, 2018, 14:29 |
store_vof_norm
|
#8 |
New Member
Meisam
Join Date: Oct 2017
Posts: 4
Rep Power: 9 |
Thank you Pakk.
The problem is that when I compile and load it successfully and I want to call the udf file for boundary conditions I receive the error "no udf function is loaded". Can you help me fix it. ? Thank you again |
|
February 19, 2018, 06:28 |
|
#9 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
Does you code include a boundary condition? The code above only has source conditions...
Otherwise: are you sure that compiling went fine? Did you check the screen if any errors showed up? |
|
March 12, 2018, 02:57 |
|
#10 |
New Member
Lee
Join Date: Feb 2018
Posts: 12
Rep Power: 8 |
hello~
I want to use the degassing boundary for my case, but I don't know how to load this UDF to the layer of cells next to the outlet as Fluent UDF manual told, can you help me? Thx a lot~ |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
the DEFINE_MASS_TRANSFER is only a interpreting udf IN ANSYS 14.0 | fangdian | Fluent UDF and Scheme Programming | 7 | April 19, 2016 04:53 |
syntax error while interpreting the UDF | rohit chothave | Fluent UDF and Scheme Programming | 2 | July 13, 2013 12:09 |
parse error while interpreting udf | Kristin | Fluent UDF and Scheme Programming | 3 | March 15, 2012 07:43 |
parse error with interpreting UDF | ivanbuz | Fluent UDF and Scheme Programming | 2 | August 13, 2009 19:29 |
interpreting UDF | Muhammad Shakaib | FLUENT | 1 | January 24, 2006 11:58 |