mirror of
https://github.com/CoolProp/CoolProp.git
synced 2026-04-23 03:00:17 -04:00
Merge branch 'master' into eigenPolynomials
This commit is contained in:
106
CMakeLists.txt
106
CMakeLists.txt
@@ -157,6 +157,7 @@ if (COOLPROP_EES_MODULE)
|
||||
if (!MSVC)
|
||||
set_target_properties(COOLPROP_EES PROPERTIES COMPILE_FLAGS "-m32" LINK_FLAGS "-m32")
|
||||
endif()
|
||||
add_dependencies (${app_name} generate_headers)
|
||||
endif()
|
||||
|
||||
if (COOLPROP_OCTAVE_MODULE)
|
||||
@@ -166,9 +167,13 @@ if (COOLPROP_OCTAVE_MODULE)
|
||||
INCLUDE(${SWIG_USE_FILE})
|
||||
FIND_PACKAGE(Octave REQUIRED)
|
||||
|
||||
# Make a src directory to deal with file permissions problem with MinGW makefile
|
||||
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/src)
|
||||
|
||||
# Find the required libraries
|
||||
find_library(OCTAVE_LIB octave PATHS ${OCTAVE_LINK_DIRS})
|
||||
find_library(OCTINTERP_LIB octinterp PATHS ${OCTAVE_LINK_DIRS})
|
||||
find_library(CRUFT_LIB cruft PATHS ${OCTAVE_LINK_DIRS})
|
||||
|
||||
# Set the include folders
|
||||
SET(OCTAVE_WRAP_INCLUDE_DIRS ${INCLUDE_DIR})
|
||||
@@ -181,11 +186,108 @@ if (COOLPROP_OCTAVE_MODULE)
|
||||
|
||||
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})
|
||||
SWIG_LINK_LIBRARIES(CoolProp ${OCTAVE_LIB} ${OCTINTERP_LIB} ${CRUFT_LIB})
|
||||
|
||||
add_dependencies (CoolProp generate_headers)
|
||||
set_target_properties(CoolProp PROPERTIES SUFFIX ".oct" PREFIX "")
|
||||
add_dependencies (${app_name} generate_headers)
|
||||
endif()
|
||||
|
||||
if (COOLPROP_CSHARP_MODULE)
|
||||
|
||||
# Must have SWIG and C#
|
||||
FIND_PACKAGE(SWIG REQUIRED)
|
||||
INCLUDE(${SWIG_USE_FILE})
|
||||
FIND_PACKAGE(Csharp REQUIRED)
|
||||
|
||||
# Make a src directory to deal with file permissions problem with MinGW makefile
|
||||
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/src)
|
||||
|
||||
set(I_FILE "${CMAKE_SOURCE_DIR}/src/CoolProp.i")
|
||||
|
||||
# Set properties before adding module
|
||||
SET_SOURCE_FILES_PROPERTIES(${I_FILE} PROPERTIES CPLUSPLUS ON)
|
||||
if (WIN32)
|
||||
SET_SOURCE_FILES_PROPERTIES(${I_FILE} PROPERTIES SWIG_FLAGS "-dllimport CoolProp")
|
||||
endif()
|
||||
SWIG_ADD_MODULE(CoolProp csharp ${I_FILE} ${APP_SOURCES})
|
||||
|
||||
if (WIN32)
|
||||
set_target_properties(CoolProp PROPERTIES PREFIX "")
|
||||
endif()
|
||||
add_dependencies (${app_name} generate_headers)
|
||||
endif()
|
||||
|
||||
if (COOLPROP_JAVA_MODULE)
|
||||
|
||||
# Must have SWIG and Java
|
||||
FIND_PACKAGE(SWIG REQUIRED)
|
||||
INCLUDE(${SWIG_USE_FILE})
|
||||
find_package(Java REQUIRED)
|
||||
find_package(JNI)
|
||||
|
||||
# Make a src directory to deal with file permissions problem with MinGW makefile
|
||||
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/src)
|
||||
|
||||
message(STATUS "JAVA_INCLUDE_PATH = ${JAVA_INCLUDE_PATH}")
|
||||
|
||||
include_directories(${JAVA_INCLUDE_PATH})
|
||||
include_directories(${JAVA_INCLUDE_PATH}/win32)
|
||||
|
||||
set(I_FILE "${CMAKE_SOURCE_DIR}/src/CoolProp.i")
|
||||
|
||||
SET_SOURCE_FILES_PROPERTIES(${I_FILE} PROPERTIES CPLUSPLUS ON)
|
||||
|
||||
SWIG_ADD_MODULE(CoolProp java ${I_FILE} ${APP_SOURCES})
|
||||
|
||||
if (WIN32)
|
||||
set_target_properties(CoolProp PROPERTIES PREFIX "")
|
||||
endif()
|
||||
|
||||
if (!MSVC)
|
||||
set_target_properties(COOLPROP_EES PROPERTIES COMPILE_FLAGS "-m64" LINK_FLAGS "-m64")
|
||||
endif()
|
||||
add_dependencies (${app_name} generate_headers)
|
||||
endif()
|
||||
|
||||
if (COOLPROP_MATLAB_MODULE)
|
||||
|
||||
add_definitions(/DMATLAB_MEX_FILE) #define matlab macros
|
||||
add_definitions(/DMX_COMPAT_32)
|
||||
|
||||
find_package(Matlab REQUIRED)
|
||||
|
||||
IF(MATLAB_FOUND)
|
||||
message(STATUS "MATLAB Found, MATLAB MEX will be compiled.")
|
||||
ELSE(MATLAB_FOUND)
|
||||
MESSAGE("MATLAB not found...nothing will be built.")
|
||||
ENDIF(MATLAB_FOUND)
|
||||
|
||||
# set up matlab libraries
|
||||
INCLUDE_DIRECTORIES(${MATLAB_INCLUDE_DIR})
|
||||
add_library(PropsSI SHARED ${APP_SOURCES} ${CMAKE_SOURCE_DIR}/wrappers/MATLAB/Matlabdef.def ${CMAKE_SOURCE_DIR}/wrappers/MATLAB/PropsSI.cpp)
|
||||
add_library(HAPropsSI SHARED ${APP_SOURCES} ${CMAKE_SOURCE_DIR}/wrappers/MATLAB/Matlabdef.def ${CMAKE_SOURCE_DIR}/wrappers/MATLAB/HAProps.cpp)
|
||||
target_link_libraries(PropsSI ${MATLAB_LIBRARIES})
|
||||
target_link_libraries(HAPropsSI ${MATLAB_LIBRARIES})
|
||||
|
||||
if(WIN32) # 32-bit or 64-bit mex
|
||||
if (CMAKE_CL_64)
|
||||
SET_TARGET_PROPERTIES(PropsSI PROPERTIES PREFIX "" SUFFIX .mexw64)
|
||||
SET_TARGET_PROPERTIES(HAPropsSI PROPERTIES PREFIX "" SUFFIX .mexw64)
|
||||
else()
|
||||
SET_TARGET_PROPERTIES(PropsSI PROPERTIES SUFFIX .mexw32)
|
||||
SET_TARGET_PROPERTIES(HAPropsSI PROPERTIES SUFFIX .mexw32)
|
||||
endif()
|
||||
else()
|
||||
if (CMAKE_SIZEOF_VOID_P MATCHES "8")
|
||||
SET_TARGET_PROPERTIES(PropsSI PROPERTIES PREFIX "" SUFFIX .mexa64 PREFIX "")
|
||||
SET_TARGET_PROPERTIES(HAPropsSI PROPERTIES PREFIX "" SUFFIX .mexa64 PREFIX "")
|
||||
else()
|
||||
SET_TARGET_PROPERTIES(PropsSI PROPERTIES PREFIX "" SUFFIX .mexglx PREFIX "")
|
||||
SET_TARGET_PROPERTIES(HAPropsSI PROPERTIES PREFIX "" SUFFIX .mexglx PREFIX "")
|
||||
endif()
|
||||
endif()
|
||||
add_dependencies (PropsSI generate_headers)
|
||||
add_dependencies (HAPropsSI generate_headers)
|
||||
endif()
|
||||
|
||||
# NOT WORKING!
|
||||
|
||||
@@ -858,6 +858,19 @@
|
||||
timestamp = {2013.04.09}
|
||||
}
|
||||
|
||||
@ARTICLE{Michailidou-JPCRD-2014-Heptane,
|
||||
author = {E. K. Michailidou and M. J. Assael and M. L. Huber and I. M. Abdulagatov
|
||||
and R. A. Perkins},
|
||||
title = {Reference Correlation of the Viscosity of n-Heptane from the Triple
|
||||
Point to 600 K and up to 248 MPa},
|
||||
journal = {J. Phys. Chem. Ref. Data},
|
||||
year = {2014},
|
||||
volume = {43},
|
||||
pages = {023103},
|
||||
owner = {Belli},
|
||||
timestamp = {2014.06.10}
|
||||
}
|
||||
|
||||
@ARTICLE{Michailidou-JPCRD-2013,
|
||||
author = {E. K. Michailidou and M. J. Assael and M. L. Huber and R. A. Perkins},
|
||||
title = {{Reference Correlation of the Viscosity of n-Hexane from the Triple
|
||||
@@ -871,6 +884,19 @@
|
||||
timestamp = {2013.09.21}
|
||||
}
|
||||
|
||||
@ARTICLE{Mulero-JPCRD-2014,
|
||||
author = {A. Mulero and I. Cachadi{\~n}a},
|
||||
title = {{Recommended Correlations for the Surface Tension of Several Fluids
|
||||
Included in the REFPROP Program}},
|
||||
journal = {J. Phys. Chem. Ref. Data},
|
||||
year = {2014},
|
||||
volume = {43},
|
||||
pages = {023104-1:8},
|
||||
doi = {10.1063/1.4878755},
|
||||
owner = {Belli},
|
||||
timestamp = {2014.06.10}
|
||||
}
|
||||
|
||||
@ARTICLE{Mulero-JPCRD-2012,
|
||||
author = {A. Mulero and I. Cachadi{\~n}a and M. I. Parra},
|
||||
title = {{Recommended Correlations for the Surface Tension of Common Fluids}},
|
||||
@@ -1178,7 +1204,7 @@
|
||||
|
||||
@ARTICLE{SantamariaPerez-PRB-2010,
|
||||
author = {David Santamar{\'i}a-P{\'e}rez and Goutam Dev Mukherjee and Beate
|
||||
Schwager and Reinhard Boehler},
|
||||
Schwager and Reinhard Boehler},
|
||||
title = {High-pressure melting curve of helium and neon: Deviations from corresponding
|
||||
states theory},
|
||||
journal = {Physical Review B},
|
||||
|
||||
72
dev/cmake/Modules/FindCsharp.cmake
Normal file
72
dev/cmake/Modules/FindCsharp.cmake
Normal file
@@ -0,0 +1,72 @@
|
||||
#
|
||||
# A CMake Module for finding and using C# (.NET and Mono).
|
||||
#
|
||||
# The following variables are set:
|
||||
# CSHARP_FOUND - set to ON if C# is found
|
||||
# CSHARP_USE_FILE - the path to the C# use file
|
||||
# CSHARP_TYPE - the type of the C# compiler (eg. ".NET" or "Mono")
|
||||
# CSHARP_VERSION - the version of the C# compiler (eg. "v4.0" or "2.10.2")
|
||||
# CSHARP_COMPILER - the path to the C# compiler executable (eg. "C:/Windows/Microsoft.NET/Framework/v4.0.30319/csc.exe" or "/usr/bin/gmcs")
|
||||
# CSHARP_INTERPRETER - the path to interpreter needed to run CSharp executables
|
||||
# CSHARP_PLATFORM - the C# target platform
|
||||
# CSHARP_SDK - the SDK commandline switch (empty for .NET, for Mono eg. "/sdk:2" or "/sdk:4")
|
||||
#
|
||||
# This file is based on the work of GDCM:
|
||||
# http://gdcm.svn.sf.net/viewvc/gdcm/trunk/CMake/FindCSharp.cmake
|
||||
# Copyright (c) 2006-2010 Mathieu Malaterre <mathieu.malaterre@gmail.com>
|
||||
#
|
||||
|
||||
# TODO: ADD ABILITY TO SELECT WHICH C# COMPILER eg. .NET or Mono (if both exist). For the moment, .NET is selected above Mono.
|
||||
|
||||
# Make sure find package macros are included
|
||||
include( FindPackageHandleStandardArgs )
|
||||
|
||||
unset( CSHARP_COMPILER CACHE )
|
||||
unset( CSHARP_INTERPRETER CACHE )
|
||||
unset( CSHARP_TYPE CACHE )
|
||||
unset( CSHARP_VERSION CACHE )
|
||||
unset( CSHARP_FOUND CACHE )
|
||||
|
||||
# By default use anycpu platform, allow the user to override
|
||||
set( CSHARP_PLATFORM "anycpu" CACHE STRING "C# target platform: x86, x64, anycpu, or itanium" )
|
||||
if( NOT ${CSHARP_PLATFORM} MATCHES "x86|x64|anycpu|itanium" )
|
||||
message( FATAL_ERROR "The C# target platform '${CSHARP_PLATFORM}' is not valid. Please enter one of the following: x86, x64, anycpu, or itanium" )
|
||||
endif( )
|
||||
|
||||
if( WIN32 )
|
||||
find_package( DotNetFrameworkSdk )
|
||||
if( NOT CSHARP_DOTNET_FOUND )
|
||||
find_package( Mono )
|
||||
endif( )
|
||||
else( UNIX )
|
||||
find_package( Mono )
|
||||
endif( )
|
||||
|
||||
if( CSHARP_DOTNET_FOUND )
|
||||
set( CSHARP_TYPE ".NET" CACHE STRING "Using the .NET compiler" )
|
||||
set( CSHARP_VERSION ${CSHARP_DOTNET_VERSION} CACHE STRING "C# .NET compiler version" FORCE )
|
||||
set( CSHARP_COMPILER ${CSHARP_DOTNET_COMPILER_${CSHARP_DOTNET_VERSION}} CACHE STRING "Full path to .NET compiler" FORCE )
|
||||
set( CSHARP_INTERPRETER "" CACHE INTERNAL "Interpretor not required for .NET" FORCE )
|
||||
elseif( CSHARP_MONO_FOUND )
|
||||
set( CSHARP_TYPE "Mono" CACHE STRING "Using the Mono compiler" )
|
||||
set( CSHARP_VERSION ${CSHARP_MONO_VERSION} CACHE STRING "C# Mono compiler version" FORCE )
|
||||
set( CSHARP_COMPILER ${CSHARP_MONO_COMPILER_${CSHARP_MONO_VERSION}} CACHE STRING "Full path to Mono compiler" FORCE )
|
||||
set( CSHARP_INTERPRETER ${CSHARP_MONO_INTERPRETER_${CSHARP_MONO_VERSION}} CACHE STRING "Full path to Mono interpretor" FORCE )
|
||||
set( CSHARP_SDK "/sdk:2" CACHE STRING "C# Mono SDK commandline switch (e.g. /sdk:2, /sdk:4, /sdk:5)" )
|
||||
endif( )
|
||||
|
||||
# Handle WIN32 specific issues
|
||||
if ( WIN32 )
|
||||
if ( CSHARP_COMPILER MATCHES "bat" )
|
||||
set( CSHARP_COMPILER "call ${CSHARP_COMPILER}" )
|
||||
endif ( )
|
||||
endif( )
|
||||
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(CSharp DEFAULT_MSG CSHARP_TYPE CSHARP_VERSION CSHARP_COMPILER)
|
||||
|
||||
mark_as_advanced( CSHARP_TYPE CSHARP_VERSION CSHARP_COMPILER CSHARP_INTERPRETER CSHARP_PLATFORM CSHARP_SDK )
|
||||
|
||||
# Set the USE_FILE path
|
||||
# http://public.kitware.com/Bug/view.php?id=7757
|
||||
get_filename_component( current_list_path ${CMAKE_CURRENT_LIST_FILE} PATH )
|
||||
set( CSHARP_USE_FILE ${current_list_path}/UseCSharp.cmake )
|
||||
92
dev/cmake/Modules/FindDotNetFrameworkSdk.cmake
Normal file
92
dev/cmake/Modules/FindDotNetFrameworkSdk.cmake
Normal file
@@ -0,0 +1,92 @@
|
||||
#
|
||||
# A CMake Module for finding C# .NET.
|
||||
#
|
||||
# The following variables are set:
|
||||
# CSHARP_DOTNET_FOUND
|
||||
# CSHARP_DOTNET_COMPILER_${version} eg. "CSHARP_DOTNET_COMPILER_v4.0.30319"
|
||||
# CSHARP_DOTNET_VERSION eg. "v4.0.30319"
|
||||
# CSHARP_DOTNET_VERSIONS eg. "v2.0.50727, v3.5, v4.0.30319"
|
||||
# DotNetFrameworkSdk_USE_FILE
|
||||
#
|
||||
# Additional references can be found here:
|
||||
# .NET SDK 1.1: http://www.microsoft.com/downloads/details.aspx?FamilyID=9b3a2ca6-3647-4070-9f41-a333c6b9181d&displaylang=en
|
||||
# .NET SDK 2.0: http://www.microsoft.com/downloads/details.aspx?FamilyID=fe6f2099-b7b4-4f47-a244-c96d69c35dec&displaylang=en
|
||||
# .NET SDK 3.5: http://www.microsoft.com/downloads/details.aspx?familyid=333325fd-ae52-4e35-b531-508d977d32a6&displaylang=en
|
||||
# C# Compiler options: http://msdn.microsoft.com/en-us/library/2fdbz5xd(v=VS.71).aspx
|
||||
#
|
||||
# This file is based on the work of GDCM:
|
||||
# http://gdcm.svn.sf.net/viewvc/gdcm/trunk/CMake/FindDotNETFrameworkSDK.cmake
|
||||
# Copyright (c) 2006-2010 Mathieu Malaterre <mathieu.malaterre@gmail.com>
|
||||
#
|
||||
|
||||
set( csharp_dotnet_valid 1 )
|
||||
if( DEFINED CSHARP_DOTNET_FOUND )
|
||||
# The .NET compiler has already been found
|
||||
# It may have been reset by the user, verify it is correct
|
||||
if( NOT DEFINED CSHARP_DOTNET_COMPILER_${CSHARP_DOTNET_VERSION} )
|
||||
set( csharp_dotnet_version_user ${CSHARP_DOTNET_VERSION} )
|
||||
set( csharp_dotnet_valid 0 )
|
||||
set( CSHARP_DOTNET_FOUND 0 )
|
||||
set( CSHARP_DOTNET_VERSION "CSHARP_DOTNET_VERSION-NOTVALID" CACHE STRING "C# .NET compiler version, choices: ${CSHARP_DOTNET_VERSIONS}" FORCE )
|
||||
message( FATAL_ERROR "The C# .NET version '${csharp_dotnet_version_user}' is not valid. Please enter one of the following: ${CSHARP_DOTNET_VERSIONS}" )
|
||||
endif( )
|
||||
endif( )
|
||||
|
||||
unset( CSHARP_DOTNET_VERSIONS CACHE ) # Clear versions
|
||||
|
||||
# Get the framework directory based on platform
|
||||
if( ${CSHARP_PLATFORM} MATCHES "x64|itanium" )
|
||||
set( csharp_dotnet_framework_dir "$ENV{windir}/Microsoft.NET/Framework64" )
|
||||
else( )
|
||||
set( csharp_dotnet_framework_dir "$ENV{windir}/Microsoft.NET/Framework" )
|
||||
endif( )
|
||||
|
||||
# Search for .NET versions
|
||||
string( REPLACE "\\" "/" csharp_dotnet_framework_dir ${csharp_dotnet_framework_dir} )
|
||||
file( GLOB_RECURSE csharp_dotnet_executables "${csharp_dotnet_framework_dir}/csc.exe" )
|
||||
list( SORT csharp_dotnet_executables )
|
||||
list( REVERSE csharp_dotnet_executables )
|
||||
foreach ( csharp_dotnet_executable ${csharp_dotnet_executables} )
|
||||
if( csharp_dotnet_valid )
|
||||
# Extract version number (eg. v4.0.30319)
|
||||
# TODO: Consider using REGEX
|
||||
string( REPLACE "${csharp_dotnet_framework_dir}/" "" csharp_dotnet_version_temp ${csharp_dotnet_executable} )
|
||||
string( REPLACE "/csc.exe" "" csharp_dotnet_version_temp ${csharp_dotnet_version_temp} )
|
||||
|
||||
# Add variable holding executable
|
||||
set( CSHARP_DOTNET_COMPILER_${csharp_dotnet_version_temp} ${csharp_dotnet_executable} CACHE STRING "C# .NET compiler ${csharp_dotnet_version}" FORCE )
|
||||
mark_as_advanced( CSHARP_DOTNET_COMPILER_${csharp_dotnet_version_temp} )
|
||||
endif( )
|
||||
|
||||
# Create a list of supported compiler versions
|
||||
if( NOT DEFINED CSHARP_DOTNET_VERSIONS )
|
||||
set( CSHARP_DOTNET_VERSIONS "${csharp_dotnet_version_temp}" CACHE STRING "Available C# .NET compiler versions" FORCE )
|
||||
else( )
|
||||
set( CSHARP_DOTNET_VERSIONS "${CSHARP_DOTNET_VERSIONS}, ${csharp_dotnet_version_temp}" CACHE STRING "Available C# .NET compiler versions" FORCE )
|
||||
endif( )
|
||||
mark_as_advanced( CSHARP_DOTNET_VERSIONS )
|
||||
|
||||
# We found at least one .NET compiler version
|
||||
set( CSHARP_DOTNET_FOUND 1 CACHE INTERNAL "Boolean indicating if C# .NET was found" )
|
||||
endforeach( csharp_dotnet_executable )
|
||||
|
||||
if( CSHARP_DOTNET_FOUND )
|
||||
# Report the found versions
|
||||
message( STATUS "Found the following C# .NET versions: ${CSHARP_DOTNET_VERSIONS}" )
|
||||
|
||||
# Set the compiler version
|
||||
# Do not force, so that the user can manually select their own version if they wish
|
||||
if ( DEFINED CSHARP_DOTNET_COMPILER_v2.0.50727 )
|
||||
# If available, select .NET v2.0.50727 (this is the minimal version as it supports generics, and allows use of VS2008)
|
||||
set( CSHARP_DOTNET_VERSION "v2.0.50727" CACHE STRING "C# .NET compiler version" )
|
||||
else( )
|
||||
# Select the highest version (first in reverse sorted list)
|
||||
list( GET CSHARP_DOTNET_VERSIONS 0 csharp_dotnet_version_temp )
|
||||
set( CSHARP_DOTNET_VERSION ${csharp_dotnet_version_temp} CACHE STRING "C# .NET compiler version" )
|
||||
endif( )
|
||||
mark_as_advanced( CSHARP_DOTNET_VERSION )
|
||||
endif( )
|
||||
|
||||
# Set USE_FILE
|
||||
get_filename_component( current_list_path ${CMAKE_CURRENT_LIST_FILE} PATH )
|
||||
set( DotNetFrameworkSdk_USE_FILE ${current_list_path}/UseDotNetFrameworkSdk.cmake )
|
||||
59
dev/cmake/Modules/FindMatlab.cmake
Normal file
59
dev/cmake/Modules/FindMatlab.cmake
Normal file
@@ -0,0 +1,59 @@
|
||||
# - this module looks for Matlab
|
||||
# Defines:
|
||||
# MATLAB_INCLUDE_DIR: include path for mex.h
|
||||
# MATLAB_LIBRARIES: required libraries: libmex, libmx
|
||||
# MATLAB_MEX_LIBRARY: path to libmex
|
||||
# MATLAB_MX_LIBRARY: path to libmx
|
||||
|
||||
SET(MATLAB_FOUND 0)
|
||||
IF( "$ENV{MATLAB_ROOT}" STREQUAL "" )
|
||||
MESSAGE(STATUS "MATLAB_ROOT environment variable not set." )
|
||||
MESSAGE(STATUS "In Linux this can be done in your user .bashrc file by appending the corresponding line, e.g:" )
|
||||
MESSAGE(STATUS "export MATLAB_ROOT=/usr/local/MATLAB/R2012b" )
|
||||
MESSAGE(STATUS "In Windows this can be done by adding system variable, e.g:" )
|
||||
MESSAGE(STATUS "MATLAB_ROOT=D:\\Program Files\\MATLAB\\R2011a" )
|
||||
ELSE()
|
||||
|
||||
FIND_PATH(MATLAB_INCLUDE_DIR mex.h
|
||||
$ENV{MATLAB_ROOT}/extern/include)
|
||||
|
||||
INCLUDE_DIRECTORIES(${MATLAB_INCLUDE_DIR})
|
||||
|
||||
FIND_LIBRARY( MATLAB_MEX_LIBRARY
|
||||
NAMES libmex mex
|
||||
PATHS $ENV{MATLAB_ROOT}/bin $ENV{MATLAB_ROOT}/extern/lib
|
||||
PATH_SUFFIXES glnxa64 glnx86 win64/microsoft win32/microsoft)
|
||||
|
||||
FIND_LIBRARY( MATLAB_MX_LIBRARY
|
||||
NAMES libmx mx
|
||||
PATHS $ENV{MATLAB_ROOT}/bin $ENV{MATLAB_ROOT}/extern/lib
|
||||
PATH_SUFFIXES glnxa64 glnx86 win64/microsoft win32/microsoft)
|
||||
|
||||
|
||||
|
||||
ENDIF()
|
||||
|
||||
# This is common to UNIX and Win32:
|
||||
SET(MATLAB_LIBRARIES
|
||||
${MATLAB_MEX_LIBRARY}
|
||||
${MATLAB_MX_LIBRARY}
|
||||
)
|
||||
MESSAGE (STATUS "MATLAB_ROOT: $ENV{MATLAB_ROOT}")
|
||||
MESSAGE (STATUS "MATLAB_INCLUDE_DIR: ${MATLAB_INCLUDE_DIR}")
|
||||
MESSAGE (STATUS "MATLAB_LIBRARIES: ${MATLAB_LIBRARIES}")
|
||||
MESSAGE (STATUS "MATLAB_MEX_LIBRARY: ${MATLAB_MEX_LIBRARY}")
|
||||
MESSAGE (STATUS "MATLAB_MX_LIBRARY: ${MATLAB_MX_LIBRARY}")
|
||||
|
||||
IF(MATLAB_INCLUDE_DIR AND MATLAB_LIBRARIES)
|
||||
SET(MATLAB_FOUND 1)
|
||||
MESSAGE(STATUS "Matlab libraries will be used")
|
||||
ENDIF()
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
MATLAB_LIBRARIES
|
||||
MATLAB_MEX_LIBRARY
|
||||
MATLAB_MX_LIBRARY
|
||||
MATLAB_INCLUDE_DIR
|
||||
MATLAB_FOUND
|
||||
MATLAB_ROOT
|
||||
)
|
||||
162
dev/cmake/Modules/FindMono.cmake
Normal file
162
dev/cmake/Modules/FindMono.cmake
Normal file
@@ -0,0 +1,162 @@
|
||||
#
|
||||
# A CMake Module for finding Mono.
|
||||
#
|
||||
# The following variables are set:
|
||||
# CSHARP_MONO_FOUND
|
||||
# CSHARP_MONO_COMPILER_${version} eg. "CSHARP_MONO_COMPILER_2.10.2"
|
||||
# CSHARP_MONO_INTERPRETOR_${version} eg. "CSHARP_MONO_INTERPRETOR_2.10.2"
|
||||
# CSHARP_MONO_VERSION eg. "2.10.2"
|
||||
# CSHARP_MONO_VERSIONS eg. "2.10.2, 2.6.7"
|
||||
#
|
||||
# Additional references can be found here:
|
||||
# http://www.mono-project.com/Main_Page
|
||||
# http://www.mono-project.com/CSharp_Compiler
|
||||
# http://mono-project.com/FAQ:_Technical (How can I tell where the Mono runtime is installed)
|
||||
#
|
||||
# This file is based on the work of GDCM:
|
||||
# http://gdcm.svn.sf.net/viewvc/gdcm/trunk/CMake/FindMono.cmake
|
||||
# Copyright (c) 2006-2010 Mathieu Malaterre <mathieu.malaterre@gmail.com>
|
||||
#
|
||||
|
||||
set( csharp_mono_valid 1 )
|
||||
if( DEFINED CSHARP_MONO_FOUND )
|
||||
# The Mono compiler has already been found
|
||||
# It may have been reset by the user, verify it is correct
|
||||
if( NOT DEFINED CSHARP_MONO_COMPILER_${CSHARP_MONO_VERSION} )
|
||||
set( csharp_mono_version_user ${CSHARP_MONO_VERSION} )
|
||||
set( csharp_mono_valid 0 )
|
||||
set( CSHARP_MONO_FOUND 0 )
|
||||
set( CSHARP_MONO_VERSION "CSHARP_MONO_VERSION-NOTVALID" CACHE STRING "C# Mono compiler version, choices: ${CSHARP_MONO_VERSIONS}" FORCE )
|
||||
message( FATAL_ERROR "The C# Mono version '${csharp_mono_version_user}' is not valid. Please enter one of the following: ${CSHARP_MONO_VERSIONS}" )
|
||||
endif( NOT DEFINED CSHARP_MONO_COMPILER_${CSHARP_MONO_VERSION} )
|
||||
endif( DEFINED CSHARP_MONO_FOUND )
|
||||
|
||||
unset( CSHARP_MONO_VERSIONS CACHE ) # Clear versions
|
||||
if( WIN32 )
|
||||
# Search for Mono on Win32 systems
|
||||
# See http://mono-project.com/OldReleases and http://www.go-mono.com/mono-downloads/download.html
|
||||
set( csharp_mono_bin_dirs )
|
||||
set( csharp_mono_search_hints
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Novell\\Mono\\2.11.2;SdkInstallRoot]/bin"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Novell\\Mono\\2.10.9;SdkInstallRoot]/bin"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Novell\\Mono\\2.10.8;SdkInstallRoot]/bin"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Novell\\Mono\\2.10.7;SdkInstallRoot]/bin"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Novell\\Mono\\2.10.6;SdkInstallRoot]/bin"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Novell\\Mono\\2.10.5;SdkInstallRoot]/bin"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Novell\\Mono\\2.10.4;SdkInstallRoot]/bin"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Novell\\Mono\\2.10.3;SdkInstallRoot]/bin"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Novell\\Mono\\2.10.2;SdkInstallRoot]/bin"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Novell\\Mono\\2.10.1;SdkInstallRoot]/bin"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Novell\\Mono\\2.10;SdkInstallRoot]/bin"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Novell\\Mono\\2.8;SdkInstallRoot]/bin"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Novell\\Mono\\2.6.7;SdkInstallRoot]/bin"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Novell\\Mono\\2.6.4;SdkInstallRoot]/bin"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Novell\\Mono\\2.6.3;SdkInstallRoot]/bin"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Novell\\Mono\\2.6.1;SdkInstallRoot]/bin"
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Novell\\Mono\\2.6;SdkInstallRoot]/bin"
|
||||
)
|
||||
foreach( csharp_mono_search_hint ${csharp_mono_search_hints} )
|
||||
get_filename_component( csharp_mono_bin_dir "${csharp_mono_search_hint}" ABSOLUTE )
|
||||
if ( EXISTS "${csharp_mono_bin_dir}" )
|
||||
set( csharp_mono_bin_dirs ${csharp_mono_bin_dirs} ${csharp_mono_bin_dir} )
|
||||
endif ( EXISTS "${csharp_mono_bin_dir}" )
|
||||
endforeach( csharp_mono_search_hint )
|
||||
# TODO: Use HKLM_LOCAL_MACHINE\Software\Novell\Mono\DefaultCLR to specify default version
|
||||
# get_filename_component( test "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Novell\\Mono;DefaultCLR]" NAME )
|
||||
|
||||
foreach ( csharp_mono_bin_dir ${csharp_mono_bin_dirs} )
|
||||
string( REPLACE "\\" "/" csharp_mono_bin_dir ${csharp_mono_bin_dir} )
|
||||
if (EXISTS "${csharp_mono_bin_dir}/dmcs.bat")
|
||||
set( csharp_mono_executable "${csharp_mono_bin_dir}/dmcs.bat")
|
||||
elseif (EXISTS "${csharp_mono_bin_dir}/gmcs.bat")
|
||||
set( csharp_mono_executable "${csharp_mono_bin_dir}/gmcs.bat")
|
||||
elseif (EXISTS "${csharp_mono_bin_dir}/mcs.bat")
|
||||
set( csharp_mono_executable "${csharp_mono_bin_dir}/mcs.bat")
|
||||
endif (EXISTS "${csharp_mono_bin_dir}/dmcs.bat")
|
||||
|
||||
if( csharp_mono_valid )
|
||||
# Extract version number (eg. 2.10.2)
|
||||
string(REGEX MATCH "([0-9]*)([.])([0-9]*)([.]*)([0-9]*)" csharp_mono_version_temp ${csharp_mono_bin_dir})
|
||||
set( CSHARP_MONO_VERSION ${csharp_mono_version_temp} CACHE STRING "C# Mono compiler version" )
|
||||
mark_as_advanced( CSHARP_MONO_VERSION )
|
||||
|
||||
# Add variable holding executable
|
||||
set( CSHARP_MONO_COMPILER_${csharp_mono_version_temp} ${csharp_mono_executable} CACHE STRING "C# Mono compiler ${csharp_mono_version_temp}" FORCE )
|
||||
mark_as_advanced( CSHARP_MONO_COMPILER_${csharp_mono_version_temp} )
|
||||
|
||||
# Set interpreter
|
||||
if (EXISTS "${csharp_mono_bin_dir}/mono.exe")
|
||||
set( CSHARP_MONO_INTERPRETER_${csharp_mono_version_temp} "${csharp_mono_bin_dir}/mono.exe" CACHE STRING "C# Mono interpreter ${csharp_mono_version_temp}" FORCE )
|
||||
mark_as_advanced( CSHARP_MONO_INTERPRETER_${csharp_mono_version_temp} )
|
||||
endif (EXISTS "${csharp_mono_bin_dir}/mono.exe")
|
||||
endif( csharp_mono_valid )
|
||||
|
||||
# Create a list of supported compiler versions
|
||||
if( NOT DEFINED CSHARP_MONO_VERSIONS )
|
||||
set( CSHARP_MONO_VERSIONS "${csharp_mono_version_temp}" CACHE STRING "Available C# Mono compiler versions" FORCE )
|
||||
else( NOT DEFINED CSHARP_MONO_VERSIONS )
|
||||
set( CSHARP_MONO_VERSIONS "${CSHARP_MONO_VERSIONS}, ${csharp_mono_version_temp}" CACHE STRING "Available C# Mono versions" FORCE )
|
||||
endif( NOT DEFINED CSHARP_MONO_VERSIONS )
|
||||
mark_as_advanced( CSHARP_MONO_VERSIONS )
|
||||
|
||||
# We found at least one Mono compiler version
|
||||
set( CSHARP_MONO_FOUND 1 CACHE INTERNAL "Boolean indicating if C# Mono was found" )
|
||||
endforeach( csharp_mono_bin_dir )
|
||||
|
||||
else( UNIX )
|
||||
# Search for Mono on non-Win32 systems
|
||||
set( chsarp_mono_names "mcs" "mcs.exe" "dmcs" "dmcs.exe" "smcs" "smcs.exe" "gmcs" "gmcs.exe" )
|
||||
set(
|
||||
csharp_mono_paths
|
||||
"/usr/bin/"
|
||||
"/usr/local/bin/"
|
||||
"/usr/lib/mono/2.0"
|
||||
"/opt/novell/mono/bin"
|
||||
)
|
||||
find_program(
|
||||
csharp_mono_compiler # variable is added to the cache, we removed it below
|
||||
NAMES ${chsarp_mono_names}
|
||||
PATHS ${csharp_mono_paths}
|
||||
)
|
||||
|
||||
if( EXISTS ${csharp_mono_compiler} )
|
||||
# Determine version
|
||||
find_program(
|
||||
csharp_mono_interpreter # variable is added to the cache, we removed it below
|
||||
NAMES mono
|
||||
PATHS ${csharp_mono_paths}
|
||||
)
|
||||
if ( EXISTS ${csharp_mono_interpreter} )
|
||||
execute_process(
|
||||
COMMAND ${csharp_mono_interpreter} -V
|
||||
OUTPUT_VARIABLE csharp_mono_version_string
|
||||
)
|
||||
string( REGEX MATCH "([0-9]*)([.])([0-9]*)([.]*)([0-9]*)" csharp_mono_version_temp ${csharp_mono_version_string} )
|
||||
set( CSHARP_MONO_INTERPRETER_${CSHARP_MONO_VERSION} ${csharp_mono_interpreter} CACHE STRING "C# Mono interpreter ${csharp_mono_version_temp}" FORCE )
|
||||
mark_as_advanced( CSHARP_MONO_INTERPRETER_${CSHARP_MONO_VERSION} )
|
||||
endif ( EXISTS ${csharp_mono_interpreter} )
|
||||
unset( csharp_mono_interpreter CACHE )
|
||||
|
||||
# We found Mono compiler
|
||||
set( CSHARP_MONO_VERSION ${csharp_mono_version_temp} CACHE STRING "C# Mono compiler version" )
|
||||
mark_as_advanced( CSHARP_MONO_VERSION )
|
||||
set( CSHARP_MONO_COMPILER_${CSHARP_MONO_VERSION} ${csharp_mono_compiler} CACHE STRING "C# Mono compiler ${CSHARP_MONO_VERSION}" FORCE )
|
||||
mark_as_advanced( CSHARP_MONO_COMPILER_${CSHARP_MONO_VERSION} )
|
||||
set( CSHARP_MONO_VERSIONS ${CSHARP_MONO_VERSION} CACHE STRING "Available C# Mono compiler versions" FORCE )
|
||||
mark_as_advanced( CSHARP_MONO_VERSIONS )
|
||||
set( CSHARP_MONO_FOUND 1 CACHE INTERNAL "Boolean indicating if C# Mono was found" )
|
||||
endif( EXISTS ${csharp_mono_compiler} )
|
||||
|
||||
# Remove temp variable from cache
|
||||
unset( csharp_mono_compiler CACHE )
|
||||
|
||||
endif( WIN32 )
|
||||
|
||||
if( CSHARP_MONO_FOUND )
|
||||
# Report the found versions
|
||||
message( STATUS "Found the following C# Mono versions: ${CSHARP_MONO_VERSIONS}" )
|
||||
endif( CSHARP_MONO_FOUND )
|
||||
|
||||
# Set USE_FILE
|
||||
get_filename_component( current_list_path ${CMAKE_CURRENT_LIST_FILE} PATH )
|
||||
set( Mono_USE_FILE ${current_list_path}/UseMono.cmake )
|
||||
@@ -108,6 +108,17 @@
|
||||
],
|
||||
"type": "rhoV",
|
||||
"using_tau_r": true
|
||||
},
|
||||
"surface_tension": {
|
||||
"BibTeX": "Mulero-JPCRD-2014",
|
||||
"Tc": 398.3,
|
||||
"a": [
|
||||
0.06812
|
||||
],
|
||||
"description": "sigma = sum(a_i*(1-T/Tc)^n_i)",
|
||||
"n": [
|
||||
1.314
|
||||
]
|
||||
}
|
||||
},
|
||||
"CAS": "75-19-4",
|
||||
|
||||
@@ -108,6 +108,17 @@
|
||||
],
|
||||
"type": "rhoV",
|
||||
"using_tau_r": true
|
||||
},
|
||||
"surface_tension": {
|
||||
"BibTeX": "Mulero-JPCRD-2014",
|
||||
"Tc": 511.72,
|
||||
"a": [
|
||||
0.07348
|
||||
],
|
||||
"description": "sigma = sum(a_i*(1-T/Tc)^n_i)",
|
||||
"n": [
|
||||
1.388
|
||||
]
|
||||
}
|
||||
},
|
||||
"CAS": "287-92-3",
|
||||
|
||||
@@ -107,6 +107,17 @@
|
||||
],
|
||||
"type": "rhoV",
|
||||
"using_tau_r": true
|
||||
},
|
||||
"surface_tension": {
|
||||
"BibTeX": "Mulero-JPCRD-2014",
|
||||
"Tc": 586.5,
|
||||
"a": [
|
||||
0.04246
|
||||
],
|
||||
"description": "sigma = sum(a_i*(1-T/Tc)^n_i)",
|
||||
"n": [
|
||||
1.207
|
||||
]
|
||||
}
|
||||
},
|
||||
"CAS": "556-67-2",
|
||||
|
||||
@@ -107,6 +107,17 @@
|
||||
],
|
||||
"type": "rhoV",
|
||||
"using_tau_r": true
|
||||
},
|
||||
"surface_tension": {
|
||||
"BibTeX": "Mulero-JPCRD-2014",
|
||||
"Tc": 619.15,
|
||||
"a": [
|
||||
0.04408
|
||||
],
|
||||
"description": "sigma = sum(a_i*(1-T/Tc)^n_i)",
|
||||
"n": [
|
||||
1.357
|
||||
]
|
||||
}
|
||||
},
|
||||
"CAS": "541-02-6",
|
||||
|
||||
@@ -107,6 +107,17 @@
|
||||
],
|
||||
"type": "rhoV",
|
||||
"using_tau_r": true
|
||||
},
|
||||
"surface_tension": {
|
||||
"BibTeX": "Mulero-JPCRD-2014",
|
||||
"Tc": 645.78,
|
||||
"a": [
|
||||
0.05105
|
||||
],
|
||||
"description": "sigma = sum(a_i*(1-T/Tc)^n_i)",
|
||||
"n": [
|
||||
1.594
|
||||
]
|
||||
}
|
||||
},
|
||||
"CAS": "540-97-6",
|
||||
|
||||
@@ -108,6 +108,17 @@
|
||||
],
|
||||
"type": "rhoV",
|
||||
"using_tau_r": true
|
||||
},
|
||||
"surface_tension": {
|
||||
"BibTeX": "Mulero-JPCRD-2014",
|
||||
"Tc": 557.0,
|
||||
"a": [
|
||||
0.0825
|
||||
],
|
||||
"description": "sigma = sum(a_i*(1-T/Tc)^n_i)",
|
||||
"n": [
|
||||
1.39
|
||||
]
|
||||
}
|
||||
},
|
||||
"CAS": "616-38-6",
|
||||
|
||||
@@ -107,6 +107,17 @@
|
||||
],
|
||||
"type": "rhoV",
|
||||
"using_tau_r": true
|
||||
},
|
||||
"surface_tension": {
|
||||
"BibTeX": "Mulero-JPCRD-2014",
|
||||
"Tc": 617.12,
|
||||
"a": [
|
||||
0.0638
|
||||
],
|
||||
"description": "sigma = sum(a_i*(1-T/Tc)^n_i)",
|
||||
"n": [
|
||||
1.22
|
||||
]
|
||||
}
|
||||
},
|
||||
"CAS": "100-41-4",
|
||||
|
||||
@@ -107,6 +107,17 @@
|
||||
],
|
||||
"type": "rhoV",
|
||||
"using_tau_r": true
|
||||
},
|
||||
"surface_tension": {
|
||||
"BibTeX": "Mulero-JPCRD-2014",
|
||||
"Tc": 599.4,
|
||||
"a": [
|
||||
0.0456
|
||||
],
|
||||
"description": "sigma = sum(a_i*(1-T/Tc)^n_i)",
|
||||
"n": [
|
||||
1.41
|
||||
]
|
||||
}
|
||||
},
|
||||
"CAS": "141-62-8",
|
||||
|
||||
@@ -107,6 +107,17 @@
|
||||
],
|
||||
"type": "rhoV",
|
||||
"using_tau_r": true
|
||||
},
|
||||
"surface_tension": {
|
||||
"BibTeX": "Mulero-JPCRD-2014",
|
||||
"Tc": 628.36,
|
||||
"a": [
|
||||
0.03972
|
||||
],
|
||||
"description": "sigma = sum(a_i*(1-T/Tc)^n_i)",
|
||||
"n": [
|
||||
1.254
|
||||
]
|
||||
}
|
||||
},
|
||||
"CAS": "141-63-9",
|
||||
|
||||
@@ -107,6 +107,17 @@
|
||||
],
|
||||
"type": "rhoV",
|
||||
"using_tau_r": true
|
||||
},
|
||||
"surface_tension": {
|
||||
"BibTeX": "Mulero-JPCRD-2014",
|
||||
"Tc": 653.2,
|
||||
"a": [
|
||||
0.040798
|
||||
],
|
||||
"description": "sigma = sum(a_i*(1-T/Tc)^n_i)",
|
||||
"n": [
|
||||
1.3323
|
||||
]
|
||||
}
|
||||
},
|
||||
"CAS": "107-52-8",
|
||||
|
||||
@@ -107,6 +107,17 @@
|
||||
],
|
||||
"type": "rhoV",
|
||||
"using_tau_r": true
|
||||
},
|
||||
"surface_tension": {
|
||||
"BibTeX": "Mulero-JPCRD-2014",
|
||||
"Tc": 564.09,
|
||||
"a": [
|
||||
0.04992
|
||||
],
|
||||
"description": "sigma = sum(a_i*(1-T/Tc)^n_i)",
|
||||
"n": [
|
||||
1.465
|
||||
]
|
||||
}
|
||||
},
|
||||
"CAS": "107-51-7",
|
||||
|
||||
@@ -107,6 +107,17 @@
|
||||
],
|
||||
"type": "rhoV",
|
||||
"using_tau_r": true
|
||||
},
|
||||
"surface_tension": {
|
||||
"BibTeX": "Mulero-JPCRD-2014",
|
||||
"Tc": 518.75,
|
||||
"a": [
|
||||
0.04576
|
||||
],
|
||||
"description": "sigma = sum(a_i*(1-T/Tc)^n_i)",
|
||||
"n": [
|
||||
1.272
|
||||
]
|
||||
}
|
||||
},
|
||||
"CAS": "107-46-0",
|
||||
|
||||
@@ -106,6 +106,17 @@
|
||||
],
|
||||
"type": "rhoV",
|
||||
"using_tau_r": true
|
||||
},
|
||||
"surface_tension": {
|
||||
"BibTeX": "Mulero-JPCRD-2014",
|
||||
"Tc": 799.0,
|
||||
"a": [
|
||||
0.072487
|
||||
],
|
||||
"description": "sigma = sum(a_i*(1-T/Tc)^n_i)",
|
||||
"n": [
|
||||
1.9014
|
||||
]
|
||||
}
|
||||
},
|
||||
"CAS": "112-63-0",
|
||||
|
||||
@@ -106,6 +106,17 @@
|
||||
],
|
||||
"type": "rhoV",
|
||||
"using_tau_r": true
|
||||
},
|
||||
"surface_tension": {
|
||||
"BibTeX": "Mulero-JPCRD-2014",
|
||||
"Tc": 782.0,
|
||||
"a": [
|
||||
0.0565
|
||||
],
|
||||
"description": "sigma = sum(a_i*(1-T/Tc)^n_i)",
|
||||
"n": [
|
||||
1.31
|
||||
]
|
||||
}
|
||||
},
|
||||
"CAS": "112-62-9",
|
||||
|
||||
@@ -106,6 +106,19 @@
|
||||
],
|
||||
"type": "rhoV",
|
||||
"using_tau_r": true
|
||||
},
|
||||
"surface_tension": {
|
||||
"BibTeX": "Mulero-JPCRD-2014",
|
||||
"Tc": 755.0,
|
||||
"a": [
|
||||
0.025025,
|
||||
0.044435
|
||||
],
|
||||
"description": "sigma = sum(a_i*(1-T/Tc)^n_i)",
|
||||
"n": [
|
||||
3.039,
|
||||
1.1653
|
||||
]
|
||||
}
|
||||
},
|
||||
"CAS": "112-39-0",
|
||||
|
||||
@@ -106,6 +106,19 @@
|
||||
],
|
||||
"type": "rhoV",
|
||||
"using_tau_r": true
|
||||
},
|
||||
"surface_tension": {
|
||||
"BibTeX": "Mulero-JPCRD-2014",
|
||||
"Tc": 775.0,
|
||||
"a": [
|
||||
0.02313,
|
||||
0.04567
|
||||
],
|
||||
"description": "sigma = sum(a_i*(1-T/Tc)^n_i)",
|
||||
"n": [
|
||||
3.242,
|
||||
1.163
|
||||
]
|
||||
}
|
||||
},
|
||||
"CAS": "112-61-8",
|
||||
|
||||
@@ -107,6 +107,17 @@
|
||||
],
|
||||
"type": "rhoV",
|
||||
"using_tau_r": true
|
||||
},
|
||||
"surface_tension": {
|
||||
"BibTeX": "Mulero-JPCRD-2014",
|
||||
"Tc": 433.74,
|
||||
"a": [
|
||||
0.04465
|
||||
],
|
||||
"description": "sigma = sum(a_i*(1-T/Tc)^n_i)",
|
||||
"n": [
|
||||
1.21
|
||||
]
|
||||
}
|
||||
},
|
||||
"CAS": "463-82-1",
|
||||
|
||||
@@ -108,6 +108,19 @@
|
||||
],
|
||||
"type": "rhoV",
|
||||
"using_tau_r": true
|
||||
},
|
||||
"surface_tension": {
|
||||
"BibTeX": "Mulero-JPCRD-2014",
|
||||
"Tc": 382.51,
|
||||
"a": [
|
||||
0.06158,
|
||||
0.8247
|
||||
],
|
||||
"description": "sigma = sum(a_i*(1-T/Tc)^n_i)",
|
||||
"n": [
|
||||
1.281,
|
||||
6.505
|
||||
]
|
||||
}
|
||||
},
|
||||
"CAS": "29118-24-9",
|
||||
|
||||
@@ -108,14 +108,14 @@
|
||||
"using_tau_r": true
|
||||
},
|
||||
"surface_tension": {
|
||||
"BibTeX": "Mulero-JPCRD-2012",
|
||||
"BibTeX": "Mulero-JPCRD-2014",
|
||||
"Tc": 345.857,
|
||||
"a": [
|
||||
0.05416
|
||||
0.0537
|
||||
],
|
||||
"description": "sigma = sum(a_i*(1-T/Tc)^n_i)",
|
||||
"n": [
|
||||
1.255
|
||||
1.25
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
@@ -107,6 +107,17 @@
|
||||
],
|
||||
"type": "rhoV",
|
||||
"using_tau_r": true
|
||||
},
|
||||
"surface_tension": {
|
||||
"BibTeX": "Mulero-JPCRD-2014",
|
||||
"Tc": 435.75,
|
||||
"a": [
|
||||
0.05903
|
||||
],
|
||||
"description": "sigma = sum(a_i*(1-T/Tc)^n_i)",
|
||||
"n": [
|
||||
1.246
|
||||
]
|
||||
}
|
||||
},
|
||||
"CAS": "590-18-1",
|
||||
|
||||
@@ -108,6 +108,17 @@
|
||||
],
|
||||
"type": "rhoV",
|
||||
"using_tau_r": true
|
||||
},
|
||||
"surface_tension": {
|
||||
"BibTeX": "Mulero-JPCRD-2014",
|
||||
"Tc": 616.89,
|
||||
"a": [
|
||||
0.06445
|
||||
],
|
||||
"description": "sigma = sum(a_i*(1-T/Tc)^n_i)",
|
||||
"n": [
|
||||
1.256
|
||||
]
|
||||
}
|
||||
},
|
||||
"CAS": "108-38-3",
|
||||
|
||||
@@ -315,7 +315,8 @@
|
||||
"conductivity": {
|
||||
"BibTeX": "Assael-JPCRD-2013-Heptane",
|
||||
"critical": {
|
||||
"GAMMA": 0.0586,
|
||||
"R0": 1.02,
|
||||
"GAMMA": 0.0586,
|
||||
"qD": 1250000000.0,
|
||||
"type": "simplified_Olchowy_Sengers",
|
||||
"zeta0": 2.45e-10
|
||||
@@ -394,6 +395,57 @@
|
||||
],
|
||||
"type": "polynomial"
|
||||
}
|
||||
},
|
||||
"viscosity": {
|
||||
"BibTeX": "Michailidou-JPCRD-2014-Heptane",
|
||||
"dilute": {
|
||||
"C": 2.1357e-08,
|
||||
"a": [
|
||||
0.33974,
|
||||
-0.49396,
|
||||
0.08050
|
||||
],
|
||||
"molar_mass": 0.100202,
|
||||
"molar_mass_units": "kg/mol",
|
||||
"t": [
|
||||
0,
|
||||
1,
|
||||
3
|
||||
],
|
||||
"type": "collision_integral"
|
||||
},
|
||||
"epsilon_over_k": 426.118,
|
||||
"epsilon_over_k_units": "K",
|
||||
"higher_order": {
|
||||
"hardcoded": "n-Heptane"
|
||||
},
|
||||
"initial_density": {
|
||||
"b": [
|
||||
-19.572881,
|
||||
219.73999,
|
||||
-1015.3226,
|
||||
2471.01251,
|
||||
-3375.1717,
|
||||
2491.6597,
|
||||
-787.26086,
|
||||
14.085455,
|
||||
-0.34664158
|
||||
],
|
||||
"t": [
|
||||
0,
|
||||
-0.25,
|
||||
-0.5,
|
||||
-0.75,
|
||||
-1.0,
|
||||
-1.25,
|
||||
-1.5,
|
||||
-2.5,
|
||||
-5.5
|
||||
],
|
||||
"type": "Rainwater-Friend"
|
||||
},
|
||||
"sigma_eta": 0.61362e-9,
|
||||
"sigma_eta_units": "m"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -109,6 +109,17 @@
|
||||
],
|
||||
"type": "rhoV",
|
||||
"using_tau_r": true
|
||||
},
|
||||
"surface_tension": {
|
||||
"BibTeX": "Mulero-JPCRD-2014",
|
||||
"Tc": 638.8,
|
||||
"a": [
|
||||
0.0556
|
||||
],
|
||||
"description": "sigma = sum(a_i*(1-T/Tc)^n_i)",
|
||||
"n": [
|
||||
1.32
|
||||
]
|
||||
}
|
||||
},
|
||||
"CAS": "1120-21-4",
|
||||
|
||||
@@ -108,6 +108,17 @@
|
||||
],
|
||||
"type": "rhoV",
|
||||
"using_tau_r": true
|
||||
},
|
||||
"surface_tension": {
|
||||
"BibTeX": "Mulero-JPCRD-2014",
|
||||
"Tc": 630.259,
|
||||
"a": [
|
||||
0.06477
|
||||
],
|
||||
"description": "sigma = sum(a_i*(1-T/Tc)^n_i)",
|
||||
"n": [
|
||||
1.227
|
||||
]
|
||||
}
|
||||
},
|
||||
"CAS": "95-47-6",
|
||||
|
||||
@@ -108,6 +108,17 @@
|
||||
],
|
||||
"type": "rhoV",
|
||||
"using_tau_r": true
|
||||
},
|
||||
"surface_tension": {
|
||||
"BibTeX": "Mulero-JPCRD-2014",
|
||||
"Tc": 616.168,
|
||||
"a": [
|
||||
0.0619
|
||||
],
|
||||
"description": "sigma = sum(a_i*(1-T/Tc)^n_i)",
|
||||
"n": [
|
||||
1.21
|
||||
]
|
||||
}
|
||||
},
|
||||
"CAS": "106-42-3",
|
||||
|
||||
@@ -107,6 +107,19 @@
|
||||
],
|
||||
"type": "rhoV",
|
||||
"using_tau_r": true
|
||||
},
|
||||
"surface_tension": {
|
||||
"BibTeX": "Mulero-JPCRD-2014",
|
||||
"Tc": 428.61,
|
||||
"a": [
|
||||
0.0001859,
|
||||
0.05539
|
||||
],
|
||||
"description": "sigma = sum(a_i*(1-T/Tc)^n_i)",
|
||||
"n": [
|
||||
0.07485,
|
||||
1.224
|
||||
]
|
||||
}
|
||||
},
|
||||
"CAS": "624-64-6",
|
||||
|
||||
@@ -14,9 +14,12 @@ import hashlib
|
||||
def get_hash(data):
|
||||
return hashlib.sha224(data).hexdigest()
|
||||
|
||||
repo_root_path = os.path.normpath(os.path.join(os.path.abspath(__file__),'..','..'))
|
||||
|
||||
# Load up the hashes of the data that will be written to each file
|
||||
if os.path.exists('hashes.json'):
|
||||
hashes = json.load(open('hashes.json','r'))
|
||||
hashes_fname = os.path.join(repo_root_path,'dev','hashes.json')
|
||||
if os.path.exists(hashes_fname):
|
||||
hashes = json.load(open(hashes_fname,'r'))
|
||||
else:
|
||||
hashes = dict()
|
||||
|
||||
@@ -99,22 +102,19 @@ def gitrev_to_file(root_dir):
|
||||
pass
|
||||
|
||||
if __name__=='__main__':
|
||||
path = os.path.abspath(__file__)
|
||||
path = os.path.dirname(path)
|
||||
path = os.path.dirname(path)
|
||||
|
||||
import shutil
|
||||
shutil.copy2(os.path.join(path, 'externals','Catch','single_include','catch.hpp'),os.path.join(path,'include','catch.hpp'))
|
||||
shutil.copy2(os.path.join(repo_root_path, 'externals','Catch','single_include','catch.hpp'),os.path.join(repo_root_path,'include','catch.hpp'))
|
||||
|
||||
version_to_file(root_dir = path)
|
||||
gitrev_to_file(root_dir = path)
|
||||
version_to_file(root_dir = repo_root_path)
|
||||
gitrev_to_file(root_dir = repo_root_path)
|
||||
|
||||
import JSON_to_CPP
|
||||
JSON_to_CPP.TO_CPP(root_dir = path, hashes = hashes)
|
||||
JSON_to_CPP.TO_CPP(root_dir = repo_root_path, hashes = hashes)
|
||||
|
||||
# Write the hashes to a hashes JSON file
|
||||
if hashes:
|
||||
fp = open('hashes.json','w')
|
||||
fp = open(hashes_fname,'w')
|
||||
fp.write(json.dumps(hashes))
|
||||
fp.close()
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ json_options = {'indent' : 2, 'sort_keys' : True}
|
||||
|
||||
# Data from Mulero, JPCRD, 2012
|
||||
# CAS codes added from CoolProp 4.2, and wikipedia where necessary
|
||||
Mulero_data = """67-64-1 Acetone 0.0633 1.160
|
||||
Mulero2012_data = """67-64-1 Acetone 0.0633 1.160
|
||||
7664-41-7 Ammonia 0.1028 1.211 -0.09453 5.585
|
||||
7440-37-1 Argon 0.037 1.25
|
||||
71-43-2 Benzene 0.07298 1.232 -0.0007802 0.8635 -0.0001756 0.3065
|
||||
@@ -87,7 +87,7 @@ Mulero_data = """67-64-1 Acetone 0.0633 1.160
|
||||
7732-18-5 Water -0.1306 2.471 0.2151 1.233
|
||||
7440-63-3 Xenon -0.11538 1.0512 0.16598 1.098"""
|
||||
|
||||
def inject_surface_tension(root_dir):
|
||||
def inject_surface_tension_2012(root_dir):
|
||||
print("*** Injecting surface tension curves from Mulero")
|
||||
Tc_dict = {'Argon':150.687,
|
||||
'Benzene':562.02,
|
||||
@@ -174,7 +174,7 @@ def inject_surface_tension(root_dir):
|
||||
}
|
||||
|
||||
import glob, json, os
|
||||
for row in Mulero_data.split('\n'):
|
||||
for row in Mulero2012_data.split('\n'):
|
||||
row = row.split(' ')
|
||||
cas = row.pop(0)
|
||||
name = row.pop(0)
|
||||
@@ -207,6 +207,109 @@ def inject_surface_tension(root_dir):
|
||||
fp = open(fname, 'w')
|
||||
fp.write(json.dumps(j, **json_options))
|
||||
fp.close()
|
||||
|
||||
|
||||
Mulero2014_data = """cis-2-butene 435.75 0.05903 1.246
|
||||
Cyclopentane 511.72 0.07348 1.388
|
||||
Cyclopropane 398.3 0.06812 1.314
|
||||
Decamethylcyclopentasiloxane 619.15 0.04408 1.357
|
||||
Decamethyltetrasiloxane 599.4 0.0456 1.41
|
||||
Diethyl ether 466.7 1.2348 1.4846 1.1808 1.5021
|
||||
Dimethyl carbonate (Dimethyl ester carbonic acid) 557 0.0825 1.39
|
||||
Dodecamethylcyclohexasiloxane 645.78 0.05105 1.594
|
||||
Dodecamethylpentasiloxane 628.36 0.03972 1.254
|
||||
Ethylbenzene 617.12 0.0638 1.22
|
||||
Ethylene oxide 468.92 0.07542 1.151
|
||||
Hexamethyldisiloxane 518.75 0.04576 1.272
|
||||
Hydrogen chloride 21 0.05994 1.0953
|
||||
Isooctane (2,2,4- trimethylpentane) 543.87 0.04794 1.209
|
||||
Methyl linoleate (Methyl (Z,Z)- 9,12-octadecadienoate) 799 0.072487 1.9014
|
||||
Methyl oleate (Methyl cis-9-octadecenoate) 782 0.0565 1.31
|
||||
Methyl palmitate (Methyl hexadecanoate) 755 0.025025 3.039 0.044435 1.1653
|
||||
Methyl stearate (Methyl octadecanoate) 775 0.02313 3.242 0.04567 1.163
|
||||
Methylcyclohexane 572.2 0.0606 1.3
|
||||
m-xylene (1,3-dimethylbenzene) 616.89 0.06445 1.256
|
||||
Neopentane (2,2- dimethylpropane) 433.74 0.04465 1.21
|
||||
Nitrogen trifluoride 234 0.063203 1.2565
|
||||
Octamethylcyclotetrasiloxane 586.5 0.04246 1.207
|
||||
Octamethyltrisiloxane 564.09 0.04992 1.465
|
||||
o-xylene (1,2-dimethylbenzene) 630.259 0.06477 1.227
|
||||
Propylcyclohexane 630.8 0.055 1.17
|
||||
p-xylene 616.168 0.0619 1.21
|
||||
R1216 (Hexafluoropropene) 358.9 0.053876 1.0944 0.038318 2.3239
|
||||
R1234ze(E) (trans-1,3,3,3-tetrafluoropropene) 382.51 0.06158 1.281 0.8247 6.505
|
||||
R143a (1,1,1-Trifluoroethane) 345.857 0.0537 1.25
|
||||
R40 (Methyl chloride) 416.3 0.071315 1.2177
|
||||
RE245cb2 (Methyl-pentafluoroethyl ether) 406.813 0.04534 1.237
|
||||
RE245fa2 (2,2,2-trifluoroethyl-difluoromethyl ether) 444.88 0.0699 1.222
|
||||
RE347mcc (HFE-7000 or Methyl-heptafluoropropyl ether) 437.7 0.05031 1.232
|
||||
Tetradecamethylhexasiloxane 653.2 0.040798 1.3323
|
||||
trans-2-butene 428.61 0.0001859 0.07485 0.05539 1.224
|
||||
Undecane 638.8 0.0556 1.32"""
|
||||
|
||||
def inject_surface_tension_2014(root_dir):
|
||||
rename = {'Undecane': 'n-Undecane',
|
||||
'm-xylene (1,3-dimethylbenzene)': 'm-Xylene',
|
||||
'o-xylene (1,2-dimethylbenzene)': 'o-Xylene',
|
||||
'R1234ze(E) (trans-1,3,3,3-tetrafluoropropene)':'R1234ze(E)',
|
||||
'R143a (1,1,1-Trifluoroethane)':'R143a',
|
||||
'Methyl linoleate (Methyl (Z,Z)- 9,12-octadecadienoate)':'MethylLinoleate',
|
||||
'Methyl oleate (Methyl cis-9-octadecenoate)':'MethylOleate',
|
||||
'Methyl palmitate (Methyl hexadecanoate)':'MethylPalmitate',
|
||||
'Methyl stearate (Methyl octadecanoate)':'MethylStearate',
|
||||
'Dimethyl carbonate (Dimethyl ester carbonic acid)':'DimethylCarbonate',
|
||||
'Hexamethyldisiloxane': 'MM',
|
||||
'Tetradecamethylhexasiloxane':'MD4M',
|
||||
'Dodecamethylpentasiloxane':'MD3M',
|
||||
'Octamethyltrisiloxane':'MDM',
|
||||
'Decamethyltetrasiloxane':'MD2M',
|
||||
'Octamethylcyclotetrasiloxane':'D4',
|
||||
'Dodecamethylcyclohexasiloxane':'D6',
|
||||
'Decamethylcyclopentasiloxane':'D5',
|
||||
'Diethyl ether':'DiethylEther',
|
||||
'Neopentane (2,2- dimethylpropane)':'Neopentane'
|
||||
}
|
||||
import glob, json, os
|
||||
for line in Mulero2014_data.split('\n'):
|
||||
|
||||
row = line.split(' ')
|
||||
#print(row)
|
||||
values = []
|
||||
j = 0
|
||||
for i in range(len(row)):
|
||||
try:
|
||||
values.append(float(row[i]))
|
||||
except:
|
||||
j = i
|
||||
|
||||
name = ' '.join(row[0:j+1])
|
||||
|
||||
Tc = values.pop(0)
|
||||
a = values[0:len(row):2]
|
||||
n = values[1:len(row):2]
|
||||
|
||||
# The dictionary of values for the surface tension
|
||||
j_st = dict(Tc = Tc,
|
||||
a = a,
|
||||
n = n,
|
||||
BibTeX = 'Mulero-JPCRD-2014',
|
||||
description = 'sigma = sum(a_i*(1-T/Tc)^n_i)'
|
||||
)
|
||||
|
||||
if name in rename:
|
||||
name = rename[name]
|
||||
fname = os.path.join(root_dir,'dev','fluids',name+'.json')
|
||||
if not os.path.exists(fname):
|
||||
print(fname + ' does not exist')
|
||||
continue
|
||||
|
||||
j = json.load(open(fname,'r'))
|
||||
|
||||
j['ANCILLARIES']['surface_tension'] = j_st
|
||||
|
||||
fp = open(fname, 'w')
|
||||
fp.write(json.dumps(j, **json_options))
|
||||
fp.close()
|
||||
|
||||
def inject_environmental_data(root_dir):
|
||||
print('*** Injecting environmental data from DTU')
|
||||
@@ -242,8 +345,9 @@ def inject_ancillaries(root_dir):
|
||||
fp.write(json.dumps(fluid, **json_options))
|
||||
|
||||
def inject(root_dir):
|
||||
inject_surface_tension_2014(root_dir)
|
||||
inject_ancillaries(root_dir)
|
||||
inject_surface_tension(root_dir)
|
||||
inject_surface_tension_2012(root_dir)
|
||||
inject_environmental_data(root_dir)
|
||||
|
||||
def combine_json(root_dir):
|
||||
@@ -291,4 +395,5 @@ def combine_json(root_dir):
|
||||
fp.close()
|
||||
|
||||
if __name__=='__main__':
|
||||
inject_surface_tension_2014(root_dir = '..')
|
||||
combine_json(root_dir = '..')
|
||||
@@ -71,19 +71,19 @@ protected:
|
||||
//~ return true;
|
||||
//~ }
|
||||
|
||||
|
||||
|
||||
/// Two important points
|
||||
SimpleState _critical, _reducing;
|
||||
|
||||
/// Molar mass [mol/kg]
|
||||
CachedElement _molar_mass;
|
||||
|
||||
|
||||
/// Universal gas constant [J/mol/K]
|
||||
CachedElement _gas_constant;
|
||||
|
||||
/// Bulk values
|
||||
double _rhomolar, _T, _p, _Q, _R;
|
||||
|
||||
|
||||
CachedElement _tau, _delta;
|
||||
|
||||
/// Transport properties
|
||||
@@ -161,7 +161,7 @@ protected:
|
||||
virtual long double calc_d2alphar_dDelta_dTau(void){throw NotImplementedError("calc_d2alphar_dDelta_dTau is not implemented for this backend");};
|
||||
/// Using this backend, calculate the residual Helmholtz energy term \f$\alpha^r_{\tau\tau}\f$ (dimensionless)
|
||||
virtual long double calc_d2alphar_dTau2(void){throw NotImplementedError("calc_d2alphar_dTau2 is not implemented for this backend");};
|
||||
|
||||
|
||||
// Derivatives of ideal-gas helmholtz energy
|
||||
/// Using this backend, calculate the ideal-gas Helmholtz energy term \f$\alpha^0\f$ (dimensionless)
|
||||
virtual long double calc_alpha0(void){throw NotImplementedError("calc_alpha0 is not implemented for this backend");};
|
||||
@@ -197,7 +197,7 @@ protected:
|
||||
virtual long double calc_health_hazard(void){throw NotImplementedError("calc_health_hazard is not implemented for this backend");};
|
||||
/// Using this backend, calculate the physical hazard
|
||||
virtual long double calc_physical_hazard(void){throw NotImplementedError("calc_physical_hazard is not implemented for this backend");};
|
||||
|
||||
|
||||
/// Calculate the first partial derivative for the desired derivative
|
||||
virtual long double calc_first_partial_deriv(int Of, int Wrt, int Constant){throw NotImplementedError("calc_first_partial_deriv is not implemented for this backend");};
|
||||
|
||||
@@ -217,7 +217,7 @@ protected:
|
||||
|
||||
/// Using this backend, get the name of the fluid
|
||||
virtual std::string calc_name(void){throw NotImplementedError("calc_name is not implemented for this backend");};
|
||||
|
||||
|
||||
/// Using this backend, get the triple point temperature in K
|
||||
virtual long double calc_Ttriple(void){throw NotImplementedError("calc_Ttriple is not implemented for this backend");};
|
||||
|
||||
@@ -228,6 +228,8 @@ protected:
|
||||
/// Using this backend, get the critical point molar density in mol/m^3
|
||||
virtual long double calc_rhomolar_critical(void){throw NotImplementedError("calc_rhomolar_critical is not implemented for this backend");};
|
||||
|
||||
/// Using this backend, construct the phase envelope, the variable type describes the type of phase envelope to be built.
|
||||
virtual void calc_phase_envelope(const std::string &type){throw NotImplementedError("calc_phase_envelope is not implemented for this backend");};
|
||||
public:
|
||||
|
||||
virtual long double calc_melt_p_T(long double T){throw NotImplementedError("calc_melt_p_T is not implemented for this backend");};
|
||||
@@ -236,13 +238,13 @@ public:
|
||||
|
||||
AbstractState(){};
|
||||
virtual ~AbstractState(){};
|
||||
|
||||
|
||||
/// A factory function to return a pointer to a new-allocated instance of one of the backends.
|
||||
/**
|
||||
Very Important!! : Use a smart pointer to manage the pointer returned. In older versions of C++, you can use std::tr1::smart_ptr. In C++2011 you can use std::shared_ptr
|
||||
|
||||
Several backends are possible:
|
||||
|
||||
|
||||
1. "?" : The backend is unknown, we will parse the fluid string to determine the backend to be used. Probably will use HEOS backend (see below)
|
||||
2. "HEOS" : The Helmholtz Equation of State backend for use with pure and pseudo-pure fluids, and mixtures, all of which are based on multi-parameter Helmholtz Energy equations of state. The fluid part of the string should then either be
|
||||
1. A pure or pseudo-pure fluid name (eg. "PROPANE" or "R410A"), yielding a HelmholtzEOSBackend instance.
|
||||
@@ -251,14 +253,14 @@ public:
|
||||
3. "REFPROP" : The REFPROP backend will be used. The fluid part of the string should then either be
|
||||
1. A pure or pseudo-pure fluid name (eg. "PROPANE" or "R410A"), yielding a REFPROPBackend instance.
|
||||
2. A string that encodes the components of the mixture with a "&" between them (e.g. "R32&R125"), yielding a REFPROPMixtureBackend instance.
|
||||
|
||||
|
||||
4. "TTSE&XXXX": The TTSE backend will be used, and the tables will be generated using the XXXX backend where XXXX is one of the base backends("HEOS", "REFPROP", etc. )
|
||||
5. "BICUBIC&XXXX": The Bicubic backend will be used, and the tables will be generated using the XXXX backend where XXXX is one of the base backends("HEOS", "REFPROP", etc. )
|
||||
6. "INCOMP": The incompressible backend will be used
|
||||
7. "BRINE": The brine backend will be used
|
||||
*/
|
||||
static AbstractState * factory(const std::string &backend, const std::string &fluid_string);
|
||||
|
||||
|
||||
// The derived classes must implement this function to define whether they use mole fractions (true) or mass fractions (false)
|
||||
virtual bool using_mole_fractions(void) = 0;
|
||||
|
||||
@@ -268,7 +270,7 @@ public:
|
||||
|
||||
/// Clear all the cached values
|
||||
bool clear();
|
||||
|
||||
|
||||
void set_mole_fractions(const std::vector<double> &mole_fractions){set_mole_fractions(std::vector<long double>(mole_fractions.begin(), mole_fractions.end()));};
|
||||
void set_mass_fractions(const std::vector<double> &mass_fractions){set_mass_fractions(std::vector<long double>(mass_fractions.begin(), mass_fractions.end()));};
|
||||
|
||||
@@ -360,6 +362,7 @@ public:
|
||||
/// Return the isobaric expansion coefficient \f$ \beta = \frac{1}{v}\left.\frac{\partial v}{\partial T}\right|_p = -\frac{1}{\rho}\left.\frac{\partial \rho}{\partial T}\right|_p\f$ in 1/K
|
||||
double isobaric_expansion_coefficient(void);
|
||||
double fugacity_coefficient(int i);
|
||||
void build_phase_envelope(const std::string &type);
|
||||
//double fundamental_derivative_of_gas_dynamics(void);
|
||||
|
||||
// ----------------------------------------
|
||||
|
||||
@@ -188,6 +188,7 @@ struct ViscosityHigherOrderVariables
|
||||
enum ViscosityDiluteEnum {VISCOSITY_HIGHER_ORDER_BATSCHINKI_HILDEBRAND,
|
||||
VISCOSITY_HIGHER_ORDER_HYDROGEN,
|
||||
VISCOSITY_HIGHER_ORDER_HEXANE,
|
||||
VISCOSITY_HIGHER_ORDER_HEPTANE,
|
||||
VISCOSITY_HIGHER_ORDER_ETHANE,
|
||||
VISCOSITY_HIGHER_ORDER_FRICTION_THEORY,
|
||||
VISCOSITY_HIGHER_ORDER_NOT_SET
|
||||
|
||||
@@ -12,8 +12,8 @@ using std::shared_ptr;
|
||||
#include <tr1/memory>
|
||||
using namespace std::tr1;
|
||||
#elif defined(__ISAPPLE__)
|
||||
#include <tr1/memory>
|
||||
using namespace std::tr1;
|
||||
#include <memory>
|
||||
using std::shared_ptr;
|
||||
#elif defined(__ISWINDOWS__) && defined(__MINGW32__)
|
||||
#include <tr1/memory>
|
||||
using namespace std::tr1;
|
||||
|
||||
@@ -302,6 +302,10 @@ double AbstractState::fugacity_coefficient(int i){
|
||||
// TODO: Cache the fug. coeff for each component
|
||||
return calc_fugacity_coefficient(i);
|
||||
}
|
||||
void AbstractState::build_phase_envelope(const std::string &type)
|
||||
{
|
||||
calc_phase_envelope(type);
|
||||
}
|
||||
double AbstractState::isothermal_compressibility(void){
|
||||
return 1.0/_rhomolar*first_partial_deriv(iDmolar, iP, iT);
|
||||
}
|
||||
|
||||
@@ -427,6 +427,9 @@ protected:
|
||||
else if (!target.compare("n-Hexane")){
|
||||
fluid.transport.viscosity_higher_order.type = CoolProp::ViscosityHigherOrderVariables::VISCOSITY_HIGHER_ORDER_HEXANE; return;
|
||||
}
|
||||
else if (!target.compare("n-Heptane")){
|
||||
fluid.transport.viscosity_higher_order.type = CoolProp::ViscosityHigherOrderVariables::VISCOSITY_HIGHER_ORDER_HEPTANE; return;
|
||||
}
|
||||
else if (!target.compare("Ethane")){
|
||||
fluid.transport.viscosity_higher_order.type = CoolProp::ViscosityHigherOrderVariables::VISCOSITY_HIGHER_ORDER_ETHANE; return;
|
||||
}
|
||||
|
||||
@@ -189,6 +189,8 @@ long double HelmholtzEOSMixtureBackend::calc_viscosity_background(long double et
|
||||
delta_eta_h = TransportRoutines::viscosity_hydrogen_higher_order_hardcoded(*this); break;
|
||||
case ViscosityHigherOrderVariables::VISCOSITY_HIGHER_ORDER_HEXANE:
|
||||
delta_eta_h = TransportRoutines::viscosity_hexane_higher_order_hardcoded(*this); break;
|
||||
case ViscosityHigherOrderVariables::VISCOSITY_HIGHER_ORDER_HEPTANE:
|
||||
delta_eta_h = TransportRoutines::viscosity_heptane_higher_order_hardcoded(*this); break;
|
||||
case ViscosityHigherOrderVariables::VISCOSITY_HIGHER_ORDER_ETHANE:
|
||||
delta_eta_h = TransportRoutines::viscosity_ethane_higher_order_hardcoded(*this); break;
|
||||
default:
|
||||
|
||||
@@ -280,6 +280,7 @@ long double TransportRoutines::viscosity_hydrogen_higher_order_hardcoded(Helmhol
|
||||
|
||||
long double TransportRoutines::viscosity_hexane_higher_order_hardcoded(HelmholtzEOSMixtureBackend &HEOS)
|
||||
{
|
||||
|
||||
long double Tr = HEOS.T()/507.82, rhor = HEOS.keyed_output(CoolProp::iDmass)/233.182;
|
||||
|
||||
// Output is in Pa-s
|
||||
@@ -287,6 +288,16 @@ long double TransportRoutines::viscosity_hexane_higher_order_hardcoded(Helmholtz
|
||||
return pow(rhor,static_cast<long double>(2.0/3.0))*sqrt(Tr)*(c[0]/Tr+c[1]/(c[2]+Tr+c[3]*rhor*rhor)+c[4]*(1+rhor)/(c[5]+c[6]*Tr+c[7]*rhor+rhor*rhor+c[8]*rhor*Tr));
|
||||
}
|
||||
|
||||
long double TransportRoutines::viscosity_heptane_higher_order_hardcoded(HelmholtzEOSMixtureBackend &HEOS)
|
||||
{
|
||||
/// From Michailidou-JPCRD-2014-Heptane
|
||||
long double Tr = HEOS.T()/540.13, rhor = HEOS.rhomass()/232;
|
||||
|
||||
// Output is in Pa-s
|
||||
double c[] = {0, 22.15000/1e6, -15.00870/1e6, 3.71791/1e6, 77.72818/1e6, 9.73449, 9.51900, -6.34076, -2.51909};
|
||||
return pow(rhor,2.0L/3.0L)*sqrt(Tr)*(c[1]*rhor+c[2]*pow(rhor,2)+c[3]*pow(rhor,3)+c[4]*rhor/(c[5]+c[6]*Tr+c[7]*rhor+rhor*rhor+c[8]*rhor*Tr));
|
||||
}
|
||||
|
||||
long double TransportRoutines::viscosity_higher_order_friction_theory(HelmholtzEOSMixtureBackend &HEOS)
|
||||
{
|
||||
if (HEOS.is_pure_or_pseudopure)
|
||||
|
||||
@@ -20,7 +20,7 @@ public:
|
||||
with \f$T^* = \frac{T}{\varepsilon/k}\f$ and \f$\sigma\f$ in nm, M is in kg/kmol. Yields viscosity in Pa-s.
|
||||
*/
|
||||
static long double viscosity_dilute_kinetic_theory(HelmholtzEOSMixtureBackend &HEOS);
|
||||
|
||||
|
||||
/**
|
||||
\brief The dilute gas viscosity term that is based on collision integral or effective cross section
|
||||
|
||||
@@ -34,7 +34,7 @@ public:
|
||||
*/
|
||||
static long double viscosity_dilute_collision_integral(HelmholtzEOSMixtureBackend &HEOS);
|
||||
|
||||
/**
|
||||
/**
|
||||
\brief A dilute gas viscosity term formed of summation of power terms
|
||||
|
||||
\f[
|
||||
@@ -46,7 +46,7 @@ public:
|
||||
|
||||
static long double viscosity_dilute_collision_integral_powers_of_T(HelmholtzEOSMixtureBackend &HEOS);
|
||||
|
||||
/**
|
||||
/**
|
||||
\brief The initial density dependence term \f$B_{\eta}\f$ from Rainwater-Friend theory
|
||||
|
||||
The total contribution from this term is given by
|
||||
@@ -68,17 +68,17 @@ public:
|
||||
*/
|
||||
static long double viscosity_initial_density_dependence_Rainwater_Friend(HelmholtzEOSMixtureBackend &HEOS);
|
||||
|
||||
/**
|
||||
/**
|
||||
\brief The modified Batschinski-Hildebrand contribution to the viscosity
|
||||
|
||||
\f[
|
||||
\Delta\eta = \displaystyle\sum_{i}a_{i}\delta^{d1_i}\tau^{t1_j}+\left(\displaystyle\sum_{i}f_i\delta^{d2_i}\tau^{t2_i}\right)\left(\frac{1}{\delta_0(\tau)-\delta}-\frac{1}{\delta_0(\tau)}\right)
|
||||
\f]
|
||||
where \f$\tau = T_c/T\f$ and \f$\delta = \rho/\rho_c\f$
|
||||
where \f$\tau = T_c/T\f$ and \f$\delta = \rho/\rho_c\f$
|
||||
\f[
|
||||
\delta_0(\tau) = \displaystyle\frac{\displaystyle\sum_{i}g_i\tau^{h_i}}{\displaystyle\sum_{i}p_i\tau^{q_i}}
|
||||
\f]
|
||||
The more general form of \f$\delta_0(\tau)\f$ is selected in order to be able to handle all the forms in the literature
|
||||
The more general form of \f$\delta_0(\tau)\f$ is selected in order to be able to handle all the forms in the literature
|
||||
*/
|
||||
static long double viscosity_higher_order_modified_Batschinski_Hildebrand(HelmholtzEOSMixtureBackend &HEOS);
|
||||
|
||||
@@ -91,6 +91,7 @@ public:
|
||||
static long double viscosity_ethane_higher_order_hardcoded(HelmholtzEOSMixtureBackend &HEOS);
|
||||
static long double viscosity_hydrogen_higher_order_hardcoded(HelmholtzEOSMixtureBackend &HEOS);
|
||||
static long double viscosity_hexane_higher_order_hardcoded(HelmholtzEOSMixtureBackend &HEOS);
|
||||
static long double viscosity_heptane_higher_order_hardcoded(HelmholtzEOSMixtureBackend &HEOS);
|
||||
static long double viscosity_higher_order_friction_theory(HelmholtzEOSMixtureBackend &HEOS);
|
||||
|
||||
/**
|
||||
@@ -110,7 +111,7 @@ public:
|
||||
\Delta\lambda(\rho,T) = \displaystyle\sum_iA_i\tau^{t,i}\delta^{d_i}
|
||||
\f]
|
||||
|
||||
As used by Assael, Perkins, Huber, etc., the residual term is given by
|
||||
As used by Assael, Perkins, Huber, etc., the residual term is given by
|
||||
\f[
|
||||
\Delta\lambda(\rho,T) = \displaystyle\sum_i(B_{1,i}+B_{2,i}(T/T_c))(\rho/\rho_c)^i
|
||||
\f]
|
||||
@@ -135,9 +136,9 @@ public:
|
||||
\f[
|
||||
\zeta = \zeta_0\left(\frac{p_c\rho}{\Gamma\rho_c^2}\right)^{\nu/\gamma}\left[\left.\frac{\partial \rho(T,\rho)}{\partial p} \right|_{T}- \frac{T_R}{T}\left.\frac{\partial \rho(T_R,\rho)}{\partial p} \right|_{T} \right]^{\nu/\gamma},
|
||||
\f]
|
||||
where \f$\lambda^{(c)}\f$ is in W\f$\cdot\f$m\f$^{-1}\f$\f$\cdot\f$K\f$^{-1}\f$, \f$\zeta\f$ is in m,
|
||||
\f$c_p\f$ and \f$c_v\f$ are in J\f$\cdot\f$kg\f$^{-1}\cdot\f$K\f$^{-1}\f$, \f$p\f$ and \f$p_c\f$ are in Pa,
|
||||
\f$\rho\f$ and \f$\rho_c\f$ are in mol\f$\cdot\f$m\f$^{-3}\f$, \f$\eta\f$ is the viscosity in Pa\f$\cdot\f$s,
|
||||
where \f$\lambda^{(c)}\f$ is in W\f$\cdot\f$m\f$^{-1}\f$\f$\cdot\f$K\f$^{-1}\f$, \f$\zeta\f$ is in m,
|
||||
\f$c_p\f$ and \f$c_v\f$ are in J\f$\cdot\f$kg\f$^{-1}\cdot\f$K\f$^{-1}\f$, \f$p\f$ and \f$p_c\f$ are in Pa,
|
||||
\f$\rho\f$ and \f$\rho_c\f$ are in mol\f$\cdot\f$m\f$^{-3}\f$, \f$\eta\f$ is the viscosity in Pa\f$\cdot\f$s,
|
||||
and the remaining parameters are defined in the following tables.
|
||||
|
||||
It should be noted that some authors use slightly different values for the "universal" constants
|
||||
@@ -145,9 +146,9 @@ public:
|
||||
Coefficients for use in the simplified Olchowy-Sengers critical term
|
||||
Parameter | Variable | Value
|
||||
--------- | -------- | ------
|
||||
Boltzmann constant | \f$k\f$ | \f$1.3806488\times 10^{-23}\f$ J\f$\cdot\f$K\f$^{-1}\f$
|
||||
Universal amplitude | \f$R_D\f$ | 1.03
|
||||
Critical exponent | \f$\nu\f$ | 0.63
|
||||
Boltzmann constant | \f$k\f$ | \f$1.3806488\times 10^{-23}\f$ J\f$\cdot\f$K\f$^{-1}\f$
|
||||
Universal amplitude | \f$R_D\f$ | 1.03
|
||||
Critical exponent | \f$\nu\f$ | 0.63
|
||||
Critical exponent | \f$\gamma\f$ | 1.239
|
||||
Reference temperature | \f$T_R\f$ | 1.5\f$T_c\f$
|
||||
|
||||
@@ -182,7 +183,7 @@ public:
|
||||
|
||||
Bell, I. H.; Wronski, J.; Quoilin, S. & Lemort, V. (2014), Pure and Pseudo-pure Fluid Thermophysical Property Evaluation and the Open-Source Thermophysical Property Library CoolProp, Industrial & Engineering Chemistry Research, 53, (6), 2498-2508
|
||||
|
||||
which is originally based on the methods presented in
|
||||
which is originally based on the methods presented in
|
||||
|
||||
Huber, M. L., Laesecke, A. and Perkins, R. A., (2003), Model for the Viscosity and Thermal Conductivity of Refrigerants, Including a New Correlation for the Viscosity of R134a, Industrial & Engineering Chemistry Research, v. 42, pp. 3163-3178
|
||||
|
||||
@@ -200,4 +201,4 @@ public:
|
||||
}; /* class TransportRoutines */
|
||||
|
||||
}; /* namespace CoolProp */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -181,6 +181,7 @@ static char default_reference_state[] = "DEF";
|
||||
SATPdll_POINTER SATPdll;
|
||||
SATSdll_POINTER SATSdll;
|
||||
SATTdll_POINTER SATTdll;
|
||||
SATSPLNdll_POINTER SATSPLNdll;
|
||||
SETAGAdll_POINTER SETAGAdll;
|
||||
SETKTVdll_POINTER SETKTVdll;
|
||||
SETMIXdll_POINTER SETMIXdll;
|
||||
@@ -307,6 +308,7 @@ double setFunctionPointers()
|
||||
SATPdll = (SATPdll_POINTER) getFunctionPointer((char *)SATPdll_NAME);
|
||||
SATSdll = (SATSdll_POINTER) getFunctionPointer((char *)SATSdll_NAME);
|
||||
SATTdll = (SATTdll_POINTER) getFunctionPointer((char *)SATTdll_NAME);
|
||||
SATSPLNdll = (SATSPLNdll_POINTER) getFunctionPointer((char *)SATSPLNdll_NAME);
|
||||
SETAGAdll = (SETAGAdll_POINTER) getFunctionPointer((char *)SETAGAdll_NAME);
|
||||
SETKTVdll = (SETKTVdll_POINTER) getFunctionPointer((char *)SETKTVdll_NAME);
|
||||
SETMIXdll = (SETMIXdll_POINTER) getFunctionPointer((char *)SETMIXdll_NAME);
|
||||
@@ -550,7 +552,8 @@ void REFPROPMixtureBackend::set_REFPROP_fluids(const std::vector<std::string> &f
|
||||
}
|
||||
else if (ierr > 0) // Error
|
||||
{
|
||||
if (k==0) continue;
|
||||
if (k==0 && N > 1)
|
||||
continue; // Allow us to use PPF if a pure fluid
|
||||
else
|
||||
throw ValueError(format("%s",herr));
|
||||
}
|
||||
@@ -603,11 +606,6 @@ long double REFPROPMixtureBackend::calc_melt_p_T(long double T)
|
||||
long ierr;
|
||||
char herr[255];
|
||||
|
||||
if (T > calc_melt_Tmax())
|
||||
{
|
||||
throw ValueError(format("Melting temperature [%g] is out of range",T));
|
||||
}
|
||||
|
||||
MELTTdll(&_T, &(mole_fractions[0]),
|
||||
&p_kPa,
|
||||
&ierr,herr,errormessagelength); // Error message
|
||||
@@ -672,6 +670,15 @@ long double REFPROPMixtureBackend::calc_fugacity_coefficient(int i)
|
||||
return static_cast<long double>(fug_cof[i]);
|
||||
}
|
||||
|
||||
void REFPROPMixtureBackend::calc_phase_envelope(const std::string &type)
|
||||
{
|
||||
long ierr;
|
||||
char herr[255];
|
||||
SATSPLNdll(&(mole_fractions[0]), // Inputs
|
||||
&ierr, herr, errormessagelength); // Error message
|
||||
if (ierr > 0) { throw ValueError(format("%s",herr).c_str()); }
|
||||
}
|
||||
|
||||
void REFPROPMixtureBackend::update(long input_pair, double value1, double value2)
|
||||
{
|
||||
double rho_mol_L=_HUGE, rhoLmol_L=_HUGE, rhoVmol_L=_HUGE,
|
||||
|
||||
@@ -24,7 +24,7 @@ protected:
|
||||
std::vector<double> mole_fractions_liq, mole_fractions_vap;
|
||||
public:
|
||||
REFPROPMixtureBackend(){};
|
||||
|
||||
|
||||
/// The instantiator
|
||||
/// @param fluid_names The vector of strings of the fluid components, without file ending
|
||||
REFPROPMixtureBackend(const std::vector<std::string>& fluid_names);
|
||||
@@ -34,10 +34,10 @@ public:
|
||||
bool using_mole_fractions(){return true;}
|
||||
|
||||
/// Updating function for REFPROP
|
||||
/**
|
||||
/**
|
||||
In this function we take a pair of thermodynamic states, those defined in the input_pairs
|
||||
enumeration and update all the internal variables that we can. REFPROP calculates
|
||||
a lot of other state variables each time you use a flash routine so we cache all the
|
||||
a lot of other state variables each time you use a flash routine so we cache all the
|
||||
outputs that we can, which saves on computational time.
|
||||
|
||||
@param input_pair Integer key from CoolProp::input_pairs to the two inputs that will be passed to the function
|
||||
@@ -59,17 +59,19 @@ public:
|
||||
void set_REFPROP_fluids(const std::vector<std::string> &fluid_names);
|
||||
|
||||
/// Set the mole fractions
|
||||
/**
|
||||
/**
|
||||
@param mole_fractions The vector of mole fractions of the components
|
||||
*/
|
||||
void set_mole_fractions(const std::vector<long double> &mole_fractions);
|
||||
|
||||
|
||||
/// Set the mass fractions
|
||||
/**
|
||||
/**
|
||||
@param mass_fractions The vector of mass fractions of the components
|
||||
*/
|
||||
void set_mass_fractions(const std::vector<long double> &mass_fractions);
|
||||
|
||||
void calc_phase_envelope(const std::string &type);
|
||||
|
||||
/// Check if the mole fractions have been set, etc.
|
||||
void check_status();
|
||||
|
||||
@@ -81,7 +83,7 @@ public:
|
||||
long double calc_surface_tension(void);
|
||||
|
||||
long double calc_fugacity_coefficient(int i);
|
||||
|
||||
|
||||
long double calc_melt_p_T(long double T);
|
||||
long double calc_melt_T_p(long double p);
|
||||
long double calc_melt_rho_T(long double T);
|
||||
|
||||
@@ -95,6 +95,7 @@
|
||||
# define SATPdll SATPdll
|
||||
# define SATSdll SATSdll
|
||||
# define SATTdll SATTdll
|
||||
# define SATSPLNdll SATSPLNdll
|
||||
# define SETAGAdll SETAGAdll
|
||||
# define SETKTVdll SETKTVdll
|
||||
# define SETMIXdll SETMIXdll
|
||||
@@ -210,6 +211,7 @@
|
||||
# define SATPdll satpdll_
|
||||
# define SATSdll satsdll_
|
||||
# define SATTdll sattdll_
|
||||
# define SATSPLNdll satsplndll_
|
||||
# define SETAGAdll setagadll_
|
||||
# define SETKTVdll setktvdll_
|
||||
# define SETMIXdll setmixdll_
|
||||
@@ -316,6 +318,7 @@
|
||||
# define SATPdll satpdll_
|
||||
# define SATSdll satsdll_
|
||||
# define SATTdll sattdll_
|
||||
# define SATSPLNdll satsplndll_
|
||||
# define SETAGAdll setagadll_
|
||||
# define SETKTVdll setktvdll_
|
||||
# define SETMIXdll setmixdll_
|
||||
@@ -420,6 +423,7 @@
|
||||
# define SATPdll satpdll
|
||||
# define SATSdll satsdll
|
||||
# define SATTdll sattdll
|
||||
# define SATSPLNdll satsplndll
|
||||
# define SETAGAdll setagadll
|
||||
# define SETKTVdll setktvdll
|
||||
# define SETMIXdll setmixdll
|
||||
@@ -536,6 +540,7 @@
|
||||
#define SATPdll_NAME FUNCTION_NAME(SATPdll)
|
||||
#define SATSdll_NAME FUNCTION_NAME(SATSdll)
|
||||
#define SATTdll_NAME FUNCTION_NAME(SATTdll)
|
||||
#define SATSPLNdll_NAME FUNCTION_NAME(SATSPLNdll)
|
||||
#define SETAGAdll_NAME FUNCTION_NAME(SETAGAdll)
|
||||
#define SETKTVdll_NAME FUNCTION_NAME(SETKTVdll)
|
||||
#define SETMIXdll_NAME FUNCTION_NAME(SETMIXdll)
|
||||
@@ -649,6 +654,7 @@ extern "C" {
|
||||
typedef void (CALLCONV SATPdll_TYPE)(double *,double *,long *,double *,double *,double *,double *,double *,long *,char*,long );
|
||||
typedef void (CALLCONV SATSdll_TYPE)(double *,double *,long *,long *,long *,double *,double *,double *,long *,double *,double *,double *,long *,double *,double *,double *,long *,char*,long );
|
||||
typedef void (CALLCONV SATTdll_TYPE)(double *,double *,long *,double *,double *,double *,double *,double *,long *,char*,long );
|
||||
typedef void (CALLCONV SATSPLNdll_TYPE)(double *,long *,char*,long );
|
||||
typedef void (CALLCONV SETAGAdll_TYPE)(long *,char*,long );
|
||||
typedef void (CALLCONV SETKTVdll_TYPE)(long *,long *,char*,double *,char*,long *,char*,long ,long ,long );
|
||||
typedef void (CALLCONV SETMIXdll_TYPE)(char*,char*,char*,long *,char*,double *,long *,char*,long ,long ,long ,long ,long );
|
||||
@@ -857,6 +863,7 @@ extern "C" {
|
||||
typedef SATPdll_TYPE * SATPdll_POINTER;
|
||||
typedef SATSdll_TYPE * SATSdll_POINTER;
|
||||
typedef SATTdll_TYPE * SATTdll_POINTER;
|
||||
typedef SATSPLNdll_TYPE * SATSPLNdll_POINTER;
|
||||
typedef SETAGAdll_TYPE * SETAGAdll_POINTER;
|
||||
typedef SETKTVdll_TYPE * SETKTVdll_POINTER;
|
||||
typedef SETMIXdll_TYPE * SETMIXdll_POINTER;
|
||||
|
||||
@@ -108,6 +108,14 @@ vel("Hexane", "T", 250, "Dmass", 700, "V", 528.2e-6, 1e-3),
|
||||
vel("Hexane", "T", 400, "Dmass", 600, "V", 177.62e-6, 1e-3),
|
||||
vel("Hexane", "T", 550, "Dmass", 500, "V", 95.002e-6, 1e-3),
|
||||
|
||||
// From Assael, JPCRD, 2014
|
||||
vel("Heptane", "T", 250, "Dmass", 1e-14, "V", 4.9717e-6, 1e-3),
|
||||
vel("Heptane", "T", 400, "Dmass", 1e-14, "V", 7.8361e-6, 1e-3),
|
||||
vel("Heptane", "T", 550, "Dmass", 1e-14, "V", 10.7394e-6, 1e-3),
|
||||
vel("Heptane", "T", 250, "Dmass", 720, "V", 725.69e-6, 1e-3),
|
||||
vel("Heptane", "T", 400, "Dmass", 600, "V", 175.94e-6, 1e-3),
|
||||
vel("Heptane", "T", 550, "Dmass", 500, "V", 95.105e-6, 1e-3),
|
||||
|
||||
// From Fenghour, JPCRD, 1998
|
||||
vel("CO2", "T", 220, "Dmass", 2.440, "V", 11.06e-6, 1e-3),
|
||||
vel("CO2", "T", 300, "Dmass", 1.773, "V", 15.02e-6, 1e-3),
|
||||
@@ -263,10 +271,10 @@ vel("Hexane", "T", 400, "Dmass", 650, "L", 129.28e-3, 2e-4),
|
||||
vel("Hexane", "T", 510, "Dmass", 2, "L", 36.772e-3, 1e-4),
|
||||
|
||||
// From Assael, JPCRD, 2013
|
||||
//vel("Heptane", "T", 250, "Dmass", 720, "L", 137.09e-3, 1e-4),
|
||||
//vel("Heptane", "T", 400, "Dmass", 2, "L", 21.794e-3, 1e-4),
|
||||
//vel("Heptane", "T", 400, "Dmass", 650, "L", 120.75e-3, 1e-4),
|
||||
//vel("Heptane", "T", 535, "Dmass", 100, "L", 51.655e-3, 1e-4),
|
||||
vel("Heptane", "T", 250, "Dmass", 720, "L", 137.09e-3, 1e-4),
|
||||
vel("Heptane", "T", 400, "Dmass", 2, "L", 21.794e-3, 1e-4),
|
||||
vel("Heptane", "T", 400, "Dmass", 650, "L", 120.75e-3, 1e-4),
|
||||
vel("Heptane", "T", 535, "Dmass", 100, "L", 51.655e-3, 3e-3), // Relaxed tolerance because conductivity was fit using older viscosity correlation
|
||||
|
||||
// From Assael, JPCRD, 2013
|
||||
vel("Ethanol", "T", 300, "Dmass", 850, "L", 209.68e-3, 1e-4),
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
#include "HumidAirProp.h"
|
||||
#include "CoolPropTools.h"
|
||||
#include "mex.h" /*--This one is required*/
|
||||
#include <cstdio>
|
||||
#include <string>
|
||||
#include "float.h"
|
||||
|
||||
/* Prototype for the Props function to be called. Can't use the CoolProp.h header because there are a lot of
|
||||
c++ parts in the header that cannot be easily hidden when compiling */
|
||||
double HAProps(char *Output, char* Name1, double Prop1, char* Name2, double Prop2, char* Name3, double Prop3);
|
||||
|
||||
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
|
||||
extern "C" void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
|
||||
{
|
||||
int npol,Nel;
|
||||
int m,n,u,v,k,Output_len,Name1_len,Name2_len,Name3_len;
|
||||
@@ -21,27 +22,27 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
|
||||
|
||||
/* Get the output (it is a string) (+1 for the NULL terminator)*/
|
||||
Output_len=(mxGetM(prhs[0]) * mxGetN(prhs[0])) + 1;
|
||||
Output = mxCalloc(Output_len, sizeof(char));
|
||||
Output = (char*)mxCalloc(Output_len, sizeof(char));
|
||||
status = mxGetString(prhs[0], Output, Output_len);
|
||||
|
||||
/* Get the output (it is a string) (+1 for the NULL terminator)*/
|
||||
Name1_len=(mxGetM(prhs[1]) * mxGetN(prhs[1])) + 1;
|
||||
Name1 = mxCalloc(Name1_len, sizeof(char));
|
||||
Name1 = (char*)mxCalloc(Name1_len, sizeof(char));
|
||||
mxGetString(prhs[1], Name1, Name1_len);
|
||||
|
||||
Name2_len=(mxGetM(prhs[3]) * mxGetN(prhs[3])) + 1;
|
||||
Name2 = mxCalloc(Name2_len, sizeof(char));
|
||||
Name2 = (char*)mxCalloc(Name2_len, sizeof(char));
|
||||
mxGetString(prhs[3], Name2, Name2_len);
|
||||
|
||||
Name3_len=(mxGetM(prhs[5]) * mxGetN(prhs[5])) + 1;
|
||||
Name3 = mxCalloc(Name3_len, sizeof(char));
|
||||
Name3 = (char*)mxCalloc(Name3_len, sizeof(char));
|
||||
mxGetString(prhs[5], Name3, Name3_len);
|
||||
|
||||
Prop1 = mxGetScalar(prhs[2]);
|
||||
Prop2 = mxGetScalar(prhs[4]);
|
||||
Prop3 = mxGetScalar(prhs[6]);
|
||||
|
||||
x = HAProps(Output,Name1,Prop1,Name2,Prop2,Name3,Prop3);
|
||||
x = HumidAir::HAPropsSI(Output,Name1,Prop1,Name2,Prop2,Name3,Prop3);
|
||||
*mxGetPr(plhs[0])=x;
|
||||
}
|
||||
else
|
||||
1
wrappers/MATLAB/Matlabdef.def
Normal file
1
wrappers/MATLAB/Matlabdef.def
Normal file
@@ -0,0 +1 @@
|
||||
EXPORTS mexFunction
|
||||
@@ -1,23 +1,11 @@
|
||||
#include "CoolProp.h"
|
||||
#include "CoolPropTools.h"
|
||||
#include "mex.h" /*--This one is required*/
|
||||
|
||||
/* Prototype for the Props function to be called. Can't use the CoolProp.h header because there are a lot of
|
||||
c++ parts in the header that cannot be easily hidden when compiling */
|
||||
double PropsSI(char *Output, char *Name1, double Prop1, char *Name2, double Prop2, char * Ref);
|
||||
double Props1(char *Output, char * Ref);
|
||||
long get_global_param_string(char*, char*);
|
||||
long get_fluid_param_string(char *fluid, char *param, char * Output);
|
||||
long get_standard_unit_system(void);
|
||||
void set_standard_unit_system(long);
|
||||
#include "GlobalConstants.h"
|
||||
#include <cstdio>
|
||||
#include <string>
|
||||
#include "float.h"
|
||||
|
||||
bool ValidNumber(double x)
|
||||
{
|
||||
// Idea from http://www.johndcook.com/IEEE_exceptions_in_cpp.html
|
||||
return (x <= DBL_MAX && x >= -DBL_MAX);
|
||||
};
|
||||
|
||||
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
|
||||
extern "C" void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
|
||||
{
|
||||
int npol,Nel;
|
||||
int m,n,u,v,k,Output_len,Name1_len,Name2_len,Ref_len,Param_len;
|
||||
@@ -31,29 +19,19 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
|
||||
{
|
||||
/* Get the refrigerant (it is a string) (+1 for the NULL terminator)*/
|
||||
Ref_len=(mxGetM(prhs[0]) * mxGetN(prhs[0])) + 1;
|
||||
Ref = mxCalloc(Ref_len, sizeof(char));
|
||||
Ref = (char*)mxCalloc(Ref_len, sizeof(char));
|
||||
status = mxGetString(prhs[0], Ref, Ref_len);
|
||||
|
||||
/* Get the output (it is a string) (+1 for the NULL terminator)*/
|
||||
Output_len=(mxGetM(prhs[1]) * mxGetN(prhs[1])) + 1;
|
||||
Output = mxCalloc(Output_len, sizeof(char));
|
||||
Output = (char*)mxCalloc(Output_len, sizeof(char));
|
||||
status = mxGetString(prhs[1], Output, Output_len);
|
||||
|
||||
/* Try to shortcut to get the strings for the fluid */
|
||||
if (!strcmp(Output,"aliases") || !strcmp(Output,"CAS") || !strcmp(Output,"CAS_number") || !strcmp(Output,"ASHRAE34") || !strcmp(Output,"REFPROPName") || !strcmp(Output,"REFPROP_name") || !strcmp(Output,"TTSE_mode"))
|
||||
{
|
||||
get_fluid_param_string(Ref,Output,fluidslist);
|
||||
plhs[0] = mxCreateString(fluidslist);
|
||||
return;
|
||||
}
|
||||
else if (!strcmp(Output,"enable_TTSE"))
|
||||
{
|
||||
enable_TTSE_LUT(Ref);
|
||||
return;
|
||||
}
|
||||
else if (!strcmp(Output,"disable_TTSE"))
|
||||
{
|
||||
disable_TTSE_LUT(Ref);
|
||||
std::string fluidslist = CoolProp::get_fluid_param_string(Ref,Output);
|
||||
plhs[0] = mxCreateString(fluidslist.c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -61,9 +39,9 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
|
||||
|
||||
/* Create matrix for the return argument. */
|
||||
plhs[0] = mxCreateDoubleMatrix(1,1, mxREAL);
|
||||
|
||||
|
||||
/* Get the value*/
|
||||
val = Props1(Ref,Output);
|
||||
val = CoolProp::PropsSI(Ref,"T",0,"P",0,Output);
|
||||
/* If it is a good value, return it*/
|
||||
if (ValidNumber(val))
|
||||
{
|
||||
@@ -72,8 +50,8 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
|
||||
/* Otherwise there was an error, return the CoolProp error*/
|
||||
else
|
||||
{
|
||||
get_global_param_string("errstring",errstr);
|
||||
sprintf(errstr2,"CoolProp Error: %s",errstr);
|
||||
std::string errstr = CoolProp::get_global_param_string("errstring");
|
||||
sprintf(errstr2,"CoolProp Error: %s",errstr.c_str());
|
||||
mexErrMsgTxt(errstr2);
|
||||
}
|
||||
}
|
||||
@@ -84,26 +62,26 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
|
||||
|
||||
/* Get the refrigerant (it is a string) (+1 for the NULL terminator)*/
|
||||
Ref_len=(mxGetM(prhs[5]) * mxGetN(prhs[5])) + 1;
|
||||
Ref = mxCalloc(Ref_len, sizeof(char));
|
||||
Ref = (char*)mxCalloc(Ref_len, sizeof(char));
|
||||
mxGetString(prhs[5], Ref, Ref_len);
|
||||
|
||||
/* Get the output (it is a string) (+1 for the NULL terminator)*/
|
||||
Output_len=(mxGetM(prhs[0]) * mxGetN(prhs[0])) + 1;
|
||||
Output = mxCalloc(Output_len, sizeof(char));
|
||||
Output = (char*)mxCalloc(Output_len, sizeof(char));
|
||||
mxGetString(prhs[0], Output, Output_len);
|
||||
|
||||
Name1_len=(mxGetM(prhs[1]) * mxGetN(prhs[1])) + 1;
|
||||
Name1 = mxCalloc(Name1_len, sizeof(char));
|
||||
Name1 = (char*)mxCalloc(Name1_len, sizeof(char));
|
||||
mxGetString(prhs[1], Name1, Name1_len);
|
||||
|
||||
Name2_len=(mxGetM(prhs[3]) * mxGetN(prhs[3])) + 1;
|
||||
Name2 = mxCalloc(Name2_len, sizeof(char));
|
||||
Name2 = (char*)mxCalloc(Name2_len, sizeof(char));
|
||||
mxGetString(prhs[3], Name2, Name2_len);
|
||||
|
||||
Prop1 = mxGetScalar(prhs[2]);
|
||||
Prop2 = mxGetScalar(prhs[4]);
|
||||
|
||||
val = PropsSI(Output,Name1,Prop1,Name2,Prop2,Ref);
|
||||
val = CoolProp::PropsSI(Output,Name1,Prop1,Name2,Prop2,Ref);
|
||||
|
||||
/* If it is a good value, return it */
|
||||
if (ValidNumber(val))
|
||||
@@ -113,32 +91,32 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
|
||||
/* Otherwise there was an error, return the CoolProp error*/
|
||||
else
|
||||
{
|
||||
get_global_param_string("errstring",errstr);
|
||||
sprintf(errstr2,"CoolProp Error: %s",errstr);
|
||||
std::string errstr = CoolProp::get_global_param_string("errstring");
|
||||
sprintf(errstr2,"CoolProp Error: %s",errstr.c_str());
|
||||
mexErrMsgTxt(errstr2);
|
||||
}
|
||||
}
|
||||
else if (nrhs == 1 && mxIsChar (prhs[0]))
|
||||
{
|
||||
Ref_len=(mxGetM(prhs[0]) * mxGetN(prhs[0])) + 1;
|
||||
Ref = mxCalloc(Ref_len, sizeof(char));
|
||||
Ref = (char*)mxCalloc(Ref_len, sizeof(char));
|
||||
status = mxGetString(prhs[0], Ref, Ref_len);
|
||||
|
||||
std::string s;
|
||||
if (!strcmp(Ref,"FluidsList")){
|
||||
get_global_param_string("FluidsList",fluidslist);
|
||||
s = CoolProp::get_global_param_string("FluidsList");
|
||||
}
|
||||
else if (!strcmp(Ref,"version")){
|
||||
get_global_param_string("version",fluidslist);
|
||||
s = CoolProp::get_global_param_string("version");
|
||||
}
|
||||
else if (!strcmp(Ref,"gitrevision")){
|
||||
get_global_param_string("gitrevision", fluidslist);
|
||||
s = CoolProp::get_global_param_string("gitrevision");
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf(errstr2,"single input is invalid: %s",Ref);
|
||||
mexErrMsgTxt(errstr2);
|
||||
}
|
||||
plhs[0] = mxCreateString(fluidslist);
|
||||
plhs[0] = mxCreateString(s.c_str());
|
||||
return;
|
||||
}
|
||||
else
|
||||
@@ -19,6 +19,12 @@ cdef class AbstractState:
|
||||
cpdef double smolar(self)
|
||||
cpdef double cpmolar(self)
|
||||
cpdef double cvmolar(self)
|
||||
cpdef double rhomass(self)
|
||||
cpdef double hmass(self)
|
||||
cpdef double smass(self)
|
||||
cpdef double cpmass(self)
|
||||
cpdef double cvmass(self)
|
||||
cpdef double speed_sound(self)
|
||||
|
||||
|
||||
cpdef double keyed_output(self, long)
|
||||
@@ -13,7 +13,7 @@ cdef class AbstractState:
|
||||
del self.thisptr
|
||||
|
||||
cpdef update(self, long ipair, double Value1, double Value2):
|
||||
""" Update :cpapi:`AbstractState::update` """
|
||||
""" Update function - mirrors c++ function :cpapi:`AbstractState::update` """
|
||||
self.thisptr.update(ipair, Value1, Value2)
|
||||
|
||||
## ----------------------------------------
|
||||
@@ -25,30 +25,43 @@ cdef class AbstractState:
|
||||
return self.thisptr.keyed_output(iOutput)
|
||||
|
||||
cpdef double T(self) except *:
|
||||
""" Get the temperature in K - wrapper of c++ function :cpapi:`AbstractState::T` """
|
||||
return self.thisptr.T()
|
||||
cpdef double p(self) except *:
|
||||
""" Get the pressure in Pa - wrapper of c++ function :cpapi:`AbstractState::p` """
|
||||
return self.thisptr.p()
|
||||
cpdef double rhomolar(self) except *:
|
||||
""" Get the density in mol/m^3 - wrapper of c++ function :cpapi:`AbstractState::rhomolar` """
|
||||
return self.thisptr.rhomolar()
|
||||
# cpdef double rhomass(self) except *:
|
||||
# return self.thisptr.rhomass()
|
||||
cpdef double rhomass(self) except *:
|
||||
""" Get the density in kg/m^3 - wrapper of c++ function :cpapi:`AbstractState::rhomass` """
|
||||
return self.thisptr.rhomass()
|
||||
cpdef double hmolar(self) except *:
|
||||
""" Get the enthalpy in J/mol - wrapper of c++ function :cpapi:`AbstractState::hmolar` """
|
||||
return self.thisptr.hmolar()
|
||||
cpdef double smolar(self) except *:
|
||||
""" Get the entropy in J/mol/K - wrapper of c++ function :cpapi:`AbstractState::smolar` """
|
||||
return self.thisptr.smolar()
|
||||
cpdef double cpmolar(self) except *:
|
||||
""" Get the constant pressure specific heat in J/mol/K - wrapper of c++ function :cpapi:`AbstractState::cpmolar` """
|
||||
return self.thisptr.cpmolar()
|
||||
cpdef double cvmolar(self) except *:
|
||||
""" Get the constant volume specific heat in J/mol/K - wrapper of c++ function :cpapi:`AbstractState::cvmolar` """
|
||||
return self.thisptr.cvmolar()
|
||||
# cpdef double hmass(self) except *:
|
||||
# return self.thisptr.hmass()
|
||||
# cpdef double smass(self) except *:
|
||||
# return self.thisptr.smass()
|
||||
# cpdef double cpmass(self) except *:
|
||||
# return self.thisptr.cpmass()
|
||||
# cpdef double cvmass(self) except *:
|
||||
# return self.thisptr.cvmass()
|
||||
cpdef double hmass(self) except *:
|
||||
""" Get the enthalpy in J/kg - wrapper of c++ function :cpapi:`AbstractState::hmass` """
|
||||
return self.thisptr.hmass()
|
||||
cpdef double smass(self) except *:
|
||||
""" Get the entropy in J/kg/K - wrapper of c++ function :cpapi:`AbstractState::smass` """
|
||||
return self.thisptr.smass()
|
||||
cpdef double cpmass(self) except *:
|
||||
""" Get the constant pressure specific heat in J/kg/K - wrapper of c++ function :cpapi:`AbstractState::cpmass` """
|
||||
return self.thisptr.cpmass()
|
||||
cpdef double cvmass(self) except *:
|
||||
""" Get the constant volume specific heat in J/kg/K - wrapper of c++ function :cpapi:`AbstractState::cvmass` """
|
||||
return self.thisptr.cvmass()
|
||||
cpdef double speed_sound(self) except *:
|
||||
""" Get the speed of sound in m/s - wrapper of c++ function :cpapi:`AbstractState::speed_sound` """
|
||||
return self.thisptr.speed_sound()
|
||||
|
||||
|
||||
@@ -276,8 +276,8 @@ cdef dict paras = {iDmass : 'D',
|
||||
iCpmass : 'C',
|
||||
# iC0 : 'C0',
|
||||
iCvmass : 'O',
|
||||
iV : 'V',
|
||||
iL : 'L',
|
||||
iviscosity : 'V',
|
||||
iconductivity : 'L',
|
||||
iSmass : 'S',
|
||||
iUmass : 'U',
|
||||
# iDpdT : 'dpdT'
|
||||
|
||||
@@ -126,7 +126,7 @@ if __name__=='__main__':
|
||||
url='http://coolprop.sourceforge.net',
|
||||
description = """Open-source thermodynamic and transport properties database""",
|
||||
packages = ['CoolProp5','CoolProp5.Plots','CoolProp5.tests','CoolProp5.GUI'],
|
||||
ext_modules = [CoolProp_module, constants_module],
|
||||
ext_modules = [CoolProp_module, AbstractState_module, constants_module],
|
||||
package_dir = {'CoolProp5':'CoolProp5',},
|
||||
#package_data = {'CoolProp5':['State.pxd','CoolProp.pxd','constants_header.pxd','include/*.h','include/rapidjson/*.h','include/rapidjson/internal/*.h','CoolPropBibTeXLibrary.bib']},
|
||||
cmdclass={'build_ext': build_ext},
|
||||
@@ -144,7 +144,7 @@ if __name__=='__main__':
|
||||
|
||||
sys.path.pop(0)
|
||||
import CoolProp5.CoolProp as CP5
|
||||
print(CP5.PropsSI('P','T',300,'D',1e-10,'Water'))
|
||||
print(CP5.PropsSI('L','T',300,'D',1e-10,'Water'))
|
||||
|
||||
# #Clean up the include folder
|
||||
# shutil.rmtree(os.path.join('CoolProp','include'), ignore_errors = True)
|
||||
|
||||
Reference in New Issue
Block a user