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

UDF Parabolic 2D Velocity Profile Issue

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By LuckyTran

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 27, 2018, 12:43
Default UDF Parabolic 2D Velocity Profile Issue
  #1
New Member
 
Join Date: Jan 2018
Posts: 2
Rep Power: 0
chrislyn is on a distinguished road
Hi,

I am trying to specify a fully developed velocity at the inlet of my gradual expansion diffuser. The UDF is below.

/************************************************** ********
udf_parabolicinlet.c
UDF for specifying a steady-state velocity profile boundary condition
************************************************** ********/

#include "udf.h"

DEFINE_PROFILE(inlet_x_xyvelocity, thread, index)
{
real x[ND_ND];
real y;
face_t f;

begin_f_loop(f, thread)

{
F_CENTROID(x,f,thread);
y = x[1];
F_PROFILE(f, thread, index) = .21 - y*y/(.002*.002)*.21;

}
end_f_loop(f, thread)
}


I plotted the equation in MATLAB and got a nice parabolic profile. However, whenever I run this case, I do not get a smooth graph. I get the graph attached.
Screenshot (375).jpg

The steps I follow are:
Write Code...save with file extension ".c"
Interpret it in Setup
Use it as the u component of the velocity inlet boundary condition
Run
Check Velocity Profile

Does anyone know what may be happening here?
chrislyn is offline   Reply With Quote

Old   November 29, 2018, 14:45
Default
  #2
Senior Member
 
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,675
Rep Power: 66
LuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura about
To get a smooth curve, you simply need more points. Two things to consider:
Make sure your mesh is fine enough so that the curve appears smooth (it will always be jagged as shown).

How do you produce this plot? Using a line probe or what? Check the settings.


Better just, just plot the full velocity field and look at it and see if it makes sense.
chrislyn likes this.
LuckyTran is offline   Reply With Quote

Old   December 11, 2018, 12:11
Default
  #3
New Member
 
Join Date: Jan 2018
Posts: 2
Rep Power: 0
chrislyn is on a distinguished road
Quote:
Originally Posted by LuckyTran View Post
To get a smooth curve, you simply need more points. Two things to consider:
Make sure your mesh is fine enough so that the curve appears smooth (it will always be jagged as shown).

How do you produce this plot? Using a line probe or what? Check the settings.


Better just, just plot the full velocity field and look at it and see if it makes sense.
Thank you so much! The mesh was too coarse in the initial run. Once I ran a mesh independence test, the profile looked how it was supposed to.
chrislyn is offline   Reply With Quote

Reply

Tags
fully developed inlet, udf


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
3D UDF Paraboilc Velocity Profile (Can't Maintain) Sing FLUENT 12 August 7, 2017 06:25
Parabolic velocity profile in 3d with UDF mmk3818 Fluent UDF and Scheme Programming 1 August 21, 2016 18:35
How to define a parabolic velocity inlet of particles with UDF zumaqiong FLUENT 2 February 22, 2010 09:46
Logarithmic velocity profile cfdworker Fluent UDF and Scheme Programming 0 April 23, 2009 19:09
udf for velocity profile in a geometry having two inlets shubham208011 Fluent UDF and Scheme Programming 0 April 6, 2009 15:13


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