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

PyFluent postproc - assign report value to a float variable

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 15, 2023, 09:19
Default PyFluent postproc - assign report value to a float variable
  #1
New Member
 
Zalan Zsigmond
Join Date: May 2018
Posts: 1
Rep Power: 0
Zalan is on a distinguished road
Hi All,

I'm new to Ansys PyFluent and I'd like to have an surface-average temperature report value assigned to a numerical (float) variable in PyFluent.
Doing this TUI command within Fluent Console:
/report/surface-integrals/mass-weighted-avg/ycut_1 temperature no
Gave the following output:
Mass-Weighted Average Static Temperature [K]
-------------------------------- --------------------
ycut_1 345.40113




When I run the PyFluent-equivalent command of the above code in Jupyter Notebook, some strange 'False' boolean is given as output:
Commands:
t_bulk = solver.results.report.surface_integrals(report_typ e = "area-weighted-avg", surface_id = ["ycut_1"], cell_report = "temperature", write_to_file = False)
print(t_bulk)


Result:

Area-Weighted Average
Static Temperature [K]
-------------------------------- --------------------
ycut_1 342.32108
False


Assigning this command to a variable results in a 'bool' type variable but this is weird as it seems a string to me:
Command:
type(t_bulk)

Output:

bool


My question is: do you know any trick on how to get just the numerical value of this report (in above example, 342.32108)?


Many thanks in advance.

Last edited by Zalan; August 15, 2023 at 09:28. Reason: Text editing disappeared
Zalan is offline   Reply With Quote

Old   August 28, 2023, 12:14
Default
  #2
New Member
 
wuhaibin
Join Date: Aug 2023
Posts: 8
Rep Power: 3
HB833 is on a distinguished road
I have encountered similar issues, but what I want to store the text, and I use: message_ Session. tui. mesh. manage. list(),the i get all the information about the mesh of all fluid. I want to save it as a string type into a variable, but I failed. I am unable to save some values and text in pyfluent. Have you made any progress on this issue recently? Can you help me?
HB833 is offline   Reply With Quote

Old   September 4, 2023, 16:53
Default Same question
  #3
New Member
 
Quique Dios
Join Date: Sep 2023
Posts: 1
Rep Power: 0
quiquedios is on a distinguished road
Has anyone figured this out already? I'm finding the same issue

Quote:
Originally Posted by Zalan View Post
Hi All,

I'm new to Ansys PyFluent and I'd like to have an surface-average temperature report value assigned to a numerical (float) variable in PyFluent.
Doing this TUI command within Fluent Console:
/report/surface-integrals/mass-weighted-avg/ycut_1 temperature no
Gave the following output:
Mass-Weighted Average Static Temperature [K]
-------------------------------- --------------------
ycut_1 345.40113




When I run the PyFluent-equivalent command of the above code in Jupyter Notebook, some strange 'False' boolean is given as output:
Commands:
t_bulk = solver.results.report.surface_integrals(report_typ e = "area-weighted-avg", surface_id = ["ycut_1"], cell_report = "temperature", write_to_file = False)
print(t_bulk)


Result:

Area-Weighted Average
Static Temperature [K]
-------------------------------- --------------------
ycut_1 342.32108
False


Assigning this command to a variable results in a 'bool' type variable but this is weird as it seems a string to me:
Command:
type(t_bulk)

Output:

bool


My question is: do you know any trick on how to get just the numerical value of this report (in above example, 342.32108)?


Many thanks in advance.
quiquedios is offline   Reply With Quote

Reply

Tags
pyfluent, pyfluent core, reporting, tui


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
generating report definition shows Unbound variable Shamoon Jamshed FLUENT 7 September 21, 2021 03:40
Report Output Filename - variable Jiricbeng CFX 0 August 15, 2014 08:44
Assign new variable in CFX Post Ben CFX 1 August 25, 2008 15:59
error in COMSOL:'ERROR:6164 Duplicate Variable' bhushas COMSOL 1 May 30, 2008 05:35
Replace periodic by inlet-outlet pair lego CFX 3 November 5, 2002 21:09


All times are GMT -4. The time now is 18:07.