Menu

Dynamic Simulation Excercise

2019-09-13
2022-03-06
  • Patrick Veiltl

    Patrick Veiltl - 2019-09-13

    Hello Daniel,
    I'm currently trying to create a dynamic simulation with the newest version of DWSIM (5.7) and came accross your tutorial (http://dwsim.inforside.com.br/wiki/index.php?title=Dynamic_Simulation_Tutorial_with_DWSIM_and_Python,_Part_2:_Building_the_Dynamic_Model).
    I followed all the instructions, but I get the following error report:

    [13.09.2019 13:32:39] Error running script: Traceback (most recent call last):
    File "<string>", line 16, in <module>
    File "<string>", line 21, in <module>
    AttributeError: 'NoneType' object has no attribute 'ExtraProperties'</module></string></module></string>

    I tried the simulation in both DWSIM and DWSIM (New UI) but get the same error.
    Can you help me solve this problem?

     
  • Daniel Medeiros

    Daniel Medeiros - 2019-09-13

    Which script is the one giving you this error?

     
  • Patrick Veiltl

    Patrick Veiltl - 2019-09-16

    It's the script "RunDynamicProcess_OpenLoop". The error immeadiatly appears when I press "Update and Run (Asynch)".

     
  • Daniel Medeiros

    Daniel Medeiros - 2019-09-16

    I've fixed the article and the associated files for v5.7 Update 14. Remember to open the files on the Cross-Platform UI, the Classic UI won't handle it correctly.

    Thanks!
    Daniel

     
  • Patrick Veiltl

    Patrick Veiltl - 2019-09-17

    Thanks, I downloaded the files you uploded on the page 2 and 3 respectively.
    The simulation runs succesfully, but two new problems emerged.

    The graph for Outlet.Temperature(t) that gets displayed after the simulation, doesn't show a change in temperature for either fluid. Both Outlet Temperatures stay at Pre-Pertubation-Temperature. This problem is found in both files on page 2 and 3.
    The other problem concerns the calculation of the cold water mass flow, which diverges to infinity. This solely happens in the program containing the PID controler (file on page 3) .

     
  • Daniel Medeiros

    Daniel Medeiros - 2019-09-17

    Are you running the scripts asynchronously (Run Async)?

     
  • Patrick Veiltl

    Patrick Veiltl - 2019-09-17

    Yes.
    I run RunDynamicProcess_OpenLoop asynchyronously.

     
    • Daniel Medeiros

      Daniel Medeiros - 2019-09-17

      Sorry, try downloading the files again. Basically you'll have to change

      Flowsheet.RequestCalculation()
      

      by

      Flowsheet.SolveFlowsheet2()
      

      in the loops as the first one runs asynchronously on Windows... this will be fixed in the next release.

       
  • Patrick Veiltl

    Patrick Veiltl - 2019-09-17

    I downloaded the new file and checked if
    Flowsheet.RequestCalculation()
    is replaced by
    Flowsheet.SolveFlowsheet2()

    Still the same problem. The Outlet Temperatures don't change.

     
  • Daniel Medeiros

    Daniel Medeiros - 2019-09-17

    They worked here in v5.7 Update 13.

     
  • Daniel Medeiros

    Daniel Medeiros - 2019-09-17

    Are you running DWSIM on Windows? What is your system language?

     
  • Patrick Veiltl

    Patrick Veiltl - 2019-09-17

    Does the progam actually calculate Outlet Temperatures with this formula, or does it get the value directly from HX-01?

    if (deltat <= delay1 and t0 > 0.0):
    hx.ColdSideOutletTemperature = hx.ExtraProperties.ColdFluidPrePerturbationOutletTemperature + (deltat/delay1)**2 * (hx.ColdSideOutletTemperature - hx.ExtraProperties.ColdFluidPrePerturbationOutletTemperature)

    It seems as if by calculating the Outlet.Temperatures this way, the start value ColdFluidPrePerturbationOutletTemperature isn't changed and therefore displayed throughout the whole time interval.
    Or in other words, could you explain what this calculation achives?

    If it works in your version of DWSIM it may have to do with my current software v5.7 Update 14.

     
  • Daniel Medeiros

    Daniel Medeiros - 2019-09-17

    Output of the closed loop in part 3

     
  • Patrick Veiltl

    Patrick Veiltl - 2019-09-17

    This is my result of "RunDynamicProcess_ClosedLoop" with "Update and Run Asynch"

     
  • Daniel Medeiros

    Daniel Medeiros - 2019-09-17

    Your PID parameters are not the correct ones. Perhaps your internet provider hasn't updated the links to the files on my server.

    This is the output on v5.7 Update 14, so it should work ok on yours. Try the attached files.

     
  • Patrick Veiltl

    Patrick Veiltl - 2019-09-17

    Thank you Daniel, the files you sent me worked perfectly.

     
    • Daniel Medeiros

      Daniel Medeiros - 2019-09-17

      You're welcome!

       
  • Jens Wallevik

    Jens Wallevik - 2019-09-19

    Hi. I am trying to plot using classic UI. I found this example but the window just hangs for a while then closes. http://dwsim.inforside.com.br/wiki/index.php?title=IronPython_Script_Snippets#Create_and_Display_a_Two-Dimensional_Plot_.28Classic_UI.29

     
    • Jens Wallevik

      Jens Wallevik - 2019-09-19

      Ok...just figured out one way...use 'form1.ShowDialog()' rather than 'form1.Show()'
      ...although that pauses the code

       

      Last edit: Jens Wallevik 2019-09-19
  • Haider Alazzawi

    Haider Alazzawi - 2022-03-06

    Good times Mr. "Daniel Medeiros', How are you sir!
    I am new to this tool, I have faced issue from the first download and trying a tutorials, the property package division does not show the option of "Flash Algorithms". Is this a technical issue? or it is missing file in the software?

     
    • Daniel Medeiros

      Daniel Medeiros - 2022-03-06

      DWSIM is always being updated and enhanced. the Flash Algorithm is not a direct selection anymore as it has been moved to the property package settings.

       
      • Haider Alazzawi

        Haider Alazzawi - 2022-03-06

        Thank you so much sir! I appreciate your time!!

         
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.