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

DPM macro undeclared variable

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 2, 2020, 13:18
Default DPM macro undeclared variable
  #1
New Member
 
Monza e Brianza
Join Date: Nov 2020
Posts: 8
Rep Power: 6
loren is on a distinguished road
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);
}
loren is offline   Reply With Quote

Old   November 2, 2020, 14:25
Default
  #2
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
Compile it.
pakk is offline   Reply With Quote

Old   November 3, 2020, 11:39
Default
  #3
New Member
 
Monza e Brianza
Join Date: Nov 2020
Posts: 8
Rep Power: 6
loren is on a distinguished road
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?
loren is offline   Reply With Quote

Old   November 3, 2020, 15:00
Default
  #4
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
Quote:
Originally Posted by loren View Post
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?
That means your fluent is not properly installed. Look for the nmake error on this forum, many questions about that, some with answers.
pakk is offline   Reply With Quote

Reply

Tags
dpm, macro, undeclared variable


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 Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 01:03.