CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > ANSYS > FLUENT

How to set as input parameter in Fluent a variable existing outside it?

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

LinkBack Thread Tools Search this Thread Display Modes
Old   March 3, 2015, 11:25
Default How to set as input parameter in Fluent a variable existing outside it?
New Member
Join Date: Dec 2014
Posts: 2
Rep Power: 0
didimad is on a distinguished road
Hy everyone,
I'm trying to couple some output of a Matlab code with Fluent. Let me explain myself : i'd like to set as input parameter for the Fluent solver, a variable ( scalar) that come from matlab code. Is there any way to impose the location (path) of my variable ( saved from the matlab code) in the parameter set, so that i don't have to enter its value manually?

For example, i've a variable named a.txt , and i want to set it as an input parameter through the parameter set interface, how can i do?

Thanks for your help !
didimad is offline   Reply With Quote

Old   March 3, 2015, 12:10
Senior Member
Andrew Kokemoor
Join Date: Aug 2013
Posts: 122
Rep Power: 12
Kokemoor is on a distinguished road
Hm, hopefully someone else here can cook up something more elegant, but this should do the trick.

Is there a reason you need to use Fluent parameters in particular? It will probably be easiest to do this with a scheme variable. Here's some unsanitary code that defines a variable "param" and reads the first value in "a.txt" into it.

(rp-var-define 'param 0.0 'real #f)
(define p (open-input-file "a.txt"))
(rpsetvar 'param (read p))
(close-input-port p)
Now that you've got a scheme variable with your value, you can use it pretty much anywhere.

(rpgetvar 'param)
Kokemoor is offline   Reply With Quote


Thread Tools Search this Thread
Search this Thread:

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
[OpenFOAM] Paraview 3.98 - errors when saving geometry file pajot ParaView 1 September 28, 2013 11:45
Fluent 14 journal script to set fluid parameters jhome ANSYS 0 April 30, 2012 05:26
Error when input new parameter in Fluent micro11sl FLUENT 0 July 1, 2011 07:42
Install problem in linux navaladi OpenFOAM Installation 11 July 17, 2008 03:24
Problem installing on 64bit with ver13 jonititan OpenFOAM Installation 0 April 28, 2006 06:45

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