|
[Sponsors] |
March 17, 2010, 01:52 |
UDF issue
|
#1 |
Senior Member
MASOUD
Join Date: Mar 2009
Posts: 102
Rep Power: 17 |
I'm trying to compile the following code for energy equation source term:
--------------------------------- #include "udf.h" #include "mem.h" static real ACT_AREA=1; static real REF_EXCH_CURR_A=1; static real MW_H2=1; static real REF_CONC=1; static real BETA=1; static real ALPHA=1; static real NO_ELEC=1; static real EQU_POT_A=1; static real FARADAY=1; static real UNI_GAS_CONS=1; static real STOCH=1; static real RXN_RATE_A; static real Z; static real ZZ; static real ZZZ; static real ELEC_COND=1; static real CARB_COND=1; static real OVERPOT_A; static real SOURCE_1; static real SOURCE_2; static real SOURCE_3; static real SOURCE; static real A; static real B; DEFINE_SOURCE(ENERGY_SOURCE_ANODE,c,t,dS,eqn) { A=C_UDSI_G(c,t,0); B=C_UDSI_G(c,t,1); SOURCE_1=pow((A/ELEC_COND),2)/ELEC_COND; SOURCE_2=pow((B/CARB_COND),2)/CARB_COND; Z=ACT_AREA*REF_EXCH_CURR_A*pow(((C_YI(c,t,1)*C_R(c ,t)/MW_H2)/REF_CONC),BETA); ZZ=exp((ALPHA*NO_ELEC*FARADAY*(C_UDSI(c,t,0)-EQU_POT_A))/(UNI_GAS_CONS*C_T(c,t))); ZZZ=exp((1-ALPHA)*NO_ELEC*FARADAY*(EQU_POT_A-C_UDSI(c,t,0))/(UNI_GAS_CONS*C_T(c,t))); RXN_RATE_A=Z*(ZZ-ZZZ); OVERPOT_A=C_UDSI(c,t,0)-REF_EXCH_CURR_A; SOURCE_3=RXN_RATE_A*OVERPOT_A; SOURCE=SOURCE_1+SOURCE_2+SOURCE_3; dS[eqn]=0; return SOURCE; } ------------------------------- But I came across the following error: ..\..\src\ENERGY_SOURCE-ANODE.c(32) : error C2440: '=' : cannot convert from 'real *' to 'real' ..\..\src\ENERGY_SOURCE-ANODE.c(34) : error C2440: '=' : cannot convert from 'real *' to 'real' Generating Code... Any idea??? |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Dynamic Mesh UDF | Qureshi | FLUENT | 7 | March 23, 2017 07:37 |
UDF parallel error: chip-exec: function not found????? | shankara.2 | Fluent UDF and Scheme Programming | 1 | January 16, 2012 22:14 |
How to add a UDF to a compiled UDF library | kim | FLUENT | 3 | October 26, 2011 21:38 |
UDF...UDF...UDF...UDF | Luc SEMINEL | FLUENT | 0 | November 25, 2002 04:03 |
UDF, UDF, UDF, UDF | Luc SEMINEL | Main CFD Forum | 0 | November 25, 2002 04:01 |