Code Monkey home page Code Monkey logo

danwbr / dwsim Goto Github PK

View Code? Open in Web Editor NEW
262.0 28.0 88.0 827.06 MB

DWSIM is a Steady-State and Dynamic Sequential Modular Chemical Process Simulator for Windows, Linux and macOS.

Home Page: https://dwsim.org

License: GNU General Public License v3.0

Visual Basic .NET 40.45% C# 30.35% Batchfile 0.03% MATLAB 0.01% XSLT 0.01% Rich Text Format 0.44% HTML 0.67% JavaScript 0.01% CSS 0.01% Python 27.88% Rez 0.01% Rebol 0.04% R 0.01% Shell 0.12% Roff 0.01%
flowsheeting chemical-engineering thermodynamics thermodynamics-models unit-operation simulation modeling thermo-library cad computer-aided-design

dwsim's Introduction

GitHub issues tickets forums wiki donate

DWSIM - Open Source Process Simulator

Copyright 2008-2024 Daniel Wagner and contributors

DWSIM is a software for modeling, simulation and optimization of steady-state and dynamic chemical processes.

License

DWSIM is licensed under the GNU General Public License (GPL) Version 3.

See COPYING for more information.

Supported Operating Systems

  • Windows (32/64-bit x86) with .NET Framework 4.6.2 or newer
  • Linux (32-bit armhf / 64-bit x86) with Mono 6.8 or newer
  • macOS (formerly OS X) 10.7 or newer

Donations

Project Details

Project Name Description
Shared Projects
DWSIM.Automation Automation Library
DWSIM.Automation.Tests Automation Testing Application
DWSIM.DynamicsManager Dynamic Simulation Manager library
DWSIM.DrawingTools.SkiaSharp Flowsheet Drawing Tools (SkiaSharp-based)
DWSIM.DrawingTools.SkiaSharp.Extended Additional Flowsheet Drawing Tools (SkiaSharp-based)
DWSIM.DrawingTools.SkiaSharp.Tests Test Application for Drawing Tools (SkiaSharp-based)
DWSIM.ExtensionMethods Extension Methods
DWSIM.ExtensionMethods.Eto Extension Methods for Eto.Forms
DWSIM.FlowsheetSolver Flowsheet Solver library
DWSIM.GlobalSettings Shared global settings
DWSIM.Interfaces Interface definitions
DWSIM.Inspector Inspector Reports library
DWSIM.Libraries.OctaveSharp Octave interface
DWSIM.Libraries.PythonLink Python interface
DWSIM.Logging Logging library
DWSIM.MathOps Math library
DWSIM.MathOps.RandomOps Random number generator library
DWSIM.MathOps.SwarmOps Optimization library
DWSIM.SharedClasses Shared/Base class definitions
DWSIM.Simulate365 Simulate365 Platform Integration
DWSIM.Thermodynamics Thermo library
DWSIM.Thermodynamics.AdvancedEOS.GERG2008 GERG2008 Property Package
DWSIM.Thermodynamics.AdvancedEOS.PCSAFT PC-SAFT Property Package
DWSIM.Thermodynamics.AdvancedEOS.PRSRKAdv PR78/SRK with T-dep IPs Property Package
DWSIM.Thermodynamics.Databases.ChEDLThermoLink ChEDL Thermo Python Library Database Linker/Parser
DWSIM.Thermodynamics.Databases.ChemeoLink Cheméo Database Linker/Parser
DWSIM.Thermodynamics.Databases.DDBStructureLink DDB UNIFAC/MODFAC Structure Database Linker/Parser
DWSIM.Thermodynamics.Databases.KDBLink KDB Database Linker/Parser
DWSIM.Thermodynamics.CoolPropInterface Interface for CoolProp native library
DWSIM.UnitOperations Unit Operations library
DWSIM.UI.Web Shared Web Forms components
DWSIM.XMLSerializer Custom XML Serializer
Classic UI Projects (Windows Forms)
DWSIM Main DWSIM GUI with Tools and Utilities
DWSIM.Apps.AzureServer Azure Solver Server
DWSIM.Apps.TCPServer TCP/IP Solver Server
DWSIM.Controls.DockPanel DockPanel control
DWSIM.Controls.DockPanel.ThemeVS2012Light Theme for DockPanel control
DWSIM.Controls.PropertyGridEx Extended Property Grid Control
DWSIM.Controls.TabStrip TabStrip control
DWSIM.Controls.ZedGraph Custom ZedGraph Library
DWSIM.Plugins.NaturalGas Natural Gas Properties Plugin
DWSIM.SkiaSharp.Views.Desktop SkiaSharp Controls for Windows Forms
Cross-Platform UI Projects
DWSIM.FlowsheetBase Flowsheet Base Class for Cross-Platform UI
DWSIM.UI.Desktop Cross-Platform UI App Launcher
DWSIM.UI.Desktop.Editors Cross-Platform UI Editors (Views/Forms)
DWSIM.UI.Desktop.Forms Cross-Platform UI Main App Forms
DWSIM.UI.Desktop.GTK Cross-Platform UI GTK# Platform-specific code
DWSIM.UI.Desktop.Mac Cross-Platform UI MonoMac Platform-specific code
DWSIM.UI.Desktop.Shared Cross-Platform UI shared code
DWSIM.UI.Desktop.WinForms Cross-Platform UI Windows Forms Platform-specific code
DWSIM.UI.Desktop.WPF Cross-Platform UI Windows Presentation Foundation (WPF) Platform-specific code

Compiling

  • DWSIM can be compiled using Visual Studio 2019 or newer on Windows.
  • To compile everything and run:
    • Open Visual Studio 2019 or 2022 and clone this repository directly from GitHub
    • Change the Build target to 'Debug/x64', 'ReleaseLinux/x64', 'ReleaseWinMac/x64' or 'ReleaseWinMac/x86'
    • Click on the Solution object and restore NuGet packages
    • Build the solution
    • Select 'DWSIM' or 'DWSIM.UI.Desktop' as the startup project
    • Run

dwsim's People

Contributors

alexandersemenyak avatar andr1976 avatar chemscobra avatar danwbr avatar dependabot[bot] avatar greg66 avatar jarlped avatar mersadk avatar msakai avatar yosimulation avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dwsim's Issues

[BUG] Wrong unit for bubble and dew temperature

Describe the bug
Following the Introductory courses on DWSIM, Level 1 Task 1 (DWSIM Simulator on YouTube). I have noted to the wrong units for bubble and dew temperature

To Reproduce
Steps to reproduce the behavior:

  1. Add a material stream
  2. Open Results / Phase properties /Mixture
  3. Scroll down to 'Bubble Temperature @ P' and 'Dew Temperature @ P'
  4. Note to units for these values! They should be temperature unit not pressure unit

Expected behavior
Correct temperature unit shall be displayed

image-204

System

  • DWSIM 6.1 Update 1
  • OS: Windows 10

Setting : Reaction Tab - Always first reaction in the list is highlighted

Describe the bug
In setting window, Reaction tab, when you select reaction in the list it will be highlighted. Clicking on the row the edit window appears. After editing and closing this windows, the Reaction Tab is displayed again but instead of edited row the first row (reaction) will be highlighted. In other words always it jumps to first row

To Reproduce
Steps to reproduce the behavior:

  1. Go to Setting, Reaction tab
  2. Click on (for example) third row (third reaction in the list)
  3. After editing the third reaction close its window
  4. See error: The highlighted row (reaction) is the first row. It jumps to first row

Expected behavior
The highlighted row shall be the same one it was selected /edited.

Issue stream flowrate: all input boxes are active all the time

Describe the bug
For a feed/inlet stream one can set flowrate using one of molar flow, mass flow or volumetric flow! but after setting a flowrate for example mass flowrate other input boxes e.g molar and volumetric liquid flowrate are still active and one also enter a value in those boxes.

To Reproduce
Steps to reproduce the behavior:

  1. Open DWSIM
  2. Create a new simulation
  3. Add a material stream
  4. Set flow rate e.g. molar flow
  5. See issue: mass flow rate and volumetric liquid flow rate still are active

Image-025

Expected behavior
It is recommended when one of flowrate is set the other input boxes (flowrate) grayed out

Desktop (please complete the following information):

  • OS: Windows 10
  • Classic UI
  • DWSIM 6.1 Update 4

[New Features] Unit operations

Proposal for adding a Roadmap
Daniel,

These are some suggestion to be included into DWSIM roadmap! I highly recommend to ask for volunteers to help and you manage the whole work as a project manager! The https://dwsim.fossee.in/ are a group of talents and can help very much.

Unit Operations
There are some unit operations can be added with some efforts and worth to be included as midterm goals like

  • Air cooler
  • Plate exchanger
  • Fired heater
  • Relief valve
  • Stream cutter (to switch fluid packages)

Longterm goals
I will send separate ticket.

[BUG] Vapor fraction cannot be greater than one

Describe the bug
When define a material stream using PVF or TVF, DWSIM accept vapor fraction greater than 1

To Reproduce
Steps to reproduce the behavior:

  1. Add a new material stream to flowsheet
  2. Go to Input Data / Stream Conditions
  3. Select TVF as Flash Spec and set vapor fraction greater than one
  4. See error (for example specific enthalpy)

Expected behavior
DWSIM shall not allow to enter vapor fraction greater than one. Fortunately it does not accept negative vapor fraction.

Issue Energy Stream

Describe the bug
Setting the energy flow of energy stream connected to some unit operations does not work like Compressor.

  • For cooler you cannot set calculation type as energy stream
  • For heater both energy added/removed and energy stream are confusing and one of them may be enough
  • For cooler both energy added/removed and energy stream are confusing and one of them may be enough
  • For expander when calculation type is Energy stream you cannot set energy flow

To Reproduce For Compressor
Steps to reproduce the behavior:

  1. Create a new simulation
  2. Add a compressor with inlet/outlet and an energy stream
  3. Set the calculation type as Energy Stream
    3.Open the energy stream and set its energy flow
  4. Run simulation
  5. You will see DWSIM refuses to use the value set for Energy flow from Energy Stream

Desktop (please complete the following information):

  • OS: Windows 10
  • Classic UI
  • DWSIM 6.1 Update 4

Additional context
This issue will be completed when other unit operations are tested.

Error in Solving the Simulation-Reactors

Dear Medeiros,
It could not possible to solve a simple steam reforming by both equilibrium and Gibbs reactors.

  • First, Steam reforming with Equilibrium reactor (including reforming and water gas-shift reactions) is solved at above 20 bar, but below 10 bar, it could not be solved.
    -Second, Equilibrium reactor of steam reforming at high pressure (above 20 bar) is OK, but when I want to add a Gibbs reactor beside the flowsheet and compare the results of two reactors, it could not be solved. The same procedure was applied two other softwares, e.g. HYSYS, without any problem.
    Could you please see the attached files.

DWSim_Reforming_test
Worksheet_DWSim_reforming.txt

Yours Sincerely,
Hadi Ebrahimi

DWSIM6 compilation issue

Hi Daniel, just wanted to let you know that the solution won't flawlessly compile on Visual Studio 2017.
Here is the error list after a 'Build>clean'.

Keep up coding!
list

Issue Cooler/Heater with "Outlet Vapor Molar Fraction" as claculation type

Describe the bug
It seems Heater / Cooler have problem when calculation type is set to Outlet Vapor Mole Fraction. DWSIM solves heater/cooler very quickly with outlet temperature, temperature change or heat added/removed. But for the same setting if you change calculation type to outlet vapor fraction, it fails and a failure message is appeared as below (see attached simulation file):

"Error COOL-006: PT/PV/TV Flash: Maximum number of iterations reached. (T = 818.66 K, P = 601,325.00 Pa, MoleFracs = { 0.333333333333333, 0.333333333333333, 0.333333333333333, })"

To Reproduce
Steps to reproduce the behavior:

  1. Open attached simulation file and open the Cooler object editor
  2. Note to the vapor fraction and heat added removed values
  3. Change the calculation type to outlet vapor fraction
  4. Run the simulation
  5. See error

Important
The above error is true for heaters. See heater in simulation file and repeat step 2-4 above

Another Issue
The strange behavior is when one of the cooler or heater fails to converge I see the other equipment is red or its outlet is red! What is going wrong here?

Expected behavior
The same calculation result is expected with all calculation type for cooler/heater. Also it seems the convergence is very slow with outlet vapor fraction!

Simulation file
issue-heater-cooler-outlet-vapor-fraction.zip

Desktop (please complete the following information):

  • OS: Windows 10
  • Classic UI
  • DWSIM 6.1 Update 4

DTL via python throws exception from Ipopt.Finalize()

When DTL is run via python and the script terminates an unhandled exception occurs. Happens both when running
python script.py
and
pythin -i script.py
For the latter exception occurs when interactive pythin is exited with Ctrl-Z

Unhandled Exception: System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
at Cureos.Numerics.Ipopt.FreeIpoptProblem(IntPtr ipopt_problem)
at Cureos.Numerics.Ipopt.Dispose(Boolean disposing)
at Cureos.Numerics.Ipopt.Finalize()

Expected behavior
No exception.

Desktop (please complete the following information):

  • Win 10 x64
  • DTL_v6.3.7615

Pythin code to reproduce

import clr, array

from System import String, Double, Array, Reflection, Exception

dtlpath = "C:\\Users\ANRA\OneDrive - Ramboll\\Documents\\DWSIM Application Data\\PythonDTL\\"

clr.AddReference(dtlpath + "DWSIM.Thermodynamics.StandaloneLibrary.dll")

from DWSIM.Thermodynamics import Streams, PropertyPackages, CalculatorInterface
from DWSIM.Interfaces.Enums import FlashCalculationType
from DWSIM.Thermodynamics.PropertyPackages.Auxiliary.FlashAlgorithms import *

import CapeOpen

dtlc = CalculatorInterface.Calculator()

print(String.Format("DTL version: {0}", Reflection.Assembly.GetAssembly(dtlc.GetType()).GetName().Version))
print()

dtlc.Initialize()

#nrtl = PropertyPackages.NRTLPropertyPackage(True)
pr = PropertyPackages.PengRobinsonPropertyPackage(True)

dtlc.TransferCompounds(pr)

T = 94+273.15 #K
P = 25*101325.0 #Pa
  
carray = Array[String](["Water", "Methane", "Propane", "Isobutane", "N-butane", "N-decane"])
comparray = Array[Double]([0.1, 0.3, 0.1, 0.1, 0.1, 0.3])

#result2 = dtlc.PTFlash(pr,3,P,T,carray,comparray)


ms = dtlc.CreateMaterialStream(carray, comparray)

print ("Calculating Material Stream Phase Equilibria and Properties at T = " + str(T) + " K and P = " + str(P) + " Pa")
#print ("Mass Flow = 1000 kg/s")

ms.SetPropertyPackage(pr)
ms.SetPressure(P)
ms.SetTemperature(T)
ms.SetMolarFlow(1.0) # kg/s
#nlvlle=NestedLoopsImmiscible
#nlvlle.StabSearchCompIDs = String(r"Water")
#nlvlle.StabSearchSeverity = 0
#ms.FlashAlgorithm = nlvlle

ms.SetFlashSpec("PT")
ms.Calculate()

vapordensity = ms.GetPhase("Vapor").Properties.density
print("Vapor Phase Density: " + str(vapordensity) + " kg/m3")
print("Vapour molecular weight: " + str(ms.GetPhase("Vapour").Properties.molecularWeight)+ " kg/kmole")

liquiddensity = ms.GetPhase("Liquid1").Properties.density
print("Liquid1 Phase Density: " + str(liquiddensity) + " kg/m3")
print("Liquid1 molecular weight: " + str(ms.GetPhase("liquid1").Properties.molecularWeight) + " kg/kmole")

liquid2density = ms.GetPhase("Liquid2").Properties.density
print("Liquid 2 Phase Density: " + str(liquid2density) + " kg/m3")
print("Liquid2 molecular weight: " + str(ms.GetPhase("Liquid2").Properties.molecularWeight) + " kg/kmole")

for comp in ms.GetPhase("Overall").Compounds.Values:
    print(comp.ConstantProperties.Name + " Overall Molar Flow: " + str(comp.MolarFlow) + " mol/s")

vaporflow = ms.GetPhase("Vapor").Properties.massflow
print("Vapor Phase Mass Flow: " + str(vaporflow) + " kg/s")

liquidflow = ms.GetPhase("Liquid1").Properties.massflow
print("Liquid Phase Mass Flow: " + str(liquidflow) + " kg/s")

Invalid cast by deserialization (dot->comma problem). Need invariant culture

By open file from this link https://sourceforge.net/p/dwsim/discussion/844529/thread/d6577f67f5/ (in attach)

Error Loading Flowsheet Graphic Objects: System.InvalidCastException: Приведение строки "59.64677" к типу "Integer" является недопустимым. ---> System.FormatException: Input string was not in a correct format.   at Microsoft.VisualBasic.CompilerServices.Conversions.ParseDouble(String Value, NumberFormatInfo NumberFormat)   at Microsoft.VisualBasic.CompilerServices.Conversions.ToInteger(String Value)   --- End of inner exception stack trace ---   at Microsoft.VisualBasic.CompilerServices.Conversions.ToInteger(String Value)   at XMLSerializer.XMLSerializer.Deserialize(Object obj, List1 xmlprops, Boolean Fields) in C:\Users\Daniel\source\repos\DanWBR\dwsim6\DWSIM.Serializers.XML\XMLSerializer.vb:line 92   at DWSIM.Drawing.SkiaSharp.GraphicObjects.GraphicObject.LoadData(List1 data) in C:\Users\Daniel\source\repos\DanWBR\dwsim6\DWSIM.Drawing.SkiaSharp\GraphicObjects\Base\GraphicObject.vb:line 91   at DWSIM.FormMain.AddGraphicObjects(FormFlowsheet form, List1 data, ConcurrentBag1 excs, String pkey, Int32 shift, Boolean reconnectinlets) in C:\Users\Daniel\source\repos\DanWBR\dwsim6\DWSIM\Forms\Main Window\FormMain.vb:line 1106
bug.zip

Small Issue in Version Number

There is a small issue in displaying the version number on windows during installation.
It shows 6 two times. See below screenshot.

Screenshots
image_002

Desktop (please complete the following information):

  • OS: Windows 10
  • DWSIM 6.1

Issue Distillation Column condenser/reboiler specification drop down for units do not work

Describe the bug
The drop down menu for choosing the units in Specification page Condenser and Reboiler tab does not work.

To Reproduce
Steps to reproduce the behavior:

  1. Open a simulation contains a distillation column like the one attached
  2. Click on the distillation column to open the object editor
  3. Open Specification/ Condenser or Specification/Reboiler
  4. No unit is shown for pressure and pressure drop
  5. For reboiler there is no pressure drop input
  6. The drop down menu to select units on input does not work

Expected behavior
When enter inputs, it is expected to show the units and lets user select unit of input data from drop down menu

Screenshots

Image-036
Image-037

Desktop (please complete the following information):

  • OS: Windows 10
  • Classic UI
  • DWSIM 6.1 Update 4

Sample simulation file

Issue: Plug flow reactor and negative concentration

OS: Windows 10
DWSIM: Version 6 update 7

To reproduce:

  1. Open the attached simulation file in DWSIM 6 update 7
  2. Change the feed flowrate from 3600 kg/h to 100 kg/h
  3. DWSIM issues an error: "ODE solver calculated negative molar flows at volume step 0.041/1 m3"

It seems using low flowrate results in high residence time and then full consumption of main reactant hence results in negative values for component molar flow. One suggestion is to use Events in ODE solver to recognize when one of the reactant has been finished and then ODE Solver use zero for reaction rate!

Another issue

The reaction in this simulation is irreversible "N2+3H2 -> 2NH3" DWSIM strangely calculates conversion for NH3 as 1.30516E+13.
The reaction rate is r=k*Ca where k=0.004 and the reverse reaction has been set to zero (both RO and A' and E')


Simulation file has been attached

PFR-Ammonia Synthesis - Issue Report.zip

Provide Species Measurements in Vol %

Is your feature request related to a problem? Please describe.
All of the quantitative data (for gaseous species) are limited to presentation in molar or mass fractions. In some cases, such as the concentrations of gases, providing the data in vol% is very helpful.

Describe the solution you'd like
As an option, the INDICATORS provided in DWSIM should allow for display values in the % range (mole fraction * 100). This is much more consistent with what operators see on an instrument cluster

Describe alternatives you've considered
None. I just have to realize that the values on the display are molar fractions, instead of volume %.

Additional context
Add any other context or screenshots about the feature request here.

Issue in CSTR: Simple esterification reaction

The attached file shows a simple second order esterification in a CSTR.

Acetic Acid + Etahnol -> Ethyl Acetate + Water

A + B = C + D

-rA = k.Ca.Cb,   k=0.005

PP: NRTL

T=70C
P=1 bar
F=3600 kg/hr

This is an example taken from FOSSE spoken tutorial.

It works fine in DWSIM 6 but in 6.1 and above returns error. I think this example is a very simple from numerical point of view but DWSIM returns: maximum number of iteration reached !

I assume DWSIM fails in flash calculation as CSTR is a simple algebraic equation here and solver should not fail.

Some interesting findings:

  • change water DO from 0 to 1 in reaction definition, DWSIM solves the flowsheet.
  • change DO for Acetic acid from 1 to 0.5, DWSIM solves the flowsheet

what is the problem? Is there any issue with numerical solver!

cstr-estrification-issue.zip

Issue Shortcut Column and negative minimum refulx ratio

Describe the bug
DWSIM reports negative reflux ratio. The simulation is repeated in Hysys V11 and it shows correct value!

To Reproduce
Steps to reproduce the behavior:

  1. Open the attached simulation file. It shows a simple shortcut column
  2. Open shortcut column object editor
  3. Scroll down to Results
  4. See error: negative value for minimum reflux (-0.288117)
  5. Solving in Hysys 11 returns (0.031)

Expected behavior
Reflux ratio cannot be negative

Simulation files
shortcut-column.zip

Desktop (please complete the following information):

  • OS: Windows 10
  • Classic UI
  • DWSIM 6.1 Update 4

[Consistency] Distillation Column - Specification Compound Fraction in Product Stream

Describe the bug
For consistency it is better to use Molar and Mass basis instead of M and We when column specification is Compound Fraction in Product Stream

To Reproduce
Steps to reproduce the behavior:

  1. Open a simulation contains a distillation column
  2. Click on the distillation column to open the object editor
  3. Open Specification/ Condenser or Specification/Reboiler
  4. Set specification as "Compound Fraction in Product Stream"
  5. Use drop down menu for selecting basis
  6. It is M or We which is not consistent with basis on other objects

Screenshots
Image-039
Image-038

Desktop (please complete the following information):

  • OS: Windows 10
  • Classic UI
  • DWSIM 6.1 Update 4

Sample simulation file
Rigorous-Columns.zip

[Feature Request] Complex kinetics using Python script

Is your feature request related to a problem? Please describe.
Adding complex kinetics and non standard reaction rate is impossible or error prone and tedious using the current Kinetics and Heterogeneous Kinetics interfaces.

Describe the solution you'd like
Use Python Scripts for complex kinetics as Kinetic script or Kinetic procedure or Advanced kinetic

How to implement

  • Add new reaction from Reaction tab
  • Use for current interfaces: Kinetic / Heterogenous Catalytic
  • Complete the components and stoichiometry section
  • Select between GUI / Advanced or Kinetic Procedure or Kinetic Script or Advanced Kinetic
  • Advanced Kinetic shall have its own new tab
  • On selection an edit box let to enter the scripts

More details and supporting documents will be emailed.

Flash calculation gives spurious results

DWSIM 6.3u3 Windows 10 x64
Flash calculation returns spurious phase split with water present

Steps to reproduce the behavior:

  1. Include components. Water, Methane, Propane, i-Butane, N-butane, N-decane, molefrac: 0.2,0.2,0.1,0.1,0.1,0.3
  2. Set stream T=94 C
  3. Set stream P= 25 bar
  4. Inspect results and observe that only gas phase exists.

Expected behavior
Expected to see vapour, liquid1, and Liquid2 phase, with approx. phasefraction 0.2 (slightly less) of liquid2 as water
However, when water is reduced and methane increased first a split into vapour, liquid1 and then to vapour, liq1, liq2 and molefrac water of 0.1 and methane molefrac 0.3

flashtest - Copy.zip

Additional context
Attached is DWSIm file and the expected output from a 3-phase flash (free water) by Michelsen
2020-11-08_21-17-21

Issue Pump Type

The object palette / pressure changers contains only Centrifugal Pump. This element can also be used to simulate other pumps like reciprocating, diaphragm pump, ...

Screenshots

Image-032

It is recommended to change Centrifugal Pump to Pump and if it is needed add a type parameter in object editor.

Desktop (please complete the following information):

  • OS: Windows 10
  • Classic UI
  • DWSIM 6.1 Update 4

Issue Gibbs Reactor Element Matrix: You cannot delete an empty row

Describe the bug
In Gibbs Reactor Object Editor for Elements matrix you can add as many as rows by clicking on the Element button, but you cannot delete them and if you keep them empty, you get error in solving the reactor

It is more strange to see you cannot save the simulation file. DWSIM throw an error like below

Fig 1. Error on saving

Image-045

To Reproduce
Steps to reproduce the behavior:

  1. Open a Gibbs Reactor Object Editor
  2. Go to Calculation Parameters / Elements
  3. Click on Element
  4. Try delete the empty row!! and see the error
  5. Try to save the simulation file and see error of Fig 1 above

Expected behavior
You should be able to simply delete the empty rows

Screenshots
Fig 2. Error in deleting empty row
Image-044

Desktop (please complete the following information):

  • OS: Windows 10
  • Classic UI
  • DWSIM 6.1 Update 6

Suggestion: "Save" and "Save as" icons on DWSIM toolbar

Suggestion
This is only a suggestion and ignore it if is inappropriate!

The Save as icon (button) used in DWSIM classic UI is the standard "Save" icon in every UI for example see

The save as icon normally is a disk and pen, for example see

So, I suggest to be compatible with other standard UI please

  • Use current "Save as" icon/button for "Save"
  • Use a new (common) "Save as" button as can be seen in above links something similar below
    icons8-save-as-50

Screenshot
Current Save and Save as icons on DWSIM classic UI. The Save all icon is correct.

Image-012

Issue Pump

  • Pump can accept a gas stream as inlet and DWSIM does not complain!! This is not real behavior. In the user manual it explains you can set a parameter to ignore vapor in feed but in DWSIM 6.1 there is not such feature.

  • What is the difference between power required and energy stream? These are confusing while this is not an issue. I think this needs to be discussed with Daniel in more detail.

Note that gas are compressible and the calculation method addressed in user manual cannot be used for gas stream. It seems the calculation is for constant density fluid, so in my opinion DWSIM should refuse accepting gas stream as pump inlet, but it can tolerate occurring vapor in small amount and issue warning to warn user!

Desktop (please complete the following information):

  • OS: Windows 10
  • Classic UI
  • DWSIM 6.1 Update 4

Sidebar Object Editors - Different width of sidebar

Describe the bug
In the flowsheet environment clicking any object (single click) open the object editor in the sidebar. The sidebar width seems different for different object and this causes distracting your attention from focusing on simulation

To Reproduce
Steps to reproduce the behavior:

  1. Open a simulation
  2. Click on a material stream, the sidebar is opened
  3. Click on a reactor or distillation column
  4. See error: the sidebar width increases/decreases with selecting different object

Expected behavior
A constant sidebar width where user can customize it.

[IDEA] Lets Change the order of components in a simulation

IDEA
It seems DWSIM shows the components list everywhere in the order they were added to a simulation! Sometimes it is good to show them in another order like sorted alphabetically or show important components first. The suggestion is one can reorder the components in setting / compounds page!

Another Suggestion
In Hysys which is more a hydrocarbon processing simulator, it shows light hydrocarbon like methane ethane, ... first! It may be useful to have options in compounds page to show different components in different order, so selection and adding new components to a simulation will be much easier.

Category: [Enhancement]

DTL gives different results that DWSIM

Running a flash with Peng-Robinson in DTL gives different results compared to DWSIM

To Reproduce
See attached python script below for calling DTL and attached DWSIM file
It is also noted that DTL returns the global molecular weight both when calling the vapour and liquid

Expected behavior
Expecting comparable results, DTL returns vapour/liquid, DWSIM returns vapour/liquid/liquid
Expecting the correct molecular weight for each phase and not the global

Desktop (please complete the following information):

  • OS: Win 10 x64
  • DWSIM 6.3u3
  • DTL latest
Python 

import clr, array

from System import String, Double, Array, Reflection, Exception

dtlpath = "C:\\Users\ANRA\OneDrive - Ramboll\\Documents\\DWSIM Application Data\\PythonDTL\\"

clr.AddReference(dtlpath + "DWSIM.Thermodynamics.StandaloneLibrary.dll")

from DWSIM.Thermodynamics import Streams, PropertyPackages, CalculatorInterface
from DWSIM.Interfaces.Enums import FlashCalculationType
from DWSIM.Thermodynamics.PropertyPackages.Auxiliary.FlashAlgorithms import *

import CapeOpen

dtlc = CalculatorInterface.Calculator()

print(String.Format("DTL version: {0}", Reflection.Assembly.GetAssembly(dtlc.GetType()).GetName().Version))
print()

dtlc.Initialize()

#nrtl = PropertyPackages.NRTLPropertyPackage(True)
pr = PropertyPackages.PengRobinsonPropertyPackage(True)

dtlc.TransferCompounds(pr)

T = 94+273.15 #K
P = 25*101325.0 #Pa
  
carray = Array[String](["Water", "Methane", "Propane", "Isobutane", "N-butane", "N-decane"])
comparray = Array[Double]([0.1, 0.3, 0.1, 0.1, 0.1, 0.3])

#result2 = dtlc.PTFlash(pr,3,P,T,carray,comparray)


ms = dtlc.CreateMaterialStream(carray, comparray)

print ("Calculating Material Stream Phase Equilibria and Properties at T = " + str(T) + " K and P = " + str(P) + " Pa")
#print ("Mass Flow = 1000 kg/s")

ms.SetPropertyPackage(pr)
ms.SetPressure(P)
ms.SetTemperature(T)
ms.SetMolarFlow(1.0) # kg/s
#nlvlle=NestedLoopsImmiscible
#nlvlle.StabSearchCompIDs = String(r"Water")
#nlvlle.StabSearchSeverity = 0
#ms.FlashAlgorithm = nlvlle

ms.SetFlashSpec("PT")
ms.Calculate()

vapordensity = ms.GetPhase("Vapor").Properties.density
print("Vapor Phase Density: " + str(vapordensity) + " kg/m3")
print("Vapour molecular weight: " + str(ms.GetPhase("Vapour").Properties.molecularWeight)+ " kg/kmole")

liquiddensity = ms.GetPhase("Liquid1").Properties.density
print("Liquid1 Phase Density: " + str(liquiddensity) + " kg/m3")
print("Liquid1 molecular weight: " + str(ms.GetPhase("liquid1").Properties.molecularWeight) + " kg/kmole")

liquid2density = ms.GetPhase("Liquid2").Properties.density
print("Liquid 2 Phase Density: " + str(liquid2density) + " kg/m3")
print("Liquid2 molecular weight: " + str(ms.GetPhase("Liquid2").Properties.molecularWeight) + " kg/kmole")

for comp in ms.GetPhase("Overall").Compounds.Values:
    print(comp.ConstantProperties.Name + " Overall Molar Flow: " + str(comp.MolarFlow) + " mol/s")

vaporflow = ms.GetPhase("Vapor").Properties.massflow
print("Vapor Phase Mass Flow: " + str(vaporflow) + " kg/s")

liquidflow = ms.GetPhase("Liquid1").Properties.massflow
print("Liquid Phase Mass Flow: " + str(liquidflow) + " kg/s")

flashtest2.zip
Additional context
Add any other context about the problem here.

[Feature request] A way to enter create Hypos/pseudo components in a table like manner

Existing way of defining hypos/pseudos
In the current state hypotheticals/pseudocomponents are entered one by one, which is tedious

Suggestion for improvement
Allow entering/defining a number of components at once in a table style where each hypo is entered with name and a minimum required input e.g. boiling point, density or molecular weight, and optional additional input. In case optional input is not given, these properties are estimated with known methods e.g. Density, molecular weight, Pc, Vc, Tc, accentric factor etc.

Using a table input - hypos defined in other programs can easily be copy pasted

See example below

image

Allow INDICATORS in DWSIM to report values in %, not just fractions.

Is your feature request related to a problem? Please describe.
All of the quantitative data (for gaseous species) are limited to presentation in molar or mass fractions. In some cases, such as the concentrations of gases, providing the data in vol% is very helpful.

Describe the solution you'd like
As an option, the INDICATORS provided in DWSIM should allow for display values in the % range (mole fraction * 100). This is much more consistent with what operators see on an instrument cluster

Describe alternatives you've considered
None. I just have to realize that the values on the display are molar fractions, instead of volume %.

Additional context
Add any other context or screenshots about the feature request here.

Issue Classic UI

OS: Windows 10
UI: Classic UI, DWSIM 6 update 7

To replicate the issue

  1. Open DWSIM with double click from Windows desktop
  2. From File click "New Steady-State Simulation"
  3. Follow the wizard step by step and click finish in the last step

Nothing will appear, you still see the Welcome to DWSIM page! Click on cascade windows, group windows, ... has no effect and you have to save the simulation and open the newly saved file to see the simulation environment

Gibbs reactor solver regression

IMPORTANT: This section is for code-related bugs. For usage issues, please go to the Support Forums.

Describe the bug
The new gibbs reactor solver introduced some regressions (cases that were converging before don't work anymore). A residual value in the error function remains as a result of the convergence process and throws a "convergence error" exception.

Expected behavior
The new solver must work for all previous cases.

[Improvement] Fix number of digits after decimal point in numerical input and output

Describe the issue
It is recommended to have certain number of digits after decimal point in displaying the results. One case is mole and mass fractions.
Expected behavior
Use certain number of digits after decimal points for mole and mass fraction

Screenshots

Fig 1. DWSIM
DWSIM_001

Fig 2. Other simulator
AspenHysys_002

Desktop (please complete the following information):

  • OS: Windows 10
  • DWSIM 6.2
  • Classic UI

Additional context
It may be useful to be able to set these numbers in general setting. Other simulator has this kind of setting for example see

Fig 3. Sample setting for numerical results
AspenHysys_003

Issue Modal Windows Stay on Top of all Windows in Desktop

Describe the bug

Some floating windows in DWSIM are modal. The issue is they stay on top of all windows opened in Windows Desktop while they should be modal and stay on top of windows opened inside DWSIM. This makes problems when for example assue you are reading data from a pdf opened in Windows desktop and you are entering them in DWSIM.

Examples

  1. Reaction Window

Expected behavior
A modal window shall only stay on top of opened windows in DWSIM not other windows in Desktop.

Desktop (please complete the following information):

  • OS: Windows 10
  • Classic UI
  • DWSIM 6.1 Update 6

Issue: Wrong height of notebox and overlap with Solution Inspector Message

Describe the bug
This issue has been reported before (see #13), but seems still not solved!

Description
Look at the below screenshots

Image 1: Notes in Object Editor is not visible with full height
Image-015

Image 2: Solution Inspector wrongly covers part of Notes in Object Editor

Image-016

Expected behavior

  1. Visible Notes with full height
  2. Move Solution Inspector message strip to proper position or show it as docked window!

Desktop (please complete the following information):

  • OS: Windows 10
  • DWSIM 6.1 Update 3
  • Classic UI

Issue Compressor Calculation Type

The specification or calculation type for compressor contains:

  • Pressure Increase/Decrease [Remove decrease]
  • Outlet pressure
  • Power required/generated [Remove generated]
  • Energy stream
  • Known head
  • Performance curve

Comments

  1. The first and third specifications above need correction
  2. When you use Energy stream, it means you should be able to set the energy flow of an Energy Stream, but DWSIM refuses to set the energy flow of Energy Stream (this is the case when compressor was solved using other specification and then you want to use energy stream)!
    2.1. If you already run compressor with outlet pressure or other spec, DWSIM uses the old value for energy stream
    2.2 If you set Compressor spec as Energy Stream when you add a new compressor, then setting energy flow, DWSIM issues an error like below:

COMP-003: A specified or calculated property for this Unit Operation is invalid. Please check it for incorrect specifications or miscalculated values. (name: power, value: -2.96059473233375E-16)

Desktop (please complete the following information):

  • OS: Windows 10
  • Classic UI
  • DWSIM 6.1 update 4

Issue in Equilibrium Reactor: Partial oxidation reaction

I have attached a testfile1 with three reactions in a equilibrium reactor:

(1): CH4 + H2O <-> CO + 3H2
(2): CH4 + CO2 <-> 2CO + 2H2
(3): 2CH4 + O2 <-> 2CO + 4H2

PP: Peng-Robinson

Running the simulation is possible without errors.
However, increasing the temperature or the pressure of the feed does not change the product composition or the conversion rates in any way. The same behaviour repeates itself if only partial oxidation of methane is simulated.

Expected behavior
As far as i know, any reaction which results in a change of moles in gas phase, shold be at least dependent on pressure.

Desktop (please complete the following information):

  • OS: Windows 10
  • DWSIM 6.3 Update 2
  • Classic UI

Additional context
This behaviour seems to be connected with the presence of O2 within the equation of reaction. I have created 3 further testfiles.

-Testfile2 just contains a comparision between the global and the single three reactions of testfile1 within the equilibrium reactor. (The gibbs reactor is just for further comparisons)

-In Testfile3 i have created a similar setup as in Testfile 1. However, the reactions are carried out based on Methanol instead of Methane. The result is basically the same as in Testfile 1. No change depending on pressure and/or temperature.

Testfiles_Kouessan.zip

[BUG] Solution inspector covers part of result table

Describe the bug
When Solution inspector is on, it create a ribbon bottom of object properties. It should be displayed blow object properties window and not cover it.

To Reproduce
Steps to reproduce the behavior:

  • Click on a material stream and look at the results see below figure
    image-205

  • Now turn on the Solution Inspector

  • Press F5 to solve the flowsheet and Solution Inspector appears at the bottom right of screen

  • See the figure when solution inspector is open

image-206

  • Note that part of result is hidden because the Solution Inspector small window covers part of results.

** Expected Behaviour**

  • There should be no overlap between two objects
  • Put the Solution Inspector report ribbon and icon below the object property table.

Issue: Compressor Object Editor has typos in

Describe the bug
There are typos in error message in compressor object editor and the message width is not appropriate. Also the tooltip shown is in another language. See attached screenshot.

To Reproduce
Steps to reproduce the behavior:

  1. Open a DWSIM simulation file
  2. add a compressor
  3. Click on compressor to open the object editor window on the left side
  4. Hover mouse over status icon, it shows Ativar/Desativar which is not in English
  5. Give some wrong data as calculation parameter (for example give outlet pressure less than the inlet pressure) and run simulation. DWSIM shows an error message on compressor object editor it has types: Error (peration should be Error (Operation see attached image
  6. The text is long and does not wrap when the width of object editor is smaller than the width of error message.

Expected behavior

  1. Correct the tooltip (it should be in English)
  2. Correct the typo in error message
  3. Adjust the width and wrap properties of error message

Screenshots
Image-011

Desktop (please complete the following information):

  • OS: Windows 10
  • DWSIM 6.1 Update 3
  • Classic UI

Side note:
For error messages like P_inlet>P_outlet why DWSIM does not give meaningful error message e.g: Outlet pressure cannot be less than the inlet pressure"

Welcome Panel does not work correctly

Describe the bug
Welcome Panel is not shown when the DWSIM main window is empty while the Welcome Panel under Menu-bar/View is selected!

To Reproduce
Steps to reproduce the behavior:

  1. Open DWSIM on Windows 10
  2. You see a nice Welcome Panel
  3. Open a simulation file or create one. Welcome Panel is disappeared
  4. Close all simulation files. DWSIM window is empty nothing is shown
  5. Open View from menu bar
    5.1. You see Welcome Panel checkbox is activated, BUT Welcome Panel is NOT shown
    5.2 Uncheck (de-select) the Welcome Panel
    5.3. Toggle (select) the Welcome Panel again, you will see Welcome Panel again

Expected behavior

  1. Toggle checkbox to show Welcome Panel should work correctly
  2. On DWSIM empty window, Welcome Panel shall be displayed

[Bug] Critical: Closing Message Window is not visible and DWSIM cannot be closed

Describe the bug
Closing a simulation shows a message window and ask for save any changes! Sometimes this window is not shown at the top of other floating windows and DWSIM does not respond to other actions and one has to close DWSIM from task manager using force close!

To Reproduce
Steps to reproduce the behavior:

  1. Open a DWSIM simulation file, no matter what it is
  2. Un-dock any of main windows (e.g. flowsheet, spreadsheet, Material Streams, ...) and float it at the middle of screen
  3. Close simulation file by clicking on close button top right of simulation window
  4. See error: The Close Message Window which seems to be a modal window is behind the float window and you cannot interact with DWSIM. The only solution is to go to Task Manager and force close DWSIM!

Another Bug
When you float a window in DWSIM it seems it behave like a modal window, for example float Watch Panel. Then try to open another program like Excel or Chrome, ... You see the floating window here watch Panel stays at top of all programs and you cannot for example work with Excel or Chrome!

Expected behavior

  1. The modal windows like DWSIM messaging windows shall be at the top of all other floating windows opened in DWSIM. So, in a case reported above user can interact with DWSIM.
  2. Floating windows in DWSIM should not stays at top of other programs

Screenshots

  1. Watch Panel is Floating
  2. Try to close simulation file

Image-019

Desktop (please complete the following information):

  • OS: Windows 10
  • DWSIM 6.1 Update 3
  • Classic UI

[IDEA] Auto Numbering

It seems auto numbering in DWSIM is started from zero and increased by +1 when a new element is added. It is recommended to use separate numbering for different elements as below

  • Material stream start from 001
  • Energy stream start from 001
  • Each unit operation separately start from 001 e.g
    • pumps start from 001 like PUMP-001
    • compressor start from 001 like COMP-001
    • separator start from 001 SEP-001
    • etc.

In preparing process documents like PFD and heat and material balance tables you should have sequential number for material stream, pumps, valves, etc ... and it is confusing when in H&M Table your stream number are missing.

Desktop (please complete the following information):

  • OS: Windows 10
  • Classic UI
  • DWSIM 6.1 Update 4

Inconsistent big icons and blurry toolbar DWSIM 6 Update 1

Describe the bug
Update 1 for DWSIM 6 brings some fix for high resolution screens but it seems unintentionally most of icons on toolbar and local menu and menu bar got inconsistent big size. I have attached some images. I did not such issue in DWSIM 6. or 6.1

Tested on
Windows 10
Screen 1920x1080 Full HD
DWSIM 6 Update 1

Look at the last three icons (right)

image-199

image-200

[Bug] a single stream can be used both as inlet and outlet of a unit operation at the same time

Describe the bug
In a DWSIM simulation one can connect a stream to a unit operation both as inlet and outlet as the same time. This is not proper behaviour!

To Reproduce
Steps to reproduce the behavior:

  1. Open a simulation file in DWSIM
  2. Click on a sample unit operation to open the object editor
  3. Select a stream for example MSTR-001 as inlet
  4. Select the same stream as outlet
  5. See error as below image
    Image-013

Expected behavior
DWSIM shall prevent connecting a stream as inlet and outlet of same unit operation.
A suggestion is DWSIM does not list the feed streams of a unit operation when one select an outlet stream and vice versa

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Windows 10
  • DWSIM 6.1 Update 3
  • Classic UI

Further bug
As explained above for compressor one can do as below

  1. simulate a compressor and get correct solution (for example see attached DWSIM file for gas compression)
  2. disconnect the outlet and use the feed as outlet stream
  3. Rerun the simulation
  4. DWSIM strangely run this strange flowsheet (e.g inlet stream = outlet stream = MSTR-001) and does not show any error or warning. See screenshot below

Image-014

Simulation file

level02-unit-operation.zip

[IDEA] Number of Inlets / Outlets Ports

In the current version some elements have more than one inlet port. For example separator has six inlet port (why six inlets?)
Mixer has six inlets while splitter has two outlet ports.

I may suggest

[1] Only keep the required inlet/outlet port for example separator can have one inlet. To do this few equipment needs modifying
[2] If it is required to have several inlet/outlet ports like mixer (inlet) and splitter (outlet), it would be great to be able to dynamically able to add new ports from UI. This is the case in Hysys for separator, mixer, splitter. But I think having one inlet port and using a mixer for several feed stream is preferred.

  • DWSIM 6.2 update 4
  • Classic UI
  • Windows 10

[Improvement] Use Liquid Phase and Aqueous Phase instead of Liquid 1 and 2

Describe the issue
DWSIM when shows results for three phase streams uses liquid 1 and liquid 2. One example where it is confusing is three phase separator where DWSIM uses liquid 1 both for hydrocarbon outlet and water outlet. Instead I suggest to use everywhere

  • Vapor phase
  • Liquid phase
  • Aqueous phase

See the below images for clarification.
Screenshots

DWSIM_emsVAyWMQc

DWSIM_8S7Bjq3PDP

DWSIM_4IlPh96z0G

Desktop (please complete the following information):

  • OS: Windows 10
  • DWSIM 6.2
  • Classic UI

[Feature Request]: Some Improvement on UI

  1. The selected compounds for a simulation shall be displayed at the top of list in Setting Window/ Compound. Right now you have to scroll all over the list to find them! A side panel to show selected compounds may be also useful!

  2. Modal windows: Some DWSIM windows like Setting are modal. The issue is they stay over all open windows in current desktop while it shall only stay over open windows in DWSIM

  3. Single click on objects in Flowsheet opens the Object Editors in the sidebar for editing object! This is not good as you may want to relocate object and single click is used to select the object. It is better to use double click for opening Object Editors.

  4. Gas-Liquid Separator: Why the gas-liquid separator has 6 inlet streams! In industry we have no such cases even so, in simulation environment it is enough to use a mixer and the connect the outlet to mixer to separator

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.