CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   problem in 3d parabolic velocity profile (https://www.cfd-online.com/Forums/fluent/37482-problem-3d-parabolic-velocity-profile.html)

Lokesh August 4, 2005 17:27

problem in 3d parabolic velocity profile
 
Hi, I keep getting a error whenever i interpret(SEGMENTATION VIOLATION) or compile (Error code 1)the following code for parabolic velocity profile. I'm pretty new to Fluent. So I'm not exacltly sure what is causing this problem. Can anyone kindly help me in this regard

/************************************************** *********************

vprofile.c

UDF for specifying steady-state velocity profile boundary condition ************************************************** **********************/ #include "udf.h"

DEFINE_PROFILE(inlet_x_velocity, thread, position) { real x[ND_ND]; real r; face_t f;

begin_f_loop(f, thread)

{

F_CENTROID(x,f,thread);

r = sqrt(pow(x[0],2)+pow(x[1],2));

F_PROFILE(f, thread, position) = 2*0.1(1-pow(r/0.000175,2));

} end_f_loop(f, thread) }


Mahesh August 5, 2005 06:42

Re: problem in 3d parabolic velocity profile
 
pow is not working , use x*x instead of pow(x,2).

Lokesh August 5, 2005 06:58

Re: problem in 3d parabolic velocity profile
 
thanks a lot mahesh...i will check it out

dirk August 5, 2005 07:59

Re: problem in 3d parabolic velocity profile
 
"pow" does work, I also use it.

Lokesh August 5, 2005 12:35

Re: problem in 3d parabolic velocity profile
 
Hi everyone. I replaced the pow and even replaced the sqrt. But still the code doesnt work. It just gives me a message " Error code 1" if i try to compile it. Any help would be really appreciated. I have copied the code below

/************************************************** *********************

vprofile.c

UDF for specifying steady-state velocity profile boundary condition ************************************************** **********************/ #include "udf.h"

DEFINE_PROFILE(inlet_x_velocity, thread, position) { float x[ND_ND]; /* this will hold the position vector */ float r; face_t f;

begin_f_loop(f, thread)

{

F_CENTROID(x,f,thread);

r = (((x[0]*x[0])+(x[1]*x[1])))^0.5;

F_PROFILE(f, thread, position) = 2*0.1(1-((r/0.000175)*(r/0.000175)));

} end_f_loop(f, thread) }


dirk August 8, 2005 09:54

Re: problem in 3d parabolic velocity profile
 
Hello,

obviously you forgot a "*" in the line with F_PROFILE() on the right hand side before the first bracket. I just tested this corrected UDF and it works.

Dirk

Lokesh August 8, 2005 16:21

Re: problem in 3d parabolic velocity profile
 
it still doesnt work for me..do i have to do something else for building the library. i just compile my udf after reading my .cas file. Thanks Lokesh

dirk August 8, 2005 16:31

Re: problem in 3d parabolic velocity profile
 
I used interpreted udf.

Mahesh August 11, 2005 05:36

Re: problem in 3d parabolic velocity profile
 
use interpreted udf also a multiplier is missing after 0.1


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