Menu

Problems with the calculation of enthalpy

2015-10-20
2015-11-19
  • Kevin Herrera Laya

    Hello!!

    I am modeling the resolution of a PT flash calling DWSIM Standalone Thermodynamics Library (DTL) in LabVIEW but verifying the calculation of enthalpies on a molar basis and mass basis, I have some differences from the library used by the simulator which complicates the performance of the rest the necessary calculations.

    For the same material stream the DTL gives me an Mixture Specific Enthalpy of 0.18205 kJ/kg and the simulator says 0.07341 kJ/kg. The problem is the same when I calculate in molar basis.

    Is there any update of the DTL? I have the DTL which was last modified on June 16, 2014.

    Thank you very much for your help.

     
  • Daniel Medeiros

    Daniel Medeiros - 2015-10-20

    Which property package are you using?

     
  • Kevin Herrera Laya

    Peng-Robinson (PR)

    The material stream is

    Methane 0,7607
    Ethane 0,1031
    Propane 0,0543
    i-Butane 0,0075
    n-Butane 0,01
    n- Pentane 0,014
    CO2 0,0481
    N2 0,0023

    P 270000 Pa
    T 300 K

     
  • Kevin Herrera Laya

    I changed my machine but when I'm registering the library to use it through COM interface an error occurs.

    RegAsm : warning RA0000 : Registering an unsigned assembly with /codebase can cause your assembly to interfere with other applications that may be installed on the same computer. The /codebase switch is intended to be used only with signed assemblies. Please give your assembly a strong name and re-register it.

    I read that this warning appears when you try to register a DLL that is not signed and what you should do is sign the DLL generated and recompile the project. I don't know if it is true. If you could help me, I would appreciate it.

    Best regards
    Kevin

     

    Last edit: Kevin Herrera Laya 2015-11-12
  • Daniel Medeiros

    Daniel Medeiros - 2015-11-12

    This is just a warning. It would only cause you trouble if you had multiple versions of the library in different places. Only the last registered one would be accessible.

     
  • Kevin Herrera Laya

    I can register the dll v2.2.7 but I can not register the v3.0.0 so my program can not access the library v3.0.0.

     

    Last edit: Kevin Herrera Laya 2015-11-12
  • Daniel Medeiros

    Daniel Medeiros - 2015-11-12

    Remove the /codebase switch then.

    BTW, there's a new (3.1.0) version available to download.

     
  • Kevin Herrera Laya

    Now the error is:

    Could not load type 'System.Runtime.CompilerServices.ExtensionAttribute' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

    I try registering the v3.1.0 but the error was the same.

     
  • Daniel Medeiros

    Daniel Medeiros - 2015-11-12

    Do you have the .NET 4.0 Runtime installed? What is your operating system?

     
  • Kevin Herrera Laya

    I need to check that. I'm using win7 x64.

     
  • Daniel Medeiros

    Daniel Medeiros - 2015-11-12

    How did you try to register the dll (the exact command line)?

     
  • Kevin Herrera Laya

    I'm copying the dll on my .NET 4.0 installation directory (C:\Windows\Microsoft.NET\Framework\v4.0.30319) and using:

    RegAsm.exe /tlb:DWSIM.Thermodynamics.tlb DWSIM.Thermodynamics.dll /codebase

     
  • Daniel Medeiros

    Daniel Medeiros - 2015-11-13

    Maybe I wasn't very clear on the instructions. The correct way to register is to put the DLL in a known place, like a personal directory, navigate to there, open a command line tool and then register it like this:

    C:\Windows\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe /tlb:DWSIM.Thermodynamics.tlb DWSIM.Thermodynamics.dll /codebase

    The codebase switch will then record the current DLL path into registry so it can be found by the COM callers.

     
  • Kevin Herrera Laya

    I installed NET Framework v4.5.1 and then I can read the dll from LabVIEW 2013. I don't need make the register with RegAsm because LabVIEW uses .NET callers and you must to provide the location of the dll.

    Thanks a lot.

     
  • Daniel Medeiros

    Daniel Medeiros - 2015-11-16

    Great. I checked how I compiled the DLL and I did use .NET 4.0, it is strange that it required 4.5.1 to work. Maybe it is a LabVIEW requirement.

     
  • Daniel Medeiros

    Daniel Medeiros - 2015-11-16

    Kevin, if you are going to do equilibrium calculations, check the new "CalcEquilibrium" routine, it returns the results as a well-defined class with some mole-to-mass ans vice-versa conversion utilities. Much easier to work with.

     
  • Kevin Herrera Laya

    Perfect, I'll check that.

    Thanks!

     

Log in to post a comment.