|
[Sponsors] |
November 2, 2020, 13:18 |
DPM macro undeclared variable
|
#1 |
New Member
Monza e Brianza
Join Date: Nov 2020
Posts: 8
Rep Power: 6 |
Hi! I wrote this UDF for DPM mass transfer. When I try to interpret the UDF I get the error "undeclared variable" for TP_CELL(tp), and for the other macros too.
Can you help me? #include "udf.h" #include "dpm.h" DEFINE_DPM_LAW(bubbled,tp,coupled) { cell_t c = TP_CELL(tp); Thread *t = TP_CELL_THREAD(tp); real temp, P, Dco2, Sc, d, ki, kh, Ci, Cinf, massrate; temp = 288; d = TP_DIAM(tp); Dco2 = (1.38*pow(10.0,-23.0)*temp)/(6.0*M_PI*0.001003*pow(10.0,-10.0)); Sc=0.001003/(TP_RHO(tp)*Dco2); if (d<0.0035) {ki=(2+0.6*pow(Re,1./2.)*pow(Sc,1./3.))*Dco2/d; else if(d<=0.0045 && d>0.0035) ki=0.2838*d-0.0009121; else ki=2/pow(M_PI, 1./2.)*pow(Re*Sc,1./2.)*Dco2/d } kh=44*1000/101325*pow(2.7183,2119.05/temp-17.4141); P = C_P(c, t); Ci=P*kh; Cinf=0; massrate=M_PI*d*d*ki*(Ci-Cinf); TP_MASS(tp)=TP_MASS(tp)-massrate*TP_DT(tp); TP_DIAM(tp)=pow((6.0*TP_MASS(tp))/(M_PI*44*P/temp/8314),1./3.); TP_RHO(tp)= (44*P)/(8314*temp); } |
|
November 2, 2020, 14:25 |
|
#2 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
Compile it.
|
|
November 3, 2020, 11:39 |
|
#3 |
New Member
Monza e Brianza
Join Date: Nov 2020
Posts: 8
Rep Power: 6 |
Hi Pakk,
When I compile it, Fluent can't read the "nmake" file. if I just use the "dpm.h" library and interpret it, I got a parse error in config.h line 118. How can I solve the problem? |
|
November 3, 2020, 15:00 |
|
#4 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
That means your fluent is not properly installed. Look for the nmake error on this forum, many questions about that, some with answers.
|
|
Tags |
dpm, macro, undeclared variable |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
DEFINE_PROFILE how to transfer variable for another macro? | pawel123 | Fluent UDF and Scheme Programming | 5 | May 1, 2015 09:05 |
THREAD_STORE: undeclared variable | rarevalo | FLUENT | 0 | June 14, 2011 05:32 |
CFX macro: Name of mesh File as Variable | Saima | CFX | 2 | May 27, 2011 19:59 |
How to pass a variable from a define macro... | Padian | FLUENT | 2 | May 30, 2008 06:22 |
Env variable not set | gruber2 | OpenFOAM Installation | 5 | December 30, 2005 05:27 |