|
[Sponsors] |
October 25, 2012, 05:33 |
what are these errors ?
|
#1 |
New Member
IVI
Join Date: Oct 2012
Posts: 14
Rep Power: 14 |
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 |
|
November 12, 2012, 04:32 |
|
#2 |
Senior Member
SSL
Join Date: Oct 2012
Posts: 226
Rep Power: 15 |
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] |
|
December 13, 2012, 16:18 |
|
#3 |
Member
vlg
Join Date: Jul 2011
Location: My home :)
Posts: 81
Rep Power: 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. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Building OpenFOAM1.7.0 from source | ata | OpenFOAM Installation | 46 | March 6, 2022 14:21 |
How to write k and epsilon before the abnormal end | xiuying | OpenFOAM Running, Solving & CFD | 8 | August 27, 2013 16:33 |
Convergence moving mesh | lr103476 | OpenFOAM Running, Solving & CFD | 30 | November 19, 2007 15:09 |
IcoFoam parallel woes | msrinath80 | OpenFOAM Running, Solving & CFD | 9 | July 22, 2007 03:58 |
Could anybody help me see this error and give help | liugx212 | OpenFOAM Running, Solving & CFD | 3 | January 4, 2006 19:07 |