Matlab and Ansys Workbench -aas coupling

  • 1.1K Views
  • Last Post 12 April 2019
  • Topic Is Solved
aacius1 posted this 26 October 2018

Hello,

 

I am working to connect Matlab 2016b with Ansys Workbench.  I have downloaded the -aas toolbox and installed it into matlab.  I have successfully captured the fluent coupling and the Mechanical APDL coupling.  There are instructions with the toolbox to couple with workbench but I cannot seem to get it to work.  I have attached the aas instruction sheet.

Following the instruction on page 4 of the attached PDF, I went into to command prompt and went to run the "runwb2" .bat file with the extensions the instructions suggest as an example.  Not sure how to determine if the example write out is appropriate or not.

Specifically I need to create a aaS_Wbld.txt file that will allow the link to happen.  Everything I can find states that the file needs to be made but not how to get it.

I have already reviewed the popular ansys blog How to Make Matlab apps.  It is not helpful in determining how to actually get the aas keys made, it just states to go make them.

Any help on this would be greatly appreciated.

Attached Files

Order By: Standard | Newest | Votes
Kremella posted this 26 October 2018

Hello,

As ANSYS employees, we will not be able to open any attached files. Could you please post the instructions you are talking about as screenshots? If this does not work, could you please point us to the link where you found this document? We would like to understand your question better. 

If you have not see these already, here are some resources which might be of some help to you.

https://studentcommunity.ansys.com/thread/download-matlab-toolbox-ansysaas/

https://www.ansys.com/blog/how-to-make-matlab-apps-for-ansys/

Also, I am moving this post to 'Structural Mechanics' for more traction.

I hope this helps.

Best Regards,

Karthik

aacius1 posted this 26 October 2018

Thanks for the response Karthik

You're first link was helpful to me earlier today as it explains how to find Fluent and MAPDL.  The suggestions by the Admin at the end of the thread  on using workbench were how to call workbench in matlab.  You'll notice step 3 of the admins suggestions calls aaS-Wbld.txt.  That's the file I need to get Ansys to create.  I have already gotten MAPDL and Fluent to make respective files for their uses.

Unfortunately the 2nd link only states that the .txt file Im trying to get should be made, not how to make it

The instructions state that for workbench you should add the below to the standard workbench command

-I -E "with open('aaS_Wbld.txt','w') as file:file.write(Server.StartServer('localhost',0,9000,9200))"

I assumed that this meant I should call workbench from the windows command prompt.  I used the following line...

C:\Program Files\ANSYS Inc\v162\Framework\bin\Win64\rubwb2 -I -E "with open('aaS_Wbld.txt','w') as file:file.write(Server.StartServer('localhost',0,9000,9200))"

I found that this would open workbench but I would receive an error that stated there was a unexpected syntax ":" and would point at 'w' near the beginning of the extra command.

Ansys Student also has youtube files on how to get MAPDL and Fluent set up but not workbench.  If we figure this out, I'm sure it would help a lot of people if another video was added

 

Thanks

Aric

Gary_S posted this 29 October 2018


Example:

Create a batch file in your home folder, i.e. C:\users\jsmith

Double click the batch file. WB will start, and the aaS_WbId.txt will be created 

Note: The 2nd command is a single line. 

 

myRunWB.cmd

-------------

@echo off

"C:\Program Files\ANSYS Inc\v190\Framework\bin\Win64\runwb2.exe" -I -E "with open('aaS_WbId.txt','w') as file:file.write(Server.StartServer('localhost',0,9000,9200))"

  • Liked by
  • SandeepMedikonda
  • aacius1
aacius1 posted this 29 October 2018

Hey Gary_S

 

Hopefully you won't mind but I have another question since you got me past that first roadblock. Once I open up Workbench with this, and follow the method of connecting matlab to workbench by putting the following into Matlab:

orb=initialize_orb()

load_ansys_aas;

actwbserver(CUsers/me/aaS_WbId.txt')

 

 

 

 

 

 

 

 

 

 

 

 

Everything seems to be going fine.

 

When I enter in the next commands as suggested by the instructions I get JAVA errors.  The command and error are below.

Whenever I use execwbcommand(' ') I get the same error.  My understanding was that it should work in a similar way to regular ansys script commands. 

 

Matlab error

Meru posted this 12 April 2019


Example:

Create a batch file in your home folder, i.e. C:\users\jsmith

Double click the batch file. WB will start, and the aaS_WbId.txt will be created 

Note: The 2nd command is a single line. 

 

myRunWB.cmd

-------------

@echo off

"C:\Program Files\ANSYS Inc\v190\Framework\bin\Win64\runwb2.exe" -I -E "with open('aaS_WbId.txt','w') as file:file.write(Server.StartServer('localhost',0,9000,9200))"

Hello,

while running this bat file I am able to create a txt file called aaS_WbId.txt but this file is blank and there is no key in it. could you help me in overcoming this hurdle? 

also when I initiate connection with in matlab by actwbserver('aaS_WbId.txt') command I am getting a java error 

could you please help me 

Thank you

Meru

Close