CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   ANSYS (https://www.cfd-online.com/Forums/ansys/)
-   -   Cannot Execute DEFINE_ON_DEMAND Function via MATLAB ANSYS_aaS Toolbox (https://www.cfd-online.com/Forums/ansys/215120-cannot-execute-define_on_demand-function-via-matlab-ansys_aas-toolbox.html)

ahouse8 February 22, 2019 13:48

Cannot Execute DEFINE_ON_DEMAND Function via MATLAB ANSYS_aaS Toolbox
 
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_lpm 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
at
AAS_CORBA.EFluentGenericErrorHelper.read(EFluentGe nericErrorHelper.java:80)
at
AAS_CORBA._ICoFluentSchemeControllerStub.doMenuCom mand(_ICoFluentSchemeControllerStub.java:95)



I have tried multiple variations of the line in question, 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 the udf library from 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.


All times are GMT -4. The time now is 18:49.