Hi Nur, A follow-up on the gas permeation model. I abandoned the Aziaba model (see mails above) and now focus on the work bij Scholz et al. (2013), “Modeling Gas Permeation by Linking Nonideal Effects”, Industrial & Engineering Chemistry Research. I managed to get a basic model running in Python. It works for counter-current (hollow fiber) and cross-current (spiral wound) flow patterns. The basic model only considers the basic mass balances (molar flows in each section for each component) and the...
Hi, Python.NET works like a charm in DWSim. However, it looks like the normal Python output console (std.out) is not redirected to the Information Panel (messages). The following code: print("Hello World") Always results in this error: Error running script '': Python.Runtime.PythonException: a bytes-like object is required, not 'str' An easy workaround is: Flowsheet.WriteMessage("Hello World") More problematic are imported packages who also write to std.out. One cannot easily change their output,...
A short follow-up: I managed to get Gekko running in DWSim. Procedure: - install WinPython (version 3.9); - install Gekko package (pip install gekko); - register winPython in DWSim (General settings/Python); - DWSim/Script Manager, set python interpreter = Python.NET Test one of these Gekko examples. A few changes are required to the scripts: - print(value) => Flowsheet.WriteMessage(str(value)) - list comprehension: works for values but not for lists of objects, change to a for loop with list.append(object);...
A short follow-up: I managed to get Gekko running in DWSim. Procedure: - install WinPython (version 3.9); - install Gekko package (pip install gekko); - register winPython in DWSim (General settings/Python); - DWSim/Script Manager, set python interpreter = Python.NET Test one of these Gekko examples. A few changes are required to the scripts: - print(value) => Flowsheet.WriteMessage(str(value)) - list comprehension: works for values but not for lists of objects, change to a for loop with list.append(object);...
Hi, I'm looking for a non-linear constrained optimization solver. My problem is multi-variable (hundreds), multiple equality constraints and an objective function to minimize. This one is for gas permeation with multiple gas components. A 1D problem along the axis of the permeation module. It gets divided in N virtual sections. In each section, the composition of feed and permeate gas changes due to permeation through the membrane. There are calculation algorithms for this, but difficult to implement...
Hi, I'm working in DWSim version 8.8.3. IronPython scripting is available and working. However, I can't find the interactive python console. How do I activate the console? Or is it no longer available? Best regards, Geert
Hi Nur, I've managed to get the gas permeation unit from Aziaba (2022) to run. It needs a few small tweaks in the source code, only to to with the property editor, not the unit calculation. I've tested on of the test cases described in the article: Sada (1992), gas permeation with a mixture of CO2 and air. I tried to test this at different stage cuts (ratio permeate flow to feed flow). It runs at very low stage cuts (< 0,01). But I always get an error when I try to increase the stage cut, either...
Hi Daniel, The open-source code for the gas permeation module was written in vb.net. It is 1200 lines of code. Translating this to python is a big job. I haven't watched your youtube about creating an external unit operation in detail. But I assumed this was written in vb.net? We have source code both for the unit operation (hollow fibre membrane module) and the property editor. Both in vb.net. I assume it is a fairly straightforward job to compile this and register in DWSim? On another note, is...