CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (http://www.cfd-online.com/Forums/fluent-udf/)
-   -   UDF to input initial value of velocity throughout the domain. (http://www.cfd-online.com/Forums/fluent-udf/113938-udf-input-initial-value-velocity-throughout-domain.html)

sn2ou7 March 1, 2013 06:53

UDF to input initial value of velocity throughout the domain.
 
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.

msaeedsadeghi March 2, 2013 05:12

You can use "DEFINE_INIT".

sn2ou7 March 2, 2013 06:01

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.

msaeedsadeghi March 2, 2013 06:19

Don't worry about it. DEFINE_INIT is on the top of manual initialization and the UDF is preferable to manual initialization.

sagarkhushalraozade October 17, 2013 13:01

UDF interpretation
 
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.

Mohammad80 October 20, 2013 17:27

UDF help
 
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..

bansa9643 October 22, 2013 14:04

Define INIT
 
Quote:

Originally Posted by msaeedsadeghi (Post 410998)
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.
Any ideas? Thanks in advance!
Best,
A.B.


All times are GMT -4. The time now is 23:00.