Skip to Main Content



February 11, 2017

The (Technical) Kindness of Ansys Fluent aaS, a Matlab Example

My friend, a fellow Romanian, just told me a funny story. She just relocated to the U.S. and was asking her dentist "When will I have the root channel treatment?". The dentist kindly replied "Did you mean root canal, my dear?" 

Human kindness is a beautiful thing. As a software developer, I often wish that computer programs would be equally technically kind. Most of them are not. Many times, when a user mistypes a command, applications crash.

This is pretty common when driving Ansys Fluent from a remote program like Matlab. The Fluent scripting language is contextual. Consequently, the syntactic rules are changing during the simulation. For instance, substantially different commands are available when the CFD solver is changing the state, for example from meshing mode to simulation mode.

Fortunately, the aaS interface supports technical kindness. Consequently, when a command seems to be incorrect or incomplete, Fluent will switch to a "kind" response. Ultimately, the kindness will be offered as a clarifying exception. The exception should help the Matlab user understand the context. At this point such user could correct or complete the command.

My friend is using Matlab to drive Ansys Fluent, so I decided to demonstrate the technique in snippet of Matlab code for her. Here it is for you:

Matlab Code Driving Ansys Fluent

disp('Start Example')
out='Report not received';
     disp('Requesting <report summary>');
     out = tui.doMenuCommandToString('report summary -?')
catch ex
     if strcmp(ex_id , 'MATLAB:Java:GenericException')
          if strcmp(ex_object_class,'class AAS_CORBA.EYesNoQuestion')
     if bIKnowHowToClarify==false;
if bIKnowHowToClarify==true
     disp('Answering <No> to the clarification question...');
     disp('Requesting <report summary no>');
     out = tui.doMenuCommandToString('report summary no -?');

Program output

Start Example
Requesting <report summary>
write to file? [no]
Answering <No> to the clarification question...
Requesting <report summary no>
Version: 2d, dp, pbns, lam (2d, double pre....

Additionally, I would like to note something in the code. Adding  the suffix "-?" to a command indicates that suggestions are welcomed. Similarly, the absence of "-?" will turn off Fluent "kindness". Finally, Fluent supports a set of four clarifying exceptions. Of course, they are properly documented in Ansys manuals. Just search for "aaS" keyword. For more information about Matlab Fluent cosimulation please check out How to Make Matlab Apps for Ansys.

당신을 위한 Ansys 솔루션을 알아보십시오.


* = 필수 항목

문의해 주셔서 감사합니다!

여러분의 질문에 답변해 드리기 위해 최선을 다하겠습니다. Ansys 담당 엽업이 곧 연락을 드릴 것입니다.

바닥글 이미지