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

(ask) how to create UDF for inlet velocity profile

Register Blogs Community New Posts Updated Threads Search

Like Tree21Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 18, 2011, 08:38
Default (ask) how to create UDF for inlet velocity profile
  #1
Member
 
wibi ario
Join Date: Feb 2011
Posts: 46
Rep Power: 15
sincity is on a distinguished road
hi all
i have a question
what should i do if i wanna go to use UDF for my inlet velocity profile 3D case
how can i define it
just a simple question, hope it will be answered by you.regards
sincity is offline   Reply With Quote

Old   March 18, 2011, 08:49
Default
  #2
Senior Member
 
Amir's Avatar
 
Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 735
Blog Entries: 1
Rep Power: 23
Amir is on a distinguished road
Hi,
refer to DEFINE_PROFILE macro in UDF-manual.
saifmasood likes this.
Amir is offline   Reply With Quote

Old   March 18, 2011, 09:34
Default
  #3
Member
 
wibi ario
Join Date: Feb 2011
Posts: 46
Rep Power: 15
sincity is on a distinguished road
hi amir thanks for attention
actually the UDF manual is not helping me at all because i want to create UDf for 3D case inlet velocity profile, but i dont know how to define the velocity function in 3D vector (x,y,z)
maybe you have some tutorial or case example??regards.
sincity is offline   Reply With Quote

Old   March 18, 2011, 10:44
Default
  #4
Senior Member
 
Amir's Avatar
 
Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 735
Blog Entries: 1
Rep Power: 23
Amir is on a distinguished road
Hi Wibi,
here's a example for fully developed flow in a pipe:
Code:
#include "udf.h"
#define Q 1.5625e-5  //unit m3/sec
#define Diameter 4.5e-3  //unit m
DEFINE_PROFILE(axialVelocity,t,i)
{
    real x[ND_ND];
    real r,Area;
    face_t f;
    Area=(M_PI/4.0)*pow(Diameter,2);
    begin_f_loop(f,t)
    {
        F_CENTROID(x,f,t);
        r=sqrt(pow(x[0],2)+pow(x[1],2));
        F_PROFILE(f,t,i)=(2.0*Q/Area)*(1-pow(2.0*r/Diameter,2));
    }
    end_f_loop(f,t)
}
Amir is offline   Reply With Quote

Old   March 18, 2011, 11:49
Default
  #5
Member
 
wibi ario
Join Date: Feb 2011
Posts: 46
Rep Power: 15
sincity is on a distinguished road
mmm...is it UDF for 3D case amir??
sincity is offline   Reply With Quote

Old   March 18, 2011, 14:07
Default
  #6
Senior Member
 
Amir's Avatar
 
Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 735
Blog Entries: 1
Rep Power: 23
Amir is on a distinguished road
Quote:
Originally Posted by sincity View Post
mmm...is it UDF for 3D case amir??
it computes axial velocity magnitude in a pipe(z-direction) as a function of x & y.
you can also define three UDFs for each velocity components that are similar to above. it depends on the method that you want to set velocity in B.C. panel; magnitude normal or components.
Amir is offline   Reply With Quote

Old   March 19, 2011, 00:32
Default
  #7
Member
 
wibi ario
Join Date: Feb 2011
Posts: 46
Rep Power: 15
sincity is on a distinguished road
amir my friend,
i am very confuse about what were you talking about, since i'm new user for UDF
so i hope you have more time to explain about this topic.
amir in defining UDF should i plot my velocity data first to get the function
or just go straight use your UDF example that you gave to me?
please answer.regards
sincity is offline   Reply With Quote

Old   March 19, 2011, 09:51
Default
  #8
Senior Member
 
Amir's Avatar
 
Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 735
Blog Entries: 1
Rep Power: 23
Amir is on a distinguished road
Ok,
first you should decide what kind of velocity declaration you want to use.(in B.C. panel) e.g. you can use velocity magnitude normal to plane or setting individual velocity components. without UDF, you can set constant values for them in GUI.
but for your case that three components change with coordinates(I think), you should write 3 UDF for velocity components and declare them as functions of x,y,z and hook them in respective places. it's obvious that you should have velocities as functions of x,y,z.
if you post your velocity function, I may help you more.

regards,

Amir
Amir is offline   Reply With Quote

Old   March 21, 2011, 00:44
Default
  #9
Member
 
wibi ario
Join Date: Feb 2011
Posts: 46
Rep Power: 15
sincity is on a distinguished road
its going converging.. my question is i have no idea about that velocity function, that's what i want to talk about you. how can i extract my own velocity function, especially in my 3D case??
sincity is offline   Reply With Quote

Old   March 21, 2011, 04:01
Default
  #10
Senior Member
 
Amir's Avatar
 
Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 735
Blog Entries: 1
Rep Power: 23
Amir is on a distinguished road
if your inlet velocity profile is obtained from another FLUENT calculation, it's easy to handle. else you need to use other post processing softwares like MATLAB or others to fit functions to them and then use obtained functions in UDFs.
Amir is offline   Reply With Quote

Old   March 21, 2011, 04:31
Default
  #11
Member
 
wibi ario
Join Date: Feb 2011
Posts: 46
Rep Power: 15
sincity is on a distinguished road
could i just adapting the function from another velocity function and put it on my UDF??maybe your function? or maybe any general form of function that i could use
sincity is offline   Reply With Quote

Old   March 21, 2011, 04:36
Default
  #12
Senior Member
 
Amir's Avatar
 
Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 735
Blog Entries: 1
Rep Power: 23
Amir is on a distinguished road
you can use any forms of explicit functions in UDfs.
e.g.:
V_x=V_x(x,y,z),....
Amir is offline   Reply With Quote

Old   November 16, 2011, 18:41
Default
  #13
New Member
 
Yingying Wang
Join Date: Nov 2011
Posts: 2
Rep Power: 0
wangy16 is on a distinguished road
Quote:
Originally Posted by Amir View Post
if your inlet velocity profile is obtained from another FLUENT calculation, it's easy to handle. else you need to use other post processing softwares like MATLAB or others to fit functions to them and then use obtained functions in UDFs.
Can you tell me how to extract the 3D velocity profile from another FLUENT calculation and load the velocity file as the input? I don't know how to get the velocity file. I read some tutorial saying the velocity file can be obtained as a file format of "XY".
wangy16 is offline   Reply With Quote

Old   November 17, 2011, 03:40
Default
  #14
Senior Member
 
Amir's Avatar
 
Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 735
Blog Entries: 1
Rep Power: 23
Amir is on a distinguished road
Quote:
Originally Posted by wangy16 View Post
Can you tell me how to extract the 3D velocity profile from another FLUENT calculation and load the velocity file as the input? I don't know how to get the velocity file. I read some tutorial saying the velocity file can be obtained as a file format of "XY".
Hi,

you can use (file->write->profile) in your previous results and the use (file->read->profile) in new case. (for more info, refer to manual)

Bests,
__________________
Amir
Amir is offline   Reply With Quote

Old   November 22, 2011, 06:46
Default
  #15
Member
 
Naimah
Join Date: Nov 2011
Posts: 58
Rep Power: 15
wanna88 is on a distinguished road
Hi,

My project is to perform CFD analysis on dissecting aneurismal aorta.

I have to create pulsatile inlet velocity and pulsatile outlet pressure waveform at inlet and outlet of the aorta respectively.

The example of pulsatile inlet velocity is as shown in the link below
http://www.google.com.my/imgres?q=Ti...Wl_WbBw&zoom=1

May I know how to define this type of graph using UDF?

Thank you so much
wanna88 is offline   Reply With Quote

Old   November 22, 2011, 08:39
Default
  #16
Senior Member
 
Amir's Avatar
 
Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 735
Blog Entries: 1
Rep Power: 23
Amir is on a distinguished road
Quote:
Originally Posted by wanna88 View Post
Hi,

My project is to perform CFD analysis on dissecting aneurismal aorta.

I have to create pulsatile inlet velocity and pulsatile outlet pressure waveform at inlet and outlet of the aorta respectively.

The example of pulsatile inlet velocity is as shown in the link below
http://www.google.com.my/imgres?q=Ti...Wl_WbBw&zoom=1

May I know how to define this type of graph using UDF?

Thank you so much
Hi,

you have 2 choices:
1) you can prepare a file with special format which defines desires parameter at different time; it this method, you cannot specify spacial variation. (you can find further explanation in manual in setting unsteady BCs)
2) you can fit functions for different segments and write a UDF for it; this method doesn't have ant restrictions in special declaration.

Bests,
__________________
Amir
Amir is offline   Reply With Quote

Old   November 22, 2011, 21:59
Default
  #17
Member
 
Naimah
Join Date: Nov 2011
Posts: 58
Rep Power: 15
wanna88 is on a distinguished road
2) you can fit functions for different segments and write a UDF for it; this method doesn't have ant restrictions in special declaration.

May I know in details what is mean by fir functions for different segments and write a UDF for it?


Thank you.

REgards,
Naimah
wanna88 is offline   Reply With Quote

Old   November 23, 2011, 05:57
Default
  #18
Senior Member
 
Amir's Avatar
 
Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 735
Blog Entries: 1
Rep Power: 23
Amir is on a distinguished road
Quote:
Originally Posted by wanna88 View Post
2) you can fit functions for different segments and write a UDF for it; this method doesn't have ant restrictions in special declaration.

May I know in details what is mean by fir functions for different segments and write a UDF for it?


Thank you.

REgards,
Naimah
In UDFs, you have to declare parameter variations via functions, so you can digitize your graph and then find a functions which fit to your discrete data; for this purpose, it's better to fit different functions for different segments for better accuracy but it's straight forward.

Bests,
__________________
Amir
Amir is offline   Reply With Quote

Old   December 5, 2011, 05:12
Default
  #19
Member
 
Naimah
Join Date: Nov 2011
Posts: 58
Rep Power: 15
wanna88 is on a distinguished road
Hi Amir,

May I know how to do post processing in FLUENT?

For example I would like to see the plotted graph (pressure/velocity) vs time.
Besides, how to get the data for cross sectional area at certain parts of geometry at certain time?

Thank you.

Regards,
Naimah
wanna88 is offline   Reply With Quote

Old   December 5, 2011, 09:53
Default
  #20
Senior Member
 
Amir's Avatar
 
Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 735
Blog Entries: 1
Rep Power: 23
Amir is on a distinguished road
Quote:
Originally Posted by wanna88 View Post
Hi Amir,

May I know how to do post processing in FLUENT?

For example I would like to see the plotted graph (pressure/velocity) vs time.
Besides, how to get the data for cross sectional area at certain parts of geometry at certain time?

Thank you.

Regards,
Naimah
Dear Naimah,

It depends, e.g. if you want to have pressure or velocity in a specified point, you can use "solve->monitor->surface ...."; if you didn't activate it before iteration, you have to write a simple journal file for this purpose.
For extracting data of cross-sections; firstly you need to generate these cross-sections in "surface->quadratic or plane" then you can export desired data to other post processors in "file->export". But if you want to export these data for successive time steps; you have to choices: 1) there is such capability in ver. 13 in "file-> export" I think. 2) you can write a journal file to do what you want during iteration.

Bests,
__________________
Amir
Amir 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 create non-uniform velocity profile in FLUENT? pankaj FLUENT 7 October 24, 2016 05:52
udf for velocity profile in a geometry having two inlets shubham208011 Fluent UDF and Scheme Programming 0 April 6, 2009 16:13
UDF velocity and temperature Raj FLUENT 3 February 1, 2009 19:29
UDF velocity profile at nodes Emad FLUENT 2 January 29, 2009 07:35


All times are GMT -4. The time now is 17:28.