diana a short introduction
play

DIANA A short introduction Michael Krasnyk Max Planck Institute - PowerPoint PPT Presentation

11 March 2009 ICVT, Universit at Stuttgart DIANA A short introduction Michael Krasnyk Max Planck Institute for Dynamics of Complex Technical Systems, PSPD group Otto-von-Guericke-University, IFAT U N I V E E K R S C I I T R


  1. 11 March 2009 ICVT, Universit¨ at Stuttgart DIANA — A short introduction Michael Krasnyk Max Planck Institute for Dynamics of Complex Technical Systems, PSPD group Otto-von-Guericke-University, IFAT U N I V E E K R S C I I T R Ä E U T G M N A G O D V E O B U T T R O G MAX−PLANCK−INSTITUT DYNAMIK KOMPLEXER TECHNISCHER SYSTEME MAGDEBURG

  2. U N I V K E E R C S I I T R E Ä T U G M Motivation N A G O D V E O B U T T R O G High demand for first principle modeling of chemical processes Complexity of processes and models Structure of implemented models Goals of computer-based modeling computer-aided process engineering systematical modeling approaches reusable and transparent models Physically motivated concepts for structuring of balance based models Ponton (1991), Marquardt (1996), Gilles (1997), Mangold (2002) OvGU, MPI Modeling tool ProMoT / Simulation tool Diana 2/27

  3. U N I V K E E R C S I I T R E Ä T U G M Modeling tool ProMoT N A G O D V E O B U T T R O G Equation-based modeling differential-algebraic systems (differential index 1) Petri networks object-oriented concepts for models multiple inheritance aggregation model implementation text-based in modeling language MDL graphical modeling with GUI Equation analysis and optimization elimination of explicit algebraic relations structure analysis of the complete system for solvability Symbolic differentiation in ProMoT OvGU, MPI Modeling tool ProMoT / Simulation tool Diana 3/27

  4. U N I V K E E R C S I I T R E Ä T U G M Simulation tool Diana N A G O D V E O B U T T R O G Current activity (define-module Create :class "Test" Future plans ... ) Promot C++ model CapeDAESO Model description Make CapeDAESOSolver Initial values User PetriNetworks Simulation results Continuation Data XML Diana SWIG PyGTK import diana Run NumPy import solver mod=Model("Test") SciPy GUI ... Python OvGU, MPI Modeling tool ProMoT / Simulation tool Diana 4/27

  5. U N I V K E E R C S I I T R E Ä T U G M Diana architecture N A G O D V E O B U T T R O G Promot Swig-Wrapping Model Files Python-embedded shared libraries Python Model Loader Solver Factory Python Scripting - Control of simulator activity - loads a model from a file - loads numerical algorithms - Model Data Access - calls model-specific initialization from file - Callback Functions routines Diana Numerical Algorithms C++ Model - encapsulates model data: - Parameters - State Variables Integrators - Provides interface to - Equations/Help-Vars - Event Functions Solvers - Petri network - Assertions Event Handlers Online Plotter - Selection of Variables Optimizers - Generation of standard Plots Output Service Numerical Libraries Continuators Gnuplot / wxPython - collection of data during calculation - Online / Offline Plots SUNDIALS ARPACK - Access by scripts/plotting Sensitivity Analysers - Output to Simulation-Log BLAS LAPACK SciPy/ Numeric - Scientific Programming in Parameter Analysers Umfpack Harvell Python - Matlab-like Functionality Result Files OvGU, MPI Modeling tool ProMoT / Simulation tool Diana 5/27

  6. U N I V K E E R C S I I T R E Ä T U G M Diana dependencies N A G O D V E O B U T T R O G Required dependencies gcc (version � 3.3.1) python (version � 2.4) swig (version � 1.3.31) xerces (version � 2.7.0) cppunit (version � 1.11.0) External numerical libraries: Required linear algebra libraries BLAS http://www.netlib.org/blas/ LAPACK http://www.netlib.org/lapack/ UMFPACK http://www.cise.ufl.edu/research/sparse/umfpack/ Optional linear algebra libraries ARPACK http://www.cse.scitech.ac.uk/nag/hsl/ Harwell Subroutine Library http://www.cse.scitech.ac.uk/nag/hsl/ Differential algebraic solvers IDA/Sundials http://acts.nersc.gov/sundials DASPK http://www.cs.ucsb.edu/~cse/software.html OvGU, MPI Modeling tool ProMoT / Simulation tool Diana 6/27

  7. U N I V K E E R C S I I T R E Ä T U G M Diana installation N A G O D V E O B U T T R O G Latest sources can be found here: http://promottrac.mpi-magdeburg.mpg.de/dist/ Doxygen-generated documentation for the Diana: http://promottrac.mpi-magdeburg.mpg.de/doc/Diana/ Build and install: ./ config/bootstrap ./ configure --prefix=< installation prefix > \ --with -ufsparse=<ufsparse installation dir > \ --with -arpack=<arpack lib path > \ --with -blas=<blas lib path > \ --with -lapack=<lapack lib path > \ --with -sundials=<sundials installation dir > \ --with -cppunit -prefix=<cppunit installation dir > \ --with -xerces=<xerces installation dir > \ --with -mdl2diana=<mdl2diana path > make make check make install OvGU, MPI Modeling tool ProMoT / Simulation tool Diana 7/27

  8. U N I V K E E R C S I I T R E Ä T U G M Simulation models N A G O D V E O B U T T R O G CAPE-OPEN interface extension IDianaDAESO defines a dynamical model as a DAE system in implicit form f : R × R n × R n × R p → R n ∈ C ∞ f ( t , x , ˙ x , ν ) = 0 , extension interface gives an access to derivatives of the model ∂ k + l + m f ( t , x , ˙ x , ν ) , k , l , m � 0 , ∂ k x ∂ l ˙ x ∂ m ν that are obtained with help of CAS Maxima ProMoT command mdl2diana produces C ++ model code mdl2diana <module > [-f <mdl -file >] [-d <diana -name >] [-c] [-g <generation -dir >] [-sd <triples of integers >] [-sd -sing] [-sd -sens] Diana command dianac compiles a model to shared library dianac <model_name > [--clean] [--rebuild ] [-O <OPT >] OvGU, MPI Modeling tool ProMoT / Simulation tool Diana 8/27

  9. U N I V K E E R C S I I T R E Ä T U G M Simulation model interface N A G O D V E O B U T T R O G Interface methods Get/Set(All)[Variables|Derivatives|Parameters] access methods to the state vector x , derivatives vector ˙ x and parameters vector ν . Get(All)Residuals methods return the residual vector f Get[Lower|Upper]Bounds methods return user defined maximal and minimal values for the state variables Get/SetIndependentVar are access methods to the independent variable t Get(All)(Diff|Par)JacobianValues methods return values of the Jacobian matrices ∂ f /∂ x , ∂ f /∂ ˙ x or ∂ f /∂ν GetHighOrderJacobian method returns values of the higher order Jacobian ma- trix ∂ ( k ) f /∂ { x , ˙ x , ν } ( k ) Save/LoadState save and restore a state of the ESO instance ESO additional parameters SymbolicJacobian shows whether a symbolically or numerically computed deriva- tives will be returned by Get(*)JacobianValues FDPartition, FDOrder, FDEpsilon numerical differentiation parameters OvGU, MPI Modeling tool ProMoT / Simulation tool Diana 9/27

  10. U N I V K E E R C S I I T R E Ä T U G M Model: Continuous Stirred Tank Reactor N A G O D V E O B U T T R O G The mass balances of the model read [Zeyer et al., 1999] c H 2 O 2 ˙ = ˙ q in / V ( c H 2 O 2 , in − c H 2 O 2 ) − ( r 1 + r 2 + r 3 ) c in T , c ˙ q in c CH 3 CHO ˙ = ˙ q in / V ( c CH 3 CHO , in − c CH 3 CHO ) + ( r 1 − r 2 ) c CH 3 COOH = ˙ ˙ q in / V ( c CH 3 COOH , in − c CH 3 COOH ) + r 2 ˙ = ˙ q in / V ( c cat , in − c cat ) − ( r 4 − r 5 ) c cat c Reaction rates r i , i = 1 , . . . , 5 are k 1 e − E 1 / ( RT ) c cat c H 2 O 2 2 3 k 2 e − E 2 / ( RT ) c cat c H 2 O 2 c CH 3 CHO 6 7 6 k 3 e − E 3 / ( RT ) c cat c H 2 O 2 7 6 7 k 4 e − E 4 / ( RT ) c cat √ c CH 3 CHO 6 7 4 5 k 5 e − E 5 / ( RT ) ( c F , ges − c cat ) The energy balance is V ρ c p ˙ q in ( T in − T ) + ( UA ) cool ( T cool − T ) + V P 3 T = ρ c p ˙ i =1 r i ( − ∆ h R ) i V cool ρ c p ˙ T cool = ρ c p ˙ q cool ( T cool , in − T cool ) + ( UA ) cool ( T − T cool ) OvGU, MPI Modeling tool ProMoT / Simulation tool Diana 10/27

Recommend


More recommend