Hi @耳,
Saw your post about the MATLAB-Fluent temperature function issue and thought I could help out. That error you're running into with the Z-axis temperature function is actually pretty common - you're definitely not doing anything wrong on your end. Looking at your code, your CORBA setup is actually perfect - getting those summary reports means your connection is solid. The issue you're hitting is just a string handling quirk in how MATLAB passes quoted expressions to Fluent's TUI.
The issue you're seeing occurs because MATLAB's string handling gets confused when passing quoted expressions through the CORBA interface to Fluent's Scheme-based TUI. Your "4[K]*z/1[m]" function is valid, but the quotes aren't making it through the interface properly.
Try this modification first - should fix your exact line:
% Replace your current temperature function line with this: temperatureFunc = '''4[K]*z/1[m]'''; % single quotes around double quotes command = ['define boundary-conditions wall wall yes no yes no no yes temperature no ' temperatureFunc ' no no no no yes yes yes yes yes yes']; iFluentTuiInterpreter.doMenuCommandToString(command);
*If that still gives you trouble*, try breaking down your long command:
% Instead of your single long line, try step-by-step: iFluentTuiInterpreter.doMenuCommandToString('define boundary-conditions wall wall'); iFluentTuiInterpreter.doMenuCommandToString('yes'); % thermal conditions iFluentTuiInterpreter.doMenuCommandToString('no'); % heat generation iFluentTuiInterpreter.doMenuCommandToString('yes'); % temperature iFluentTuiInterpreter.doMenuCommandToString('no'); % constant temperature iFluentTuiInterpreter.doMenuCommandToString('no'); % profile iFluentTuiInterpreter.doMenuCommandToString('yes'); % temperature function iFluentTuiInterpreter.doMenuCommandToString('temperature'); iFluentTuiInterpreter.doMenuCommandToString('no'); % derivative iFluentTuiInterpreter.doMenuCommandToString('"4[K]*z/1[m]"'); % your function here % then add the remaining 'no' and 'yes' responses...
The first fix works because MATLAB treats the outer single quotes as string delimiters and passes the inner double quotes through correctly. The step-by-step approach will help you pinpoint exactly where the command is failing if the simple fix doesn't work.
Hope this helps get your simulation running! Let me know if you need any clarification on these approaches or run into other issues.
P.S. - Your CORBA initialization code looks really clean, by the way. The way you're handling the summary report output is a nice touch for verification.