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

change fluent parameter via udf

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By pakk

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 17, 2013, 06:01
Default change fluent parameter via udf
  #1
New Member
 
Manuel Lorenz
Join Date: Jul 2011
Posts: 5
Rep Power: 15
lorenz is on a distinguished road
Hi,
I use in my simulation some input parameters (for example for the inlet temperature or for the flow rate ratio of an outflow). I have found out how to acess these variables via scheme. But is there also a way to access and change these parameters with an udf function?
Thanks...
lorenz is offline   Reply With Quote

Old   September 23, 2013, 08:09
Default
  #2
Member
 
Christopher Hershey
Join Date: Feb 2012
Location: East Lansing, Michigan
Posts: 41
Rep Power: 14
Hershey is on a distinguished road
Yes, it is possible. So take the following example:

In FLUENT, define your scheme variable 'x'

(rp-var-define 'x 0 'integer #f)

Now you have defined an integer variable x with 0 as its value.

To set this in a UDF

RP_Set_Integer("x",3)

Now you have set the scheme variable x to 3.

Two notes: Your variable must be a string in the UDF and the Integer portion changes based on the type of variable you have.

You can also access your variable in a UDF by:

y = RP_Get_Integer("x");

Now y is equal to your value set in the scheme variable x.

Please respond if you need more help.
Hershey is offline   Reply With Quote

Old   January 19, 2015, 10:47
Default How to access input parameters
  #3
New Member
 
Anders Simonsen
Join Date: Sep 2013
Posts: 18
Rep Power: 13
ASimonsen is on a distinguished road
Hello.

lorenz - how did you access the input parameters via scheme?

Regards Anders
ASimonsen is offline   Reply With Quote

Old   January 20, 2015, 04:14
Default
  #4
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
Look at the Fluent UDF manual. Section 3.6.2: Accessing a Scheme Variable in the Text Interface.

In this case, it would be:
Code:
(%rpgetvar ’x)
ASimonsen likes this.
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
UDF to record FLUENT Solver variables... mariachi Fluent UDF and Scheme Programming 11 September 24, 2019 01:07
Two questions on Fluent UDF Steven Fluent UDF and Scheme Programming 7 March 23, 2018 04:22
UDF interpret in Fluent wanghaojie Fluent UDF and Scheme Programming 1 February 3, 2012 15:51
Fluent UDF Discontinuous Motion lequi7 Fluent UDF and Scheme Programming 2 November 4, 2011 00:18
fluent UDF external library lapack problem Rick FLUENT 0 May 7, 2008 11:16


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