CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   VOF in Eulerian model (http://www.cfd-online.com/Forums/fluent/50344-vof-eulerian-model.html)

isabel January 21, 2009 06:45

VOF in Eulerian model
 
Hi everybody, I need to access to volume of fluid gradient and temperature gradient to use as a source. I am using Eulerian model. Fluent compiles well but when I try to iterate it gives me this error:

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. Error Object: ()

The code is:

#include "udf.h"

#include "sg.h"

#include "sg_mphase.h"

#include "flow.h"

#include "mem.h"

DEFINE_ADJUST(area_density, domain)

{

Thread *t;

Thread **pt;

cell_t c;

Domain *pDomain = DOMAIN_SUB_DOMAIN(domain,P_PHASE);

real voidx, voidy, voidz=0;

{

Alloc_Storage_Vars(pDomain,SV_VOF_RG,SV_VOF_G,SV_N ULL);

Scalar_Reconstruction(pDomain, SV_VOF,-1,SV_VOF_RG,NULL);

Scalar_Derivatives(pDomain,SV_VOF,-1,SV_VOF_G,SV_VOF_RG,

Vof_Deriv_Accumulate);

}

{

Alloc_Storage_Vars(domain, SV_T_RG, SV_T_G, SV_NULL);

T_derivatives(domain);

Free_Storage_Vars(domain, SV_T_RG, SV_NULL);

}

mp_thread_loop_c (t,domain,pt)

if (FLUID_THREAD_P(t))

{

Thread *tp = pt[P_PHASE];

begin_c_loop (c,t)

{

C_UDMI(c,t,0) = (C_VOF_G(c,tp)[0]*C_T_G(c,t)[0]+C_VOF_G(c,tp)[1]*C_T_G(c,t)[1]);

}

end_c_loop (c,t)

}

Free_Storage_Vars(pDomain,SV_VOF_RG,SV_VOF_G,SV_NU LL);

Free_Storage_Vars(domain, SV_T_G, SV_NULL);

}

DEFINE_SOURCE(gas, cell, thread, dS, eqn)

{

real x[ND_ND];

real source;

Thread *tm = THREAD_SUPER_THREAD(thread);

Thread **pt = THREAD_SUB_THREADS(tm);

source = -0.6*(C_UDMI(cell,tm,0)/40);

C_UDMI(cell, tm, 1) = source;

dS[eqn] =0;

return source;

}

DEFINE_SOURCE(liquid, cell, thread, dS, eqn)

{

real x[ND_ND];

real source;

Thread *tm = THREAD_SUPER_THREAD(thread);

Thread **pt = THREAD_SUB_THREADS(tm);

source = -C_UDMI(cell, tm, 1);

dS[eqn] = 0;

return source;

}



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