[ANSYS, Inc. Logo] return to home search
next up previous contents index

2.2.2 DEFINE_DELTAT



Description


DEFINE_DELTAT is a general-purpose macro that you can use to control the size of the time step during the solution of a transient problem. Note that this macro can be used only if Adaptive is selected from the Time Stepping Method drop-down list in the Run Calculation task page in ANSYS FLUENT.



Usage



DEFINE_DELTAT( name, d)


Argument Type Description
symbol name UDF name.
Domain *d Pointer to domain over which the time stepping control
  function is to be applied. The domain argument provides access
  to all cell and face threads in the mesh. For multiphase flows,
  the pointer that is passed to the function by the solver is the
  mixture-level domain.
   
Function returns  
real  
   

There are two arguments to DEFINE_DELTAT: name and domain. You supply name, the name of the UDF. domain is passed by the ANSYS FLUENT solver to your UDF. Your UDF will need to compute the real value of the physical time step and return it to the solver.



Example


The following UDF, named mydeltat, is a simple function that shows how you can use DEFINE_DELTAT to change the value of the time step in a simulation. First, CURRENT_TIME is used to get the value of the current simulation time (which is assigned to the variable flow_time). Then, for the first 0.5 seconds of the calculation, a time step of 0.1 is set. A time step of 0.2 is set for the remainder of the simulation. The time step variable is then returned to the solver. See Section  3.5 for details on CURRENT_TIME.

/*********************************************************************
   UDF that changes the time step value for a time-dependent solution
**********************************************************************/
#include "udf.h"

DEFINE_DELTAT(mydeltat,d)
{
   real time_step;
   real flow_time = CURRENT_TIME;
   if (flow_time < 0.5)
      time_step = 0.1;
   else
      time_step = 0.2;
   return time_step;
}



Hooking an Adaptive Time Step UDF to ANSYS FLUENT


After the UDF that you have defined using DEFINE_DELTAT is interpreted (Chapter  4) or compiled (Chapter  5), the name of the argument that you supplied as the first DEFINE macro argument (e.g,. mydeltat) will become visible and selectable in the Adaptive Time Step Settings dialog box in ANSYS FLUENT. See Section  6.1.2 for details.


next up previous contents index Previous: 2.2.1 DEFINE_ADJUST
Up: 2.2 General Purpose DEFINE
Next: 2.2.3 DEFINE_EXECUTE_AT_END
Release 12.0 © ANSYS, Inc. 2009-01-14