Fluids

Fluids

Topics relate to Fluent, CFX, Turbogrid and more

Question about importing external discrete heat loads by using Fluent UDF.

    • lzfneu
      Subscriber

      Dear all,

      I intend to read an external file contains four columns data, which are x, y, z and heat loads, then assign heat loads to model. The file is large contains more than 8,000,000 lines. 

      In order to import the discrete data as heat loads to fluent to perform thermal calculation with water cooling. For each iteration, I need to calculate the distance between the coordinate of cell center of the model and x,y,z coordinate read from external file line by line. If the distance is near enough (less than threshold value), then assign heat loads to the corresponding cell center.

      To my knowledge, I think I have to use "loop" in DEFINE_SOURCE to read external file line by line and perform distance calculation. However, the external file contains more than 8,000,000 lines and the computer needs many many times to finish.

      Is there a quick method or built-in function for fluent UDF to perform heat loads importing from external file. Any suggestions will be appreciated. 

      Thanks in advance. 

       

    • Atharva Nagarkar
      Subscriber

      Hello,

      The DEFINE_SOURCE macro is used to specify custom source terms for the different types of solved transport equations in Ansys Fluent and not to read external files. You can find more about this particular macro at the link below.

      2.3. Model-Specific DEFINE Macros (ansys.com) -> Check section 2.3.43

      You need to convert your data into a text file format, read it and then assign heat loads after comparing with the threshold value using Fluent Macros. Please see the following links from the Fluent UDF Manual. Please be careful when doing this in parallel.

      A.13. C Library Functions (ansys.com) -> Check section A.13.3

      7.4. Reading and Writing Files in Parallel (ansys.com) -> Check section 7.4.1

      If you are not able to access the link, please refer to this forum discussion: Using Help with links (ansys.com)

Viewing 1 reply thread
  • You must be logged in to reply to this topic.