CFD Online Discussion Forums

CFD Online Discussion Forums (
-   FLUENT (

Taner April 14, 2002 11:45

Dear Madam, Sir ;

I need to find the name of the TIME variable that is used in the original C code of Fluent for unsteady coupled explicit solver.I 'll use it to write my own UDF which computes a time dependent inlet boundary velocity.I have to save the time values ,so that variable is critical. I've examined the udf tutorials and lots of messages in this group but couldn't find it. I'll be happy if anybody informs me about this subject. I'm looking forward to your messages, because the deadline for the project is on the first week of May. Thanks...


Johnix April 14, 2002 21:14

This is an example in Fluent user's guide ...
<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.0 Transitional//EN' >

<html> <head>

<title>My Web Site Title</title> </head> <meta name="Description" content="A Short but sharp description of website or web page for search engines"> <meta name="Keywords" content="A list of keywords users may type in a search engine to find website or page"> <meta name="Generator" content="WebSoftware HotHTML 2001 Professional Edition"> <body bgcolor="#FFFFFF" text="#000000" link="#804040" vlink="#008080" alink="#004080">

Hi, The following is a sample code:

The C function (sinusoidal-v.c) that will be used to compute this velocity is shown below.

#include "udf.h"

DEFINE_PROFILE(inlet_xv_sinusoidal, thread, nv)

{ face_t f;
<font color="#FF0000">
real flow_time = RP_Get_Real("flow-time"); /*!!! Maybe this is what you want ... */
</font>begin_f_loop (f,thread)

F_PROFILE(f,thread,nv) = 20. + 5.*sin(10.*flow_time);

} end_f_loop (f,thread) }

The function that is defined is named inlet_xv_sinusoidal. A floating point variable is created for the time, flow_time.

Before you can compile this UDF, you must specify an unsteady flow calculation.

<font color="#0000FF">
Good Luck!

</body> </html>

Taner April 15, 2002 05:19

Re: This is an example in Fluent user's guide ...
Hi Johnix! Thank you for your interest, but I want to save the time values for Coupled Explicit solver. I've examined the tutorials before and tried to save them using "flow-time" variable but it didn't work out.I think that is something different for Coupled solver. Sincerely...

Taner BALKAN Istanbul

Johnix April 15, 2002 09:16

Re: This is an example in Fluent user's guide ...
Hi, Taner

In my opinion, whether the time value is savable doesn't depend on what solver(ex/im) you choose.

o you have to choose "Unsteady solver"

o In Iterate dialogbox, set "Time step size", "Number of time step" and "Max Iterations per time step" correctly ...

I tyied, and it worked well, suppose I have understood your question...

Taner April 16, 2002 04:58

Re: This is an example in Fluent user's guide ...
Dear Johnix ! In some udf tutorials time variable is written as "flow_time". After I have examined your first message again, I became aware of where the problem is. "flow-time" is the right usage :) Thank you for your interest again...

Sincerely Taner

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