Cannot Execute DEFINE_ON_DEMAND Function via MATLAB ANSYS_aaS Toolbox

  • Last Post 23 February 2019
ahouse8 posted this 22 February 2019


I am currently trying to compile a UDF library and execute a function on demand via the MATLAB ANSYS aaS Toolbox. Using the object function ‘doMenuCommand,’ I am able to compile and load the UDF library using the same text commands as if I were writing a Journal file: 

iFluentTuiInterpreter.doMenuCommand('define user-defined compiled-functions compile libudf yes Example1.c’);

iFluentTuiInterpreter.doMenuCommand('define user-defined compiled-functions compile libudf yes n Example2.h’); 

However, when attempting to ‘execute on demand,’ an ‘EFluentGenericError’ is thrown. When attempting to run the following line: 

iFluentTuiInterpreter.doMenuCommand('define user-defined execute-on-demand MyFunction::libudf’); 

The following error results: 

Java exception occurred:

AAS_CORBA.EFluentGenericError: IDL:AAS_CORBA/EFluentGenericError:1.0 





I have tried multiple variations of the line in questions, all of which return the same error. The Fluent aaS manual states “you will be able to execute the full set of TUI commands in the Fluent Remote Console as if you are running Fluent locally.”


Some other interesting points:

After compiling and loading in MATLAB, the Define on Demand function can be run via the gui and the tui in the local instance of Fluent. However, when running it from the tui, the function in question does not appear in the list. Fluent states: “Execute on demand function name ["none"]”, but entering “MyFunction::libudf” will run the function.


Any help would be appreciated. The only documentation that is referenced is the aaS manual. No separate documentation exists for the ANSYS_aaS toolbox, but the syntax in that manual has to be tweaked slightly to run in MATLAB.


tsiriaks posted this 23 February 2019

I would recommend to try posting this question in Physics Simulation -> Fluid Dynamics  section. You might get more attention there.

Thank you,