CFD Online Logo CFD Online URL
Home > Forums > Fluent UDF and Scheme Programming

P_POS Undeclared Variable Error

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Display Modes
Old   October 24, 2013, 15:51
Default P_POS Undeclared Variable Error
New Member
Join Date: Oct 2013
Posts: 4
Rep Power: 4
osuguy is on a distinguished road
Hey Everyone,

I have this simple code below I am using to try to get a feel for body force modeling. I am having trouble compiling the code, as it comes up with an undeclared variable error when looking at the P_POS macros in the if statements.

#include "udf.h"

real bforce=0;

if (P_POS(p)[0]>-.01 && P_POS(p)[0]<.01 && P_POS(p)[1]>.03 && i==0)
{ bforce=2;
if (P_POS(p)[0]>-.01 && P_POS(p)[0]<.01 && P_POS(p)[1]>.03 && i==1)
{ bforce=1;

return bforce;

Any help as to why this is happening or ways to fix it would be greatly appreciated.

osuguy is offline   Reply With Quote

Old   March 8, 2014, 06:38
New Member
Select One
Join Date: Mar 2014
Posts: 2
Rep Power: 0
SSOHEIL is on a distinguished road

Try to include dpm.h and declare P_POS as:
#include <dpm.h>
double P_POS[3]; //3 for a 3D or 2 for a 2D case

SSOHEIL is offline   Reply With Quote


Thread Tools
Display Modes

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
an error in Calculator's equation immortality OpenFOAM Paraview & paraFoam 11 September 3, 2013 16:18
UDF: DEFINE_CG_MOTION for vertical jump motion of an electrode! alban Fluent UDF and Scheme Programming 2 June 8, 2010 18:54
checking the system setup and Qt version vivek070176 OpenFOAM Installation 22 June 1, 2010 12:34
groovyBC sega OpenFOAM Running, Solving & CFD 12 February 17, 2010 10:30
user subroutine error CFDUSER CFX 2 December 9, 2006 07:31

All times are GMT -4. The time now is 19:40.