# UDF to input initial value of velocity throughout the domain.

 Register Blogs Members List Search Today's Posts Mark Forums Read

 March 1, 2013, 06:53 UDF to input initial value of velocity throughout the domain. #1 New Member   Delhi Join Date: Mar 2013 Posts: 2 Rep Power: 0 I have to model a lid driven cavity flow where there is initial value of velocity throughout the domain given by some function. I know how to write UDF for defining boundary condition of velocity, but I am completely clueless as to how write UDF to define initial velocity profile throughout the domain.

 March 2, 2013, 05:12 #2 Senior Member   SSL Join Date: Oct 2012 Posts: 227 Rep Power: 5 You can use "DEFINE_INIT".

 March 2, 2013, 06:01 #3 New Member   Delhi Join Date: Mar 2013 Posts: 2 Rep Power: 0 thank you for your reply.. I have one question as after hooking, when is the "DEFINE_INIT" called... Do I have to do standard initialization which I generally do as x vel =0 , y vel = 0 etc and as the solver runs it will then call my UDF to initialize. or I do not have to do the standard/hybrid initialization rather click on something else to initialize the flow using my UDF.

 March 2, 2013, 06:19 #4 Senior Member   SSL Join Date: Oct 2012 Posts: 227 Rep Power: 5 Don't worry about it. DEFINE_INIT is on the top of manual initialization and the UDF is preferable to manual initialization.

 October 17, 2013, 13:01 UDF interpretation #5 New Member   Sagar Join Date: Oct 2013 Posts: 1 Rep Power: 0 Hi guys, I'm in a spot of bother here. I am trying to do my term project using fluent and I have to simulate the Taylor-Green vortex for Re = 100, with periodic boundary conditions in a cell of unit dimensions (1m x 1m). I want to define the initial velocity of the vortex U = -cos(2*pi*x)sin(2*pi*y) V = sin(2*pi*x)cos(2*pi*y) P = -(cos(4*pi*x) + cos(4*pi*y))/4 I want to enter a .cpp code in the form of a user defined function but I don't know exactly how to do that (I am not aware about the exact syntax to be used). Can anyone please guide me in creating such a code (in a simple way)? Also guide me to feed this program into fluent so that it gets "interpreted" properly. Thanking you in advance.

 October 20, 2013, 17:27 UDF help #6 New Member   Mohammad Join Date: Jun 2013 Posts: 12 Rep Power: 4 Hello msaeedsadeghi Could you please help me? I did a simulation of a geometry same as shown in the following movie: https://www.youtube.com/watch?v=e7kiLTy1URU I tried to do the motion same as in the movie, but I couldn't. After I searched in the internet, I noticed that I have to use a UDF to do the motion same as shown in the movie. Please, do you have a tutorial showing how to write a UDF file? I hope you can help me. My email is: mas20001920@yahoo.com Regards..

October 22, 2013, 14:04
Define INIT
#7
New Member

A
Join Date: Nov 2012
Location: France
Posts: 7
Rep Power: 4
Quote:
 Originally Posted by msaeedsadeghi Don't worry about it. DEFINE_INIT is on the top of manual initialization and the UDF is preferable to manual initialization.
Thanks for your input. Nevertheless, I have some doubts regarding DEFINE_INIT's preference and working.

A UDF (with DEFINE_INIT) allows initilisation of a sub domain's thread VOF value. This is seen in display-contour-vof. Next, when a calculation is run with this value, even for a single time step, the value of VOF reverts back to its default value in the solution initialisation box. Am I missing something somewhere?

What I am trying to do is, in a way an external patch using a UDF.. which seems to fail..when compared to a simple internal patch provided by Fluent.
Best,
A.B.

 Tags fluent, fluent - udf, udf

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post immortality OpenFOAM Running, Solving & CFD 2 January 25, 2013 11:21 Heroic OpenFOAM Running, Solving & CFD 26 December 17, 2012 04:34 bookie56 OpenFOAM Installation 8 August 13, 2011 04:03 vaina74 OpenFOAM Running, Solving & CFD 3 June 8, 2010 12:30 sunnysun OpenFOAM Running, Solving & CFD 5 March 16, 2009 04:32

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