CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (http://www.cfd-online.com/Forums/fluent-udf/)
-   -   what are these errors ? (http://www.cfd-online.com/Forums/fluent-udf/108503-what-these-errors.html)

89566008 October 25, 2012 04:33

what are these errors ?
 
hi all , I've been trying to interpret my udf and I see these errors :

line 5: invalid type for binary expression: double * array 2 of double.
for this UDF :

#include "udf.h"
DEFINE_SOURCE(gas_source,c,t,dS,eqn)
{
real source;
source = C_UDSI(c,t,0)*C_UDSI_G(c,t,0);
dS[eqn] = 0;
return source;
}

and these errors :
line 24: type_size: don't know what to do with TYPE_STRUCT
line 26: invalid type conversion: double -> pointer to char
for this UDF :


#include "udf.h"
#include "dpm.h"
#include "surf.h"
#include "metric.h"
#include "math.h"
#include "mem.h"

#define Pia 3.14
#define epsilon_0 8.85e-12
#define epsilon_r 1.000590
#define K_ion 0.00022

DEFINE_UDS_UNSTEADY(my_uds_unsteady,c,t,i,apu,su)
{
real vol;
vol=C_VOLUME(c,t);
}

DEFINE_DPM_LAW(particle_charge_density,p,ci)
{

real Qd,Q,Qk,t, t_half;
real particle_charge_dens=0,pcd=0,sigma;
for(p=0;p=397;p++)
{
Qd=3*Pia*epsilon_0*(epsilon_r/(epsilon_r+2))*pow(P_DIAM(p),2.0)*C_UDSI_G(c,t,1)[1];
t_half=4*epsilon_0/(C_UDSI(c,t,0)*K_ion);
Qk=(3*Qd/2)-(t_half*Qd/P_TIME(p));
if(Qk<=Qd)
{
Q=Qk
else
Q=Qd
}
particle_charge_dens=(0.0001*Q*0.65)/(P_MASS(p));
sigma+=particle_charge_dens;
}
pcd=sigma/vol;
}

enum
{
v,
rho,
N_REQUIRED_UDS
};
DEFINE_SOURCE(phi_source,c,t,dS,eqn)
{
real source;
source = (C_UDSI(c,t,0)+pcd)/epsilon_0;
dS[eqn] = 0;
return source;
}

Please guide me,
thanks
IVI

msaeedsadeghi November 12, 2012 04:32

C_UDSI_G is an array with 2 or 3 dimensions.
You should use this for example:
*C_UDSI_G(c,t,0)[0]
or
*C_UDSI_G(c,t,0)[1]
or
*C_UDSI_G(c,t,0)[2]

villager December 13, 2012 16:18

p is pointer to tracked particle structure for some particle, it can't be used as incremental variable (counter): (line 24) "p=0; p<397... "
DEFINE_DPM_LAW will be called for each particle tracked by FLUENT. And you have no need to loop these particles in DPM, because this macro is called for every particle.


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