CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)

 Asghari August 25, 2006 03:57

I use from following udf for definition heat and mass source terms in vof model. then i hook this source terms to fluent .

But as soon as i start run,i face with access violation error in relation with hooking macro of energy source define in mixture level phase.

/********Defining mass source term for secondary phase*****/

{

real T_SAT= a value;

real Source ;

Source=0.0;

if(C_T(cell,pt[1])>=T_SAT)

{ Source=-0.1*C_VOF(cell,pt[1])*C_R(cell,pt[1])*fabs(C_T(cell,pt[1]-T_SAT)/T_SAT); }

if((Source=0.0)&&(C_T(cell,pt[1])<=T_SAT))

{ Source=0.1*C_VOF(cell,pt[0])*C_R(cell,pt[0])*fabs(C_T(cell,pt[0]-T_SAT)/T_SAT); }

ds[eqn]=0.0; return Source;

}

ERROR HAPPENED IN FOLLOWING DEFINE_SOURCE MACRO for energy source!!!

/********Defining enthalpy source term for mixture*****/

{

real T_SAT= a value;

real Source ;

Source=0.0;

if(C_T(cell,pt[1])>=T_SAT)

{ Source=-0.1*C_VOF(cell,pt[1])*C_R(cell,pt[1])*fabs(C_T(cell,pt[1]-T_SAT)/T_SAT); }

if((Source=0.0)&&(C_T(cell,pt[1])<=T_SAT))

{ Source=0.1*C_VOF(cell,pt[0])*C_R(cell,pt[0])*fabs(C_T(cell,pt[0]-T_SAT)/T_SAT); }

ds[eqn]=0.0;

SOURCE_ENERGY=Source*2443000

return SOURCE_ENERGY;

}

Can everybody explain why this access violation error happen in hooking energy define_source in mixture phase?

Best regards;

 RoM August 28, 2006 06:52

If you hook the energy source to the mixture then cell_thread will be the mixture thread.