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

change fluent parameter via udf

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By pakk

Reply
 
LinkBack Thread Tools Display Modes
Old   September 17, 2013, 05:01
Default change fluent parameter via udf
  #1
New Member
 
Manuel Lorenz
Join Date: Jul 2011
Posts: 5
Rep Power: 6
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, 07:09
Default
  #2
Member
 
Christopher Hershey
Join Date: Feb 2012
Location: East Lansing, Michigan
Posts: 41
Rep Power: 5
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: 4
Rep Power: 3
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: 689
Rep Power: 9
pakk is on a distinguished road
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

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Two questions on Fluent UDF Steven Fluent UDF and Scheme Programming 4 September 20, 2013 16:30
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
UDF to record FLUENT Solver variables... mariachi Fluent UDF and Scheme Programming 9 February 19, 2010 13:25
fluent UDF external library lapack problem Rick FLUENT 0 May 7, 2008 10:16


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