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

Udf doubt

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 19, 2017, 03:48
Default Udf doubt
  #1
New Member
 
Neethu N
Join Date: Nov 2017
Posts: 8
Rep Power: 8
Neethu_N is on a distinguished road
Hello, please help me with this. I am studying UDF coding. I found this code in the ANSYS Manual.

/************************************************** *********************
udfexample.c
UDF for specifying steady-state velocity profile boundary condition
************************************************** **********************/
#include "udf.h"
DEFINE_PROFILE(inlet_x_velocity, thread, position)
{
real x[ND_ND]; /* this will hold the position vector */
real y, h;
face_t f;
h = 0.016; /* inlet height in m */
begin_f_loop(f,thread)
{
F_CENTROID(x, f, thread);
y = 2.*(x[1]-0.5*h)/h; /* non-dimensional y coordinate */
F_PROFILE(f, thread, position) = 0.1*(1.0-y*y);
}
end_f_loop(f, thread)
}

Is it necessary to find the centroid? The code works without it too.
Neethu_N is offline   Reply With Quote

Old   December 19, 2017, 03:54
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
3.2.4.1. Face Centroid (F_CENTROID)
The macro listed in Table 3.21: Macro for Face Centroids Defined in metric.h (p. 261) can be used to obtain the real centroid of a face. F_CENTROID finds the coordinate position of the centroid of the face f and stores the coordinates in the x array. Note that the x array is always one-dimensional, but it can be x[2] or x[3] depending on whether you are using the 2D or 3D solver.
AlexanderZ is offline   Reply With Quote

Old   December 19, 2017, 04:02
Default
  #3
New Member
 
Neethu N
Join Date: Nov 2017
Posts: 8
Rep Power: 8
Neethu_N is on a distinguished road
I got it. Thank you very much
Neethu_N is offline   Reply With Quote

Reply

Tags
fluent - 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
UDF for vapor pressure anuarun Fluent UDF and Scheme Programming 12 December 24, 2021 10:12
Doubt about real x[ND_ND] declaration in FLUENT udf Abhya Fluent UDF and Scheme Programming 5 March 21, 2013 00:21
parse error while interpreting udf Kristin Fluent UDF and Scheme Programming 3 March 15, 2012 06:43
I need UDF help. S.Whitney FLUENT 0 October 15, 2007 11:29
UDF, UDF, UDF, UDF Luc SEMINEL Main CFD Forum 0 November 25, 2002 04:01


All times are GMT -4. The time now is 10:51.