CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > FLUENT

problem in 3d parabolic velocity profile

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

Reply
 
LinkBack Thread Tools Display Modes
Old   August 4, 2005, 17:27
Default problem in 3d parabolic velocity profile
  #1
Lokesh
Guest
 
Posts: n/a
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) }

  Reply With Quote

Old   August 5, 2005, 06:42
Default Re: problem in 3d parabolic velocity profile
  #2
Mahesh
Guest
 
Posts: n/a
pow is not working , use x*x instead of pow(x,2).
  Reply With Quote

Old   August 5, 2005, 06:58
Default Re: problem in 3d parabolic velocity profile
  #3
Lokesh
Guest
 
Posts: n/a
thanks a lot mahesh...i will check it out
  Reply With Quote

Old   August 5, 2005, 07:59
Default Re: problem in 3d parabolic velocity profile
  #4
dirk
Guest
 
Posts: n/a
"pow" does work, I also use it.
  Reply With Quote

Old   August 5, 2005, 12:35
Default Re: problem in 3d parabolic velocity profile
  #5
Lokesh
Guest
 
Posts: n/a
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) }

  Reply With Quote

Old   August 8, 2005, 09:54
Default Re: problem in 3d parabolic velocity profile
  #6
dirk
Guest
 
Posts: n/a
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
  Reply With Quote

Old   August 8, 2005, 16:21
Default Re: problem in 3d parabolic velocity profile
  #7
Lokesh
Guest
 
Posts: n/a
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
  Reply With Quote

Old   August 8, 2005, 16:31
Default Re: problem in 3d parabolic velocity profile
  #8
dirk
Guest
 
Posts: n/a
I used interpreted udf.
  Reply With Quote

Old   August 11, 2005, 05:36
Default Re: problem in 3d parabolic velocity profile
  #9
Mahesh
Guest
 
Posts: n/a
use interpreted udf also a multiplier is missing after 0.1
  Reply With Quote

Reply

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
Parabolic inlet velocity profile msrinath80 OpenFOAM Running, Solving & CFD 156 January 2, 2014 19:17
3D UDF Paraboilc Velocity Profile with max velocity johnGo Fluent UDF and Scheme Programming 1 January 4, 2011 22:45
[boundary condition] logarithmic velocity profile cfdworker FLUENT 2 April 17, 2009 23:36
2D air parabolic velocity profile ilker FLUENT 2 November 12, 2008 09:43
Multi step transient UDF velocity profile problem William177 FLUENT 1 February 3, 2008 07:47


All times are GMT -4. The time now is 00:50.