Giter Club home page Giter Club logo

Comments (20)

DanWBR avatar DanWBR commented on May 27, 2024 1

Captura de Tela 2020-11-20 às 15 19 41

Captura de Tela 2020-11-20 às 15 19 53

Captura de Tela 2020-11-20 às 15 21 36

Captura de Tela 2020-11-20 às 15 21 42

from dwsim.

DanWBR avatar DanWBR commented on May 27, 2024 1

Actually, you can access almost everything as there are other variables available like Flowsheet, Reaction and Reactor.

from dwsim.

DanWBR avatar DanWBR commented on May 27, 2024 1

There is some room for improvement. Stay tuned

from dwsim.

DanWBR avatar DanWBR commented on May 27, 2024 1

The wrapper depends on the library. I've written many C++/Fortran wrappers for DWSIM already. It is the communication bridge between VB/C# and Fortran that is prone to crashes.

from dwsim.

kookma avatar kookma commented on May 27, 2024

Hi Daniel, I am eagerly looking forward for this feature! I am ready to help with test and evaluation once the feature is added!

from dwsim.

kookma avatar kookma commented on May 27, 2024

Hi Daniel,
Thank you! This is amazing! I know only Schlumberger Symmetry (VMGSim) has such a feature!

I like to give a try! If you push a new release I will go through details and will submit the result and comments.

from dwsim.

kookma avatar kookma commented on May 27, 2024

This is a great improvement in writing very complex multi step reactions for multi component - multi reactions system!

from dwsim.

kookma avatar kookma commented on May 27, 2024

Hi Daniel,
I have installed the new version and tried to implement a simple example like below
CO + 1/2 O2 --> CO2

with r = 0.5 * R1

but I could not get any conversion. Would you please add an example to see how it works?

Thank you

from dwsim.

DanWBR avatar DanWBR commented on May 27, 2024

@kookma can you attach your sim file?

from dwsim.

kookma avatar kookma commented on May 27, 2024

Hi Daniel,

See attached file. I played and seems I could get a conversion in isothermal operation but failed in adiabatic mode! Seems the reaction set works and issue is because flash calculation.

By the way I would very pleased to receive any example by you and also I may recommend to add few examples to be distributed with DWSIM.

test_rxn_python.zip

from dwsim.

DanWBR avatar DanWBR commented on May 27, 2024

You're using the script exactly as expected, except that

  • You've defined a Liquid-only reaction with non-condensable gases
  • You're using a CSTR with a 100% vapor inlet stream.

from dwsim.

kookma avatar kookma commented on May 27, 2024

Hi Daniel,

  • I modified the code by replacing the reactor with a PFR one
  • I changed the reaction to be occurred in vapor/gas phase

I cannot get a converge!

test_rxn_python.zip

from dwsim.

kookma avatar kookma commented on May 27, 2024

Hello again Daniel,
I understood the issue is with Plug Flow ODE solver. It seems it is a non-stiff ODE solver so for r=0.5C it cannot integrate the ODES. I changed r to 0.005C and also implemented basic kinetic reaction and compared the two PFRS

  • A PFR with simple kinetics r=0.005Ca
  • A PFR with Python script for advances kinetics r=0.005Ca

No both converge, but the second at lower speed. You can check my third version of simulation.

test_rxn_python_R03.zip

from dwsim.

DanWBR avatar DanWBR commented on May 27, 2024

Now both converge or don't? Using the script will be much slower because it is called a zillion times by the ode solver.

from dwsim.

kookma avatar kookma commented on May 27, 2024

Daniel, well both of them converged! How we can improved this?
The computation time is considerable!

from dwsim.

DanWBR avatar DanWBR commented on May 27, 2024

Is there something that we could do about the issue with the ODE solver?

from dwsim.

kookma avatar kookma commented on May 27, 2024

Is there something that we could do about the issue with the ODE solver?

I have not good at VB.Net so I did not understand how ODE solvers have been implemented, but I may have few suggestions:

  1. If ODEsolver used in DWSIM is not a stiff solver then it will try to solve a stiff ODE by decrease the step size ans so computation takes more and if solver is called many times then we see a considerable computation time to solve a PFR
  2. If DWSIM has stiff solver then item 1 is not correct here and may be having ode solver in VB.NET makes it slow

I think if DWSIM can use Python why not to use Scipy DLLs and use of robust solvers in SciPy? I also think we can use other libraries as DLL like Fortran ones which are very fast and then write a wrapper in VB.NET to able use them with minimum friction.

What do you think?

from dwsim.

DanWBR avatar DanWBR commented on May 27, 2024

Using Scipy would be much, much slower. Also, about the fortran libs, it is hard to write the wrapper, and it may crash frequently.

DWSIM uses the DotNumerics library which contains these ODE solvers: http://www.dotnumerics.com/NumericalLibraries/DifferentialEquations/Default.aspx

Currently using OdeImplicitRungeKutta5 in the PFR.

from dwsim.

kookma avatar kookma commented on May 27, 2024

I have worked with Fortran and its reliable, but have no experience to write wrapper in VB.NET.
I will have a look at DotNumerics! But OdeImplicitRungeKutta5 is a good choice here.

from dwsim.

AdrianDietz avatar AdrianDietz commented on May 27, 2024

HI,

I do not know what the dotnumerics library is worth, looks like a translation to c# from fortran. I any case the reference for solving problems that requires numerical integration is the suite sundials with cvode that is written in c (https://computing.llnl.gov/projects/sundials). I have tested (comparing against their fortran equivalent) and used it in the past, I do not now whether the license is compatible with gpl.

Kind regards,

Adrian

from dwsim.

Related Issues (20)

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.