/[ascend]/trunk/models/johnpye/fprops/modelica/README.txt
ViewVC logotype

Annotation of /trunk/models/johnpye/fprops/modelica/README.txt

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3421 - (hide annotations) (download)
Wed Jul 24 02:31:08 2019 UTC (14 months ago) by jpye
File MIME type: text/plain
File size: 2815 byte(s)
added note about DyMat.

1 jpye 3418 FPROPS for OpenModelica
2     -----------------------
3    
4 jpye 3420 This directory contains some initial experiments for connecting FPROPS to
5     OpenModelica. So far it is just proof of concept showing how FPROPS property
6     calculations can be called from Modelica; it is by no means a comprehensive
7     wrapper for fully-fledged simulation work.
8 jpye 3418
9 jpye 3421 It is assumped that you have OpenModelica already installed. Our process for
10     that is given here:
11     https://github.com/SolarTherm/SolarTherm/wiki/Building-SolarTherm
12    
13 jpye 3418 To run the example,
14    
15     svn co http://svn.ascend4.org/trunk/models/johnpye/fprops
16     cd fprops
17     scons WITH_ASCEND=0
18     cd modelica
19     scons
20 jpye 3420 export LD_LIBRARY_PATH=..
21 jpye 3418 omc ExternalLibraries.mos
22 jpye 3420 python simpleplot.py
23 jpye 3418
24 jpye 3420 The .mos script loads and runs a trivial simulation in which a pressurised
25     mass of CO₂ is heated, resulting in a gradual temperature rise.
26 jpye 3418
27 jpye 3420 The 'simpleplot.py' script finds the resulting *_res.mat file and displays its
28     contents as a plot.
29 jpye 3418
30 jpye 3420 It is intended that this code will be extended slightly to allow different
31     fluids to be selected from Modelica. Currently the code is hard-wired for
32     'carbondioxide' (Helmholtz correlation).
33    
34    
35     Useful resources
36     ----------------
37    
38     Modelica By Example -- External Functions
39     https://mbe.modelica.university/behavior/functions/external/
40     * this is mostly reference materials from the Modelica Language Specification
41    
42     Interoperability -- C and Python (OpenModelica)
43     https://www.openmodelica.org/doc/OpenModelicaUsersGuide/latest/interop_c_python.html
44     * this has some nice examples of external functions, but is sparse on details
45     about how to make it all work. The Python stuff is not relevant here.
46    
47     Modelica Language Specification version 3.4
48     https://www.modelica.org/documents/ModelicaSpec34.pdf#page=165
49     * This gives some more formal description of how external functions are declared
50     including documentation of the 'annotations' that relate to linking with
51     external functions. Modelica can compile external functions itself, but
52     in this work, we are doing that outside Modelica, using 'scons'.
53    
54     SCons Documentation
55     https://scons.org/documentation.html
56     * SCons is a tool for compiling software and other similar tasks.
57    
58     FPROPS
59     https://fprops.org/
60     * FPROPS is a small library for calculating the thermodynamic and thermophysical
61     properties of pure fluids using accurate Helmholtz correlations as well as
62     less accurate correlations such as Peng-Robinson. It has wrappers to allow
63     its use with Python and the modelling language ASCEND (https://ascend4.org/)
64    
65 jpye 3421 DyMat
66     https://bitbucket.org/jraedler/dymat/src/master/
67     https://bitbucket.org/jraedler/dymat/src/master/doc/DyMat-Guide.pdf
68     * This is a Python tool used by 'simpleplot.py' to extract results from the
69     *_res.mat files produced by 'omc', the OpenModelica compiler and resulting
70     model executables.
71    
72 jpye 3420 --
73     John Pye
74     Jul 2019
75    

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22