CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

UDF report definition/output parameter

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 20, 2020, 04:58
Default UDF report definition/output parameter
  #1
New Member
 
Join Date: Jun 2020
Posts: 3
Rep Power: 5
okkervb is on a distinguished road
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
okkervb is offline   Reply With Quote

Old   November 7, 2021, 04:33
Default
  #2
New Member
 
Anas Nur Fauzan
Join Date: Oct 2019
Posts: 18
Rep Power: 6
luzikato is on a distinguished road
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?
luzikato is offline   Reply With Quote

Old   November 7, 2021, 09:54
Default
  #3
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
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".
pakk is offline   Reply With Quote

Old   November 11, 2021, 08:44
Default
  #4
New Member
 
Anas Nur Fauzan
Join Date: Oct 2019
Posts: 18
Rep Power: 6
luzikato is on a distinguished road
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;
}
You can refer this further in 7.3.2.2.2. Node-to-Host Data Transfer Page 554 in FLUENT UDF User Guide.
Hope this helps. Good luck.
luzikato is offline   Reply With Quote

Old   December 20, 2022, 04:10
Default
  #5
New Member
 
Anonymous
Join Date: Jul 2022
Posts: 6
Rep Power: 3
leodan is on a distinguished road
Thank you. I was breaking my head, but your answer saved me.
leodan is offline   Reply With Quote

Reply

Tags
fluent 19.2, report definition, report definition udf, udf


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
UDF compiling error Weiqiang Liu FLUENT 2 November 21, 2018 09: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 05:35
Monitoring/writing a single parameter from UDF. nvarma FLUENT 5 September 2, 2018 21:52
change fluent parameter via udf lorenz Fluent UDF and Scheme Programming 3 January 20, 2015 03:14
Force can not converge colopolo CFX 13 October 4, 2011 22:03


All times are GMT -4. The time now is 15:08.