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

UDF for defining a velocity gradient

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 22, 2013, 11:58
Default UDF for defining a velocity gradient
  #1
New Member
 
Musa
Join Date: May 2009
Location: UK
Posts: 26
Rep Power: 16
mozkan26 is on a distinguished road
Dear friends,

I`m trying to simulate an axisymmetric swirl flow in Fluent with a very simple geometry, attached image shows my geometry and boundary conditions.

At the inlet boundary, radial and swirl velocity components are zero and axial velocity gradient is zero.

Gauge pressure is zero at the outlet and there is a wall with a constant rotational speed.

My UDF file for axial velocity gradient is below but I`m not sure if this is correct because I have difficulties with converging and continuity does not satisfy.

********************
#include "udf.h"

DEFINE_PROFILE(Axial_Velocity_Gradient,t,i)
{
real xf[ND_ND], xc[ND_ND];
face_t f;
cell_t c0;
Thread*t0;
begin_f_loop(f,t)
{
F_CENTROID(xf,f,t);
c0=F_C0(f,t);
t0=THREAD_T0(t);
C_CENTROID(xc,c0,t0);
F_PROFILE(f,t,i)=C_U(c0,t0);
}
end_f_loop(f,t)
}
********************

Many thanks in advance.

Musa
Attached Images
File Type: jpg axisymmetric swirl.jpg (21.4 KB, 50 views)
mozkan26 is offline   Reply With Quote

Old   March 26, 2018, 13:23
Default
  #2
New Member
 
David
Join Date: Nov 2017
Posts: 14
Rep Power: 8
uconcorde is on a distinguished road
Quote:
Originally Posted by mozkan26 View Post
Dear friends,

I`m trying to simulate an axisymmetric swirl flow in Fluent with a very simple geometry, attached image shows my geometry and boundary conditions.

At the inlet boundary, radial and swirl velocity components are zero and axial velocity gradient is zero.

Gauge pressure is zero at the outlet and there is a wall with a constant rotational speed.

My UDF file for axial velocity gradient is below but I`m not sure if this is correct because I have difficulties with converging and continuity does not satisfy.

********************
#include "udf.h"

DEFINE_PROFILE(Axial_Velocity_Gradient,t,i)
{
real xf[ND_ND], xc[ND_ND];
face_t f;
cell_t c0;
Thread*t0;
begin_f_loop(f,t)
{
F_CENTROID(xf,f,t);
c0=F_C0(f,t);
t0=THREAD_T0(t);
C_CENTROID(xc,c0,t0);
F_PROFILE(f,t,i)=C_U(c0,t0);
}
end_f_loop(f,t)
}
********************

Many thanks in advance.

Musa
Hi Musa,

I am facing the similar situation. Did you find out how to fix it?

Many thanks,
Dv
uconcorde is offline   Reply With Quote

Old   August 7, 2021, 21:16
Default I need write an udf for swirling velocity inlet in 3D
  #3
New Member
 
Amine AGRISS
Join Date: Sep 2018
Posts: 1
Rep Power: 0
amineag is on a distinguished road
Hello everyone!
I would like to simulate an airflow over a pipe in Ansys Fluent. I want the flow at outlet of the pipe to be swirled.
How can Swirl the flow at the exit of the pipe?
Can I use an UDF to swirl the flow at the exit of the pipe??
Thank you!
amineag 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
3D velocity inlet UDF zumaqiong Fluent UDF and Scheme Programming 2 October 24, 2016 04:44
specified shear at wall - temperature gradient - UDF - access violation error senD Fluent UDF and Scheme Programming 9 September 18, 2014 07:29
Velocity gradient in previous timestep mateus FLUENT 1 December 13, 2012 13:07
3D UDF Paraboilc Velocity Profile with max velocity johnGo Fluent UDF and Scheme Programming 1 January 4, 2011 21:45
why boudary slip velocity is so larte using udf cxzhao FLUENT 0 July 4, 2005 00:06


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