Code Monkey home page Code Monkey logo

nukleon84 / openfmsl Goto Github PK

View Code? Open in Web Editor NEW
10.0 5.0 3.0 19.98 MB

The Open Flowsheet Modeling Library is a collection of C# libraries that can be used to simulate stationary chemical processes using mass- and energy balances. The library includes a basic implementation of the IKCAPE Thermodynamics and a handful of simple unit operations. The resulting equation system is solved simulatenously using a Newton-type solver using the L/U decomposition provided in CSPARSE.net.

License: MIT License

Batchfile 0.14% C# 99.86%

openfmsl's Introduction

OpenFMSL

The Open Flowsheet Modeling Library is a collection of C# libraries that can be used to simulate stationary chemical processes using mass- and energy balances. The library includes a basic implementation of the IKCAPE Thermodynamics and a handful of simple unit operations. The resulting equation system is solved simulatenously using a Newton-type solver using the L/U decomposition provided in CSPARSE.net.

The library also includes a very simple IDE that allows saving, editing and executing multiple simulation scripts (written in the Python language) in a single project file (persisted with Newtonsoft.JSON). The IDE has a simple interactive shell based on IronPython and a very simple graph model for showing diagrams (rendered using OxyPlot). This project would not have been possible without those awesome open-source libraries.

This program was build for fun and the enjoyment of exploring process simulation tools. It was heavily inspired by the PhD thesis of K.Lau and G. Varma.

Development of a process simulator using object oriented programming: Information modeling and program structure Gadiraju V. Varma https://lib.dr.iastate.edu/cgi/viewcontent.cgi?article=11354&context=rtd

Development of a process simulator using object oriented programming: Numerical procedures and convergence studies Kheng Hock Lau https://lib.dr.iastate.edu/cgi/viewcontent.cgi?article=11324&context=rtd

The thermodynamics methods implemented in this libary are part of the IKCAPE thermodynamics. I reimplemented the equations in my own modeling framework. I also use the neutral input format described in their user guide as an input format. http://dechema.de/en/IK_CAPE+THERMO-p-40.html

If you are interested in Process Simulation software, make sure to check out the stellar DWSIM project by Daniel Medeiros: https://github.com/DanWBR/dwsim5

Disclaimer: This is my first real GitHub project. I apologize for any things that I forgot to add. If you find some things are missing (like Licenses for libraries), please notify me. I will add them as soon as possible.

Quick Start

In the \install folder you will find a precompiled version of the project. You can just unzip and run it directly. You will need the .net-Framework 4.5.2 installed. https://github.com/Nukleon84/OpenFMSL/tree/master/install

Prerequisites

  • Visual Studio 2015 (Community edition is free to use for open-source software)
  • MSBuild 14.0
  • Nuget Package Manager Commandline Program

In some parts features from C# 6.0 (e.g. null-coalescing operator) are used.

Set up

As the build script is still hard-coded to my development computer, you must build everything manually for the moment. The project is setup using an enterprise component architecture model, so building from scratch is rather simple. Just follow the steps given below.

  1. Clone the repository on your hard drive
  2. Build the solution ./source.contracts/OpenFMSL.contracts/OpenFMSL.contracts.sln. This will create a bin.contracts folder in the project root that all the components in the source folder reference to.
  3. Build all the solutions in the ./source/ folder in any order you like. The binaries are put into the deploy/exe or deploy/exe_debug folder. There are no dependencies between the component projects.
  4. Execute shell.exe in the deploy folder to launch the simple IDE.

Getting started

  1. Once the program has started, click the Load button (second from the left) to select the BasicExample.project file.
  2. Double-click the model "BTX column" from the list alt text
  3. Press the RUN button on the toolbar to execute the script. alt text alt text

Going further

You can also build your own programs that use the different components of OpenFMSL. You should strongly consider also using Castle.Windsor as the dependency injection container, as the library was build around this very nice and powerful libary. As a starting point, you could create a command line program that uses the ThermodynamicsImporter and the basic classes in the library to run a fixed flowsheet. You can copy a lot of the Python code from the examples directly to C# (just add semicolons).

Next Steps

  1. Write better documentation/WIKI
  2. Add some more examples
  3. Properly tidy up the build script to make it run from any PC

openfmsl's People

Contributors

nukleon84 avatar dependabot[bot] avatar

Stargazers

 avatar bshao avatar  avatar Jarl Robert Pedersen Heer avatar Yoel avatar Akshay Mehta avatar  avatar  avatar Diego Giacomelli avatar Caleb Bell avatar

Watchers

Frederic Forjan avatar James Cloos avatar Tim Janus avatar  avatar bshao avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.