Download FLUENT 6.3 UDF Manual
Transcript
DEFINE Macros
ρ∆V n ρ∆V n−1
φ +
φ
∆t }
| {z
| ∆t{z
}
= −
apu
(2.7-3)
su
Equation 2.7-3 shows how su and apu are defined. Note that if more than one scalar is
being solved, a conditional if statement can be used in your UDF to define a different
unsteady term for each i. i = 0 is associated with scalar-0 (the first scalar equation
being solved).
Example
The following UDF, named my uds unsteady, modifies user-defined scalar time derivatives
using
DEFINE UDS UNSTEADY. The source code can be interpreted or compiled in FLUENT.
/***********************************************************************
UDF for specifying user-defined scalar time derivatives
************************************************************************/
#include "udf.h"
DEFINE_UDS_UNSTEADY(my_uds_unsteady,c,t,i,apu,su)
{
real physical_dt, vol, rho, phi_old;
physical_dt = RP_Get_Real("physical-time-step");
vol = C_VOLUME(c,t);
rho = C_R_M1(c,t);
*apu = -rho*vol / physical_dt;/*implicit part*/
phi_old = C_STORAGE_R(c,t,SV_UDSI_M1(i));
*su = rho*vol*phi_old/physical_dt;/*explicit part*/
}
Hooking a UDS Unsteady Function to FLUENT
After the UDF that you have defined using DEFINE UDS UNSTEADY is interpreted (Chapter 4: Interpreting UDFs) or compiled (Chapter 5: Compiling UDFs), the name of the
argument that you supplied as the first DEFINE macro argument (e.g., my uds unsteady)
will become visible and selectable in the User-Defined Scalars panel in FLUENT. See Section 6.6.3: Hooking DEFINE UDS UNSTEADY UDFs for details.
2-220
c Fluent Inc. September 11, 2006
Related documents
ANSYS FLUENT 12.0 UDF Manual
Vodafone SS 08 User's Manual
med-pc® iv programmer`s manual
MpCCI 4.2.0-1Documentation
VU-AMS 5fs short user manual
User Manual Mobile Clinical Assistant (MCA)
User`s Manual
SR61 Cordless Scanner User`s Manual
Total Cholesterol Assay Kit (Fluorometric)
SF51 Cordless Scanner User`s Guide
User`s Manual
BioSim2 User`s Manual