Define_source macro fluent udf
Hello experts!
Hope you are all fine. i am in need to take guidance regarding a small UDF which i wrote to add a source term. Actually i am working on transient Multiphase Eulerian model with one primary phase and one secondary phae. i have deactivated built in gravity and want to introduce a source term in y-momentum equation of secondary phase. Here is my UDF for the said purpose #include "udf.h" DEFINE_SOURCE(gravity_source,c,t,dS,eqn) { real gravity; real source; real density; Thread *subthread; subthread=THREAD_SUB_THREAD(t,1); gravity = 9.8; density=1000.0; source = gravity*density*C_VOF(c,subthread); dS[eqn] = 0.0; return source; } that is, source=gravity x density x volume fraction of secondary phase. but when i interpret/compile it with FLUENT i receive "Segmentation fault" error due to the presence of term "C_VOF(c,subthread)" i run my UDF without this term and it runs fine. but i have to use this term to extract the volume fraction in the cell. if you know where i am at fault please let me know, much appreciated. Thanks in anticipation. |
This should have been posted in FLUENT UDF forum.
I think your DEFINE_SOURCE is passing the primary phase thread and not the mixture one so that THREAD_SUB_THREAD is not doing what you expect. Code:
#include "udf.h" |
All times are GMT -4. The time now is 15:50. |