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

Return a value from TUI

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 1 Post By asal
  • 2 Post By pakk

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 2, 2016, 09:52
Default Return a value from TUI
  #1
Senior Member
 
Astio Lamar
Join Date: May 2012
Location: Pipe
Posts: 186
Rep Power: 13
asal is on a distinguished road
Hi!

How can I return a value from TUI? With a TUI command, I get a velocity in a point in my simulation domain and I want to set this value somewhere in my boundaries. Therefore, I need to return this value from TUI to be able to use it.
Any idea?!
thanks.
asal is offline   Reply With Quote

Old   March 2, 2016, 10:24
Default
  #2
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
What do you mean?

The way I understand what you do:

You type a TUI command. For example:
Code:
(secretfunctiontogivevelocity)
The TUI responds by saying:
Code:
24.5119
You open the boundary condition you want to change, and type "24.5119" in the appropriate place.

Is this what you want, or is it what you want but you want it to be different?
pakk is offline   Reply With Quote

Old   March 2, 2016, 10:39
Default
  #3
Senior Member
 
Astio Lamar
Join Date: May 2012
Location: Pipe
Posts: 186
Rep Power: 13
asal is on a distinguished road
Hello and thanks for your reply.

Let's assume that I got the temperature on point_1 by the following command:

Code:
report surface-integrals facet-avg point_1 , temp ,
and fluent report:

Code:
291
Now I want to take this value and assign it to the inlet boundary

Code:
define boundary-conditions inlet ,,,,,,,,, XX ,,
Above instead of XX, I need to read the previous return values (in this case 291) and substitute to XX. How can I return the reported value from the first command in order to use it later on as an input.
Hopefully it is clear now.
thanks.
ram@IIT likes this.
asal is offline   Reply With Quote

Old   March 2, 2016, 10:51
Default
  #4
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
OK, I understand. This is possible, I think, but you have to deal with annoying scheme-code.

To get a number from the TUI as variable, you can use pick-a-real.

Code:
(pick-a-real "report surface-integrals facet-avg point_1 , temp ,")
To send a command to the TUI, you can use ti-menu-load-string.

Code:
(ti-menu-load-string "define boundary-conditions inlet ,,,,,,,,, XX ,,")
Now, instead of XX, you want to put the number in the string. This can be done with format.

Code:
(format #f "define boundary-conditions inlet ,,,,,,,,, ~a ,," 300)
So, altogether:

Code:
(ti-menu-load-string (format #f "define boundary-conditions inlet ,,,,,,,,, ~a ,," (pick-a-real "report surface-integrals facet-avg point_1 , temp ,")))
I don't have Fluent open at the moment, so I did not test this.
Tarantino and huiselilun like this.
pakk is offline   Reply With Quote

Old   March 3, 2016, 05:05
Default
  #5
Senior Member
 
Astio Lamar
Join Date: May 2012
Location: Pipe
Posts: 186
Rep Power: 13
asal is on a distinguished road
Hello again and thanks a lot.
It works perfect.

Just one more question.
Is it possible to have if statement here in the Scheme?
thanks.
asal is offline   Reply With Quote

Old   March 3, 2016, 15:04
Default
  #6
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
Check this link.
pakk is offline   Reply With Quote

Reply


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
Add Temperature to multiphaseInterFoam nthiers OpenFOAM Programming & Development 6 February 17, 2016 08:42
Derive fixed number of phase from clone () in multiphaseEulerFoam Solver Aj Nair OpenFOAM Programming & Development 0 December 16, 2013 20:41
Error in CFX Solver Leuchte CFX 5 November 6, 2010 06:12
Missing math.h header Travis FLUENT 4 January 15, 2009 11:48
Define animate using TUI Zurlugh FLUENT 1 July 24, 2008 08:55


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