CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   what is wrong with the DEFINE_ADJUST macro? (http://www.cfd-online.com/Forums/fluent/94050-what-wrong-define_adjust-macro.html)

davidyin November 3, 2011 16:50

what is wrong with the DEFINE_ADJUST macro?
 
1 Attachment(s)
Hi, there is two pahses surface flow of water and air, whick is model with VOF method. I want to simulate the distribution of dissolved oxygen just in water. So I need to give the values at the air area where the volume ratio of air is much than 0.5 at every timestep. The code is written with DEFINE_ADJUST macor as following.

#include"udf.h"
#include "sg_mphase.h"
#include "mem.h"
#include "sg_mem.h"

real vair;

DEFINE_ADJUST(my_adjust, d)
{
Thread *t;
cell_t c;
thread_loop_c (t,d)
{
begin_c_loop (c,t)
vair=C_VOF(c,t,0);
if (vair>0.5) C_UDSI(c,t,0)=8.1;
end_c_loop (c,t)
}
}


It can be interpreted and hooked well.

But when I run calculation, the following erres occur.

FLUENT received fatal signal (ACCESS_VIOLATION)
1. Note exact events leading to error.
2. Save case/data under new name.
3. Exit program and restart to continue.
4. Report error to your distributor.

please give me some advices, Thank you in advance.


All times are GMT -4. The time now is 01:41.