Udf (Custumize Fluent)

Only available on StudyMode
  • Download(s) : 149
  • Published : June 1, 2013
Open Document
Text Preview
FLUENT 6.2

UDF Manual

January 2005

Copyright c 2005 by Fluent Inc. All rights reserved. No part of this document may be reproduced or otherwise used in any form without express written permission from Fluent Inc.

Airpak, FIDAP, FLUENT, FloWizard, GAMBIT, Icemax, Icepak, Icepro, MixSim, and POLYFLOW are registered trademarks of Fluent Inc. All other products or name brands are trademarks of their respective holders. CHEMKIN is a registered trademark of Reaction Design Inc. Portions of this program include material copyrighted by PathScale Corporation 2003-2004.

Fluent Inc. Centerra Resource Park 10 Cavendish Court Lebanon, NH 03766

About This Document
User-defined functions (UDFs) allow you to customize FLUENT and can significantly enhance its capabilities. This UDF Manual presents detailed information on how to write, compile, and use UDFs in FLUENT. Examples have also been included, where available. Information in this manual is presented in the following chapters: • Chapter 1: Overview • Chapter 2: C Programming Basics for UDFs • Chapter 3: A Step-by-Step UDF Example • Chapter 4: Defining a UDF Using a DEFINE Macro • Chapter 5: Macros for Accessing FLUENT Solver Variables • Chapter 6: UDF Utilities • Chapter 7: Interpreting UDF Source Files • Chapter 8: Compiling UDF Source Files • Chapter 9: Hooking Your UDF to FLUENT • Chapter 10: Parallel UDF Usage • Chapter 11: User-Defined Scalar (UDS) Transport Modeling • Chapter 12: Sample Problems This document provides some basic information about the C programming language as it relates to UDFs in FLUENT and assumes that you have some programming experience with C. If you are unfamiliar with C, please consult a C language reference (e.g., [2]) for basic information. This document does not imply responsibility on the part of Fluent Inc. for the accuracy or stability of solutions obtained using UDFs that are either user-generated or provided by Fluent Inc. Support for current license holders will be limited to guidance related to communication between a UDF and the FLUENT solver. Other aspects of the UDF development process that include conceptual function design, implementation (writing C code), compilation and debugging of C source code, execution of the UDF, and function design verification will remain the responsibility of the UDF author.

c Fluent Inc. January 11, 2005

i

About This Document

ii

c Fluent Inc. January 11, 2005

Contents

1 Overview 1.1 1.2 1.3 1.4 1.5 What is a User-Defined Function (UDF)? . . . . . . . . . . . . . . . . . Why Use UDFs? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Writing UDFs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Defining Your UDF Using DEFINE Macros . . . . . . . . . . . . . . . . . 1.5.1 1.6 Including the udf.h Header File in Your Source File . . . . . . .

1-1 1-1 1-3 1-3 1-4 1-4 1-5 1-6 1-7 1-8 1-8

Interpreting or Compiling UDFs . . . . . . . . . . . . . . . . . . . . . . 1.6.1 Differences Between Interpreted and Compiled UDFs . . . . . . .

1.7 1.8 1.9

Hooking UDFs to Your FLUENT Model . . . . . . . . . . . . . . . . . . Grid Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Data Types in FLUENT . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-10

1.10 Calling Sequence of a UDF in the FLUENT Solution Process . . . . . . . 1-12 1.11 Special Considerations for Multiphase UDFs . . . . . . . . . . . . . . . . 1-15 1.11.1 Multiphase-specific Data Types . . . . . . . . . . . . . . . . . . . 1-15 2-1 2-1 2-2 2-2 2-3 2-3 2-4 2-5 2-7

2 C Programming Basics for UDFs 2.1 2.2 2.3 2.4 2.5 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Commenting Your C Code . . . . . . . . . . . . . . . . . . . . . . . . . . C Data Types in FLUENT . . . . . . . . . . . . . . . . . . . . . . . . . . Constants . . . . . . . . . . . ....
tracking img