CFD Online Discussion Forums

CFD Online Discussion Forums (
-   Fluent UDF and Scheme Programming (
-   -   change fluent parameter via udf (

lorenz September 17, 2013 05:01

change fluent parameter via udf
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?

Hershey September 23, 2013 07:09

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


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.

ASimonsen January 19, 2015 10:47

How to access input parameters

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

Regards Anders

pakk January 20, 2015 04:14

Look at the Fluent UDF manual. Section 3.6.2: Accessing a Scheme Variable in the Text Interface.

In this case, it would be:

(%rpgetvar x)

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