Flownex API and Extendibility Definition
API stands for Application Programming Interface. It is an umbrella term used in programming. It is generally understood as “custom programming code interacting or interfacing or integrating with the app in a defined way”. Thus API can be implemented in many different ways by different vendors.
In FlownexSE, we define two major categories of API.
COM API
The first is a communications channel for other applications to communicate commands and data to Flownex. Commands such as adding or removing components, setting properties, solving the network, and reading results are issued through a communication channel. The communicating channel is built on the Microsoft Component Object Model (COM). The Flownex COM API should be interpreted in the following way.
FlownexSE can be controlled from Excel, Python scripts, or other applications that link against the COM type library.
Third-party code is not integrated into FlownexSE. A user will not see an icon of the controlling app in the Flownex library, on the canvas, etc.
FlownexSE acts as a slave, just executing the command it receives.
Extendibility
The second major Flownex API is called Extendibility. This API is tightly integrated into FlownexSE in that the library is loaded into Flownex. It can participate in the library tree and the drawing canvas and provide its own solver, menus, etc. Thus it “Extends” FlownexSE’s capability from a user perspective. Indeed, all of the items on the component tree and solver tree is actually integrated through Extendibility. Even our own flagship flow solver, called Flownex.
It will now be clearer what the distinction between the Simulation Environment, FlownexSE, and the thermo-hydraulic engine is. They are actually two separate products. The Flownex flow solver is built upon the extendibility API and runs inside FlownexSE. This distinction is of no concern for a user not programming his own plugin.
Some more examples of extendibility are EES, CFX, etc.
FlownexSE Extendibility API can be compared to Ansys ACT, or Revit API.
Extendibility and Communication API in Tandem
Just as third-party applications can control Flownex through the COM API, most engineering applications also provide some form of communications channel to control it, be it text files, OPC, COM API, GRPC, or REST API—there are as many variations as there are applications.
To control another application from within Flownex, a specific library will be developed on extendibility that calls the API of the other application to control it—usually for co-simulation. Excel components in FlownexSE are a very basic example of a third-party application used for co-simulation through a file and COM-based protocol. Applications such as EES or CFX and Ansys are also used for co-simulations through their provided APIs.
The Flownex extendibility is not limited to thermo-dynamic and flow scenarios. It can be used to integrate diverse capabilities, such as PLC emulators, nuclear reactor fuel handling, electrical networks etc.
More on Extendibility
The user can code in any .Net based language against the supplied base classes and interfaces. FlownexSE will scan the classes, methods and properties for certain attributes and integrate the library into the UI.
Code Generator
A dialog assists a user in getting started with a new custom library. It will create a Visual Studio solution and project, add the needed dependencies and output folders to the project, and generate the initial set of classes with properties.
The code generator outputs C# code.
Extendibility Examples
In the Flownex installation folder there is an “\Extendibility” folder with example projects:
A C# example project in file ExtendibilityExamplesCSharp.zip
There is also a tutorial included in the file ExtendibilityTraining.zip
Extendibility Audience
Extendibility is mainly suitable for advanced users with a strong programming background. Normally, customers with a long-term focus in specific industries, such as power plant operator training simulators, will use Extendibility.
The recommended approach for once-off integration of new functionality through a library into FlownexSE is to contract the Flownex vendor to implement it.