diff --git a/.gitignore b/.gitignore index eb139051..ba7a4299 100644 --- a/.gitignore +++ b/.gitignore @@ -38,3 +38,6 @@ /build/ /dev/hashes.json /include/cpversion.h +/dev/all_incompressibles.json +/dev/all_incompressibles_verbose.json +/include/all_incompressibles_JSON.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 660c9804..c6916c5c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,9 +32,17 @@ set (CoolProp_VERSION ${CoolProp_VERSION_MAJOR}.${CoolProp_VERSION_MINOR}.${Cool ####################################### option (COOLPROP_STATIC_LIBRARY - "Build and install CoolProp as a STATIC library (.lib, .a) as opposed to SHARED (.dll, .so)" - ON) + "Build CoolProp as a static library (.lib, .a)" + OFF) +option (COOLPROP_SHARED_LIBRARY + "Build CoolProp as a shared library (.dll, .so)" + OFF) + +option (COOLPROP_EES_MODULE + "Build the EES module" + OFF) + option (COOLPROP_TESTING "Build with test flags and include main() from catch" OFF) @@ -94,18 +102,106 @@ endif() ### FLUIDS, MIXTURES JSON ### add_custom_target(generate_headers - COMMAND ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/dev/generate_headers.py") - + COMMAND ${PYTHON_EXECUTABLE} "${CMAKE_SOURCE_DIR}/dev/generate_headers.py") ### COOLPROP LIB or DLL ### if (COOLPROP_STATIC_LIBRARY) add_library(${app_name} STATIC ${APP_SOURCES}) -else() + add_dependencies (${app_name} generate_headers) +endif() + +##### COOLPROP SHARED LIBRARY ###### +if (COOLPROP_SHARED_LIBRARY) add_library(${app_name} SHARED ${APP_SOURCES}) set_target_properties (${app_name} PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS} -DCOOLPROP_LIB") + add_dependencies (${app_name} generate_headers) endif() -add_dependencies (${app_name} generate_headers) +if (COOLPROP_64BIT_SHARED_LIBRARY) + add_library(${app_name} SHARED ${APP_SOURCES}) + set_target_properties (${app_name} PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS} -DCOOLPROP_LIB") + if (!MSVC) + set_target_properties(${app_name} PROPERTIES COMPILE_FLAGS "-m64" LINK_FLAGS "-m64") + endif() + add_dependencies (${app_name} generate_headers) + set_target_properties(${app_name} PROPERTIES PREFIX "") +endif() + +if (COOLPROP_32BIT_CDECL_SHARED_LIBRARY) + add_library(${app_name} SHARED ${APP_SOURCES}) + set_target_properties (${app_name} PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS} -DCOOLPROP_LIB -DCONVENTION=__cdecl") + if (!MSVC) + set_target_properties(${app_name} PROPERTIES COMPILE_FLAGS "-m32" LINK_FLAGS "-m32") + endif() + add_dependencies (${app_name} generate_headers) + set_target_properties(${app_name} PROPERTIES PREFIX "") +endif() + +if (COOLPROP_32BIT_STDCALL_SHARED_LIBRARY) + add_library(${app_name} SHARED ${APP_SOURCES}) + set_target_properties (${app_name} PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS} -DCOOLPROP_LIB -DCONVENTION=__stdcall") + if (!MSVC) + set_target_properties(${app_name} PROPERTIES COMPILE_FLAGS "-m32" LINK_FLAGS "-m32") + endif() + add_dependencies (${app_name} generate_headers) + set_target_properties(${app_name} PROPERTIES PREFIX "") +endif() + +if (COOLPROP_EES_MODULE) + list (APPEND APP_SOURCES "wrappers/EES/main.cpp") + include_directories(${APP_INCLUDE_DIRS}) + add_library(COOLPROP_EES SHARED ${APP_SOURCES}) + set_target_properties (COOLPROP_EES PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS} -DCOOLPROP_LIB -DCONVENTION=__cdecl") + add_dependencies (COOLPROP_EES generate_headers) + set_target_properties(COOLPROP_EES PROPERTIES SUFFIX ".dlf" PREFIX "") + if (!MSVC) + set_target_properties(COOLPROP_EES PROPERTIES COMPILE_FLAGS "-m32" LINK_FLAGS "-m32") + endif() +endif() + +if (COOLPROP_OCTAVE_MODULE) + + # Must have SWIG and Octave + FIND_PACKAGE(SWIG REQUIRED) + INCLUDE(${SWIG_USE_FILE}) + FIND_PACKAGE(Octave REQUIRED) + + # Find the required libraries + find_library(OCTAVE_LIB octave PATHS ${OCTAVE_LINK_DIRS}) + find_library(OCTINTERP_LIB octinterp PATHS ${OCTAVE_LINK_DIRS}) + + # Set the include folders + SET(OCTAVE_WRAP_INCLUDE_DIRS ${INCLUDE_DIR}) + foreach(ITR ${OCTAVE_INCLUDE_DIRS}) + list(APPEND OCTAVE_WRAP_INCLUDE_DIRS ${ITR}) + endforeach() + include_directories(${OCTAVE_WRAP_INCLUDE_DIRS}) + + set(I_FILE "${CMAKE_SOURCE_DIR}/src/CoolProp.i") + + SET_SOURCE_FILES_PROPERTIES(${I_FILE} PROPERTIES CPLUSPLUS ON) + SWIG_ADD_MODULE(CoolProp octave ${I_FILE} ${APP_SOURCES}) + SWIG_LINK_LIBRARIES(CoolProp ${OCTAVE_LIB} ${OCTINTERP_LIB}) + + add_dependencies (CoolProp generate_headers) + set_target_properties(CoolProp PROPERTIES SUFFIX ".oct" PREFIX "") + +endif() + +# NOT WORKING! +if (COOLPROP_MATHEMATICA_MODULE) + + # copy "C:\Program Files\Wolfram Research\Mathematica\9.0\SystemFiles\IncludeFiles\C\WolframLibrary.h" . + # REM folder obtained from FileNameJoin[{$BaseDirectory, "SystemFiles", "LibraryResources", $SystemID}] in Mathematica + # copy CoolProp.dll "C:\ProgramData\Mathematica\SystemFiles\LibraryResources\Windows-x86-64\" + + list (APPEND APP_SOURCES "wrappers/Mathematica/CoolPropMathematica.cpp") + include_directories(${APP_INCLUDE_DIRS}) + add_library(COOLProp SHARED ${APP_SOURCES}) + set_target_properties (COOLPROP_EES PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS} -DCOOLPROP_LIB -DCONVENTION=__cdecl") + add_dependencies (COOLPROP_EES generate_headers) + set_target_properties(COOLPROP_EES PROPERTIES SUFFIX ".dlf" PREFIX "") +endif() ### COOLPROP TESTING APP ### if (COOLPROP_TESTING) @@ -122,7 +218,6 @@ if (COOLPROP_TESTING) endif() add_test(ProcedureTests testRunner.exe) - # C++ Documentation Test add_executable (docuTest.exe "Web/examples/C++/Example.cpp") add_dependencies (docuTest.exe ${app_name}) diff --git a/CoolPropBibTeXLibrary.bib b/CoolPropBibTeXLibrary.bib index b066d4f3..3651f6c9 100644 --- a/CoolPropBibTeXLibrary.bib +++ b/CoolPropBibTeXLibrary.bib @@ -1,6 +1,18 @@ % This file was created with JabRef 2.9.2. % Encoding: ASCII +@ARTICLE{Abramson-HPR-2011, + author = {Evan H. Abramson}, + title = {Melting curves of argon and methane}, + journal = {High Pressure Research}, + year = {2011}, + volume = {31}, + pages = {549-554}, + number = {4}, + owner = {Belli}, + timestamp = {2014.06.09} +} + @CONFERENCE{Akasaka-DELFT-2013, author = {Ryo Akasaka and Yukihiro Higashi and Shigeru Koyama}, title = {{A Fundamental Equation of State For Low-GWP Refrigerant HFO-1234ze(Z)}}, @@ -1164,6 +1176,19 @@ timestamp = {2013.04.10} } +@ARTICLE{SantamariaPerez-PRB-2010, + author = {David Santamar{\'i}a-P{\'e}rez and Goutam Dev Mukherjee and Beate + Schwager and Reinhard Boehler}, + title = {High-pressure melting curve of helium and neon: Deviations from corresponding + states theory}, + journal = {Physical Review B}, + year = {2010}, + volume = {81}, + pages = {214101:1-5}, + owner = {Belli}, + timestamp = {2014.06.09} +} + @ARTICLE{Scalabrin-JPCRD-2006-CO2, author = {G. Scalabrin and P. Marchi and F. Finezzo and R. Span}, title = {{A Reference Multiparameter Thermal Conductivity Equation for Carbon diff --git a/Web/_static/PVTCP.png b/Web/_static/PVTCP.png new file mode 100644 index 00000000..a9a8722c Binary files /dev/null and b/Web/_static/PVTCP.png differ diff --git a/Web/_templates/indexsidebar.html b/Web/_templates/indexsidebar.html deleted file mode 100644 index 08458c8d..00000000 --- a/Web/_templates/indexsidebar.html +++ /dev/null @@ -1,20 +0,0 @@ - -

News

- -CoolProp was awarded the Prof. Gianfranco Angelino Award for Best Poster at the ASME ORC Conference 2013 held in Rotterdam, Netherlands -
-Here's the poster (click to view PDF): - - -

Help?

- - File github issue -
-Google group - -

Open-source projects using CoolProp

- ThermoCycle -
- PDSim -
- ACHP diff --git a/Web/_templates/layout.html b/Web/_templates/layout.html index 716b4910..55f90ef0 100644 --- a/Web/_templates/layout.html +++ b/Web/_templates/layout.html @@ -11,17 +11,3 @@
  • Documentation »
  • {% endblock %} - -{% block relbar1 %} - - -
    -matplotlib -
    -{{ super() }} -{% endblock %} - -{# put the sidebar before the body #} -{% block sidebar1 %}{{ sidebar() }}{% endblock %} -{% block sidebar2 %}{% endblock %} - diff --git a/Web/conf.py b/Web/conf.py index 0dc597a6..22945c7e 100644 --- a/Web/conf.py +++ b/Web/conf.py @@ -33,17 +33,29 @@ extensions = [#'matplotlib.sphinxext.only_directives', 'sphinx.ext.intersphinx', 'sphinx.ext.autodoc', 'sphinx.ext.mathjax', + 'sphinx.ext.extlinks', 'ipython_console_highlighting', 'sphinxcontrib.napoleon', - 'sphinxcontrib.doxylink' + 'sphinxcontrib.doxylink', + + # cloud's extensions + #'cloud_sptheme.ext.autodoc_sections', + #'cloud_sptheme.ext.index_styling', + 'cloud_sptheme.ext.relbar_toc', + #'cloud_sptheme.ext.escaped_samp_literals', + #'cloud_sptheme.ext.issue_tracker', + #'cloud_sptheme.ext.table_styling', + #'inheritance_diagram', #'numpydoc', #'breathe' ] + + plot_formats = [('png',80)] - +index_doc = "index" numpydoc_show_class_members = False @@ -74,6 +86,9 @@ version = ver.rsplit('.',1)[0] # The full version, including alpha/beta/rc tags. release = ver +extlinks = {'sfdownloads': ('http://sourceforge.net/projects/coolprop/files/CoolProp/'+release+'/%s', + 'issue ')} + # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. #language = None @@ -120,6 +135,26 @@ autoclass_content = 'both' # -- Options for HTML output --------------------------------------------------- +# import Cloud +import cloud_sptheme as csp + +# ... some contents omitted ... + +# set the html theme +html_theme = "cloud" + # NOTE: there is also a red-colored version named "redcloud" + +# ... some contents omitted ... + +# set the theme path to point to cloud's theme data +html_theme_path = [csp.get_theme_dir()] + +# [optional] set some of the options listed above... +html_theme_options = { "roottarget": "index", + "max_width" : "13in", + "logotarget": "index" + } + # The theme to use for HTML and HTML Help pages. Major themes that come with # Sphinx are currently 'default' and 'sphinxdoc'. ## html_theme = 'sphinxdoc' @@ -129,7 +164,7 @@ autoclass_content = 'both' # The style sheet to use for HTML and HTML Help pages. A file of that name # must exist either in Sphinx' static/ path, or in one of the custom paths # given in html_static_path. -html_style = 'Coolprop.css' +#html_style = 'Coolprop.css' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the @@ -148,7 +183,7 @@ html_style = 'Coolprop.css' # The name of an image file (relative to this directory) to place at the top # of the sidebar. -#html_logo = None +html_logo = "_static/PVTCP.png" # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 @@ -169,15 +204,15 @@ html_static_path = ['_static'] #html_use_smartypants = True # Content template for the index page. -html_index = 'index.html' +#html_index = 'index.html' # Custom sidebar templates, maps page names to templates. -html_sidebars = {'index': 'indexsidebar.html', - } +# html_sidebars = {'index': 'indexsidebar.html', +# } # Additional templates that should be rendered to pages, maps page names to # template names. -html_additional_pages = {'index': 'index.html'} +# html_additional_pages = {'index': 'index.html'} # If false, no module index is generated. #html_use_modindex = True diff --git a/Web/index.rst b/Web/index.rst new file mode 100644 index 00000000..c33040a8 --- /dev/null +++ b/Web/index.rst @@ -0,0 +1,86 @@ + +================= +What is CoolProp? +================= + +CoolProp is a C++ library that implements: + +- Pure and pseudo-pure fluid equations of state and transport properties for 114 components +- Mixture properties using high-accuracy Helmholtz energy formulations (or cubic EOS) +- Correlations of properties of incompressible fluids and brines +- Highest accuracy psychrometric routines + +====================== +Environments Supported +====================== + +Programming Languages: + +- Fully-featured wrappers: :sfdownloads:`Python (2.x, 3.x) ` , :sfdownloads:`Modelica `, :sfdownloads:`Octave `, :sfdownloads:`C# `, :sfdownloads:`MathCAD `, :sfdownloads:`Java ` +- High-level interface only: :sfdownloads:`Labview `, :sfdownloads:`EES `, :sfdownloads:`Microsoft Excel `, :sfdownloads:`Javascript `, :sfdownloads:`MATLAB ` +- Rudimentary wrappers exist for FORTRAN, :sfdownloads:`Maple `, :sfdownloads:`Mathematica `, :sfdownloads:`Scilab `, VB.net + +Architectures: + +- 32-bit/64-bit +- Windows, Linux, OSX, Raspberry PI, VxWorks Compact Rio, etc. + +============================ +High-Level Interface Example +============================ +In most languages, the code to calculate density ``D`` of Nitrogen at a temperature ``T`` of 298 K and a pressure ``P`` of 101325 Pa is something like:: + + rho = PropsSI('D', 'T', 298.15, 'P', 101325, 'Nitrogen') + +See more examples at `examples/examples `_ + +=================================== +Open-Source Projects Using CoolProp +=================================== + +- `Thermocycle `_ +- `PDSim `_ +- `ACHP `_ +- `DWSim `_ + +==== +Help +==== + +- File a `Github issue `_ +- Email the `Google group `_ + +=============== +Main Developers +=============== + +The primary developers are: + +- `Ian Bell `_, `Sylvain Quoilin `_, `Vincent Lemort `_, University of Liege, Liege, Belgium +- `Jorrit Wronski `_, Technical University of Denmark, Kgs. Lyngby, Denmark + +========== +Supporters +========== + +.. image:: _static/labothap.png + :height: 100px + :alt: labothap + :target: http://www.labothap.ulg.ac.be/ + +.. image:: _static/logo_ORCNext.jpg + :height: 100px + :alt: ORCNext + :target: http://www.orcnext.be/ + +\ + +.. image:: _static/herrick.png + :height: 100px + :alt: Herrick + :target: https://engineering.purdue.edu/Herrick/index.html + +.. image:: _static/maplesoft_logo.png + :height: 100px + :alt: Maple + :target: http://maplesoft.com/index.aspx \ No newline at end of file diff --git a/Web/make_logo.py b/Web/make_logo.py new file mode 100644 index 00000000..37f6f165 --- /dev/null +++ b/Web/make_logo.py @@ -0,0 +1,38 @@ +import matplotlib +matplotlib.use('WXAgg') +from matplotlib import cm +import matplotlib.pyplot as plt + +import numpy as np +import CoolProp +from mpl_toolkits.mplot3d import Axes3D +fig = plt.figure(figsize = (2,2)) +ax = fig.add_subplot(111, projection='3d') + +NT = 1000 +NR = 1000 +rho,t = np.logspace(np.log10(2e-3), np.log10(1100), NR),np.linspace(275.15,700,NT) +RHO,T = np.meshgrid(rho,t) + +P = CoolProp.CoolProp.PropsSI('P','D',RHO.reshape((NR*NT,1)),'T',T.reshape((NR*NT,1)),'REFPROP-Water').reshape(NT,NR) + +Tsat = np.linspace(273.17,647.0,100) +psat = CoolProp.CoolProp.PropsSI('P','Q',0,'T',Tsat,'Water') +rhoL = CoolProp.CoolProp.PropsSI('D','Q',0,'T',Tsat,'Water') +rhoV = CoolProp.CoolProp.PropsSI('D','Q',1,'T',Tsat,'Water') + +ax.plot_surface(np.log(RHO),T,np.log(P), cmap=cm.jet, edgecolor = 'none') +ax.plot(np.log(rhoL),Tsat,np.log(psat),color='k',lw=2) +ax.plot(np.log(rhoV),Tsat,np.log(psat),color='k',lw=2) + +ax.text(0.3,800,22, "CoolProp", size = 12) +ax.set_frame_on(False) +ax.set_axis_off() +ax.view_init(22, -136) +ax.set_xlabel(r'$\ln\rho$ ') +ax.set_ylabel('$T$') +ax.set_zlabel('$p$') +plt.tight_layout() +plt.savefig('_static/PVTCP.png',transparent = True) +plt.savefig('_static/PVTCP.pdf',transparent = True) +plt.close() \ No newline at end of file diff --git a/dev/ci/README.rst b/dev/ci/README.rst new file mode 100644 index 00000000..07ab2341 --- /dev/null +++ b/dev/ci/README.rst @@ -0,0 +1,41 @@ +Set up linux slave +================== + +In some folder (probably the home folder), do:: + + sudo apt-get buildbot buildbot-slave + buildslave create-slave slave 10.0.2.2:9989 example-slave pass + buildslave start slave + +``slave`` is the folder that the configuration will go into, ``example-slave`` is the name of the slave, ``pass`` is the password, ``10.0.0.2`` is the IP address of the host that the VM uses (shouldn't need to change it, see OSX host instructions below) + +This should start the Twisted server, yielding output like:: + + ian@ian-VirtualBox:~$ buildslave start slave/ + Following twistd.log until startup finished.. + 2014-06-08 20:17:50+0200 [-] Log opened. + 2014-06-08 20:17:50+0200 [-] twistd 14.0.0 (/usr/bin/python 2.7.5) starting up. + 2014-06-08 20:17:50+0200 [-] reactor class: twisted.internet.epollreactor.EPollReactor. + 2014-06-08 20:17:50+0200 [-] Starting BuildSlave -- version: 0.8.8 + 2014-06-08 20:17:50+0200 [-] recording hostname in twistd.hostname + 2014-06-08 20:17:50+0200 [-] Starting factory + 2014-06-08 20:17:50+0200 [-] Connecting to 10.0.2.2:9989 + 2014-06-08 20:17:50+0200 [Broker,client] message from master: attached + The buildslave appears to have (re)started correctly.` + +Configuration of OSX Virtualbox host +==================================== + +Thanks to http://stackoverflow.com/questions/1261975/addressing-localhost-from-a-virtualbox-virtual-machine and the comment of spsaucier you basically need to do the following, copied verbatim: + +To enable this on OSX I had to do the following: + +1. Shut your virtual machine down. +2. Go to ``VirtualBox Preferences -> Network -> Host-only Networks ->`` click the "+" icon. Click OK. +3.Select your box and click the "Settings" icon -> Network -> Adapter 2 -> On the "Attached to:" dropdown, select "Host-only Adapter" and your network (vboxnet0) should show up below by default. Click OK. +4. Once you start your box up again, you should be able to access localhost at http://10.0.2.2/ + +You can refer to it by localhost and access other localhosted sites by adding their references to the hosts file (C:\windows\system32\drivers\etc\hosts) like the following:: + + 10.0.2.2 localhost + 10.0.2.2 subdomain.localhost diff --git a/dev/code_blocks/coolprop.cbp b/dev/code_blocks/coolprop.cbp index ea6adcfa..6745d220 100644 --- a/dev/code_blocks/coolprop.cbp +++ b/dev/code_blocks/coolprop.cbp @@ -10,7 +10,7 @@