Fluentchpter

download Fluentchpter

of 84

Transcript of Fluentchpter

  • 8/12/2019 Fluentchpter

    1/84

    Chapter 6. Hooking UDFs toFLUENT

    Once you have interpreted or compiled your UDF using the methods described in Chap-ters4and5, respectively, you are ready to hook the function to FLUENTusing a graphicinterface panel. Once hooked, the function will be utilized in your FLUENT model. De-tails about hooking a UDF to FLUENTcan be found in the following sections. Note thatthese sections relate to corresponding sections in Chapter2: DEFINE Macros.

    Section6.1:Hooking General Purpose UDFs

    Section6.2:Hooking Model-Specific UDFs

    Section6.3:Hooking Multiphase UDFs

    Section6.4:Hooking Discrete Phase Model (DPM) UDFs

    Section6.5:Hooking Dynamic Mesh UDFs

    Section6.6:Hooking User-Defined Scalar (UDS) Transport Equation UDFs

    Section6.7:Common Errors While Hooking a UDF to FLUENT

    6.1 Hooking General Purpose UDFs

    This section contains methods for hooking general purpose UDFs to FLUENT. Gen-eral purpose UDFs are those that have been defined using macros described in Sec-tion2.2:General Purpose DEFINE Macrosand then interpreted or compiled and loadedusing methods described in Chapters4 or 5, respectively.

    c Fluent Inc. September 11, 2006 6-1

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Fluentchpter

    2/84

    Hooking UDFs toFLUENT

    6.1.1 HookingDEFINE ADJUSTUDFs

    Once you interpreted (Chapter4:Interpreting UDFs) or compiled (Chapter5:CompilingUDFs) your DEFINE ADJUST UDF, the name of the function you supplied as a DEFINEmacro argument will become visible and selectable in the User-Defined Function Hookspanel (Figure6.1.1). Note that you can hook multiple adjust UDFs to your model, if

    desired.

    Define User-DefinedFunction Hooks...

    Figure 6.1.1: The User-Defined Function Hooks Panel

    6-2 c Fluent Inc. September 11, 2006

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Fluentchpter

    3/84

    6.1 Hooking General Purpose UDFs

    Click onEdit... next to Adjust to open the Adjust Functions panel (Figure6.1.2).

    Figure 6.1.2: The Adjust Functions Panel

    Select the function(s) you wish to hook to your model from theAvailable Adjust Functionslist. Click Add and then OK to close the panel. ClickOK in the User-Defined FunctionHooks panel to apply the settings. Once added, the name of the function you selectedwill be displayed in the User-Defined Function Hooks panel. If you select more than onefunction, the number will be indicated (e.g.,2 selected).

    See Section 2.2.1: DEFINE ADJUST for details about defining adjust functions using theDEFINE ADJUSTmacro.

    c Fluent Inc. September 11, 2006 6-3

    http://-/?-http://-/?-
  • 8/12/2019 Fluentchpter

    4/84

    Hooking UDFs toFLUENT

    6.1.2 HookingDEFINE DELTATUDFs

    Once you have interpreted (Chapter4:Interpreting UDFs) or compiled (Chapter5:Com-piling UDFs) your DEFINE DELTATUDF, the name of the function you supplied as aDE-FINEmacro argument will become visible and selectable in theIteratepanel (Figure6.1.3)in FLUENT.

    Solve Iterate...

    Figure 6.1.3: The IteratePanel

    To hook the UDF to FLUENT, the Unsteady time method must be chosen in the Solverpanel. You will then need to select Adaptive as the Time Stepping Method in the Iteratepanel, choose the function name (e.g.,mydeltat) in theUser-Defined Time Stepdrop-downlist under Adaptive Time Step Parameters, and click Apply.

    i Note that when you are using the VOF Multiphase Model, you will needto selectVariableas theTime Stepping Methodto hook the time step UDF.

    See Section2.2.2: DEFINE DELTAT for details about defining DEFINE DELTATfunctions.

    6-4 c Fluent Inc. September 11, 2006

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Fluentchpter

    5/84

    6.1 Hooking General Purpose UDFs

    6.1.3 HookingDEFINE EXECUTE AT ENDUDFs

    Once you interpreted (Chapter4:Interpreting UDFs) or compiled (Chapter5:CompilingUDFs) your DEFINE EXECUTE AT END UDF, it is ready to be hooked to FLUENT. Notethat you can hook multiple at-end UDFs to your model, if desired.

    Open the User-Defined Function Hooks panel. (Figure6.1.4)Define User-DefinedFunction Hooks...

    Figure 6.1.4: The User-Defined Function Hooks Panel

    c Fluent Inc. September 11, 2006 6-5

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Fluentchpter

    6/84

    Hooking UDFs toFLUENT

    Click on the Edit button next to Execute At End. This will open the Execute At EndFunctions panel (Figure6.1.5).

    Figure 6.1.5: The Execute At End FunctionsPanel

    In theExecute At End Functionspanel, from the list of available UDFs you have interpretedor compiled and loaded, select the functions you wish to hook to your model and click Addand then OK. Click OK in the User-Defined Function Hooks panel to apply the settings.The number of functions you select will then appear in the User-Defined Function Hookspanel. For example, if you select two adjust functions (e.g.,user at end1, user at end2),then the text box forExecute At Endin theUser-Defined Function Hookspanel will display

    2 selected.See Section 2.2.3: DEFINE EXECUTE AT END for details about definingDEFINE EXECUTE AT END functions.

    6-6 c Fluent Inc. September 11, 2006

    http://-/?-http://-/?-
  • 8/12/2019 Fluentchpter

    7/84

    6.1 Hooking General Purpose UDFs

    6.1.4 HookingDEFINE EXECUTE AT EXITUDFs

    Once you have interpreted (Chapter4:Interpreting UDFs) or compiled (Chapter5:Com-piling UDFs) your DEFINE EXECUTE AT EXIT UDF, it is ready to be hooked to FLUENT.Note that you can hook multiple at-exit UDFs to your model, if desired.

    Open the User-Defined Function Hooks panel. (Figure6.1.6)Define User-DefinedFunction Hooks...

    Figure 6.1.6: The User-Defined Function Hooks Panel

    Click on the Edit button next to Execute At Exit. This will open the Execute At ExitFunctions panel (Figure6.1.7).

    In theExecute At Exit Functions panel, from the list ofAvailable Execute At End Functionsthat you have interpreted or compiled and loaded, select the functions you wish to hookto your model and clickAdd and then OK. ClickOK in the User-Defined Function Hookspanel to apply the settings. The number of functions you select will then appear inthe User-Defined Function Hooks panel. For example, if you select two at-exit functions(user-at-exit1, user at exit2), then the text box for Execute At Exit in the User-Defined Function Hooks panel will display 2 selected.

    See Section 2.2.4: DEFINE EXECUTE AT EXIT for details about definingDEFINE EXECUTE AT EXIT functions.

    c Fluent Inc. September 11, 2006 6-7

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Fluentchpter

    8/84

    Hooking UDFs toFLUENT

    Figure 6.1.7: The Execute At Exit Functions Panel

    6-8 c Fluent Inc. September 11, 2006

  • 8/12/2019 Fluentchpter

    9/84

    6.1 Hooking General Purpose UDFs

    6.1.5 HookingDEFINE INITUDFs

    Once you interpreted (Chapter4:Interpreting UDFs) or compiled (Chapter5:CompilingUDFs) your DEFINE INIT UDF, it is ready to be hooked to FLUENT. Note that you canhook multiple initialization UDFs to your model, if desired.

    Open the User-Defined Function Hooks panel. (Figure6.1.8)Define User-DefinedFunction Hooks...

    Figure 6.1.8: The User-Defined Function Hooks Panel

    c Fluent Inc. September 11, 2006 6-9

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Fluentchpter

    10/84

    Hooking UDFs toFLUENT

    Click on the Edit button next to Initialization. This will open theInitialization Functionspanel (Figure6.1.9).

    Figure 6.1.9: The Initialization Functions Panel

    In theInitialization Functionspanel, from theAvailable Initialization Functionsyou have in-terpreted or compiled and loaded, select the functions you wish to hook to your model andclick Add and then OK. Click OK in the User-Defined Function Hooks panel to apply thesettings. The number of functions you select will then appear in the User-Defined Func-tion Hooks panel. For example, if you select two initialization functions (e.g.,user init1,user init2), then the text box for Initialization in the User-Defined Function Hooks panel

    will display2 selected.See Section2.2.7: DEFINE INIT for details about defining DEFINE INIT functions.

    6-10 c Fluent Inc. September 11, 2006

    http://-/?-http://-/?-
  • 8/12/2019 Fluentchpter

    11/84

    6.1 Hooking General Purpose UDFs

    6.1.6 HookingDEFINE ON DEMANDUDFs

    Once you have interpreted (Chapter4:Interpreting UDFs) or compiled (Chapter5:Com-piling UDFs) your DEFINE ON DEMAND UDF, the name of the function you supplied as aDEFINE macro argument will become visible and selectable in the Execute On Demandpanel (Figure6.1.10) in FLUENT.

    Define User-DefinedExecute On Demand...

    Figure 6.1.10: The Execute On Demand Panel

    To hook the UDF to FLUENT, choose the function name (e.g., update) in the Functiondrop-down list in theExecute On Demand panel, and clickExecute. FLUENTwill executethe UDF immediately. Click Close to close the panel.

    See Section2.2.8: DEFINE ON DEMAND for details about defining DEFINE ON DEMAND func-tions.

    c Fluent Inc. September 11, 2006 6-11

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Fluentchpter

    12/84

    Hooking UDFs toFLUENT

    6.1.7 HookingDEFINE RW FILEUDFs

    Once you have interpreted (Chapter4:Interpreting UDFs) or compiled (Chapter5:Com-piling UDFs) yourDEFINE RW FILEUDF, it is ready to be hooked to FLUENT. Note thatyou can hook multiple read/write file UDFs to your model, if desired.

    Open the User-Defined Function Hooks panel. (Figure6.1.11)Define User-DefinedFunction Hooks...

    Figure 6.1.11: The User-Defined Function Hooks Panel

    You have the choice of hooking a UDF to read and write a case and data file. Below isa description of what each function does.

    Read Case is called when you read a case file into FLUENT. It will specify thecustomized section that is to be read from the case file.

    Write Case is called when you write a case file from FLUENT. It will specify thecustomized section that is to be written to the case file.

    Read Data is called when you read a data file into FLUENT. It will specify the

    customized section that is to be read from the data file.

    Write Data is called when you write a data file from FLUENT. It will specify thecustomized section that is to be written to the data file.

    6-12 c Fluent Inc. September 11, 2006

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Fluentchpter

    13/84

    6.1 Hooking General Purpose UDFs

    To hook a read case file UDF, for example, click on the Edit button next to Read Case.This will open the Read Case Functions panel (Figure6.1.12).

    Figure 6.1.12: The Read Case Functions Panel

    In theRead Case Functionspanel, from theAvailable Read Case Functions you have inter-preted or compiled and loaded, select the functions you wish to hook to your model andclick Add and then OK. Click OK in the User-Defined Function Hooks panel to apply thesettings. The number of functions you select will then appear in the User-Defined Func-tion Hooks panel. For example, if you select two functions (e.g.,user read1, user read2),then the text box for Read Case in the User-Defined Function Hooks panel will display 2

    selected.See Section2.2.9: DEFINE RW FILE for details about defining DEFINE RW FILE functions.

    c Fluent Inc. September 11, 2006 6-13

    http://-/?-http://-/?-
  • 8/12/2019 Fluentchpter

    14/84

    Hooking UDFs toFLUENT

    6.1.8 User-Defined Memory Storage

    You can store values computed by your UDF in memory so that they can be retrievedlater, either by a UDF or for postprocessing within FLUENT. In order to have access tothis memory, you will need to allocate memory by spcifying the Number of User-DefinedMemory Locations in the User-Defined Memory panel (Figure6.1.13).

    Define User-DefinedMemory...

    Figure 6.1.13: The User-Defined Memory Panel

    The macrosC UDMIor F UDMIcan be used in your UDF to access a particular user-definedmemory location in a cell or face, respectively. See Sections3.2.3and3.2.4for details.

    Field values that have been stored in user-defined memory will be saved to the data filewhen you next write one. These fields will also appear in the User Defined Memory...category in the drop-down lists inFLUENTs postprocessing panels. They will be namedUser Memory 0, User Memory 1, etc., based on the memory location index. The totalnumber of memory locations is limited to 500. For large numbers of user-defined memorylocations, system memory requirements will increase.

    6.2 Hooking Model-Specific UDFs

    This section contains methods for hooking model-specific UDFs to FLUENT that havebeen defined using DEFINE macros found in Section2.3:Model-Specific DEFINE Macros,and interpreted or compiled using methods described in Chapters 4 or 5, respectively.

    6-14 c Fluent Inc. September 11, 2006

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Fluentchpter

    15/84

    6.2 Hooking Model-Specific UDFs

    6.2.1 HookingDEFINE CHEM STEPUDFs

    Once you have interpreted (Chapter4:Interpreting UDFs) or compiled (Chapter5:Com-piling UDFs) your DEFINE CHEM STEP UDF, the name of the function you supplied as aDEFINEmacro argument will become visible and selectable in the User-Defined FunctionHooks panel (Figure6.2.1) inFLUENT.

    Define User-DefinedFunction Hooks...

    Figure 6.2.1: The User-Defined Function Hooks Panel

    i EDC or PDF Transport models must be enabled to hook chemistry stepUDFs.

    To hook the UDF to FLUENT, choose the function name (e.g., user chem step) in the

    Chemistry Step drop-down list in the User-Defined Function Hooks panel, and clickOK.See Section2.3.1: DEFINE CHEM STEP for details about defining DEFINE CHEM STEP func-tions.

    c Fluent Inc. September 11, 2006 6-15

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Fluentchpter

    16/84

    Hooking UDFs toFLUENT

    6.2.2 HookingDEFINE CPHIUDFs

    Once you have interpreted (Chapter4:Interpreting UDFs) or compiled (Chapter5:Com-piling UDFs) yourDEFINE CPHIUDF, the name of the function you supplied as a DEFINEmacro argument will become visible and selectable in the User-Defined Function Hookspanel (Figure6.2.2) in FLUENT.

    Define User-DefinedFunction Hooks...

    Figure 6.2.2: The User-Defined Function Hooks Panel

    i EDC or PDF Transport models must be enabled to hook the mixing modelconstant Cphi UDFs.

    In the User-Defined Function Hooks panel, hook the UDF to FLUENT by choosing the

    function name (e.g., user cphi) from the drop down list for Mixing Model Constant(Cphi), and clickOK.

    See Section2.3.2: DEFINE CPHI for details about defining DEFINE CPHI functions.

    6-16 c Fluent Inc. September 11, 2006

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Fluentchpter

    17/84

    6.2 Hooking Model-Specific UDFs

    6.2.3 HookingDEFINE DIFFUSIVITYUDFs

    Once you have interpreted (Chapter4:Interpreting UDFs) or compiled (Chapter5:Com-piling UDFs) your DEFINE DIFFUSIVITY UDF, the name of the function you supplied asa DEFINE macro argument (e.g., mean diff age) will become visible and selectable inFLUENT. To hook the UDF to FLUENT, you will first need to open the Materials panel.

    Define Materials...

    1. To hook a mass diffusivity UDF for the species tranpsort equations, choose user-defined from the drop-down list for Mass Diffusivity (Figure6.2.3).

    Figure 6.2.3: The Materials Panel

    If you have previously interpreted or compiled a DEFINE DIFFUSIVITY UDF, thentheUser-Defined Functionspanel will open allowing you to hook your UDF to FLU-ENT. Othewise, you will get an error.

    c Fluent Inc. September 11, 2006 6-17

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Fluentchpter

    18/84

    Hooking UDFs toFLUENT

    2. You have two options available for hooking diffusion coefficient UDFs to UDS equa-tions. You can either specify a UDF on a per-UDS basis, or you can hook a singlediffusivity UDF that will apply to all scalar equations.

    In the Materials panel, choose either defined-per-uds or user-defined from the drop-down list for UDS Diffusivity (Figure6.2.4) and select the desired UDF.

    Figure 6.2.4: The Materials Panel

    See Section2.3.3: DEFINE DIFFUSIVITY for details about defining DEFINE DIFFUSIVITY

    UDFs and the Users Guide for general information about UDS diffusivity.

    6-18 c Fluent Inc. September 11, 2006

    http://-/?-http://-/?-
  • 8/12/2019 Fluentchpter

    19/84

    6.2 Hooking Model-Specific UDFs

    6.2.4 HookingDEFINE DOM DIFFUSE REFLECTIVITYUDFs

    Once you have interpreted (Chapter4:Interpreting UDFs) or compiled (Chapter5:Com-piling UDFs) your DEFINE DOM DIFFUSE REFLECTIVITY UDF, the name of the functionyou supplied as a DEFINE macro argument will become visible and selectable in theUser-Defined Function Hooks panel (Figure6.2.5) in FLUENT.

    Define User-DefinedFunction Hooks...

    Figure 6.2.5: The User-Defined Function Hooks Panel

    i The Discrete Ordinates radiation model must be enabled from theRadiationModelpanel.

    To hook the UDF to FLUENT, choose the function name (e.g., user dom diff refl) in

    the DO Diffuse Reflectivity drop-down list in the User-Defined Function Hooks panel, andclickOK.

    See Section 2.3.4: DEFINE DOM DIFFUSE REFLECTIVITY for details aboutDEFINE DOM DIFFUSE REFLECTIVITY functions.

    c Fluent Inc. September 11, 2006 6-19

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Fluentchpter

    20/84

    Hooking UDFs toFLUENT

    6.2.5 HookingDEFINE DOM SOURCEUDFs

    Once you have interpreted (Chapter4:Interpreting UDFs) or compiled (Chapter5:Com-piling UDFs) your DEFINE DOM SOURCE UDF, compiled your DEFINE DOM SOURCE UDF(see Chapter5: Compiling UDFs), the name of the function you supplied as a DEFINEmacro argument will become visible and selectable in the User-Defined Function Hooks

    panel (Figure6.2.6) in FLUENT.

    i The Discrete Ordinates radiation model must be enabled.

    Define User-DefinedFunction Hooks...

    Figure 6.2.6: The User-Defined Function Hooks Panel

    To hook the UDF to FLUENT, choose the function name (e.g., user dom source) in theDO Source drop-down list in the User-Defined Function Hooks panel, and clickOK.

    See Section2.3.5: DEFINE DOM SOURCE for details about DEFINE DOM SOURCE functions.

    6-20 c Fluent Inc. September 11, 2006

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Fluentchpter

    21/84

    6.2 Hooking Model-Specific UDFs

    6.2.6 HookingDEFINE DOM SPECULAR REFLECTIVITYUDFs

    Once you have interpreted (Chapter4:Interpreting UDFs) or compiled (Chapter5:Com-piling UDFs) your DEFINE DOM SPECULAR REFLECTIVITY UDF, the name of the functionyou supplied as a DEFINE macro argument will become visible and selectable in theUser-Defined Function Hooks panel (Figure6.2.7) in FLUENT.

    Define User-DefinedFunction Hooks...

    Figure 6.2.7: The User-Defined Function Hooks Panel

    i The Discrete Ordinates radiation model must be enabled from theRadiationModelpanel.

    To hook the UDF to FLUENT, choose the function name (e.g., user dom spec refl) in

    theDO Specular Reflectivitydrop-down list in theUser-Defined Function Hookspanel, andclickOK.

    See Section 2.3.4: DEFINE DOM DIFFUSE REFLECTIVITY for details aboutDEFINE DOM SPECULAR REFLECTIVITY functions.

    c Fluent Inc. September 11, 2006 6-21

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Fluentchpter

    22/84

    Hooking UDFs toFLUENT

    6.2.7 Hooking DEFINE GRAY BAND ABS COEFFUDFs

    Once you have interpreted (Chapter4:Interpreting UDFs) or compiled (Chapter5:Com-piling UDFs) your DEFINE GRAY BAND ABS COEFF UDF, the name of the function yousupplied as aDEFINEmacro argument will become visible and selectable in the Materialspanel (shown below) in FLUENT.

    Define Materials...

    Figure 6.2.8: The Materials Panel

    To hook the UDF toFLUENT, first select user-defined-gray-bandfrom theAbsorption Co-efficientdrop-down list in theMaterialspanel. (This will open the User-Defined Functionspanel.) Then choose the name of the function (e.g., gb abs coeff) from the list of choicesin the panel, and click OK.

    See Section 2.3.7: DEFINE GRAY BAND ABS COEFF for details aboutDEFINE GRAY BAND ABS COEFF functions.

    6-22 c Fluent Inc. September 11, 2006

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Fluentchpter

    23/84

    6.2 Hooking Model-Specific UDFs

    6.2.8 HookingDEFINE HEAT FLUXUDFs

    Once you have interpreted (Chapter4:Interpreting UDFs) or compiled (Chapter5:Com-piling UDFs) your DEFINE HEAT FLUX UDF, the name of the function you supplied as aDEFINEmacro argument will become visible and selectable in the User-Defined FunctionHooks panel (Figure6.2.9) inFLUENT.

    Define User-DefinedFunction Hooks...

    Figure 6.2.9: The User-Defined Function Hooks Panel

    i TheEnergy Equation must be enabled.

    To hook the UDF to FLUENT, simply choose the function name (e.g., user heat flux)in the Wall Heat Fluxdrop-down list in theUser-Defined Function Hooks panel, and clickOK.

    See Section2.3.8: DEFINE HEAT FLUX for details about DEFINE HEAT FLUX functions.

    c Fluent Inc. September 11, 2006 6-23

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Fluentchpter

    24/84

    Hooking UDFs toFLUENT

    6.2.9 HookingDEFINE NET REACTION RATEUDFs

    Once you have interpreted (Chapter4:Interpreting UDFs) or compiled (Chapter5:Com-piling UDFs) your DEFINE NET REACTION RATE UDF, the name of the function you sup-plied as aDEFINEmacro argument will become visible and selectable in the User-DefinedFunction Hooks panel (Figure6.2.10) in FLUENT.

    Define User-DefinedFunction Hooks...

    Figure 6.2.10: The User-Defined Function Hooks Panel

    6-24 c Fluent Inc. September 11, 2006

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Fluentchpter

    25/84

    6.2 Hooking Model-Specific UDFs

    i Net reaction rate UDFs may be used for the EDC and PDF Transportmodels, as well as for the surface chemistry model. To enable the PDFTransport models, select Composition PDF Transport and Volumetric reac-tions in theSpecies Modelpanel. To enable the EDC model, select SpeciesTransportand Volumetricreactions in the Species Model panel, and choose

    EDCunder Turbulence-Chemistry Interaction.

    To hook the UDF to FLUENT, choose the function name (e.g., usr net reaction rate)in the Net Reaction Rate Function drop-down list, and click OK.

    See Section2.3.9:DEFINE NET REACTION RATEfor details aboutDEFINE NET REACTION RATEfunctions.

    6.2.10 HookingDEFINE NOX RATEUDFs

    Once you have interpreted (Chapter4:Interpreting UDFs) or compiled (Chapter5:Com-piling UDFs) your DEFINE NOX RATE UDF in FLUENT, the function name you suppliedin the DEFINE macro argument will become visible and selectable in the drop-down listforNOx Rate in the NOx Model panel (Figure6.2.11).

    Define Models Species NOx...

    Figure 6.2.11: The NOx Model Panel

    c Fluent Inc. September 11, 2006 6-25

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Fluentchpter

    26/84

    Hooking UDFs toFLUENT

    i Note that the UDF name will not appear in the list until the function hasbeen interpreted or compiled and loaded.

    Recall that a single UDF is used to define custom rates for the thermal NO, prompt NO,fuel NO, and N20 NO

    x pathways. To replace the internally-calculated NO

    x rate with

    a UDF rate for any of the NOx

    pathways, you will first need to choose the UDF name(e.g.,user nox) from the NOx Rate drop-down list, click on the desired NO

    xpathway tab

    (Thermal, Prompt, Fuel, N20 Path) underFormation Model Parameters, check the Replacewith UDF Rate box for that pathway, and then click Apply. Repeat this process until allof the NO

    xpathways are set to the desired state (default rate or UDF rate). (Note that

    the Replace with UDF Rate checkbox appears only after you have selected a NOx rateUDF.)

    If you do not check the Replace with UDF Ratebox for a particular pathway but hook theUDF function to the interface, then the UDF rate for that NOx pathway will be addedto the internally-calculated rate for the source term calculation.

    Unless specifically defined in your NOx rate UDF, data and parameter settings for eachindividual NOxpathway will be derived from the settings in theNOx Modelpanel. There-fore, it is good practice to make the appropriate settings in the NOx Model panel, eventhough you may use a UDF to replace the default rates with user-specified rates. Thereis no computational penalty for doing this because the default rate calculations will beskipped over when the Replace by UDF Rate option is selected.

    See Section2.3.10: DEFINE NOX RATE for details about defining DEFINE NOX RATE func-tions.

    6-26 c Fluent Inc. September 11, 2006

    http://-/?-http://-/?-
  • 8/12/2019 Fluentchpter

    27/84

    6.2 Hooking Model-Specific UDFs

    6.2.11 HookingDEFINE PR RATEUDFs

    Once you have interpreted (Chapter4:Interpreting UDFs) or compiled (Chapter5:Com-piling UDFs) your DEFINE PR RATE UDF, the name of the function you supplied as aDEFINEmacro argument will become visible and selectable in the User-Defined FunctionHooks panel (Figure6.2.12) in FLUENT.

    Define User-DefinedFunction Hooks...

    Figure 6.2.12: The User-Defined Function Hooks Panel

    i You must enable the particle surface reactions option before you can hookthe UDF by selecting Volumetric and Particle Surface under Reactions intheSpecies Model panel.

    To hook the UDF to FLUENT, choose the function name (e.g., user pr rate) in theParticle Reaction Rate Function drop-down list in the User-Defined Function Hooks panel,and clickOK.

    See Section2.3.11: DEFINE PR RATEfor details about definingDEFINE PR RATE functions.

    c Fluent Inc. September 11, 2006 6-27

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Fluentchpter

    28/84

    Hooking UDFs toFLUENT

    6.2.12 HookingDEFINE PRANDTLUDFs

    Once you have interpreted (Chapter4:Interpreting UDFs) or compiled (Chapter5:Com-piling UDFs) your DEFINE PRANDTL UDF, the name of the function you supplied as aDEFINEmacro argument will become visible and selectable in the Viscous Model panel(Figure6.2.13) in FLUENT. Define Models Viscous...

    Figure 6.2.13: The Viscous Model Panel

    To hook the UDF to FLUENT, choose the function name (e.g., user pr k) in the TKE

    Prandtl Number drop-down list under User-Defined Functions in the panel Viscous Modelpanel, and clickOK.

    See Section2.3.12: DEFINE PRANDTL UDFsfor details about DEFINE PRANDTL functions.

    6-28 c Fluent Inc. September 11, 2006

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Fluentchpter

    29/84

    6.2 Hooking Model-Specific UDFs

    6.2.13 HookingDEFINE PROFILEUDFs

    Once you have interpreted (Chapter4:Interpreting UDFs) or compiled (Chapter5:Com-piling UDFs) your DEFINE PROFILE UDF, the name of the function you supplied as aDEFINEmacro argument will become visible and selectable in the appropriate boundarycondition panel in FLUENT.

    Define Boundary Conditions...

    If, for example, your UDF defines a velocity inlet boundary condition, then to hook it toFLUENTfirst click on the Momentum tab in the Velocity Inlet panel (Figure6.2.14) andthen choose the function name (e.g., x velocity) in the appropriate drop-down list (e.g.,X Velocity) and clickOK. Note that the UDF name that is displayed in the drop-downlists is preceded by the wordudf(e.g., udf x velocity).

    Figure 6.2.14: The Velocity InletPanel

    If you are using your UDF to specify a fixed value in a cell zone, you will need to turnon theFixed Valuesoption in theFluidor Solidpanel and click the Fixed Valuestab. Thiswill display the fixed values parameters in the scrollable window. Next, select the name

    of the UDF in the appropriate drop-down list for the value you wish to set.See Section2.3.13: DEFINE PROFILE for details about DEFINE PROFILE functions.

    c Fluent Inc. September 11, 2006 6-29

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Fluentchpter

    30/84

    Hooking UDFs toFLUENT

    Hooking Profiles for UDS Equations

    For each of the Nscalar equations you have specified in your FLUENT model using theUser-Defined Scalars panel you can hook a fixed value UDF for a cell zone (e.g., Fluid orSolid) and a specified value or flux UDF for all wall, inflow, and outflow boundaries.

    Once you have interpreted (Chapter4:Interpreting UDFs) or compiled (Chapter5:Com-piling UDFs) your DEFINE PROFILE UDF, the name of the function you supplied as aDEFINEmacro argument will become visible and selectable in the appropriate boundarycondition panel.

    Define Boundary Conditions...

    1. If you are using your UDF to specify a fixed value in a cell zone, you will needto turn on the Fixed Values option in the Fluid or Solid panel and click the FixedValues tab (Figure 6.2.15). This will display the fixed values parameters in thescrollable window under the Fixed Values tab. Next, select the name of the UDF

    (e.g.,fixed scalar 0) in the appropriate drop-down list for the value you wish to set.

    Figure 6.2.15: The Fluid Panel with Fixed Value Inputs for User-DefinedScalars

    6-30 c Fluent Inc. September 11, 2006

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Fluentchpter

    31/84

    6.2 Hooking Model-Specific UDFs

    2. If you are using your UDF to define a specific value or flux for a scalar equation,you will need to first select the UDS tab in the wall, inflow, or outflow boundarypanel (Figure6.2.16).

    Figure 6.2.16: The WallPanel with Inputs for User-Defined Scalars

    Next, for each UDS (User Scalar 0, User Scalar 1, etc.) specify the boundary con-dition value as a constant value or a UDF (e.g., pressure profile). If you selectSpecified Flux, then your input will be the value of the flux at the boundary (i.e.,the negative of the term in parentheses on the left hand side of Equation 9.3-2inthe Users Guide dot [as in the dot product of] n [as in the vector, n], where n isthe normal into the domain). If you select Specified Value, then your input will bethe value of the scalar itself at the boundary. In the sample panel shown above, forexample, the Specified ValueforUser Scalar 0 is set to a pressure profileUDF.

    Note that for interior walls, you will need to select Coupled Boundaryif the scalarsare to be solved on both sides of a two-sided wall. Note that the Coupled Boundaryoption will show up only in the drop-down list when the scalar is defined in thefluid and solid zones in the User-Defined Scalars panel.

    c Fluent Inc. September 11, 2006 6-31

    http://-/?-
  • 8/12/2019 Fluentchpter

    32/84

    Hooking UDFs toFLUENT

    i In some cases, you may wish to exclude diffusion of the scalar at the inletof your domain. You can do this by disabling diffusion of the scalar at theinlet in the User-Defined Scalars panel.

    See Section2.3.13: DEFINE PROFILE for details about DEFINE PROFILE functions.

    6.2.14 HookingDEFINE PROPERTYUDFs

    Material Properties

    Once you have interpreted (Chapter4:Interpreting UDFs) or compiled (Chapter5:Com-piling UDFs) your material property UDF, the name of the function you supplied as aDEFINEmacro argument will become visible and selectable in theUser-Defined Functionspanel (Figure6.2.18) in FLUENT. To hook the UDF to FLUENT, you will first need toopen the User-Defined Functions panel by choosing user-defined in the drop-down list forthe appropriate property (e.g., Viscosity) in the Materials panel (Figure6.2.17).

    Define Materials...

    Next, choose the function name (e.g.,cell viscosity) from the list of UDFs displayed in theUser-Defined Functionspanel, (Figure6.2.18) and clickOK. The name of the function willsubsequently be displayed under the selected property (e.g., Viscosity) in the Materialspanel.

    i If you plan to define density using a UDF, note that the solution conver-gence will become poor as the density variation becomes large. Specifyinga compressible law (density as a function of pressure) or multiphase behav-ior (spatially varying density) may lead to divergence. It is recommended

    that you restrict the use of UDFs for density to weakly compressible flowswith mild density variations.

    See Section2.3.14:DEFINE PROPERTYUDFsfor details aboutDEFINE PROPERTYfunctions.

    6-32 c Fluent Inc. September 11, 2006

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Fluentchpter

    33/84

    6.2 Hooking Model-Specific UDFs

    Figure 6.2.17: The MaterialsPanel

    Figure 6.2.18: The User-Defined FunctionsPanel

    c Fluent Inc. September 11, 2006 6-33

  • 8/12/2019 Fluentchpter

    34/84

    Hooking UDFs toFLUENT

    6.2.15 HookingDEFINE SCAT PHASE FUNCUDFs

    Once you have interpreted (Chapter4:Interpreting UDFs) or compiled (Chapter5:Com-piling UDFs) yourDEFINE SCAT PHASE FUNCUDF, the name of the function you suppliedas aDEFINEmacro argument will become visible and selectable in the User-Defined Func-tionspanel (Figure6.2.20) inFLUENT. To hook the UDF to FLUENT, you will first need

    to open theUser-Defined Functionspanel from the Materialpanel by selectinguser-definedin the drop-down list for the Scattering Phase Function property (Figure6.2.19).

    Define Materials...

    Figure 6.2.19: The MaterialsPanel

    6-34 c Fluent Inc. September 11, 2006

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Fluentchpter

    35/84

    6.2 Hooking Model-Specific UDFs

    i The Discrete Ordinates radiation model must be enabled from theRadiationModelpanel.

    Next, choose the function name (e.g., ScatPhiB2) from the list of UDFs displayed in theUser-Defined Functions panel, and click OK. The name of the function will subsequently

    be displayed under the Scattering Phase Function property in the Materials panel.

    Figure 6.2.20: The User-Defined FunctionsPanel

    See Section2.3.15: DEFINE SCAT PHASE FUNC for details about DEFINE SCAT PHASE FUNCfunctions.

    c Fluent Inc. September 11, 2006 6-35

    http://-/?-http://-/?-
  • 8/12/2019 Fluentchpter

    36/84

    Hooking UDFs toFLUENT

    6.2.16 Hooking DEFINE SOLAR INTENSITYUDFs

    Once you have interpreted (Chapter4:Interpreting UDFs) or compiled (Chapter5:Com-piling UDFs) your DEFINE SOLAR INTENSITYUDF, the name of the function you suppliedas a DEFINE macro argument you supplied in the argument of the DEFINE macro willbecome selectable in the Radiation Model panel for Direct Solar Irradiation and Diffuse

    Solar Irradiation(Figure6.2.21).

    Define Models Radiation...

    Figure 6.2.21: The Radiation Model Panel

    6-36 c Fluent Inc. September 11, 2006

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Fluentchpter

    37/84

    6.2 Hooking Model-Specific UDFs

    To hook the UDF toFLUENT, first chooseuser-definedfrom theDirector Diffuse Solar Ir-radiationdrop-down list under Illumination Parametersin theRadiation Modelpanel. (Thiswill open the User-Defined Functions panel.) Select the function name(e.g., user solar intensity) from the UDF list in the User-Defined Functions paneland click OK. The UDF name will appear in the text entry box below the parameterdrop-down list in the Radiation Modelpanel. (Figure6.2.21)

    See Section2.3.16: DEFINE SOLAR INTENSITYfor details about DEFINE SOLAR INTENSITYfunctions.

    6.2.17 HookingDEFINE SOURCEUDFs

    Once you have interpreted (Chapter4:Interpreting UDFs) or compiled (Chapter5:Com-piling UDFs) your DEFINE SOURCE UDF, the name of the function you supplied as aDEFINEmacro argument will become visible and selectable in the Fluidor Solidpanel inFLUENT. To hook the UDF to FLUENT, you will first need to turn on the Source Termsoption in theFluidorSolidpanel (Figure6.2.22) and click theSource Termstab. This will

    display the source term parameters (mass, momentum, etc.) in the scrollable window.

    Define Boundary Conditions...

    Next, click the Edit... button next to the source term (e.g.,Mass) you wish to customize(Figure6.2.22).

    Next, click the Edit... button next to the X Momentum source term. This will openthe Mass Sources panel where you will select the number of terms you wish to model(Figure6.2.23).

    c Fluent Inc. September 11, 2006 6-37

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Fluentchpter

    38/84

    Hooking UDFs toFLUENT

    Figure 6.2.22: The FluidPanel

    6-38 c Fluent Inc. September 11, 2006

  • 8/12/2019 Fluentchpter

    39/84

    6.2 Hooking Model-Specific UDFs

    Figure 6.2.23: The FluidPanel

    Increment the Number of Mass Sources counter (e.g., 2) and then choose the functionname (e.g.,udf usr mass src1 and udf usr mass src2) from the appropriate drop-down list.(Note that the UDF name that is displayed in the drop-down lists is preceeded by theword udf.) ClickOK in the Mass Sources panel to accept the new boundary conditionand close the panel. The Mass source term in the Fluid panel will now display 2 sources.Click OK to close the Fluid panel and fix the new mass source terms for the solutioncalculation.

    Repeat this step for all of the source terms you wish to customize using a UDF.

    See Section2.3.17: DEFINE SOURCE for details about DEFINE SOURCE functions.

    c Fluent Inc. September 11, 2006 6-39

    http://-/?-http://-/?-
  • 8/12/2019 Fluentchpter

    40/84

    Hooking UDFs toFLUENT

    6.2.18 HookingDEFINE SOX RATEUDFs

    Once you have interpreted (Chapter4:Interpreting UDFs) or compiled (Chapter5:Com-piling UDFs) your DEFINE SOX RATE UDF in FLUENT, the function name you suppliedin the DEFINEmacro argument will become visible and selectable for the SOx Ratein theSOx Model panel (Figure6.2.24).

    Define Models Species SOx...

    Figure 6.2.24: The SOx Model Panel

    i Note that the UDF name will not appear in the list until the function hasbeen interpreted or compiled and loaded.

    Recall that a single UDF can be used to define custom rates for SOx Formation. Toreplace the internally-calculated SOxrate with a UDF rate, you will first need to choosethe UDF name (e.g., user sox) from theSOx Ratedrop-down list, check theReplace withUDF Rate box, and then click Apply. (Note that the Replace with UDF Rate checkboxappears only after you have selected a SOx rate UDF.)

    If you dont check the Replace with UDF Rate box but hook the UDF function to theinterface, then the UDF rate for that SOx formation will be added to the internally-calculated rate for the source term calculation.

    6-40 c Fluent Inc. September 11, 2006

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Fluentchpter

    41/84

  • 8/12/2019 Fluentchpter

    42/84

    Hooking UDFs toFLUENT

    i You must enable the wall surface reactions option before you can hookthe UDF by selecting Volumetric and Wall Surface under Reactions in theSpecies Model panel.

    To hook the UDF toFLUENT, choose the function name (e.g.,user sr rate) in theSurface

    Reaction Rate Functiondrop-down list in theUser-Defined Function Hookspanel, and clickOK.

    See Section2.3.19: DEFINE SR RATEfor details about DEFINE SR RATE functions.

    6.2.20 HookingDEFINE TURB PREMIX SOURCEUDFs

    Once you have interpreted (Chapter4:Interpreting UDFs) or compiled (Chapter5:Com-piling UDFs) yourDEFINE TURB PREMIX SOURCE UDF, the name of the function you sup-plied as aDEFINEmacro argument will become visible and selectable in the User-DefinedFunction Hooks panel (Figure6.2.26) in FLUENT.

    Define User-DefinedFunction Hooks...

    Figure 6.2.26: The User-Defined Function Hooks Panel

    i You must have a premixed combustion model enabled in theSpecies Modelpanel.

    6-42 c Fluent Inc. September 11, 2006

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Fluentchpter

    43/84

    6.2 Hooking Model-Specific UDFs

    To hook the UDF to FLUENT, choose the function name (e.g., user turb pre src) intheTurbulent Premixed Source Functiondrop-down list in theUser-Defined Function Hookspanel, and clickOK.

    See Section2.3.20: DEFINE TURB PREMIX SOURCE for details aboutDEFINE TURB PREMIX SOURCE functions.

    6.2.21 Hooking DEFINE TURBULENT VISCOSITYUDFs

    Once you have interpreted (Chapter4:Interpreting UDFs) or compiled (Chapter5:Com-piling UDFs) your DEFINE TURBULENT VISCOSITY UDF, the name of the function yousupplied as a DEFINEmacro argument will become visible and selectable in the ViscousModelpanel (Figure6.2.27) in FLUENT.

    Define Models Viscous...

    Figure 6.2.27: The Viscous Model Panel

    To hook the UDF to FLUENT, choose the function name (e.g., user mu t) in the Turbu-

    lence Viscosity drop-down list under User-Defined Functions in the Viscous Model panel,and clickOK.

    See Section 2.3.21: DEFINE TURBULENT VISCOSITY for details aboutDEFINE TURBULENT VISCOSITY functions.

    c Fluent Inc. September 11, 2006 6-43

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Fluentchpter

    44/84

    Hooking UDFs toFLUENT

    6.2.22 HookingDEFINE VR RATEUDFs

    Once you have interpreted (Chapter4:Interpreting UDFs) or compiled (Chapter5:Com-piling UDFs) your DEFINE VR RATE UDF, the name of the function you supplied as aDEFINEmacro argument will become visible and selectable in the User-Defined FunctionHooks panel (Figure6.2.28) in FLUENT.

    Define User-DefinedFunction Hooks...

    Figure 6.2.28: The User-Defined Function Hooks Panel

    i You must turn on the volumetric reactions option before you can hook theUDF by selecting Volumetric under Reactions in the Species Model panel.

    To hook the UDF to FLUENT, choose the function name (e.g., user vr rate) in theVolume Reaction Rate Function drop-down list in the User-Defined Function Hooks panel,and clickOK.

    See Section2.3.22: DEFINE VR RATE

    for details about DEFINE VR RATE

    functions.

    6-44 c Fluent Inc. September 11, 2006

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Fluentchpter

    45/84

    6.2 Hooking Model-Specific UDFs

    6.2.23 HookingDEFINE WALL FUNCTIONSUDFs

    Once you have interpreted (Chapter4:Interpreting UDFs) or compiled (Chapter5:Com-piling UDFs) your DEFINE WALL FUNCTIONS UDF, the name of the function you suppliedas a DEFINE macro argument will become visible and selectable in the Viscous Modelpanel (Figure6.2.29) in FLUENT.

    Define Models Viscous...

    Figure 6.2.29: The Viscous Model Panel

    To hook the UDF toFLUENT, choose the function name (e.g., user log law) in theLawof the Wall drop-down list, and click OK.

    See Section 2.3.23: DEFINE WALL FUNCTIONS for details about definingDEFINE WALL FUNCTIONS functions in FLUENT.

    c Fluent Inc. September 11, 2006 6-45

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Fluentchpter

    46/84

    Hooking UDFs toFLUENT

    6.3 Hooking Multiphase UDFs

    This section contains methods for hooking UDFs toFLUENTthat have been defined usingDEFINE macros (described in Section2.4: Multiphase DEFINE Macros), and interpretedor compiled using methods (described in Chapters4or5), respectively.

    6.3.1 HookingDEFINE CAVITATION RATEUDFs

    Once you have interpreted (Chapter4:Interpreting UDFs) or compiled (Chapter5:Com-piling UDFs) your DEFINE CAVITATION RATE UDF, the name of the function you sup-plied as aDEFINEmacro argument will become visible and selectable in the User-DefinedFunction Hookspanel (Figure6.3.2) inFLUENT. Note that cavitation rate UDFs can beapplied only to the Mixture multiphase model.

    To hook the UDF to FLUENT, you will first need to enable the Mixture model in theMultiphase Model panel.

    Define Models Multiphase...

    Then, in the Masstab of the Phase Interaction panel (Figure6.3.1), selectCavitation.

    Figure 6.3.1: The Phase Interaction Panel

    Next, open the User-Defined Function Hooks panel,

    Define User-DefinedFunction Hooks...

    6-46 c Fluent Inc. September 11, 2006

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Fluentchpter

    47/84

    6.3 Hooking Multiphase UDFs

    choose the function name (e.g., user cav rate) in the Cavitation Mass Rate Functiondrop-down list (Figure6.3.2), and clickOK.

    Figure 6.3.2: The User-Defined Function Hooks Panel

    See Section2.4.1: DEFINE CAVITATION RATE for details about DEFINE CAVITATION RATEfunctions.

    c Fluent Inc. September 11, 2006 6-47

    http://-/?-http://-/?-
  • 8/12/2019 Fluentchpter

    48/84

    Hooking UDFs toFLUENT

    6.3.2 Hooking DEFINE EXCHANGE PROPERTYUDFs

    Once you have interpreted (Chapter4:Interpreting UDFs) or compiled (Chapter5:Com-piling UDFs) your DEFINE EXCHANGE RATE UDF, the name of the function you suppliedas aDEFINEmacro argument will become visible and selectable in the User-Defined Func-tionspanel (see below) in FLUENT.

    Customized mass transfer UDFs can be applied to VOF, Mixture, and Eulerian multi-phase models. Drag coefficient UDFs can be applied to Mixture and Eulerian models,while heat transfer and lift coefficient UDFs can be applied only to the Eulerian model.You will need to have the multiphase model enabled before you can hook your function.

    To hook an exchange property UDF to FLUENT, you will first need to open the PhaseInteractionpanel (see below) by clicking Interactions... in the Phases panel.

    Define Phases...

    6-48 c Fluent Inc. September 11, 2006

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Fluentchpter

    49/84

    6.3 Hooking Multiphase UDFs

    Next, click on the appropriate tab (e.g., Drag) in thePhase Interaction panel, and chooseuser-defined in the drop-down list for the corresponding exchange property (e.g., DragCoefficient) that you desire. This will open the User-Defined Functionspanel.

    i Make sure that you selectSlip VelocityunderMixture Parametersin theMul-

    tiphase Modelpanel in order to display the drag coefficient for the Mixturemodel.

    Figure 6.3.3: The User-Defined Functions Panel

    Finally, choose the function name (e.g., custom drag) from the list of UDFs displayed inthe User-Defined Functions panel, (Figure6.3.3) and click OK. The function name (e.g.,custom drag) will then be displayed under the user-defined function for Drag Coefficient

    in the Phase Interactionpanel.See Section2.4.2:DEFINE EXCHANGE PROPERTYfor details about DEFINE EXCHANGE PROPERTYfunctions.

    c Fluent Inc. September 11, 2006 6-49

    http://-/?-http://-/?-
  • 8/12/2019 Fluentchpter

    50/84

    Hooking UDFs toFLUENT

    6.3.3 HookingDEFINE HET RXN RATEUDFs

    Once you have interpreted (Chapter4:Interpreting UDFs) or compiled (Chapter5:Com-piling UDFs) your DEFINE HET RXN RATE UDF, the name of the function you suppliedas a DEFINE macro argument will become visible and selectable under Reaction RateFunction in the Reactions tab of the Phase Interaction panel. Note that the Reactions

    tab is enabled only when species transport is enabled and the Reaction Rate Function isaccessible when the Total Number of Reactions is greater than 0. (Figure6.3.4).

    Define Phases Interaction...

    Figure 6.3.4: The Phase Interaction Panel

    To hook the UDF to FLUENT, choose the function name (e.g., user evap con) in theReaction Rate Function drop-down list under the Reaction tab (Figure 6.3.4), and clickOK.

    See Section2.4.3: DEFINE HET RXN RATE for details about writing DEFINE HET RXN RATEfunctions.

    6-50 c Fluent Inc. September 11, 2006

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Fluentchpter

    51/84

    6.3 Hooking Multiphase UDFs

    6.3.4 HookingDEFINE MASS TRANSFERUDFs

    Once you have interpreted (Chapter4:Interpreting UDFs) or compiled (Chapter5:Com-piling UDFs) your DEFINE MASS TRANSFER UDF, the name of the function you suppliedas a DEFINE macro argument will become visible and selectable from the Mass tab inthePhase Interaction panel (Figure6.3.5).

    Define Phases Interaction...

    Figure 6.3.5: The Phase Interaction Panel

    To hook the UDF to FLUENT, click the Mass tab and then specify the Number of MassTransfer Mechanisms greater than 0. The Mechanism drop-down list will appear. Next,chooseuser-definedfrom theMechanismdrop-down list to open theUser-Defined Functionspanel. Select the function name (e.g., liq gas source) from the UDF list and click OK.The UDF name will appear in the text entry box below the Mechanism drop-down listin the Phase Interactionpanel.

    See Section2.4.4: DEFINE MASS TRANSFERfor details about writing DEFINE MASS TRANSFERfunctions.

    c Fluent Inc. September 11, 2006 6-51

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Fluentchpter

    52/84

    Hooking UDFs toFLUENT

    6.3.5 HookingDEFINE VECTOR EXCHANGE PROPERTYUDFs

    Once you have interpreted (Chapter4:Interpreting UDFs) or compiled (Chapter5:Com-piling UDFs) your DEFINE VECTOR EXCHANGE RATE UDF, the name of the function yousupplied as a DEFINE macro argument will become visible and selectable in the User-Defined Functions panel (Figure6.3.7) in FLUENT.

    To hook the UDF to FLUENT, you will first need to open the Phase Interaction panel(Figure6.3.6) by clicking Interactions... in the Phasespanel.

    Define Phases...

    Figure 6.3.6: The Phase Interaction Panel

    Next, click on the Slip tab in the Phase Interaction panel, and choose user-defined in thedrop-down list for theSlip Velocity. This will open the User-Defined Functions panel.

    i Slip velocity UDFs apply only to the multiphase Mixture model.

    Finally, choose the function name (e.g., custom slip) from the list of UDFs displayed intheUser-Defined Functions panel, (Figure6.3.3) and click OK.

    See Section 2.4.5: DEFINE VECTOR EXCHANGE PROPERTY for details aboutDEFINE VECTOR EXCHANGE PROPERTY functions.

    6-52 c Fluent Inc. September 11, 2006

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Fluentchpter

    53/84

    6.4 Hooking Discrete Phase Model (DPM) UDFs

    Figure 6.3.7: The User-Defined Functions Panel

    6.4 Hooking Discrete Phase Model (DPM) UDFsThis section contains methods for hooking UDFs to FLUENT that have been

    defined usingDEFINEmacros described in Section2.5:Discrete Phase Model (DPM)DEFINE Macros, and

    interpreted or compiled using methods described in Chapters4 or 5, respectively.

    6.4.1 HookingDEFINE DPM BCUDFs

    Once you have interpreted (Chapter4:Interpreting UDFs) or compiled (Chapter5:Com-piling UDFs) your DEFINE DPM BC UDF, the name of the function you supplied as aDE-FINE macro argument will become visible and selectable in the appropriate boundarycondition panel (Figure6.4.1) inFLUENT.

    Define Boundary Conditions...

    Suppose that your UDF defines a particle velocity boundary condition at a wall. To hookthe UDF to FLUENT, first open the Wall boundary condition panel and select the DPMtab (Figure6.4.1)

    Then chooseuser definedas Boundary Cond. TypeunderDiscrete Phase Model Conditions.

    This will expand the panel to allow you to choose the function name (e.g., user dpm bc)from the Boundary Cond. Function drop-down list (Figure6.4.1). ClickOK.

    See Section2.5.1: DEFINE DPM BC for details about DEFINE DPM BC functions.

    c Fluent Inc. September 11, 2006 6-53

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Fluentchpter

    54/84

    Hooking UDFs toFLUENT

    Figure 6.4.1: The Wall Panel

    6-54 c Fluent Inc. September 11, 2006

  • 8/12/2019 Fluentchpter

    55/84

    6.4 Hooking Discrete Phase Model (DPM) UDFs

    6.4.2 HookingDEFINE DPM BODY FORCEUDFs

    Once you have interpreted (Chapter4:Interpreting UDFs) or compiled (Chapter5:Com-piling UDFs) your DEFINE DPM BODY FORCE UDF, the name of the function you suppliedas a DEFINE macro argument will become visible and selectable in the Discrete PhaseModelpanel (Figure6.4.2) in FLUENT.

    Define Models Discrete Phase...

    Figure 6.4.2: The Discrete Phase Model Panel

    To hook the UDF to FLUENT, choose the function name (e.g., particle body force) intheBody Forcedrop-down list underUser-Defined Functions, (Figure6.4.2) and clickOK.

    See Section 2.5.2: DEFINE DPM BODY FORCE for details about DEFINE DPM BODY FORCEfunctions.

    c Fluent Inc. September 11, 2006 6-55

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Fluentchpter

    56/84

  • 8/12/2019 Fluentchpter

    57/84

    6.4 Hooking Discrete Phase Model (DPM) UDFs

    6.4.4 HookingDEFINE DPM EROSIONUDFs

    Once you have interpreted (Chapter4:Interpreting UDFs) or compiled (Chapter5:Com-piling UDFs) your DEFINE DPM EROSION UDF, the name of the function you supplied asaDEFINEmacro argument will become visible and selectable in theDiscrete Phase Modelpanel (Figure6.4.4) in FLUENT.

    Define Models Discrete Phase...

    Figure 6.4.4: The Discrete Phase Model Panel

    To hook the UDF to FLUENT, enable theInteraction with Continuous Phase option underInteraction (Figure 6.4.4), and then turn on Erosion/Accretion under Option. Finally,choose the function name (e.g., dpm accr) in theErosion/Accretiondrop-down list underUser-Defined Functions, and click OK.

    See Section2.5.4: DEFINE DPM EROSIONfor details about DEFINE DPM EROSIONfunctions.

    c Fluent Inc. September 11, 2006 6-57

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Fluentchpter

    58/84

    Hooking UDFs toFLUENT

    6.4.5 Hooking DEFINE DPM HEAT MASSUDFs

    Once you have interpreted (Chapter4:Interpreting UDFs) or compiled (Chapter5:Com-piling UDFs) your DEFINE DPM HEAT MASS UDF, the name of the function you suppliedas aDEFINEmacro argument will become visible and selectable in theSet Injection Prop-erties panel (Figure6.4.5) in FLUENT. Before you hook the UDF, youll need to create

    your particle injections in the Injections panel.

    Define Injections...

    Figure 6.4.5: The InjectionsPanel

    6-58 c Fluent Inc. September 11, 2006

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Fluentchpter

    59/84

    6.4 Hooking Discrete Phase Model (DPM) UDFs

    Click Create in the Injections panel to open the Set Injection Properties panel and set upyour particle injections. Next, select the UDF tab in the Set Injection Properties panel(Figure6.4.5), and choose the function name (e.g., init bubbles) from the Heat/MassTransfer drop-down list under User-Defined Functions. ClickOK.

    See Section 2.5.6: DEFINE DPM INJECTION INIT for details about

    DEFINE DPM INJECTION INIT functions.

    6.4.6 HookingDEFINE DPM INJECTION INITUDFs

    Once you have interpreted (Chapter4:Interpreting UDFs) or compiled (Chapter5:Com-piling UDFs) yourDEFINE DPM INJECTION INIT UDF, the name of the function you sup-plied as aDEFINEmacro argument will become visible and selectable in the Set InjectionProperties panel (Figure 6.4.6) in FLUENT. Before you hook the UDF, youll need tocreate your particle injections in the Injections panel.

    Define Injections...

    Click Create in the Injections panel to open the Set Injection Properties panel and set upyour particle injections. Next, select the UDF tab in the Set Injection Properties panel(Figure6.4.6), and choose the function name (e.g., init bubbles) from the Initializationdrop-down list underUser-Defined Functions. ClickOK.

    See Section2.5.6:DEFINE DPM INJECTION INITfor details aboutDEFINE DPM INJECTION INITfunctions.

    c Fluent Inc. September 11, 2006 6-59

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Fluentchpter

    60/84

  • 8/12/2019 Fluentchpter

    61/84

    6.4 Hooking Discrete Phase Model (DPM) UDFs

    6.4.7 HookingDEFINE DPM LAWUDFs

    Once you have interpreted (Chapter4:Interpreting UDFs) or compiled (Chapter5:Com-piling UDFs) your DEFINE DPM LAW UDF, the name of the function you supplied as aDEFINE macro argument will become visible and selectable in the Custom Laws panel(Figure6.4.7) in FLUENT. To hook the UDF to FLUENT, first click Create in the Injec-

    tionspanel to open the Set Injection Properties panel.

    Define Injections...

    Next, turn on the Custom option under Laws in the Set Injection Properties panel. Thiswill open the Custom Laws panel.

    Figure 6.4.7: The Custom Laws Panel

    Finally, in theCustom Lawspanel, (Figure6.4.7) choose the function name (e.g., custom law)in the appropriate drop-down list located to the left of each of the six particle laws (e.g.,First Law), and clickOK.

    See Section2.5.7: DEFINE DPM LAW for details about DEFINE DPM LAW functions.

    c Fluent Inc. September 11, 2006 6-61

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Fluentchpter

    62/84

    Hooking UDFs toFLUENT

    6.4.8 HookingDEFINE DPM OUTPUTUDFs

    Once you have interpreted (Chapter4:Interpreting UDFs) or compiled (Chapter5:Com-piling UDFs) your DEFINE DPM OUTPUT UDF, the name of the function you supplied asa DEFINE macro argument will become visible and selectable in the Sample Trajectoriespanel (Figure6.4.8) in FLUENT.

    Report Discrete Phase Sample...

    Figure 6.4.8: The Sample Trajectories Panel

    To hook the UDF toFLUENT, choose the function name (e.g., dpm output) in theOutputdrop-down list underUser-Defined Functions, and clickStartandClose.

    See Section2.5.8: DEFINE DPM OUTPUT for details about DEFINE DPM OUTPUT functions.

    6-62 c Fluent Inc. September 11, 2006

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Fluentchpter

    63/84

    6.4 Hooking Discrete Phase Model (DPM) UDFs

    6.4.9 HookingDEFINE DPM PROPERTYUDFs

    Once you have interpreted (Chapter4:Interpreting UDFs) or compiled (Chapter5:Com-piling UDFs) your DEFINE DPM PROPERTY UDF, the name of the function you supplied asa DEFINE macro argument will become visible and selectable in the User-Defined Func-tions panel (Figure6.4.10). To hook the UDF toFLUENT, you will first need to open

    the User-Defined Functions panel by choosing user-defined in the drop-down list for theappropriate property (e.g., Particle Emissivity) in the Materials panel (Figure6.4.9).

    Define Materials...

    Figure 6.4.9: The Materials Panel

    i In order for the Particle Emissivity property to be displayed in the sam-ple panel shown above, you must enable a radiation model, turn on theParticle Radiation Interaction option in the Discrete Phase Model panel, andintroduce a particle injection in the Injections panel.

    c Fluent Inc. September 11, 2006 6-63

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Fluentchpter

    64/84

  • 8/12/2019 Fluentchpter

    65/84

  • 8/12/2019 Fluentchpter

    66/84

    Hooking UDFs toFLUENT

    6.4.11 HookingDEFINE DPM SOURCEUDFs

    Once you have interpreted (Chapter4:Interpreting UDFs) or compiled (Chapter5:Com-piling UDFs) your DEFINE DPM SOURCEUDF, the name of the function you supplied as aDEFINEmacro argument will become visible and selectable in the Discrete Phase Modelpanel (Figure6.4.12) in FLUENT.

    Define Models Discrete Phase...

    Figure 6.4.12: The Discrete Phase Model Panel

    To hook the UDF to FLUENT, choose the function name (e.g., dpm source) in theSourcedrop-down list underUser-Defined Functions (Figure6.4.12), and clickOK.

    See Section2.5.11: DEFINE DPM SOURCE for details about DEFINE DPM SOURCE functions.

    6-66 c Fluent Inc. September 11, 2006

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Fluentchpter

    67/84

    6.4 Hooking Discrete Phase Model (DPM) UDFs

    6.4.12 HookingDEFINE DPM SPRAY COLLIDEUDFs

    Once you have interpreted (Chapter4:Interpreting UDFs) or compiled (Chapter5:Com-piling UDFs) your DEFINE DPM SPRAY COLLIDE UDF, the name of the function you sup-plied as a DEFINE macro argument will become visible and selectable in the DiscretePhase Modelpanel (Figure6.4.13) inFLUENT.

    Define Models Discrete Phase...

    Figure 6.4.13: The Discrete Phase Model Panel

    i You will need to enable a discrete phase model in theDiscrete Phase Modelpanel before you can hook the UDF.

    To hook the UDF to FLUENT, choose the function name (e.g., udf mean spray) in theSpray Collide Function drop-down list in the User-Defined Function Hooks panel, (Fig-ure6.4.13) and click OK.

    c Fluent Inc. September 11, 2006 6-67

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Fluentchpter

    68/84

  • 8/12/2019 Fluentchpter

    69/84

    6.4 Hooking Discrete Phase Model (DPM) UDFs

    6.4.14 HookingDEFINE DPM TIMESTEPUDFs

    Once you have interpreted (Chapter4:Interpreting UDFs) or compiled (Chapter5:Com-piling UDFs) your DEFINE DPM TIMESTEP UDF, the name of the function you suppliedas a DEFINE macro argument will become visible and selectable in the Discrete PhaseModelpanel under the UDF tab for DPM Timestep (Figure6.4.15).

    Define Models Discrete Phase...

    Figure 6.4.15: The Discrete Phase Model Panel

    To hook the UDF to FLUENT, choose the function name (e.g., dpm timestep) in theDPM Time Step drop-down list under the UDFtab (Figure6.4.15), and click OK.

    See Section2.5.14: DEFINE DPM TIMESTEP for details about DEFINE DPM TIMESTEP func-tions.

    c Fluent Inc. September 11, 2006 6-69

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Fluentchpter

    70/84

    Hooking UDFs toFLUENT

    6.4.15 Hooking DEFINE DPM VP EQUILIBUDFs

    Once you have interpreted (Chapter4:Interpreting UDFs) or compiled (Chapter5:Com-piling UDFs) your DEFINE DPM VP EQUILIB UDF, the name of the function you suppliedas aDEFINEmacro argument (e.g.,raoult vp) will become visible and selectable from theMaterialspanel inFLUENT. Before you hook the UDF, youll need to create your particle

    injections in the Injections panel with the Multicomponentoption enabled. .

    Define Injections...

    Click Create in the Injections panel to open the Set Injection Properties panel and set upyour particle injections.

    Next, open the Materialspanel (Figure6.4.16),

    Define Materials...

    Figure 6.4.16: The MaterialsPanel

    6-70 c Fluent Inc. September 11, 2006

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Fluentchpter

    71/84

    6.5 Hooking Dynamic Mesh UDFs

    Select your particle-mixture material and then chooseuser-definedfrom the drop-down listfor Vapor-Particle-Equilibrium. This will open theUser-Defined Functions panel. Choosethe UDF name from the list of UDFs displayed and click OK.

    See Section2.5.15:DEFINE DPM VP EQUILIBfor details aboutDEFINE DPM VP EQUILIBRIUMfunctions.

    6.5 Hooking Dynamic Mesh UDFs

    This section contains methods for hooking UDFs toFLUENTthat have been defined usingDEFINE macros described in Section2.6:Dynamic Mesh DEFINEMacros, and interpretedor compiled using methods described in Chapters 4 or 5, respectively.

    6.5.1 HookingDEFINE CG MOTIONUDFs

    Once you have interpreted (Chapter4:Interpreting UDFs) or compiled (Chapter5:Com-piling UDFs) your DEFINE CG MOTION UDF, the name of the function you supplied as aDEFINEmacro argument will become visible and selectable in the Dynamic Mesh Zonespanel (Figure 6.5.1). To hook the UDF toFLUENT, you will first need to enable thedynamic mesh model.

    Define Dynamic Mesh Parameters...

    To enable the dymanic mesh model, select Dynamic Mesh underModel and clickOK.

    i TheDynamic Meshpanel will be accessible only when you choose Unsteadyas the time method in the Solver panel.

    Next, open the Dynamic Mesh Zones panel.

    Define Dynamic Mesh Zones...

    c Fluent Inc. September 11, 2006 6-71

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Fluentchpter

    72/84

    Hooking UDFs toFLUENT

    Figure 6.5.1: The Dynamic Mesh Zones Panel

    SelectRigid Body under Type in the Dynamic Mesh Zones panel (Figure6.5.1) and clickon the Motion Attributes tab. Finally, choose the function name (e.g., piston) from theMotion UDF/Profile drop-down list, and click Create thenClose.

    See Section2.6.1: DEFINE CG MOTION for details about DEFINE CG MOTION functions.

    6-72 c Fluent Inc. September 11, 2006

    http://-/?-http://-/?-
  • 8/12/2019 Fluentchpter

    73/84

    6.5 Hooking Dynamic Mesh UDFs

    6.5.2 HookingDEFINE GEOMUDFs

    Once you have interpreted (Chapter4:Interpreting UDFs) or compiled (Chapter5:Com-piling UDFs) yourDEFINE GEOMUDF, the name of the function you supplied as a DEFINEmacro argument will become visible and selectable in the Dynamic Mesh Zonespanel (Fig-ure6.5.2). To hook the UDF toFLUENT, you will first need to enable the Dynamic Mesh

    model.

    Define Dynamic Mesh Parameters...

    To enable the model, select Dynamic MeshunderModel and clickOK.

    i TheDynamic Meshpanel will be accessible only when you choose Unsteadyas the time method in the Solver panel.

    Next, open the Dynamic Mesh Zones panel.

    Define Dynamic Mesh Zones...

    Select Deforming under Type in the Dynamic Mesh Zones panel (Figure6.5.2) and clickon theGeometry Definitiontab. Selectuser-definedin the drop-down list underDefinition,and choose the function name (e.g., plane) from theGeometry UDFdrop-down list. ClickCreate and then Close.

    See Section2.6.2: DEFINE GEOM for details about DEFINE GEOM functions.

    c Fluent Inc. September 11, 2006 6-73

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Fluentchpter

    74/84

  • 8/12/2019 Fluentchpter

    75/84

  • 8/12/2019 Fluentchpter

    76/84

    Hooking UDFs toFLUENT

    6.5.4 HookingDEFINE SDOF PROPERTIESUDFs

    Once you have interpreted (Chapter4:Interpreting UDFs) or compiled (Chapter5:Com-piling UDFs) your DEFINE SDOF PROPERTIESUDF, the name of the function you suppliedas a DEFINE macro argument will become visible and selectable in the Dynamic MeshZones panel (Figure6.5.4) inFLUENT. To hook the UDF to FLUENT, you will first need

    to enable the Dynamic Mesh model.

    Define Dynamic Mesh Parameters...

    To enable the model, select Dynamic MeshunderModel and clickOK.

    i TheDynamic Meshpanel will be accessible only when you choose Unsteadyas the time method in the Solver panel.

    Next, open the Dynamic Mesh Zones panel.

    Define Dynamic Mesh Zones...

    6-76 c Fluent Inc. September 11, 2006

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Fluentchpter

    77/84

    6.5 Hooking Dynamic Mesh UDFs

    Figure 6.5.4: The Dynamic Mesh Zones Panel

    SelectRigid Body under Type in the Dynamic Mesh Zones panel (Figure6.5.4) and clickon the Motion Attributes tab. Choose the function name (e.g., stage) from the Six DOFUDF drop-down list. Click Create thenClose.

    See Section2.6.4: DEFINE SDOF PROPERTIES for details about DEFINE SDOF PROPERTIESfunctions.

    c Fluent Inc. September 11, 2006 6-77

    http://-/?-http://-/?-
  • 8/12/2019 Fluentchpter

    78/84

    Hooking UDFs toFLUENT

    6.6 Hooking User-Defined Scalar (UDS) Transport Equation UDFs

    This section contains methods for hooking anisotropic diffusion coeffient, fluex, and un-steady UDFs for scalar equations that have been defined using DEFINEmacros describedin Section2.7: User-Defined Scalar (UDS) Transport Equation DEFINE Macros and in-terpreted or compiled using methods described in Chapters 4 or 5, respectively. See

    Section6.2.13:Hooking DEFINE PROFILEUDFs, Section6.2.17:Hooking DEFINE SOURCEUDFs, and Section 6.2.3: Hooking DEFINE DIFFUSIVITY UDFs to hook scalar sourceterm, profile, or isotropic diffusion coefficient UDFs.

    6.6.1 Hooking DEFINE ANISOTROPIC DIFFUSIVITYUDFs

    Once you have interpreted (Chapter4:Interpreting UDFs) or compiled (Chapter5:Com-piling UDFs) your DEFINE ANISOTROPIC DIFFUSIVITY UDF, the name of the functionyou supplied as the first DEFINE macro argument (e.g., cyl ortho diff) will becomevisible and selectable in FLUENT. To hook the UDF to FLUENT, you will first need toopen the Materials panel.

    Define Materials...

    6-78 c Fluent Inc. September 11, 2006

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Fluentchpter

    79/84

    6.6 Hooking User-Defined Scalar (UDS) Transport Equation UDFs

    Figure 6.6.1: The Materials Panel

    Choose defined-per-udsfrom the drop-down list forUDS Diffusivityin the Materialspanel

    (Figure6.6.1). This will open the UDS Diffusion Coefficients panel (Figure6.6.2).

    c Fluent Inc. September 11, 2006 6-79

  • 8/12/2019 Fluentchpter

    80/84

    Hooking UDFs toFLUENT

    Figure 6.6.2: The UDS Diffusion Coefficients Panel

    In the UDS Diffusion Coefficients panel, select a scalar equation (e.g., uds-0) and chooseuser-defined-anisotropic from the drop-down list under Coefficient. This will open theUser-Defined Functions panel and allow you to select the UDF you wish to hook. Notethat you will get an error if you have neglected to previously interpret or compile aDEFINE ANISOTROPIC DIFFUSIVITY UDF. Note that you can hook a unique diffusioncoefficient UDF for each scalar tranpsport equation you have defined in your model.

    See Section 2.7.2: DEFINE ANISOTROPIC DIFFUSIVITY for details about definingDEFINE ANISOTROPIC DIFFUSIVITY UDFs and the Users Guide for general informationabout UDS anisotropic diffusivity.

    6-80 c Fluent Inc. September 11, 2006

    http://-/?-http://-/?-
  • 8/12/2019 Fluentchpter

    81/84

  • 8/12/2019 Fluentchpter

    82/84

    Hooking UDFs toFLUENT

    6.6.3 HookingDEFINE UDS UNSTEADYUDFs

    Once you have interpreted (Chapter4:Interpreting UDFs) or compiled (Chapter5:Com-piling UDFs) your DEFINE UDS UNSTEADYUDF, the name of the argument that you sup-plied as the first DEFINE macro argument (e.g., my uds unsteady) will become visibleand selectable in theUser-Defined Scalars panel (Figure6.6.4) inFLUENT.

    Define User-DefinedScalars...

    Figure 6.6.4: The User-Defined Scalars Panel

    To hook the UDF to FLUENT, first specify the Number of User-Defined Scalars (e.g., 2)in theUser-Defined Scalars panel (Figure6.6.4). As you enter the number of user-definedscalars, the panel will expand to show the Unsteady Function settings. Next, for eachscalar you have defined, increment the UDS Indexand choose the Zone Type(e.g.,all fluidzones), select the function (e.g., my uds unsteady) from theUnsteady Functiondrop-downlist, and click OK.

    6-82 c Fluent Inc. September 11, 2006

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Fluentchpter

    83/84

    6.7 Common Errors While Hooking a UDF toFLUENT

    6.7 Common Errors While Hooking a UDF toFLUENT

    In some cases, if you select user-defined as an option in a graphics panel but have notpreviously interpreted or compiled/loaded a UDF, you will get an error message.

    In other graphics panels, the user-definedoption will only become visible as an option for

    a parameter afteryou have interpreted or compiled the UDF. Once you have interpretedor compiled the UDF, you can then select user-defined option and the list of interpretedand compiled/loaded UDFs will be displayed.

    If you inadvertently hook a UDF to the wrong parameter in a FLUENT graphics panel(e.g., profile UDF for a material property), you will either get a real-time error message,or when you go to initialize or iterate the solution, FLUENT will report an error in thedialog box (Figure6.7.1).

    Figure 6.7.1: The Error Dialog

    A message will also be reported to the console (and log file):

    Error: get_udf_function: function dpm_timestep::libudf has wrong type: 28 != 26

    Error Object: #f

    c Fluent Inc. September 11, 2006 6-83

  • 8/12/2019 Fluentchpter

    84/84

    Hooking UDFs toFLUENT