Skip to content

Instantly share code, notes, and snippets.

View andr1976's full-sized avatar

Anders Andreasen andr1976

  • Ramboll Energy
  • Esbjerg, Denmark
View GitHub Profile
@DanWBR
DanWBR / dtl_test2.py
Created November 6, 2020 20:02
Using DWSIM Standalone Thermodynamics Library in Python with Python.NET (High-Level API + Material Stream calls)
import clr, array
from System.IO import Directory, Path, File
from System import String, Double, Array, Reflection, Exception
dtlpath = "C:\\Users\\Daniel\\Source\\Repos\\DanWBR\\dwsim6\\DistPackages\\DTL\\"
clr.AddReference(dtlpath + "DWSIM.Thermodynamics.StandaloneLibrary.dll")
from DWSIM.Thermodynamics import Streams, PropertyPackages, CalculatorInterface
@DanWBR
DanWBR / dtl_test.py
Last active March 19, 2024 09:04
Using DWSIM Standalone Thermodynamics Library in Python with Python.NET (Low-Level Flash API + CAPE-OPEN-style calls)
import clr
from System.IO import Directory, Path, File
from System import String, Double, Array, Reflection, Exception
dtlpath = "C:\\Users\\Daniel\\Source\\Repos\\DanWBR\\dwsim6\\DistPackages\\DTL\\"
clr.AddReference(dtlpath + "DWSIM.Thermodynamics.StandaloneLibrary.dll")
from DWSIM.Thermodynamics import Streams, PropertyPackages, CalculatorInterface
@DanWBR
DanWBR / dwsim_automation.py
Last active September 11, 2024 17:34
Create, run and save a new DWSIM simulation in Python
import pythoncom
pythoncom.CoInitialize()
import clr
from System.IO import Directory, Path, File
from System import String, Environment
dwsimpath = "C:\\Users\\Daniel\\AppData\\Local\\DWSIM8\\"