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

Mechanical Engr.

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 2 Post By Sorin

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 23, 2012, 13:16
Default Mechanical Engr.
  #1
New Member
 
F.Z. Hamadah
Join Date: Dec 2010
Location: Kuwait
Posts: 1
Rep Power: 0
fhd79 is on a distinguished road
Hi there,
I have a problem in running fluent as a batch mode using Matlab, I am using the following command !C:\Fluent.Inc\ntbin\ntx86\fluent 2ddp -hidden -i "./FNACA4412.jou"
But I always end up with an error massage of:
Error: read-data: invalid plot file format
Error Object: *eof*
Warning: An error or interrupt occurred while reading the journal file.
Some commands may not have been completed.

However, if I open fluent and used; file/read-journal ... and selected the journal file it will work perfectly..!!!

Please help and advice.

Thanx
FH.
fhd79 is offline   Reply With Quote

Old   May 9, 2013, 17:13
Default
  #2
New Member
 
Sorin Munteanu
Join Date: Apr 2013
Posts: 27
Rep Power: 14
Sorin is on a distinguished road
Hi F.H.

Did you try using Fluent in server mode?

Instead of starting Fluent from inside Matlab you can start it from outside Matlab (could be on a different machine) and then connect from Matlab. You can run the TUI commands from the connected Matlab one at a time.

See below an example (I presume you are using Fluent R14.5...)

1. Have the Fluent COM connector registered to Windows
cd C:\Fluent.Inc\fluent14.5.0\addons\corba\ntx86\
regsvr32 ComCoFluentUnit.dll

1. start Fluent in server mode with the following command:
C:\Fluent.Inc\ntbin\ntx86\fluent 2ddp -aas
Fluent will generate a server key (aaS_FluentId.txt) in the folder where you launched Fluent

2. start Matlab and execute the following commands to connect to Fluent's TUI interpreter using aaS_FluentId.txt

fluent = actxserver(‘ANSYS.CoFluentUnit.1′);
tui=fluent.getSchemeControllerInstance();
fid=fopen(‘aaS_FluentId.txt’,'r’)
fluentkey=fscanf(fid,’%s’)
fclose(fid)
fluent.ConnectToServer (fluentkey)


3. run the commands in the batch file from Matlab, mixed with your Matlab commands. See below some examples
tuiCommand="report summary"
tuiOutput=tui.DoMenuCommandToString(tuiCommand);
rpVarName='pressure/relax'
rpVarValue=tui.GetRpVar(rpVarName)
...


4. When you are done you can shutdown Fluent from Matlab:
fluent.Terminate()

You can find all commands in the ANSYS Fluent aaS documentation. For a small example you can refer to my blog post at http://www.ansys-blog.com/tag/matlab/

Please let me know if you need more info.

Sorin
blackmask and vahid_ir like this.
Sorin is offline   Reply With Quote

Old   April 23, 2015, 18:06
Default Need Help
  #3
New Member
 
Iman Haji Gholami
Join Date: Feb 2014
Posts: 2
Rep Power: 0
iman h is on a distinguished road
Hi, thank you for your tips,

I have a problem in the first line.

fluent = actxserver(‘ANSYS.CoFluentUnit.1′);

I have an error :

Error using actxserver (line 91)
Server creation failed. Invalid ProgID 'ANSYS.CoFluentUnit.1'.
iman h is offline   Reply With Quote

Old   March 24, 2016, 10:47
Default
  #4
New Member
 
Join Date: Mar 2016
Posts: 2
Rep Power: 0
s sur is on a distinguished road
Quote:
Originally Posted by iman h View Post
Hi, thank you for your tips,

I have a problem in the first line.

fluent = actxserver(‘ANSYS.CoFluentUnit.1′);

I have an error :

Error using actxserver (line 91)
Server creation failed. Invalid ProgID 'ANSYS.CoFluentUnit.1'.
I was able to make it work by omitting the ".1" after "ANSYS.CoFluentUnit", ie,

fluent = actxserver('ANSYS.CoFluentUnit')

worked for me. I was able to run FLUENT and pass TUI commands from MATLAB this way.
s sur is offline   Reply With Quote

Old   March 1, 2023, 18:42
Default
  #5
New Member
 
ashish
Join Date: Mar 2023
Posts: 1
Rep Power: 0
ashishgupta is on a distinguished road
Quote:
Originally Posted by Sorin View Post
Hi F.H.

Did you try using Fluent in server mode?

Instead of starting Fluent from inside Matlab you can start it from outside Matlab (could be on a different machine) and then connect from Matlab. You can run the TUI commands from the connected Matlab one at a time.

See below an example (I presume you are using Fluent R14.5...)

1. Have the Fluent COM connector registered to Windows
cd C:\Fluent.Inc\fluent14.5.0\addons\corba\ntx86\
regsvr32 ComCoFluentUnit.dll

1. start Fluent in server mode with the following command:
C:\Fluent.Inc\ntbin\ntx86\fluent 2ddp -aas
Fluent will generate a server key (aaS_FluentId.txt) in the folder where you launched Fluent

2. start Matlab and execute the following commands to connect to Fluent's TUI interpreter using aaS_FluentId.txt

fluent = actxserver(‘ANSYS.CoFluentUnit.1′);
tui=fluent.getSchemeControllerInstance();
fid=fopen(‘aaS_FluentId.txt’,'r’)
fluentkey=fscanf(fid,’%s’)
fclose(fid)
fluent.ConnectToServer (fluentkey)


3. run the commands in the batch file from Matlab, mixed with your Matlab commands. See below some examples
tuiCommand="report summary"
tuiOutput=tui.DoMenuCommandToString(tuiCommand);
rpVarName='pressure/relax'
rpVarValue=tui.GetRpVar(rpVarName)
...


4. When you are done you can shutdown Fluent from Matlab:
fluent.Terminate()

You can find all commands in the ANSYS Fluent aaS documentation. For a small example you can refer to my blog post at http://www.ansys-blog.com/tag/matlab/

Please let me know if you need more info.

Sorin
Hi Sir,
I am facing similar issue with Ansys MAxwell.
>> actxserver('Ansoft.ElectronicsDesktop');
Error using actxserver (line 93)
Server creation failed. Invalid ProgID 'Ansoft.ElectronicsDesktop'.

>> iMaxwell = actxserver ('AnsoftMaxwell.MaxwellScriptInterface');
Error using actxserver (line 93)
Server creation failed. Invalid ProgID 'AnsoftMaxwell.MaxwellScriptInterface'.

Could you please help me out?
Thanks!!!
ashishgupta 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
About 2 Way FSI (CFX+ANSYS Mechanical) shreyasr ANSYS 2 November 7, 2012 13:30
Incompressible flow: mechanical energy terms Pinaki Bhattacharya FLUENT 0 January 29, 2009 12:33
Help: Can a mechanical engineer be a programmer? JOHN Main CFD Forum 12 June 5, 2002 23:37


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