The DWSIM Standalone Thermodynamics Library (DTL) is a 32/64-bit .NET/Mono managed dynamic link library (DLL) that exposes DWSIM’s thermodynamics engine to external applications using a simple programming interface, with no dependency on external components.
DWSIM Standalone Thermodynamics Library is licensed under the GNU Lesser General Public License version 3 (allows linking of the library against proprietary, closed-source applications). Read the license.txt file included in the zip file for more details.
To use the library in your .NET projects, add a reference to the DWSIM.Thermodynamics.dll file. All calculation functions will be available in the DTL.Thermodynamics namespace, inside the 'Calculator' class.
This library has methods to calculate:
- Single Compound Properties
- Single Phase Mixture Properties
- PT, PH, PS, PVF and TVF Equilibrium Flashes, using an algorithm of your choice (two or three phases)
Property and Equilibrium calculation functions require parameters that must be one or more values returned by GetPropPackList, GetCompoundList, GetPropList, GetCompoundConstPropList, GetCompoundTDepPropList, GetCompoundPDepPropList and GetPhaseList. They are self-explanatory, and will return values in an array of strings.
For instance, the PTFlash function requires the name of the Property Package to use, the compound names and mole fractions, temperature in K, pressure in Pa and you may optionally provide new interaction parameters that will override the ones used internally by the library. The calculation results will be returned as a (n+2) x (3) string matrix, where n is the number of compounds. First row will contain the phase names, the second will contain the phase mole fractions and the other lines will contain the compound mole fractions in the corresponding phases.
For PH, PS, TVF and PVF flash calculation functions, an additional line is returned, containing the temperature in K or pressure in Pa in the last matrix row.
Click here to download the library, documentation and VB.NET and C# sample codes.
Click here to browse the source code through the Git web interface.