CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   Setting up a parametric simulation with UDF variables (https://www.cfd-online.com/Forums/fluent-udf/144396-setting-up-parametric-simulation-udf-variables.html)

rohinibc November 13, 2014 10:09

Setting up a parametric simulation with UDF variables
 
Hi all,

I would like to know how I can set up an input file to run fluent in batch mode to perform a series of simulations. To be more specific, about my problem, here is what I have. In my UDF function, I have 2 parameters, say, a and b and they each can have upto 10 values. I would like to study the influence of these parameters, which would be 100 simulations in total, on a specifically chosen output parameter. While I am able to declare scheme variables and invoke them within my UDF file, I don't know how to set up an input file to loop over the various values for the parameters.

Or, is there another way that I can interface Fluent with some other scripting language such as Fortran /Python/Matlab and run within scripts that are setup in these languages? Any help with this would be greatly appreciated.

macfly November 13, 2014 19:59

Hi,

I would go with a journal file that executes the following commands a 100 times:
- read case
- interprete or compile UDF
- solve and save

BUT, I would generate the journal file and the 100 different UDFs with Python, Matlab, etc.

Kokemoor November 14, 2014 10:24

Macfly's approach is probably the best, though if you've already set your UDF up to read scheme variables, you can just change the scheme variables 100 times and always use the same UDF.

rohinibc November 18, 2014 18:13

Thanks all. I did what Macfly suggested. Generated a script to produce my input file for Fluent to run in batch mode.
However, I also recently saw that in version 15.0, there is the possibility of declaring input parameters that can be read into UDF files. This I think directly syncs up with the RSM options in WorkBench too. I am yet to execute this to see how it works out.

Kokemoor November 19, 2014 10:52

DEFINE_OUTPUT_PARAMETER (2.2.10 in the UDF Manual) is a pretty straightforward macro to calculate an output parameter in the UDF. RP_Get_Input_Parameter("variable name") is the function to read input parameters, though I haven't used it myself. Section 3.6.4 of the UDF Manual has other functions to read from scheme variables as well.


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