UDF for particle deposition in porous zone
Hi,
I am very new in UDF and do not have much knowledge on C. I need urgent help in a UDF to: 1- specify the porous zone ID 2- read the particle concentration in each cell 3- reduce it as a percentage from the initial concentration 4- store the new reduced concentration I tried for many days but i am stuck, i really appreciate if anyone will help me. The code i tried is below (probably it is very bad): #include "udf.h" #include "sg_mem.h" # include "dpm.h" # define domain_ID 4 DEFINE_ADJUST(adjust_UDS,domain) { Thread *t; cell_t c; domain = Get_Domain(domain_ID); /*Fill UDS with the variable*/ thread_loop_c (t,domain) { begin_c_loop (c,t) { C_UDSI(c,t,0) = C_DPMS_CONCENTRATION(c,t); } end_c_loop (c,t) } } DEFINE_SOURCE(conc_source,c,t,dS,equ) { real x[ND_ND],c_source; source= (C_UDSI(c,t,0) + C_UDSI(c,t,0)); return source; } |
compile following code,
in fluent GUI: hook functions, allocate 1 user define memory Code:
#include "udf.h" |
Hi Alexander,
Thank you so much for your help. I will try this UDF. Could you clarify what do you mean by hook function? (interpret or compile?) And how do i allocate 1 user memory? I am so sorry, i'm just beginner in this |
I have one more question, if i want to also capture the axial velocity at each cell in the porous domain, and include it in the source equation at the end, what should i add more? i am so sorry, i really appreciate your help. you are saving me :)
|
I tried compiling the UDF, i got this error:
/////// Error: The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform (win64).\n\nThe system cannot find the file specified. \n\nD:\NUS\pollutant_study_Prof_Bala\chinese_garde ns_1m_thick_DM_geometry\udf_inlet_trying_depositio n_injecting_from_road_and_inlet\libudf\win64\3ddp_ host\libudf.dll Error Object: #f //////// When i interpret the udf, it doesnt generate errors but the solution of the case is the same, it didnt change any numbers. Could you please help me in this issue? Thank you |
Check my signature below.
|
Hi Pakk,
Thanks for your response. So how can i solve this issue? Even when i try "Serial" not parrallel, it generates a similar error, but instead of "(libudf) is not compiled for parallel use on the current platform (win64)." it says not compiled for 3ddp |
My suggestion is to look at the errors during compiling, and if you need help share them with us.
I can't see what went wrong during compiling from the word during loading. Show the errors that come after you click 'build'. (and can you suggest an improvement for my signature? Apparently it is not clear enough, but I can't see the problem...) |
All times are GMT -4. The time now is 18:53. |