-
-
October 14, 2023 at 5:25 pm
lzfneu
SubscriberDear 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.
-
October 18, 2023 at 9:36 am
Atharva Nagarkar
SubscriberHello,
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)
-
- You must be logged in to reply to this topic.

Boost Ansys Fluent Simulations with AWS
Computational Fluid Dynamics (CFD) helps engineers design products in which the flow of fluid components is a significant challenge. These different use cases often require large complex models to solve on a traditional workstation. Click here to join this event to learn how to leverage Ansys Fluids on the cloud, thanks to Ansys Gateway powered by AWS.

Earth Rescue – An Ansys Online Series
The climate crisis is here. But so is the human ingenuity to fight it. Earth Rescue reveals what visionary companies are doing today to engineer radical new ideas in the fight against climate change. Click here to watch the first episode.

Ansys Blog
Subscribe to the Ansys Blog to get great new content about the power of simulation delivered right to your email on a weekly basis. With content from Ansys experts, partners and customers you will learn about product development advances, thought leadership and trends and tips to better use Ansys tools. Sign up here.
- legend min and max
- Ensight hot iron palette from an image
- Streamlines in EnSight using MRI data
- Import MRI data into Ensight
- FLUENT APPLICATIION ERROR
- Total Surface Heat Flux Calculation in Fluent
- Drop Test of a Water-Filled Tube
- Difference between “total pressure” and “absolute pressure”?
- Minimum Orthogonal Quality Less than 0.01 For Transonic Airfoil Flow Analysis
- obtaining pressure distribution by making points in ansys
-
8808
-
4658
-
3153
-
1680
-
1470
© 2023 Copyright ANSYS, Inc. All rights reserved.