-
-
March 10, 2023 at 7:43 pm
satri
SubscriberIn Ansys documentation section 7.8 Parallel UDF example there is an example of adjust function that is been parallelized. but it does not say what tpe of geometry it corresponds to? is there any specific example in the fluent tutorials to which this UDF is applicable? If so please let me know. My aim is to validate this with an example problem run it in serial get the area-weighted avg of pressure and then run it in parallel and compute the area-weighted avg. I am not sure which example should i try this on.
-
March 13, 2023 at 4:27 pm
Rob
Ansys EmployeeI assume you mean this one? https://ansyshelp.ansys.com/account/Secured?returnurl=/Views/Secured/corp/v231/en/flu_udf/flu_udf_sec_using_udfs_parallel.html%23flu_udf_sec_parallel_example It looks to be applied to a face, but I'd not recommend using an interior without adding some further checks that are also outlined in the manual.
The examples are there to show how to take various serial concepts (typically face and cell loops) and ensure they're run correctly in parallel. There are no example geometries as the UDF features are fairly advanced.
-
March 14, 2023 at 2:30 pm
DrAmine
Ansys EmployeeYou task can be done via Report Definition and Fluent Expressions.
-
March 14, 2023 at 4:18 pm
satri
SubscriberYes, I am referring to that link.
I understand udfs are fairly advanced.
But to understand what is going on when I parallelize,
I need to reference it with a standard example problem and analyze how the inclusion of '#RP_HOST' '#RP_NODE' and noninclusion of RP_HOST and RP_NODE makes a difference in total_area or total_force. Without examples, it is hard to understand as ansys documentation does not show any examples.
Based on looking at the UDF i understand that it is being used to compute the total pressure on a face zone.
So please tell me if this will work with this problem
1. I have a cylendrical pipe of diameter D = 0.02m, length L=0.4m which has a mass flow rate of Qdot = 0.01kg/s (water). (I am going to set this up as a 2d axis-symmetric problem). I will run a simple laminar simulation.For validation purpose)a) I will evaluate the pressure drop computed with surface integrals area-weighted average from the GUI
b) I will use the UDF and compute total_force/total_area will these two numbers match?
Do you think this can be taken as a sample problem for this UDF or does this correspond to any other problem? (This is the confusion, for which problem does this UDF correspond to)
-
March 14, 2023 at 5:13 pm
Rob
Ansys EmployeeThe UDF example is to show how the parallel parts are put together. The face loops etc are covered earlier in the manual. Write the basic code and test on one core. Then look into adding the RP_HOST calls based on that part of the documentation. Then test by forcing a partition that cuts the surface(s) of interest: don't rely on Fluent's automatic method as it's intended to maximise efficiency gains.
If done correctly numbers will match. I'd not use a UDF to find pressure drop, that's what the reporting functions are for. Finding a surface pressure to do "something" is what UDFs are for.
-
March 15, 2023 at 1:55 am
satri
SubscriberI do not understand this statement.Then test by forcing a partition that cuts the surface(s) of interest: don't rely on Fluent's automatic method as it's intended to maximise efficiency gains.what do you mean by intended to maximize efficiency gains?my question is, i will use the UDF in Section 7.8 on a simple fully developed laminar flow in a pipe problem as described above.I will set int surface_thread_id=3; (in the second line of the udf printed, this is the thread ID of the inlet)and when the second to last line is executed,This one:Message("Average pressure on Surface %d is %f (Pa)\n",surface_thread_id,(total_force/total_area));will this print/display on the console the average pressure value which is equal to the area-weighted average of pressure (calculated from surface integrals)?please let me know. -
March 15, 2023 at 6:57 am
DrAmine
Ansys EmployeeWe have UDF Training on the Ansys Learning Hub where all this is explained. If you do not parallelize general purpose DEFINE Macros like DEFINE_ADJUST or DEFINE_ON_DEMAND you might end up counting things more than once and for that reason global reduction is assessed. Moreover calculation should be done on Nodes as only Nodes have mesh. Sometimes you require to pass the information between Nodes and Host and that is done syncronization. In the example that where the ID of thread zone you want to calcualte the average pressure is passed. The example in the Customization manual is detailed example to get averaged pressure and force on a boundary. It does also show which issues can arise if parallelloizing is not done (I think the UDF can be simplified but has been there for a while now). If you want to test the UDF just create a dummy example, like duct flow, and then proceed with the creation of the schme variable to store the ID of the boundary you want to evaluate pressure/force on, as described in the example.
Question: What is your goal? Perhaps built-in reports and Fluent Expression Language are enough.
-
March 15, 2023 at 10:05 am
Rob
Ansys EmployeeWhen we parallelise the model we split the load over two (or more) nodes. If we split with equal cells that's likely to give a good speed up. Now, for a pipe, if we split across the axis the partition has fewest cells: if we split along the axis the partition has most cells. The former results in less data transfer between nodes so is most efficient.
However, to test your code you want the partition to cut the boundary of interest. Otherwise it's not a very good test. Hence using the manual partition and reviewing the options other than Metis.
-
- 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.
- Suppress Fluent to open with GUI while performing in journal file
- Floating point exception in Fluent
- What are the differences between CFX and Fluent?
- Heat transfer coefficient
- Getting graph and tabular data from result in workbench mechanical
- The solver failed with a non-zero exit code of : 2
- Difference between K-epsilon and K-omega Turbulence Model
- Time Step Size and Courant Number
- Mesh Interfaces in ANSYS FLUENT
- error in cfd post
-
3778
-
2587
-
1831
-
1244
-
598
© 2023 Copyright ANSYS, Inc. All rights reserved.