CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   Problem on Parallel DEFINE_SOURCE (https://www.cfd-online.com/Forums/fluent/48178-problem-parallel-define_source.html)

Li May 8, 2008 23:13

Problem on Parallel DEFINE_SOURCE
 
Hi everyone, I met a probelm.the following code is running well in serial FLUENT.

DEFINE_SOURCE(src_number_hom,c,t,dS,eqn) {

dS[eqn]=0.0;

return C_UDMI(c,t,9); }

However, it gives wrong result in parallel FLUENT, therefore i modified it to,

DEFINE_SOURCE(src_number_hom,c,t,dS,eqn) { /* serial */ #if !PARALLEL

dS[eqn]=0.0;

return C_UDMI(c,t,9); #endif

/* node */ #if RP_NODE

if(C_PART(c,t)==myid)

{

dS[eqn]=0.0;

return C_UDMI(c,t,9);

}

else

{

dS[eqn]=0.0;

return 0.0;

} #endif

/* host */ #if RP_HOST

Message("%d %d in src_mass in host\n",C_PART(c,t),myid); dS[eqn]=0.0;

return 0.0; #endif }

but i still found it cannot give right result. anybody can help me? thanks.


All times are GMT -4. The time now is 19:48.