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

how to get Varaible value by using TUI

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 3, 2019, 09:53
Default how to get Varaible value by using TUI
  #1
New Member
 
Layth
Join Date: Mar 2016
Posts: 5
Rep Power: 10
lma80 is on a distinguished road
Hi all,
I am using VOF model and I want to get the surface tension value through the TUI by rpgetvar so I can use it in a udf. I wander if it is possibale.
Regards,
lma80 is offline   Reply With Quote

Old   September 4, 2019, 00:39
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
using scheme file you may create any king of variable
Code:
(define (make-new-rpvar name default type)
	(if (not (rp-var-object name))
		(rp-var-define name default type #f)
	)
)
(make-new-rpvar 'my_surface_tension 30.0 'real)
in UDF you can access this variable:
Code:
surf_tension = RP_Get_Real("my_surface_tension"); //get parameter
RP_Set_Real("my_surface_tension",60.0); //set parameter
best regards
AlexanderZ is offline   Reply With Quote

Old   September 4, 2019, 07:25
Default
  #3
New Member
 
Layth
Join Date: Mar 2016
Posts: 5
Rep Power: 10
lma80 is on a distinguished road
Thank you for your replay

I can use the GUI to set the surface tension coefficient by going to the phase interaction>surface tension>surface tension coefficient.
how can I get this value through the TUI?

i used the code (cx-send '(for-each (lambda (v) (pp v)) rp-variables)) to get the variable scheme list and the surface tension coefficient is part of the domains variable but I do not know how to use the rpgetvar to get the value of the surface tension coefficient.

Best Regards
lma80 is offline   Reply With Quote

Old   September 4, 2019, 21:43
Default
  #4
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
Code:
(rpgetvar 'variable_name)
try this
Code:
(rpgetvar 'mp/cvt/surface-tension)
best regards
AlexanderZ is offline   Reply With Quote

Old   September 5, 2019, 06:19
Default
  #5
New Member
 
Layth
Join Date: Mar 2016
Posts: 5
Rep Power: 10
lma80 is on a distinguished road
Thanks a lot.
lma80 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
TUI 'if' statement depending on Total Wallclock time? bloodflow FLUENT 1 August 25, 2019 22:21
Using the TUI to write/read profiles to update BC's? bloodflow FLUENT 2 August 22, 2019 07:51
Return a value from TUI asal FLUENT 5 March 3, 2016 15:04
TUI Commands from GUI? Carlos FLUENT 6 May 22, 2013 18:05
Define animate using TUI Zurlugh FLUENT 1 July 24, 2008 08:55


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