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

problem in 3d parabolic velocity profile

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 4, 2005, 18: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, 07: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, 07: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, 08: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, 13: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, 10: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, 17: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, 17: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, 06: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


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Parabolic inlet velocity profile msrinath80 OpenFOAM Running, Solving & CFD 157 February 6, 2020 06:13
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 18, 2009 00: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 16:25.