4.2.1. ICoFluentUnit

The ICoFluentUnit interface provides a set of functions that perform typical commands in ANSYS Fluent for solving a CFD simulation case. For example you can load or save case and data files, set the number of computational iterations, initiate a calculation, get or set defined parameter values, and so on. An example of a simple client that uses the interface is given in A Fluent Client Example.

interface ICoFluentUnit
string getComponentName();

returns the name of the connected component

void setComponentName(in string p_szName);

sets the name of the component to p_szName

string getComponentDescription();

returns the description of the connected component

void setComponentDescription(in string p_szDescription);

sets the description of the connected component to p_szDescription

void calculate();

iterates the solution for the number of iterations specified with setNrIterations. This is mainly for use with steady simulations as it does not perform dual-time iteration. For transient cases you can issue the solve/dual-time-iterate TUI command using doMenuCommand (see ICoFluentSchemeController)

void setNrIterations(in long p_INrIterations);

sets the number of iterations that calculate will perform to p_INrIterations.

long getNrIterations();

returns the number of iterations currently set for a calculate command to perform

void loadCase(in string p_szCaseFileName);

load the case file p_szCaseFileName from the Fluent working directory into Fluent

void loadData(in string p_szDataFileName);

load the data file p_szDataFileName from the Fluent working directory into Fluent

void saveCase(in string p_szCaseFileName);

save the current Fluent case to p_szCaseFileName in the Fluent working directory

void saveData(in string p_szDataFileName);

save the current Fluent data to p_szDataFileName in the Fluent working directory

long getNrInputParameters();

returns the number of input parameters defined in the current case

string getInputParameterNameByIndex(in long lInputParameterIndex);

returns a string containing the name of the input parameter with index lInputParameterIndex

void setInputParameterValueByIndex(in long p_lInputParameterIndex, in float p_lfInputParameterValue);

sets the value of the input parameter with index p_lInputParameterIndex to p_lfInputParameterValue

void setInputParameterValueByName(in string p_lInputParameterName, in float p_lfInputParameterValue);

sets the value of the input parameter with name p_lInputParameterName to p_lfInputParameterValue

long getNrOutputParameters();

returns the number of output parameters defined in the current case

string getOutputParameterNameByIndex(in long lOutputParameterIndex);

returns a string containing the name of the output parameter with index IOutputParameterIndex

float getOutputParameterValueByIndex(in long p_lOutputParameterIndex);

returns the value of the output parameter with index IOutputParameterIndex

float getOutputParameterValueByName(in string p_lOutputParameterName);

returns the value of the output parameter with name p_IOutputParameterName

void terminate();

terminate the connected Fluent as a Server session

Object getSchemeControllerInstance();

returns an object that can be used to send TUI or scheme commands to the Fluent session and perform more advanced functions using the ICoFluentSchemeController Interface (see ICoFluentSchemeController)


Release 18.2 - © ANSYS, Inc. All rights reserved.