CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Fluent UDF and Scheme Programming

what are these errors ?

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   October 25, 2012, 04:33
Default what are these errors ?
  #1
New Member
 
IVI
Join Date: Oct 2012
Posts: 14
Rep Power: 3
89566008 is on a distinguished road
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
89566008 is offline   Reply With Quote

Old   November 12, 2012, 03:32
Default
  #2
Senior Member
 
Saeed Sadeghi
Join Date: Oct 2012
Location: Denmark
Posts: 227
Rep Power: 4
msaeedsadeghi is on a distinguished road
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]
__________________
Regards,
Saeed Sadeghi
Ansys Fluent CFD Consultant
msaeedsadeghi is offline   Reply With Quote

Old   December 13, 2012, 15:18
Default
  #3
Member
 
John M.
Join Date: Jul 2011
Posts: 42
Rep Power: 4
villager is on a distinguished road
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.
villager is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to write k and epsilon before the abnormal end xiuying OpenFOAM Running, Solving & CFD 8 August 27, 2013 15:33
Building OpenFOAM1.7.0 from source ata OpenFOAM Installation 42 May 14, 2012 20:48
Convergence moving mesh lr103476 OpenFOAM Running, Solving & CFD 30 November 19, 2007 14:09
IcoFoam parallel woes msrinath80 OpenFOAM Running, Solving & CFD 9 July 22, 2007 02:58
Could anybody help me see this error and give help liugx212 OpenFOAM Running, Solving & CFD 3 January 4, 2006 18:07


All times are GMT -4. The time now is 05:58.