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

TP_POS undeclared variable

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 14, 2022, 11:45
Default TP_POS undeclared variable
  #1
New Member
 
Siddharth
Join Date: Mar 2018
Posts: 4
Rep Power: 8
sidkamat is on a distinguished road
Hi. I am trying to add an additional force on the tracked particle in the DPM. I am getting the error "TP_POS: undeclared variable" for the following UDF:

/*UDF for calculating DEP force*/
#include "udf.h"
#include "dpm.h"
#include "dpm_types.h"
#define pi 3.141592
/*Define parameters*/
#define km 1.0
#define epsilon 8.85e-12
#define D 1.0e-6
#define L 10.0e-6
#define alpha 1130
#define V 7000
#define R2 1.111/100
#define R1 0.794/100
DEFINE_DPM_BODY_FORCE(DEP,tp,i)
{
real beta=L/D;
real xi=beta/sqrt((beta*beta-1));
real c1=atan(xi);
real f=xi*((1-xi*xi)/c1+xi);
real Fd=0;
if(TP_POS(tp)[0]>=0.366)
{
Fd= (-1*pi*km*epsilon*D*D*L/6)/(alpha/(alpha-1)-f)*(V/log(R2/1))*(V/log(R2/1))*1/TP_POS(tp)[1];
}
else
Fd=0;
return(Fd/P_MASS(tp));
}

Can anyone identify what is wrong?
sidkamat is offline   Reply With Quote

Old   April 1, 2022, 00:16
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
try P_POS instead of TP_POS, compile code
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Reply

Tags
error, fluent, udf code, 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
two different gas! Fluid pair model! saha2122 CFX 7 February 9, 2022 08:15
Undeclared Identifier Errof UDF SteveGoat Fluent UDF and Scheme Programming 7 October 15, 2014 08:11
Errors in UDF shashank312 Fluent UDF and Scheme Programming 6 May 30, 2013 21:30
emag beta feature: charge density charlotte CFX 4 March 22, 2011 10:14
Replace periodic by inlet-outlet pair lego CFX 3 November 5, 2002 21:09


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