I just finished the Utilities Plugin system for DWSIM. What follows is a little Q&A to help clarify your minds:
Q) What is this plugin system?A) It is nothing more than an interface definition for add-in classes in DWSIM. You can develop a class library in any .NET language which implements the interface, compile it as a .NET DLL and copy the generated file to the plugins folder. Next time you start DWSIM, it will detect the plugin and make it available as an utility in any simulation.
Q) What information from the simulation will be available to the plugin?A) You will have the entire DWSIM Namespace available - since you're adding a reference to it - and also a reference to the active simulation and all its objects (streams, unit operations, settings, etc.). You will be able to, for example, instantiate new thermodynamic classes to do calculations, but nothing stops you from using your own class libraries, even if they are in separate assemblies (files).
Q) Ok, so what do I need to do to build a working plugin?A) The basic steps to create a plugin for DWSIM are:
1 - Create a new .NET project in your IDE of choice (Visual Studio, SharpDevelop or MonoDevelop), in any .NET language;
2 - Add a reference to
DWSIM.exe, and set the
CopyLocal property to
False (you don't have to copy the entire DWSIM application to create the plugin, just add the reference);
3 - Create a class that implements the Interface
IUtilityPlugin located in the
DWSIM.Interfaces Namespace;
4 - Implement the required methods;
5 - Compile your project as a .NET DLL;
6 - Copy the generated DLL to the
plugins folder in the DWSIM application folder;
7 - Start DWSIM and create a new/open an existing simulation;
8 - Your plugin will be available in the "Plugins" menu item.
To test the system I created an example plugin which shows some information about itself and a list of GUIDs of the objects in the active simulation. It is really easy and all you will need is some guidance on how to use DWSIM methods and access flowsheet objects and their properties.



Lots of progress! Keep up the good work. I had an idea that might be worth some consideration. For the next version, what do you think about implementing the whole application in Silverlight? To my knowledge, you can use C# directly in a Silverlight app ... it might be a easy way to deploy and port dwsim to multiple plaforms (win and mac for sure) and linux (moonlight).
Also, I've been testing out dwsim a little ... I don't know if there is a problem with petroleum_dist example file. Minor changes to feed oil temperature (+ 5 K) will never converge the column solver. I thought maybe it was slow, but I waited for 5+ minutes ... is this expected behavior? And also I'm surprised that the column does not converge with the IO method. I haven't dived through the source yet, but maybe you have some insight?
Regards,
KP
Yes you can use C# and VB.NET directly in Silverlight, but what I don't know is if it supports all .NET namespaces, mainly Generics... I'll take a look.
About the column, I setup that problem before changing the algorithm and didn't dig in into the code to see what is happening but I can confirm your observations. Check the specifications, if you saved the simulation before I did the modification, they will be inverted - you have to setup them again.
Kind Regards,
Daniel
I did a little testing with the phase envelope utility with an equimolar mixture of C1, C2, C3, N2 and O2 and the PR EOS. DWSIM seems to predict the dew point curve up to 5 bars of the critical pressure. The bubble point curve and critical points are not calculated at all. Can you replicate this?
KP
I sent you an e-mail.