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

UDF Help

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 23, 2014, 11:40
Default UDF Help
  #1
New Member
 
anonymous
Join Date: Mar 2014
Posts: 2
Rep Power: 0
cfduser5226 is on a distinguished road
I am trying write a UDF to be used as an inlet BC. I have read through the tutorial in Fluent and it doesn't provide much help for a 3-d application.

My inlet velocity is composed of velocity magnitudes (x,y,z velocities). The velocity only varies in Y-direction and I have derived an equation for each velocity(u=f(y),v=f(y),w=f(y)). I am just curious how to write the UDF that will be able to define velocity the entire span of the inlet.

Thanks
cfduser5226 is offline   Reply With Quote

Old   March 24, 2014, 21:55
Default
  #2
Super Moderator
 
diamondx's Avatar
 
Ghazlani M. Ali
Join Date: May 2011
Location: Tokyo, Japan
Posts: 1,385
Blog Entries: 23
Rep Power: 28
diamondx will become famous soon enough
I am no expert in UDF, I just wrote my UDF last week; the UDF manual and the tutorials will help you understand the functions, but if you wanna learn , look for existing pieces of codes, understand them and modify them so it can suit your need... 2-D should not be that different from 3-D you just add the z component... I guess
__________________
Regards,
New to ICEM CFD, try this document --> https://goo.gl/KAOIwm
Ali
diamondx is offline   Reply With Quote

Old   March 28, 2014, 08:40
Default
  #3
Senior Member
 
François Grégoire
Join Date: Jan 2010
Location: Canada
Posts: 392
Rep Power: 17
macfly is on a distinguished road
Hi cfduser,

Here's your udf, I just copied 3 times an example from the udf manual version 15.0: 2.3.19.3. Example 1 - Pressure Profile

It doesn't matter 2D or 3D in this case, the DEFINE_PROFILE loops over all faces of the boundary where you apply it.


Code:
 #include "udf.h"
 DEFINE_PROFILE(vx,t,i)
 {
    real x[ND_ND];    /* this will hold the position vector */
    real y;
    face_t f;
    begin_f_loop(f,t)
      {
       F_CENTROID(x,f,t);
       y = x[1];
       F_PROFILE(f,t,i) = 1.1e5 - y*y/(.0745*.0745)*0.1e5;
      }
    end_f_loop(f,t)
 } 
 
  DEFINE_PROFILE(vy,t,i)
 {
    real x[ND_ND];    /* this will hold the position vector */
    real y;
    face_t f;
    begin_f_loop(f,t)
      {
       F_CENTROID(x,f,t);
       y = x[1];
       F_PROFILE(f,t,i) = 1.1e5 - y*y/(.0745*.0745)*0.1e5;
      }
    end_f_loop(f,t)
 } 
 
  DEFINE_PROFILE(vz,t,i)
 {
    real x[ND_ND];    /* this will hold the position vector */
    real y;
    face_t f;
    begin_f_loop(f,t)
      {
       F_CENTROID(x,f,t);
       y = x[1];
       F_PROFILE(f,t,i) = 1.1e5 - y*y/(.0745*.0745)*0.1e5;
      }
    end_f_loop(f,t)
 }
Attached Images
File Type: png 001.png (14.3 KB, 8 views)
macfly 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
Source Term UDF VS Porous Media Model pchoopanya Fluent UDF and Scheme Programming 1 August 28, 2013 06:12
UDF parallel error: chip-exec: function not found????? shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 22:14
How to add a UDF to a compiled UDF library kim FLUENT 3 October 26, 2011 21:38
UDF...UDF...UDF...UDF Luc SEMINEL FLUENT 0 November 25, 2002 04:03
UDF, UDF, UDF, UDF Luc SEMINEL Main CFD Forum 0 November 25, 2002 04:01


All times are GMT -4. The time now is 05:07.