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

3D UDF Paraboilc Velocity Profile (Can't Maintain)

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 20, 2007, 04:17
Default 3D UDF Paraboilc Velocity Profile (Can't Maintain)
  #1
Sing
Guest
 
Posts: n/a
I am simulating the air flow over a 3D building in a wind domain using a paraboilc velocity inlet profile.

The inlet profile is written by the following code, which is compiled into Fluent without any errors.

After 2000 iterations,the solution is converged, the velocity inlet profile at a point near to the entry is plotted, which agrees well with the udf profile.

However, as the velocity profile is plotted at a distance of 1000m away from the inlet, the profile is somehow distorted and does not have the same profile as the inlet profile.

The size of the wind domain is 3500(x) x 3500(y) x 150(z). The building is at a distance of 1200m from the inlet.

What can i do to maintain the Velocity Profile along the wind domain? Plz Help~~~~~

// UDF code for 3D parabolic Velocity Profile //

#include "udf.h"

DEFINE_PROFILE(inlet_x_velocity, thread, position)

{

real x[ND_ND];

real z; // Vertical Distance

face_t f;

begin_f_loop(f, thread)

{

F_CENTROID(x,f,thread);

z = x[2];

F_PROFILE(f, thread, position) = 24.9 *pow(z,0.27);

}

end_f_loop(f, thread)

}

  Reply With Quote

Old   January 20, 2007, 05:07
Default Re: 3D UDF Paraboilc Velocity Profile (Can't Maint
  #2
Laika
Guest
 
Posts: n/a
Hi,

most probably, this is because the wall function used with the turbulence model is not compatible with the Atmospheric Boundary Layer profile you've implemented in the UDF. The wall functions are valid for small geometries (compared to yours) and relatively small cells. You just tapped a problem tat is very often neglected, but that chouldn't be neglected! You will have to play with the wall functions (I heard that's possible in v6.3) or with the k-eps model constants...

Can you provide some extra details on your project, simulation goals, findings, ... and we can probably help each other. I'll have to do an atmospheric dispersion problem soon, so it's a good time to start cooperating on these issues...

talk to you soon!

cheers, Laika, still orbiting

  Reply With Quote

Old   January 20, 2007, 05:29
Default Re: 3D UDF Paraboilc Velocity Profile (Can't Maint
  #3
Sing
Guest
 
Posts: n/a
Hi,

Thanks Laika for replying my message~

As i have posted in the previous email, i have to simulate the air flow over an isolated high-rise building, in order to observe the flow changes in the wake region in terms of velocity profile and TKE.

In my simulation, i am using the standard k-epsilon model as the first step to obtain some preliminary results.

The simluated results are satisfactory, like obseving recirculation behind the building. However, the problem is that the velocity profile at the front of the building is distorted and is actually quite different from the input parabolic velocity profile.

I am afraid that my simulated results would be very different from the results having perfect parabolic profile. Since one of my requirement is to carry out the simulation using various wind speed and profiles, so it is really important for me to keep the velocity profile up to the building.

I am using Fluent version 6.1.22 only, how can i modify the k-epsilon model constants as Laika mentioned before? Can you tell more information on that?

I can supply further information for my project if needed.

Thx

Sing

  Reply With Quote

Old   February 25, 2010, 11:19
Default
  #4
New Member
 
srinivas
Join Date: Feb 2010
Posts: 9
Rep Power: 16
sri99iitm is on a distinguished road
dude can u pls help with writing udf .
Im running simulation with a cylinder ,sphere inside it for Non Newtonian fluid.
I recently started working with fluent ,hope u could lead ur helping hand
Dimensions of cylinder
L=20cms
D=4cms
d(sphere)=2cms
Parabolic Velocity equation be V=Vmax(1-r/R)^(n+1/n)

my code:
#include "udf.h"

DEFINE_PROFILE(inlet_x_velocity, thread, position)

{

real x[ND_ND];

real y,r,R;

face_t f;

begin_f_loop(f, thread)

{

F_CENTROID(x,f,thread);

r = pow(x,2)+pow(y,2);

// Vmax=4.1,R=o.o4//

F_PROFILE(f, thread, position) = Vmax *pow(1-r/R,(n+1)/n);

}

end_f_loop(f, thread)

}

Please tell the changes i have to make ,thank u
sri99iitm is offline   Reply With Quote

Old   September 27, 2010, 07:50
Default
  #5
Member
 
lehoang_mai's Avatar
 
User_CFD
Join Date: Mar 2010
Posts: 48
Rep Power: 16
lehoang_mai is on a distinguished road
Quote:
Originally Posted by sri99iitm View Post
dude can u pls help with writing udf .
Im running simulation with a cylinder ,sphere inside it for Non Newtonian fluid.
I recently started working with fluent ,hope u could lead ur helping hand
Dimensions of cylinder
L=20cms
D=4cms
d(sphere)=2cms
Parabolic Velocity equation be V=Vmax(1-r/R)^(n+1/n)

my code:
#include "udf.h"

DEFINE_PROFILE(inlet_x_velocity, thread, position)

{

real x[ND_ND];

real y,r,R;

face_t f;

begin_f_loop(f, thread)

{

F_CENTROID(x,f,thread);

r = pow(x,2)+pow(y,2);

// Vmax=4.1,R=o.o4//

F_PROFILE(f, thread, position) = Vmax *pow(1-r/R,(n+1)/n);

}

end_f_loop(f, thread)

}

Please tell the changes i have to make ,thank u
I think, variables Vmax and n must declare in the fisrt time when you declared "Real y,R,r,Vmax,n". And variable n must assigned to any value.
lehoang_mai is offline   Reply With Quote

Old   August 27, 2011, 12:36
Default velocity inlet for 3d parabolic equation.
  #6
Member
 
Nirav
Join Date: Jul 2011
Posts: 43
Rep Power: 15
niravtm007 is on a distinguished road
Send a message via Skype™ to niravtm007
hiii friends i am entirely new to using udf's in fluent. I have a cubical geometry, with two inlets on perpendicular adjacent faces. i have to implement udf to only one of the conditions.
i have two cases
1) parabolic velocity inlet ( space varient)
2) sinusodial velocity velocity inlet ( time variant)
can any one pls send me the udf ( codes) ...
niravtm007 is offline   Reply With Quote

Old   August 31, 2011, 02:09
Default
  #7
Member
 
Nirav
Join Date: Jul 2011
Posts: 43
Rep Power: 15
niravtm007 is on a distinguished road
Send a message via Skype™ to niravtm007
. i have worked out with 2d udf for parabolic velocity inlet.
please help me how this code will change with 3d. i wanna know how will be the equation considering 3rd dimmension.
as in 2d we have V(x)=Vmax- y^2/(disatnce from centre in y direction )^2 * Vmax.
please help me.
also give suggestion how to work out on sinusoidal inlet udf.
thanks in advance
niravtm007 is offline   Reply With Quote

Old   September 1, 2011, 02:38
Default
  #8
Member
 
Nirav
Join Date: Jul 2011
Posts: 43
Rep Power: 15
niravtm007 is on a distinguished road
Send a message via Skype™ to niravtm007
can you please explain how does this line fit int o your code
F_PROFILE(f, thread, position) = 24.9 *pow(z,0.27);
. i want to use 3d parabolic inlet mine is a cubical cell 1*1*1. inlet i a circular face of o.1 dia. please tell me how to modify according to my problem
niravtm007 is offline   Reply With Quote

Old   September 17, 2014, 19:40
Default
  #9
New Member
 
bhatti
Join Date: Aug 2013
Posts: 2
Rep Power: 0
ksbiefr is on a distinguished road
could you please tell me
what is the exact equation you are using for developing Parabolic velocity profile in 3D.
ksbiefr is offline   Reply With Quote

Old   November 26, 2014, 08:58
Default udf for inlet error
  #10
New Member
 
sitasma
Join Date: May 2014
Posts: 8
Rep Power: 12
smarika is on a distinguished road
i have to simulate a wind turbine of 45 m radius. i have used this udf at the inlet but there are some error when i initialize from inlet as shown in the picture.can anyone please tell me why is this error. what can be done to correct it?

#include "udf.h"
#define zo 10
#define uo 5

DEFINE_PROFILE(inlet_x_velocity,thread,index)
{
real x[ND_ND];
real z;
face_t f;
begin_f_loop(f,thread)
{
F_CENTROID(x,f,thread);
z= x[2];
F_PROFILE(f,thread,index)=uo*pow(z/zo,0.16);
}
end_f_loop(f,thread)
}
Attached Images
File Type: jpg QQ Photo20141126205201.jpg (36.0 KB, 76 views)
smarika is offline   Reply With Quote

Old   October 14, 2015, 21:24
Default
  #11
New Member
 
Edmundo
Join Date: Jun 2014
Location: Mexico
Posts: 4
Rep Power: 12
eag.10 is on a distinguished road
Hi, did you solved the problem?, if so, did you found an error rate between the perfect parabolic profile and the distorted parabolic profile?

Regards
eag.10 is offline   Reply With Quote

Old   October 24, 2016, 05:49
Question UDF for inlet temperature
  #12
New Member
 
mm
Join Date: May 2016
Posts: 24
Rep Power: 9
mmunige is an unknown quantity at this point
Dear all

I have following UDF for inlet temperature, untill 1300s it takes correct values according to equation, but after 1300s values are higher and not accorrding to equation, like at 1301s it should have value of 405C but in simulation inlet temperature is 621C. I could not find the error in my UDF after lot of try. please check this and guide me. help please
#include"udf.h"

DEFINE_PROFILE(inlet_temperature,thread,position )

{

face_t f;

begin_f_loop(f,thread)

{

real t = RP_Get_Real("flow-time");

if (t <=1300.0 )

{

F_PROFILE(f,thread,position) = 379.13 + 0.0005*t;

}

else if (1300.0 < t && t <= 1500.0 )

{

F_PROFILE(f,thread,position)= -1.04289036878969*pow(10,-10)*pow(t,6.0)+ 8.86126436853789*pow(10,-7)*pow(t,5.0)-3.13621260398811*pow(10,-3)*pow(t,4.0)+5.91804640375908*pow(t,3.0)-6.27969461279651*pow(10,3)*pow(t,2.0)+ 3.55273415252714*pow(10,6)*t - 8.37223405676245*pow(10,8);
}
else
{

F_PROFILE(f,thread,position) = -9.51538261322402*pow(10,-23)*pow(t,6) + 8.26192751387975*pow(10,-18)*pow(t,5)-2.85237398505875*pow(10,-13)*pow(t,4)+4.97518353700886*pow(10,-9)*pow(t,3)-4.58733775886876*pow(10,-5)*pow(t,2)+ 2.10251137071757*pow(10,-1)*t +3.57252192344954*pow(10,2);

}

}

end_f_loop(f,thread)

}
mmunige is offline   Reply With Quote

Old   August 7, 2017, 07:25
Default Sing....do you resolve your problem
  #13
New Member
 
Sameera Lakmal
Join Date: Aug 2017
Posts: 3
Rep Power: 9
sameera1st is on a distinguished road
can i know how you resolve this problem
sameera1st is offline   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
UDF problems - velocity profile Oli Fluent UDF and Scheme Programming 6 October 24, 2016 11:38
How to specify the Velocity profile (eqn) by UDF Anant FLUENT 1 February 27, 2008 15:54
Multi step transient UDF velocity profile problem William177 FLUENT 1 February 3, 2008 07:47
UDF problem : inlet velocity in cyl. coord. system Jongdae Kim FLUENT 0 June 15, 2004 12:21
particle velocity and velocity profile HGG FLUENT 2 June 10, 2001 17:32


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