-
-
March 10, 2023 at 8:35 am
Francisco Acosta
SubscriberHi,
I have a report defined with DEFINE_REPORT_DEFINITION_FN in a UDF. I can plot this report within Fluent, but when I try to use it elsewhere (e.g. within an expression), its value is always zero.
I tried to solve this issue by defining another DEFINE_REPORT_DEFINITION_FN that reads the first report using Get_Report_Definition_Values. I can then use this second report everywhere, without getting zero. However, I still have an issue in the first iteration or time step: this second report is zero. For example, if for the first 3 iterations/time steps the 1st report values are [1,2,3], the second report values are [0,2,3].
Could someone clarify this behaviour? How can I directly use the value of the report created by the first udf?
The two UDFs are as follows, and im running a parallel fluent sim:
DEFINE_REPORT_DEFINITION_FN(report1){#if RP_HOSTreal value = 0;// do some stuff and set the value of value// Everything is done in host beacuse it's just a file reading operationreturn value;#endif// Note that everythin is done by host and value is not available for the nodes// I tried defininf value for all nodes and hosts and after setting its value in host passing it to nodes// with host_to_node_real_1 but fluent crushes when i try to do this}DEFINE_REPORT_DEFINITION_FN(report2) //{real val = 0;// Get the value of the report named 'report1', of size 1 (scalar)real *values;values = (real *)malloc(sizeof(real) * 1);int rv = Get_Report_Definition_Values("report1", 1, NULL, values, NULL, NULL);val = values[0];free(values);// Make the value available to hostnode_to_host_real_1(val);return val;}Thanks in advance! -
March 10, 2023 at 4:18 pm
Rob
Ansys EmployeeRead the documentation section https://ansyshelp.ansys.com/account/Secured?returnurl=/Views/Secured/corp/v231/en/flu_udf/flu_udf_GeneralSolverDEFINE.html%23flu_udf_sec_report_defintion The DEFINE_REPORT_DEFINITION_FN returns a number.
The other behaviour may be down to when data is created and updated when you start a calculation. Not everything is known at the start of iteration/timestep zero so it's possible Fluent doesn't calculate "stuff" to avoid returning nonsense values. Without asking I can't be sure, and if I ask I won't be able to report on here as it's probably not documented.
-
March 10, 2023 at 4:26 pm
Francisco Acosta
SubscriberThank you for your answer.
I know that DEFINE_REPORT_DEFINITION_FN returns a number ; thats the behaviour I expect. Other than the issue at the first time step, what I don't get is why I can't use the value of the report that uses that definition anywhere other than its own plot. For example, when I try to use the report value in an expression, I always get zero.
-
March 10, 2023 at 4:38 pm
Rob
Ansys EmployeeI know expressions are still evolving so it's possible it's not available at present. I generally use either expressions or UDFs for a task.
-
- 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
-
3720
-
2566
-
1771
-
1236
-
592
© 2023 Copyright ANSYS, Inc. All rights reserved.