flu_udf.pdf
(
9405 KB
)
Pobierz
ANSYS FLUENT UDF Manual
ANSYS, Inc.
Release 14.0
Southpointe
275 Technology Drive
Canonsburg, PA 15317
November 2011
ANSYS, Inc. is
certified to ISO
9001:2008.
ansysinfo@ansys.com
http://www.ansys.com
(T) 724-746-3304
(F) 724-514-9494
Copyright and Trademark Information
© 2011 SAS IP, Inc. All rights reserved. Unauthorized use, distribution or duplication is prohibited.
ANSYS, ANSYS Workbench, Ansoft, AUTODYN, EKM, Engineering Knowledge Manager, CFX, FLUENT, HFSS and any
and all ANSYS, Inc. brand, product, service and feature names, logos and slogans are registered trademarks or
trademarks of ANSYS, Inc. or its subsidiaries in the United States or other countries. ICEM CFD is a trademark used
by ANSYS, Inc. under license. CFX is a trademark of Sony Corporation in Japan. All other brand, product, service
and feature names or trademarks are the property of their respective owners.
Disclaimer Notice
THIS ANSYS SOFTWARE PRODUCT AND PROGRAM DOCUMENTATION INCLUDE TRADE SECRETS AND ARE CONFID-
ENTIAL AND PROPRIETARY PRODUCTS OF ANSYS, INC., ITS SUBSIDIARIES, OR LICENSORS. The software products
and documentation are furnished by ANSYS, Inc., its subsidiaries, or affiliates under a software license agreement
that contains provisions concerning non-disclosure, copying, length and nature of use, compliance with exporting
laws, warranties, disclaimers, limitations of liability, and remedies, and other provisions. The software products
and documentation may be used, disclosed, transferred, or copied only in accordance with the terms and conditions
of that software license agreement.
ANSYS, Inc. is certified to ISO 9001:2008.
U.S. Government Rights
For U.S. Government users, except as specifically granted by the ANSYS, Inc. software license agreement, the use,
duplication, or disclosure by the United States Government is subject to restrictions stated in the ANSYS, Inc.
software license agreement and FAR 12.212 (for non-DOD licenses).
Third-Party Software
See the
legal information
in the product help files for the complete Legal Notice for ANSYS proprietary software
and third-party software. If you are unable to access the Legal Notice, please contact ANSYS, Inc.
Published in the U.S.A.
Table of Contents
Using This Manual ..................................................................................................................................... xxi
1. The Contents of This Manual .............................................................................................................. xxi
2. The Contents of the FLUENT Manuals ................................................................................................ xxii
3. Typographical Conventions ............................................................................................................. xxiii
4. Mathematical Conventions .............................................................................................................. xxiii
5. Technical Support ............................................................................................................................ xxv
1. Overview of User-Defined Functions (UDFs)
.......................................................................................... 1
1.1. What is a User-Defined Function? ...................................................................................................... 1
1.2. Limitations ....................................................................................................................................... 2
1.3. Defining Your UDF Using
DEFINE
Macros ......................................................................................... 2
1.3.1. Including the
udf.h
Header File in Your Source File ................................................................ 3
1.4. Interpreting and Compiling UDFs ...................................................................................................... 4
1.4.1. Compiled UDFs ........................................................................................................................ 4
1.4.2. Interpreted UDFs ..................................................................................................................... 4
1.4.3. Differences Between Interpreted and Compiled UDFs ............................................................... 5
1.5. Hooking UDFs to Your ANSYS FLUENT Model ..................................................................................... 5
1.6. Mesh Terminology ............................................................................................................................ 6
1.7. Data Types in ANSYS FLUENT ............................................................................................................ 7
1.8. UDF Calling Sequence in the Solution Process ................................................................................... 8
1.8.1. Pressure-Based Segregated Solver ............................................................................................ 9
1.8.2. Pressure-Based Coupled Solver ................................................................................................. 9
1.8.3. Density-Based Solver ................................................................................................................ 9
1.9. Special Considerations for Multiphase UDFs .................................................................................... 12
1.9.1. Multiphase-specific Data Types ............................................................................................... 12
2.
DEFINE
Macros
..................................................................................................................................... 15
2.1. Introduction ................................................................................................................................... 15
2.2. General Purpose
DEFINE
Macros ................................................................................................... 15
2.2.1.
DEFINE_ADJUST
................................................................................................................. 16
2.2.1.1. Description ................................................................................................................... 16
2.2.1.2. Usage ............................................................................................................................ 17
2.2.1.3. Example 1 ..................................................................................................................... 17
2.2.1.4. Example 2 ..................................................................................................................... 17
2.2.1.5. Hooking an Adjust UDF to ANSYS FLUENT ...................................................................... 18
2.2.2.
DEFINE_DELTAT
................................................................................................................. 18
2.2.2.1. Description ................................................................................................................... 18
2.2.2.2. Usage ............................................................................................................................ 18
2.2.2.3. Example ........................................................................................................................ 19
2.2.2.4. Hooking an Adaptive Time Step UDF to ANSYS FLUENT .................................................. 19
2.2.3.
DEFINE_EXECUTE_AT_END
................................................................................................ 19
2.2.3.1. Description ................................................................................................................... 19
2.2.3.2. Usage ............................................................................................................................ 19
2.2.3.3. Example ........................................................................................................................ 20
2.2.3.4. Hooking an Execute-at-End UDF to ANSYS FLUENT ......................................................... 20
2.2.4.
DEFINE_EXECUTE_AT_EXIT
............................................................................................. 21
2.2.4.1. Description ................................................................................................................... 21
2.2.4.2. Usage ............................................................................................................................ 21
2.2.4.3. Hooking an Execute-at-Exit UDF to ANSYS FLUENT ......................................................... 21
2.2.5.
DEFINE_EXECUTE_FROM_GUI
........................................................................................... 21
2.2.5.1. Description ................................................................................................................... 21
2.2.5.2. Usage ............................................................................................................................ 21
Release 14.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
iii
ANSYS FLUENT UDF Manual
2.2.5.3. Example ........................................................................................................................ 22
2.2.5.4. Hooking an Execute From GUI UDF to ANSYS FLUENT ..................................................... 23
2.2.6.
DEFINE_EXECUTE_ON_LOADING
....................................................................................... 23
2.2.6.1. Description ................................................................................................................... 23
2.2.6.2. Usage ............................................................................................................................ 23
2.2.6.3. Example 1 ..................................................................................................................... 24
2.2.6.4. Example 2 ..................................................................................................................... 24
2.2.6.5. Hooking an Execute On Loading UDF to ANSYS FLUENT ................................................. 25
2.2.7.
DEFINE_EXECUTE_AFTER_CASE/DATA
............................................................................ 25
2.2.7.1. Description ................................................................................................................... 25
2.2.7.2. Usage ............................................................................................................................ 25
2.2.7.3. Example ........................................................................................................................ 26
2.2.7.4. Hooking an Execute After Reading Case and Data File UDF to ANSYS FLUENT ................. 26
2.2.8.
DEFINE_INIT
...................................................................................................................... 26
2.2.8.1. Description ................................................................................................................... 26
2.2.8.2. Usage ............................................................................................................................ 27
2.2.8.3. Example ........................................................................................................................ 27
2.2.8.4. Hooking an Initialization UDF to ANSYS FLUENT ............................................................. 28
2.2.9.
DEFINE_ON_DEMAND
........................................................................................................... 28
2.2.9.1. Description ................................................................................................................... 28
2.2.9.2. Usage ............................................................................................................................ 28
2.2.9.3. Example ........................................................................................................................ 28
2.2.9.4. Hooking an On-Demand UDF to ANSYS FLUENT ............................................................. 30
2.2.10.
DEFINE_RW_FILE
............................................................................................................. 30
2.2.10.1. Description .................................................................................................................. 30
2.2.10.2. Usage .......................................................................................................................... 30
2.2.10.3. Example ...................................................................................................................... 30
2.2.10.4. Hooking a Read/Write Case or Data File UDF to ANSYS FLUENT ..................................... 31
2.3. Model-Specific
DEFINE
Macros ...................................................................................................... 31
2.3.1.
DEFINE_CHEM_STEP
........................................................................................................... 37
2.3.1.1. Description ................................................................................................................... 37
2.3.1.2. Usage ............................................................................................................................ 37
2.3.1.3. Example ........................................................................................................................ 38
2.3.1.4. Hooking a Chemistry Step UDF to ANSYS FLUENT .......................................................... 39
2.3.2.
DEFINE_CPHI
...................................................................................................................... 39
2.3.2.1. Description ................................................................................................................... 39
2.3.2.2. Usage ............................................................................................................................ 39
2.3.2.3. Hooking a Mixing Constant UDF to ANSYS FLUENT ......................................................... 39
2.3.3.
DEFINE_DIFFUSIVITY
...................................................................................................... 40
2.3.3.1. Description ................................................................................................................... 40
2.3.3.2. Usage ............................................................................................................................ 40
2.3.3.3. Example ........................................................................................................................ 40
2.3.3.4. Hooking a Diffusivity UDF to ANSYS FLUENT .................................................................. 41
2.3.4.
DEFINE_DOM_DIFFUSE_REFLECTIVITY
.......................................................................... 41
2.3.4.1. Description ................................................................................................................... 41
2.3.4.2. Usage ............................................................................................................................ 41
2.3.4.3. Example ........................................................................................................................ 42
2.3.4.4. Hooking a Discrete Ordinates Model (DOM) Diffuse Reflectivity UDF to ANSYS FLU-
ENT .......................................................................................................................................... 42
2.3.5.
DEFINE_DOM_SOURCE
........................................................................................................ 42
2.3.5.1. Description ................................................................................................................... 42
2.3.5.2. Usage ............................................................................................................................ 43
Release 14.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
iv
ANSYS FLUENT UDF Manual
2.3.5.3. Example ........................................................................................................................ 43
2.3.5.4. Hooking a DOM Source UDF to ANSYS FLUENT ............................................................... 43
2.3.6.
DEFINE_DOM_SPECULAR_REFLECTIVITY
....................................................................... 44
2.3.6.1. Description ................................................................................................................... 44
2.3.6.2. Usage ............................................................................................................................ 44
2.3.6.3. Example ........................................................................................................................ 45
2.3.6.4. Hooking a Discrete Ordinates Model (DOM) Specular Reflectivity UDF to ANSYS FLU-
ENT .......................................................................................................................................... 45
2.3.7.
DEFINE_ECFM_SPARK_SOURCE
......................................................................................... 45
2.3.7.1. Description ................................................................................................................... 45
2.3.7.2. Usage ............................................................................................................................ 45
2.3.7.3. Example ........................................................................................................................ 46
2.3.7.4. Hooking an ECFM Spark Source UDF to ANSYS FLUENT .................................................. 47
2.3.8.
DEFINE_EMISSIVITY_WEIGHTING_FACTOR
................................................................... 47
2.3.8.1. Description ................................................................................................................... 47
2.3.8.2. Usage ............................................................................................................................ 47
2.3.8.3. Example ........................................................................................................................ 47
2.3.8.4. Hooking an Emissivity Weighting Factor UDF to ANSYS FLUENT ...................................... 48
2.3.9.
DEFINE_ZONE_MOTION
...................................................................................................... 48
2.3.9.1. Description ................................................................................................................... 48
2.3.9.2. Usage ............................................................................................................................ 48
2.3.9.3. Example ........................................................................................................................ 49
2.3.9.4. Hooking a Frame Motion UDF to ANSYS FLUENT ............................................................ 49
2.3.10.
DEFINE_GRAY_BAND_ABS_COEFF
................................................................................... 49
2.3.10.1. Description .................................................................................................................. 49
2.3.10.2. Usage .......................................................................................................................... 50
2.3.10.3. Example ...................................................................................................................... 50
2.3.10.4. Hooking a Gray Band Coefficient UDF to ANSYS FLUENT ............................................... 50
2.3.11.
DEFINE_HEAT_FLUX
......................................................................................................... 51
2.3.11.1. Description .................................................................................................................. 51
2.3.11.2. Usage .......................................................................................................................... 51
2.3.11.3. Example ...................................................................................................................... 52
2.3.11.4. Hooking a Heat Flux UDF to ANSYS FLUENT .................................................................. 52
2.3.12.
DEFINE_IGNITE_SOURCE
................................................................................................ 52
2.3.12.1. Description .................................................................................................................. 52
2.3.12.2. Usage .......................................................................................................................... 52
2.3.12.3. Example ...................................................................................................................... 53
2.3.12.4. Hooking an Ignition Source UDF to ANSYS FLUENT ....................................................... 54
2.3.13.
DEFINE_NET_REACTION_RATE
....................................................................................... 54
2.3.13.1. Description .................................................................................................................. 54
2.3.13.2. Usage .......................................................................................................................... 55
2.3.13.3. Example ...................................................................................................................... 56
2.3.13.4. Hooking a Net Reaction Rate UDF to ANSYS FLUENT ..................................................... 56
2.3.14.
DEFINE_NOX_RATE
........................................................................................................... 56
2.3.14.1. Description .................................................................................................................. 56
2.3.14.2. Usage .......................................................................................................................... 57
2.3.14.3. Example 1 ................................................................................................................... 58
2.3.14.4. Example 2 ................................................................................................................... 59
2.3.14.5. Hooking a NOx Rate UDF to ANSYS FLUENT .................................................................. 60
2.3.15.
DEFINE_PDF_TABLE
......................................................................................................... 60
2.3.15.1. Description .................................................................................................................. 60
2.3.15.2. Usage .......................................................................................................................... 61
Release 14.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
v
Plik z chomika:
jarhal
Inne pliki z tego folderu:
adyn_composite.pdf
(1883 KB)
adyn_paratutorial.pdf
(3390 KB)
adyn_usrsub.pdf
(1672 KB)
cfd_post.pdf
(6567 KB)
cfd_posttutr.pdf
(1734 KB)
Inne foldery tego chomika:
Zgłoś jeśli
naruszono regulamin