CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   define_profile UDF question (http://www.cfd-online.com/Forums/fluent/76054-define_profile-udf-question.html)

andu May 12, 2010 15:17

define_profile UDF question
 
Hello everyone

I am trying to write an UDF that changes the pressure value in a pressure outlet every 5000 iterations, in a steady case.

When I interpret it, I get this error, wich i do not understand.
Error: D:\\pump\\P.c: line 32: label "count2" not found (pc=16).

Here is the code

#include "udf.h"

DEFINE_PROFILE(pressure,t,i)
{

face_t f;
real p;

if(N_ITER<=5000)p=0;
else if(N_ITER<=10000)p=1e5;
else if(N_ITER<=15000)p=2e5;
else if(N_ITER<=20000)p=3e5;
else if(N_ITER<=25000)p=4e5;
else if(N_ITER<=30000)p=5e5;
else if(N_ITER<=35000)p=6e5;
else if(N_ITER<=40000)p=7e5;
else if(N_ITER<=45000)p=8e5;
else if(N_ITER<=50000)p=9e5;
else p=1e6;


begin_f_loop(f,t)
{

F_PROFILE(f,t,i)=p;

}
end_f_loop(f,t)


}

I would appreciate any kind of help.

Thank you,
Andrei

wangguobin14 July 1, 2010 07:15

how do you control the N_INTER out of loop?
 
Quote:

Originally Posted by andu (Post 258538)
Hello everyone

I am trying to write an UDF that changes the pressure value in a pressure outlet every 5000 iterations, in a steady case.

When I interpret it, I get this error, wich i do not understand.
Error: D:\\pump\\P.c: line 32: label "count2" not found (pc=16).

Here is the code

#include "udf.h"

DEFINE_PROFILE(pressure,t,i)
{

face_t f;
real p;

if(N_ITER<=5000)p=0;
else if(N_ITER<=10000)p=1e5;
else if(N_ITER<=15000)p=2e5;
else if(N_ITER<=20000)p=3e5;
else if(N_ITER<=25000)p=4e5;
else if(N_ITER<=30000)p=5e5;
else if(N_ITER<=35000)p=6e5;
else if(N_ITER<=40000)p=7e5;
else if(N_ITER<=45000)p=8e5;
else if(N_ITER<=50000)p=9e5;
else p=1e6;


begin_f_loop(f,t)
{

F_PROFILE(f,t,i)=p;

}
end_f_loop(f,t)


}

I would appreciate any kind of help.

Thank you,
Andrei

hi,
i am interesting in your case, especially on N_ITER ?how could you control it?
thank you !
wangguobin14@163.com


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