Menu

Help with Reaktoro

2023-06-27
2023-08-02
  • Gregor Reichert

    Gregor Reichert - 2023-06-27

    Hi together,
    i fetched actual code from GitHub and compiled the projekt.
    With this actual version Reactoro-PP should work without an additional python environment.
    I tried this, but DWSIM complains that there is no link to a Python installation folder.

    What is going wrong here?
    Please help.

     

    Last edit: Gregor Reichert 2023-06-27
    • Daniel Medeiros

      Daniel Medeiros - 2023-06-27

      Gregor, you don't need the two additional environments that you had to download before, but you need at least one 3.7-3.9 environment for Reaktoro and other DWSIM functionality like PEM Fuel Cell and python (not ironpython) scripting support.

       
  • Gregor Reichert

    Gregor Reichert - 2023-07-03

    Hi Daniel,
    i just installed Python and added the link of the folder into the general settings.

    Then i created a new simulation with Reaktoro-PP and Water, NaCl, Na+ and Cl- as components.
    I also added a new equilibrium reaction NaCl <-> Na+ + Cl-

    A new stream with Water and NaCL was created. Now i get a new error message on calculation:

    Location:
    Code Location: InitializePythonEnvironment (file 'C:\Users\g90020\source\repos\DWSIM\DWSIM.GlobalSettings\Settings.vb', line 209)

    Calling Method: Flash_PT (file 'C:\Users\g90020\source\repos\DWSIM\DWSIM.Thermodynamics.ReaktoroPropertyPackage\ReaktoroFlash.vb', line 120)

    Description:

    This error was raised during the calculation of a Unit Operation or Material Stream.

    System.TypeInitializationException: The type initializer for 'Python.Runtime.UcsMarshaler' threw an exception. ---> System.IO.FileLoadException: Could not load file or assembly 'System.Runtime.InteropServices.RuntimeInformation, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) ---> System.IO.FileLoadException: Could not load file or assembly 'System.Runtime.InteropServices.RuntimeInformation, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) ---> System.IO.FileLoadException: Could not load file or assembly 'file:///C:\Users\g90020\source\repos\DWSIM\DWSIM\bin\x64\Debug\System.Runtime.InteropServices.RuntimeInformation.dll' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
    at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
    at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
    at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)
    at System.Reflection.Assembly.LoadFrom(String assemblyFile)
    at DWSIM.My.MyApplication.LoadFromExtensionsFolder(Object sender, ResolveEventArgs args) in C:\Users\g90020\source\repos\DWSIM\DWSIM\ApplicationEvents.vb:line 135
    at System.AppDomain.OnAssemblyResolveEvent(RuntimeAssembly assembly, String assemblyFullName)
    --- End of inner exception stack trace ---
    at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
    at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
    at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)
    at System.Reflection.Assembly.LoadFrom(String assemblyFile)
    at DWSIM.My.MyApplication.LoadFromExtensionsFolder(Object sender, ResolveEventArgs args) in C:\Users\g90020\source\repos\DWSIM\DWSIM\ApplicationEvents.vb:line 135
    at System.AppDomain.OnAssemblyResolveEvent(RuntimeAssembly assembly, String assemblyFullName)
    --- End of inner exception stack trace ---
    at Python.Runtime.UcsMarshaler..cctor()
    --- End of inner exception stack trace ---
    at DWSIM.GlobalSettings.Settings.InitializePythonEnvironment(String pythonpath) in C:\Users\g90020\source\repos\DWSIM\DWSIM.GlobalSettings\Settings.vb:line 209
    at DWSIM.Thermodynamics.ReaktoroPropertyPackage.ReaktoroFlash.Flash_PT(Array Vx, Double T, Double P) in C:\Users\g90020\source\repos\DWSIM\DWSIM.Thermodynamics.ReaktoroPropertyPackage\ReaktoroFlash.vb:line 120
    at DWSIM.Thermodynamics.ReaktoroPropertyPackage.ReaktoroPropertyPackage.DW_CalcEquilibrium(FlashSpec spec1, FlashSpec spec2) in C:\Users\g90020\source\repos\DWSIM\DWSIM.Thermodynamics.ReaktoroPropertyPackage\ReaktoroPP.vb:line 145
    at DWSIM.Thermodynamics.Streams.MaterialStream.Calculate(Boolean equilibrium, Boolean properties) in C:\Users\g90020\source\repos\DWSIM\DWSIM.Thermodynamics\MaterialStream\MaterialStream.vb:line 610
    at DWSIM.Thermodynamics.Streams.MaterialStream.Calculate(Object args) in C:\Users\g90020\source\repos\DWSIM\DWSIM.Thermodynamics\MaterialStream\MaterialStream.vb:line 453
    at DWSIM.SharedClasses.UnitOperations.BaseClass.Solve() in C:\Users\g90020\source\repos\DWSIM\DWSIM.SharedClasses\BaseClass\SimulationObjectBaseClasses.vb:line 465
    at DWSIM.FlowsheetSolver.FlowsheetSolver.CalculateMaterialStreamAsync(Object fobj, ISimulationObject ms, CancellationToken ct) in C:\Users\g90020\source\repos\DWSIM\DWSIM.FlowsheetSolver\FlowsheetSolver.vb:line 388
    at DWSIM.FlowsheetSolver.FlowsheetSolver.ProcessQueueInternalAsync(Object fobj, CancellationToken ct) in C:\Users\g90020\source\repos\DWSIM\DWSIM.FlowsheetSolver\FlowsheetSolver.vb:line 605

     
  • Daniel Medeiros

    Daniel Medeiros - 2023-07-03

    Hi Gregor, please remind me of this in 7 days (I'm on vacation)

     
  • Gregor Reichert

    Gregor Reichert - 2023-07-18

    Hi Daniel,
    I'd like to remember you of that issue as suggested.
    I installed Python from the link you suggested within the property package.

    p.s.: i defined Python path in general settings:
    C:\Users\xxxxxx\Python\WPy64-310111\python-3.10.11.amd64

     

    Last edit: Gregor Reichert 2023-07-18
    • Daniel Medeiros

      Daniel Medeiros - 2023-07-18

      Hi Gregor. Only Python 3.7 to 3.9 are supported by reaktoro v1.

       
  • Gregor Reichert

    Gregor Reichert - 2023-07-18

    Hi Daniel,
    thanks for that information. I will check this out.
    Please, could you update the information on your website regarding Reaktoro ?
    Do you have a working sample file which might be included to sample files directory to demonstrate usage of that PP?

     
  • Gregor Reichert

    Gregor Reichert - 2023-07-28

    Hi Daniel,
    i installed WinPython 3.9 from link you provided on Sourceforge.
    I also checked the installation of Python is working via Spyder.

    I still get an error on running Reaktoro PP:

    Please, could you have a look?

    regards, Gregor


    *
    This error was raised during the calculation of a Unit Operation or Material Stream.

    System.TypeInitializationException: The type initializer for 'Python.Runtime.UcsMarshaler' threw an exception. ---> System.IO.FileLoadException: Could not load file or assembly 'System.Runtime.InteropServices.RuntimeInformation, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) ---> System.IO.FileLoadException: Could not load file or assembly 'System.Runtime.InteropServices.RuntimeInformation, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) ---> System.IO.FileLoadException: Could not load file or assembly 'file:///C:\Users\g90020\source\repos\DWSIM\DWSIM\bin\x64\Debug\System.Runtime.InteropServices.RuntimeInformation.dll' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
    at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
    at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
    at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)
    at System.Reflection.Assembly.LoadFrom(String assemblyFile)
    at DWSIM.My.MyApplication.LoadFromExtensionsFolder(Object sender, ResolveEventArgs args) in C:\Users\g90020\source\repos\DWSIM\DWSIM\ApplicationEvents.vb:line 135
    at System.AppDomain.OnAssemblyResolveEvent(RuntimeAssembly assembly, String assemblyFullName)
    --- End of inner exception stack trace ---
    at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
    at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
    at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)
    at System.Reflection.Assembly.LoadFrom(String assemblyFile)
    at DWSIM.My.MyApplication.LoadFromExtensionsFolder(Object sender, ResolveEventArgs args) in C:\Users\g90020\source\repos\DWSIM\DWSIM\ApplicationEvents.vb:line 135
    at System.AppDomain.OnAssemblyResolveEvent(RuntimeAssembly assembly, String assemblyFullName)
    --- End of inner exception stack trace ---
    at Python.Runtime.UcsMarshaler..cctor()
    --- End of inner exception stack trace ---
    at DWSIM.GlobalSettings.Settings.InitializePythonEnvironment(String pythonpath) in C:\Users\g90020\source\repos\DWSIM\DWSIM.GlobalSettings\Settings.vb:line 209
    at DWSIM.Thermodynamics.ReaktoroPropertyPackage.ReaktoroFlash.FlashPT(Array Vx, Double T, Double P) in C:\Users\g90020\source\repos\DWSIM\DWSIM.Thermodynamics.ReaktoroPropertyPackage\ReaktoroFlash.vb:line 120
    at DWSIM.Thermodynamics.ReaktoroPropertyPackage.ReaktoroPropertyPackage.DWCalcEquilibrium(FlashSpec spec1, FlashSpec spec2) in C:\Users\g90020\source\repos\DWSIM\DWSIM.Thermodynamics.ReaktoroPropertyPackage\ReaktoroPP.vb:line 145
    at DWSIM.Thermodynamics.Streams.MaterialStream.Calculate(Boolean equilibrium, Boolean properties) in C:\Users\g90020\source\repos\DWSIM\DWSIM.Thermodynamics\MaterialStream\MaterialStream.vb:line 610
    at DWSIM.Thermodynamics.Streams.MaterialStream.Calculate(Object args) in C:\Users\g90020\source\repos\DWSIM\DWSIM.Thermodynamics\MaterialStream\MaterialStream.vb:line 453
    at DWSIM.SharedClasses.UnitOperations.BaseClass.Solve() in C:\Users\g90020\source\repos\DWSIM\DWSIM.SharedClasses\BaseClass\SimulationObjectBaseClasses.vb:line 465
    at DWSIM.FlowsheetSolver.FlowsheetSolver.CalculateMaterialStreamAsync(Object fobj, ISimulationObject ms, CancellationToken ct) in C:\Users\g90020\source\repos\DWSIM\DWSIM.FlowsheetSolver\FlowsheetSolver.vb:line 388
    at DWSIM.FlowsheetSolver.FlowsheetSolver.ProcessQueueInternalAsync(Object fobj, CancellationToken ct) in C:\Users\g90020\source\repos\DWSIM\DWSIM.FlowsheetSolver\FlowsheetSolver.vb:line 605

     
    • Daniel Medeiros

      Daniel Medeiros - 2023-08-02

      Hi Gregor,

      I don't know what's going on on your computer. It works for me on a clean DWSIM install and when debugging it as well (Debug/x64).

       

Log in to post a comment.