CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (http://www.cfd-online.com/Forums/fluent-udf/)
-   -   P_POS Undeclared Variable Error (http://www.cfd-online.com/Forums/fluent-udf/125398-p_pos-undeclared-variable-error.html)

osuguy October 24, 2013 15:51

P_POS Undeclared Variable Error
 
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"

DEFINE_DPM_BODY_FORCE(BodyTest,p,i)
{
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.

Thanks

SSOHEIL March 8, 2014 06:38

Hi,

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

Regards.


All times are GMT -4. The time now is 07:04.