|
[Sponsors] |
October 20, 2020, 05:58 |
UDF report definition/output parameter
|
#1 |
New Member
Join Date: Jun 2020
Posts: 3
Rep Power: 6 |
Dear all,
I am trying to write an UDF to create a quite specific report definition/output parameter. By simplifying my udf I found out that the function is not returning any value to fluent, even if it does not need input from fluent. Does somebody know how to solve this problem? Example of a code giving no output: DEFINE_REPORT_DEFINITION_FN(volume_flow_rate_inlet ) { real inlet_area = 3.015607214; return inlet_area; } When I compute the value in this screen: Capture.PNG This is the output fluent gives: user-defined () -------------------------------- ------------------- test 0 Thanks in advance, Kind regards, Okkervb |
|
November 7, 2021, 05:33 |
|
#2 |
New Member
Anas Nur Fauzan
Join Date: Oct 2019
Posts: 18
Rep Power: 7 |
You defined the report value as a constant value. What is the point defining this report function if you already knew the value is then?
|
|
November 7, 2021, 10:54 |
|
#3 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
The point is to test this with the most simplified UDF possible. Okkervb explained this in the text above the UDF.
It's a smart approach. If you can't get something running, simplify your UDF, until you still have a problem but can not simplify further. Then the analysis becomes much easier. You have less code to go through.
__________________
"The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform" is NOT the error after compiling. It is the error after loading. To see compiler errors, look at your screen after you click "build". |
|
November 11, 2021, 09:44 |
|
#4 |
New Member
Anas Nur Fauzan
Join Date: Oct 2019
Posts: 18
Rep Power: 7 |
Ok sorry my bad.
I actually had experience similar to this. But I cannot guarantee this will work. Anyway, as far as I know, FLUENT solver is constructed by two types of "brain." Which are host and compute nodes. Easiest example is when we run parallel we partitioned the mesh to multiple region. All transport equation within these regions are solved by compute nodes and after being solved all the data are passed to node-0 (main compute node) and this node-0 pass it to host for further processing (which I don't really know). From your post, I assume that you are running a serial simulation. Even when doing a serial, FLUENT process still consist of these two "brains". But only consist of a host and node-0. So, I'm guessing that when your simulation runs your variable value wasn't passed to the host. Why this need to be done? Report definition sometimes involve data writing and reading to your storage, this can only be done by host. The solution is to write additional line before you return the calculated value within your macro codes. So your code should look like this. Code:
DEFINE_REPORT_DEFINITION_FN(volume_flow_rate_inlet ) {real inlet_area = 3.015607214; node_to_host_real_1(inlet_area); return inlet_area;} Hope this helps. Good luck. |
|
December 20, 2022, 05:10 |
|
#5 |
New Member
Anonymous
Join Date: Jul 2022
Posts: 6
Rep Power: 4 |
Thank you. I was breaking my head, but your answer saved me.
|
|
Tags |
fluent 19.2, report definition, report definition udf, udf |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF compiling error | Weiqiang Liu | FLUENT | 2 | November 21, 2018 10:36 |
How can I get a variable as output parameter from A UDF for post processing in fluent | Oula | Fluent UDF and Scheme Programming | 9 | November 2, 2018 06:35 |
Monitoring/writing a single parameter from UDF. | nvarma | FLUENT | 5 | September 2, 2018 22:52 |
change fluent parameter via udf | lorenz | Fluent UDF and Scheme Programming | 3 | January 20, 2015 04:14 |
Force can not converge | colopolo | CFX | 13 | October 4, 2011 23:03 |