From b528c610385bae686c8da148295a24b73551e41e Mon Sep 17 00:00:00 2001 From: Jorrit Wronski Date: Sun, 11 Jan 2015 21:22:47 +0100 Subject: [PATCH 01/14] Added correct viscosity reference fro pure water --- Web/fluid_properties/Incompressibles.bib | 15 ++++++++++++++- dev/incompressible_liquids/CPIncomp/PureFluids.py | 2 +- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Web/fluid_properties/Incompressibles.bib b/Web/fluid_properties/Incompressibles.bib index cf9b362f..f9bdf761 100644 --- a/Web/fluid_properties/Incompressibles.bib +++ b/Web/fluid_properties/Incompressibles.bib @@ -27,6 +27,19 @@ Timestamp = {2014.09.17} } +@Article{Huber2009, + Title = {{New International Formulation for the Viscosity of H2O}}, + Author = {M.L. Huber and R.A. Perkins and A. Laesecke and D.G. Friend and J.V. Sengers and M.J Assael and I.M. Metaxa and E. Vogel and R. Mare{\v s} and K. Miyagawa}, + Journal = {J. Phys. Chem. Ref. Data}, + Year = {2009}, + Number = {2}, + Pages = {101-125}, + Volume = {38}, + + Owner = {Belli}, + Timestamp = {2013.04.08} +} + @Manual{Jones2001, Title = {{SciPy}: Open source scientific tools for {Python}}, Author = {Eric Jones and Travis Oliphant and Pearu Peterson and others}, @@ -56,7 +69,7 @@ Pages = {421--426}, Volume = {128}, - Doi = {0.1115/1.2175090}, + Doi = {10.1115/1.2175090}, Owner = {jowr}, Timestamp = {2014.12.16} } diff --git a/dev/incompressible_liquids/CPIncomp/PureFluids.py b/dev/incompressible_liquids/CPIncomp/PureFluids.py index 0946bdc0..b53a270d 100644 --- a/dev/incompressible_liquids/CPIncomp/PureFluids.py +++ b/dev/incompressible_liquids/CPIncomp/PureFluids.py @@ -585,7 +585,7 @@ class Water(PureData): self.TminPsat = np.min(self.temperature.data[~np.isnan(self.saturation_pressure.data)]) self.name = "Water" self.description = "Fit of the subcooled region of the full EOS from 1 bar to 100 bar" - self.reference = "Wagner2002, Transport properties from Huber et. al (2 papers)" + self.reference = "Wagner2002, Huber2009" self.reshapeAll() # Specific heat needs special coefficiencts # self.specific_heat.coeffs = np.zeros((5,7)) From d34881b28ca69630c8e9ef3464378b7f6336e1a2 Mon Sep 17 00:00:00 2001 From: Ian Bell Date: Sun, 11 Jan 2015 20:20:05 -0700 Subject: [PATCH 02/14] Disable testing with MATLAB Signed-off-by: Ian Bell --- CMakeLists.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f4cd18ab..8074af5d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -708,13 +708,13 @@ if (COOLPROP_MATLAB_SWIG_MODULE) install (FILES ${CMAKE_CURRENT_BINARY_DIR}/+CoolProp.7z DESTINATION ${CMAKE_INSTALL_PREFIX}/MATLAB) install (FILES ${CMAKE_CURRENT_BINARY_DIR}/SwigRef.m DESTINATION ${CMAKE_INSTALL_PREFIX}/MATLAB) install (TARGETS CoolPropMATLAB_wrap DESTINATION ${CMAKE_INSTALL_PREFIX}/MATLAB) - enable_testing() - add_custom_command(TARGET CoolPropMATLAB_wrap - POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/wrappers/MATLAB/test.m ${CMAKE_CURRENT_BINARY_DIR}/.) - add_test(NAME MATLABtest - COMMAND $ENV{MATLAB_ROOT}/bin/matlab -r test -nojvm -nodesktop -nosplash - WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") + #enable_testing() + #add_custom_command(TARGET CoolPropMATLAB_wrap + # POST_BUILD + # COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/wrappers/MATLAB/test.m ${CMAKE_CURRENT_BINARY_DIR}/.) + #add_test(NAME MATLABtest + # COMMAND $ENV{MATLAB_ROOT}/bin/matlab -r test -nojvm -nodesktop -nosplash + # WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") endif() if (COOLPROP_MATLAB_MODULE) From a63d20e843ed8ca71c9505b23635baf138fd94dc Mon Sep 17 00:00:00 2001 From: Ian Bell Date: Sun, 11 Jan 2015 20:34:42 -0700 Subject: [PATCH 03/14] Make the bin/MicrosoftExcel folder for Excel Signed-off-by: Ian Bell --- dev/buildbot/master/master.cfg | 1 + 1 file changed, 1 insertion(+) diff --git a/dev/buildbot/master/master.cfg b/dev/buildbot/master/master.cfg index 91917f0d..11e805b0 100644 --- a/dev/buildbot/master/master.cfg +++ b/dev/buildbot/master/master.cfg @@ -500,6 +500,7 @@ def excel_slave(gitMode = 'incremental'): # Create the factory to add the actions to factory = getBaseFactory(gitMode=gitMode) # + factory.addStep(MakeDirectory(dir='build/bin/MicrosoftExcel', haltOnFailure = True)) factory.addStep(MakeDirectory(dir=working_folder+'/32bitDLL', haltOnFailure = True)) factory.addStep(MakeDirectory(dir=working_folder+'/64bitDLL', haltOnFailure = True)) factory.addStep(RemoveDirectory(dir="build/install_root", haltOnFailure = True)) From b2473d80c8bc8e8e912cbf1863c62e12a1dab1d7 Mon Sep 17 00:00:00 2001 From: Jorrit Wronski Date: Mon, 12 Jan 2015 08:13:33 +0100 Subject: [PATCH 04/14] Somehow the SFUSER escaped from the release script. --- dev/scripts/release.bsh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dev/scripts/release.bsh b/dev/scripts/release.bsh index c0ccd305..cf9ea12e 100755 --- a/dev/scripts/release.bsh +++ b/dev/scripts/release.bsh @@ -52,6 +52,8 @@ else exit 1 fi # +# +SFUSER="jorritw" # ibell or jorritw BASEDIR="$HOME/buildbot/server-master/public_html" REPODIR="$HOME/src/CoolPropFull.git" TMPSDIR="$HOME/src/CoolProp.sources" From b4339e89f1da2619b77b007bc56d985f10bf30c0 Mon Sep 17 00:00:00 2001 From: Jorrit Wronski Date: Mon, 12 Jan 2015 08:45:52 +0100 Subject: [PATCH 05/14] Fixed binary folder handling --- dev/scripts/release.bsh | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/dev/scripts/release.bsh b/dev/scripts/release.bsh index cf9ea12e..b5bac8c1 100755 --- a/dev/scripts/release.bsh +++ b/dev/scripts/release.bsh @@ -5,6 +5,7 @@ # # Things to remember when you make a new release: # +# * Force a new build on all buildbots from the release branch # * Run the script and check the logs # * Make a tag in your git software # * Update the default download on sourceforge to point to the new sources @@ -58,18 +59,19 @@ BASEDIR="$HOME/buildbot/server-master/public_html" REPODIR="$HOME/src/CoolPropFull.git" TMPSDIR="$HOME/src/CoolProp.sources" SRCFOLDER="$BASEDIR/$BINFOLDER/source" +DOCFOLDER="$BASEDIR/$BINFOLDER/sphinx" +DOC4FILES="4.2.5/coolpropv425docs.zip" +DOC4FOLDER="$DOCFOLDER/v4" +# # if [ "$2" == "release" ]; then DRYRUN=false else DRYRUN=true fi -DOCFOLDER="$BASEDIR/$BINFOLDER/sphinx" -DOC4FILES="4.2.5/coolpropv425docs.zip" -DOC4FOLDER="$DOCFOLDER/v4" - echo "DRYRUN = $DRYRUN" - +# +# pushd ${BASEDIR} # Change the folder if [ "$DRYRUN" != "false" ]; then printMessage "Dry run detected" @@ -99,7 +101,7 @@ else cd $(basename $TMPSDIR) popd rm -f "$BINFOLDER/README.rst.txt" - if [ "$CPVERSION" = "nightly" ]; then + if [ "$CPVERSION" == "nightly" ]; then RSYNC_OPTS="-a --no-perms -z --stats --delete" rm -rf "$BINFOLDER/docs" CPVERSION="$CPVERSION"/ #$(date +%F) @@ -131,9 +133,14 @@ if [ ${CPVERSION:0:7} != "nightly" ]; then printMessage "Publishing the docs on SourceForge" rsync $RSYNC_DRY_RUN $RSYNC_OPTS "$DOCFOLDER/" frs.sf.net-$SFUSER:/home/project-web/coolprop/htdocs fi +# +if [ "$BINFOLDER" == "release" ] && [ "$DRYRUN" != "false" ]; then + printMessage "Removing release directory" + rm -rf "$BINFOLDER/*" +else + printMessage "Not removing directory with binaries, either nightly or dryrun activated." +fi # Change back to where we came from popd -printMessage "Removing release directory" -rm -rf $BINFOLDER printMessage "All done, goodbye." exit 0 From fb4c75ea48200020a1c51316590e0fe4cdb07216 Mon Sep 17 00:00:00 2001 From: Jorrit Wronski Date: Mon, 12 Jan 2015 08:48:22 +0100 Subject: [PATCH 06/14] Added water reference to JSON file. --- dev/incompressible_liquids/json/Water.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/incompressible_liquids/json/Water.json b/dev/incompressible_liquids/json/Water.json index e5d0a49a..3c1ec516 100644 --- a/dev/incompressible_liquids/json/Water.json +++ b/dev/incompressible_liquids/json/Water.json @@ -51,7 +51,7 @@ "type": "notdefined" }, "name": "Water", - "reference": "Wagner2002, Transport properties from Huber et. al (2 papers)", + "reference": "Wagner2002, Huber2009", "saturation_pressure": { "coeffs": [ -3.863635e+03, From 038b0100bf26f6fc2dfc131e1d86b148245be3cf Mon Sep 17 00:00:00 2001 From: Jorrit Wronski Date: Mon, 12 Jan 2015 08:52:59 +0100 Subject: [PATCH 07/14] One more typo in the release script --- dev/scripts/release.bsh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/dev/scripts/release.bsh b/dev/scripts/release.bsh index b5bac8c1..d51209c6 100755 --- a/dev/scripts/release.bsh +++ b/dev/scripts/release.bsh @@ -134,11 +134,10 @@ if [ ${CPVERSION:0:7} != "nightly" ]; then rsync $RSYNC_DRY_RUN $RSYNC_OPTS "$DOCFOLDER/" frs.sf.net-$SFUSER:/home/project-web/coolprop/htdocs fi # -if [ "$BINFOLDER" == "release" ] && [ "$DRYRUN" != "false" ]; then +if [[ ("$BINFOLDER" == "release") && ("$DRYRUN" == "false") ]]; then printMessage "Removing release directory" - rm -rf "$BINFOLDER/*" -else - printMessage "Not removing directory with binaries, either nightly or dryrun activated." + rm -rf "$BINFOLDER" + mkdir -p "$BINFOLDER" fi # Change back to where we came from popd From 36188fe37edcf9cd86619a2fca80ee4fc0cf73fc Mon Sep 17 00:00:00 2001 From: Ian Bell Date: Mon, 12 Jan 2015 18:22:51 -0700 Subject: [PATCH 08/14] Bump revision to 5.0.7dev Signed-off-by: Ian Bell --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8074af5d..af9173a6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,7 +29,7 @@ project(${project_name}) # Project version set (COOLPROP_VERSION_MAJOR 5) set (COOLPROP_VERSION_MINOR 0) -set (COOLPROP_VERSION_PATCH 6) +set (COOLPROP_VERSION_PATCH 7dev) set (COOLPROP_VERSION ${COOLPROP_VERSION_MAJOR}.${COOLPROP_VERSION_MINOR}.${COOLPROP_VERSION_PATCH}) ####################################### From 658f467e263d0ced2c6a47da270674cc4cd2bb60 Mon Sep 17 00:00:00 2001 From: Ian Bell Date: Mon, 12 Jan 2015 19:20:17 -0700 Subject: [PATCH 09/14] More debug for fluid loading Signed-off-by: Ian Bell --- src/Backends/REFPROP/REFPROPMixtureBackend.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Backends/REFPROP/REFPROPMixtureBackend.cpp b/src/Backends/REFPROP/REFPROPMixtureBackend.cpp index f5354b9b..473ff319 100644 --- a/src/Backends/REFPROP/REFPROPMixtureBackend.cpp +++ b/src/Backends/REFPROP/REFPROPMixtureBackend.cpp @@ -432,10 +432,12 @@ void REFPROPMixtureBackend::set_REFPROP_fluids(const std::vector &f mole_fractions_liq.resize(N); mole_fractions_vap.resize(N); LoadedREFPROPRef = components_joined_raw; + if (get_debug_level() > 5){ std::cout << format("%s:%d: Successfully loaded REFPROP fluid: %s\n",__FILE__,__LINE__, components_joined.c_str()); } if (dbg_refprop) std::cout << format("%s:%d: Successfully loaded REFPROP fluid: %s\n",__FILE__,__LINE__, components_joined.c_str()); return; } else if (k < number_of_endings-1){ // Keep going + if (get_debug_level() > 5){std::cout << "REFPROP error/warning:" << herr << std::endl;} continue; } else From 6d004a90a82016ffb7cb99a5aad3744c1f23ddd1 Mon Sep 17 00:00:00 2001 From: Ian Bell Date: Mon, 12 Jan 2015 19:35:54 -0700 Subject: [PATCH 10/14] Fixed bug in REFPROP debug output Signed-off-by: Ian Bell --- src/Backends/REFPROP/REFPROPMixtureBackend.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Backends/REFPROP/REFPROPMixtureBackend.cpp b/src/Backends/REFPROP/REFPROPMixtureBackend.cpp index 473ff319..99f8f4ce 100644 --- a/src/Backends/REFPROP/REFPROPMixtureBackend.cpp +++ b/src/Backends/REFPROP/REFPROPMixtureBackend.cpp @@ -51,6 +51,7 @@ enum DLLNameManglingStyle{ NO_NAME_MANGLING = 0, LOWERCASE_NAME_MANGLING, LOWERC #include "REFPROPMixtureBackend.h" #include "Exceptions.h" #include "Configuration.h" +#include "CoolProp.h" #include #include @@ -432,17 +433,17 @@ void REFPROPMixtureBackend::set_REFPROP_fluids(const std::vector &f mole_fractions_liq.resize(N); mole_fractions_vap.resize(N); LoadedREFPROPRef = components_joined_raw; - if (get_debug_level() > 5){ std::cout << format("%s:%d: Successfully loaded REFPROP fluid: %s\n",__FILE__,__LINE__, components_joined.c_str()); } + if (CoolProp::get_debug_level() > 5){ std::cout << format("%s:%d: Successfully loaded REFPROP fluid: %s\n",__FILE__,__LINE__, components_joined.c_str()); } if (dbg_refprop) std::cout << format("%s:%d: Successfully loaded REFPROP fluid: %s\n",__FILE__,__LINE__, components_joined.c_str()); return; } else if (k < number_of_endings-1){ // Keep going - if (get_debug_level() > 5){std::cout << "REFPROP error/warning:" << herr << std::endl;} + if (CoolProp::get_debug_level() > 5){std::cout << "REFPROP error/warning:" << herr << std::endl;} continue; } else { - throw ValueError(format("Could not load these fluids: %s; error: %s", components_joined_raw.c_str(), herr)); + throw ValueError(format("Could not load these fluids: %s", components_joined_raw.c_str())); } } } From d1ca808ca7170c26693f74402c98b60263e6b752 Mon Sep 17 00:00:00 2001 From: Ian Bell Date: Tue, 13 Jan 2015 04:55:40 +0100 Subject: [PATCH 11/14] Fixed weird bug with long<0 in REFPROP wrapper; Closes #401 --- .../REFPROP/REFPROPMixtureBackend.cpp | 57 ++++++++++--------- 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/src/Backends/REFPROP/REFPROPMixtureBackend.cpp b/src/Backends/REFPROP/REFPROPMixtureBackend.cpp index 99f8f4ce..5ee4d66e 100644 --- a/src/Backends/REFPROP/REFPROPMixtureBackend.cpp +++ b/src/Backends/REFPROP/REFPROPMixtureBackend.cpp @@ -426,7 +426,7 @@ void REFPROPMixtureBackend::set_REFPROP_fluids(const std::vector &f errormessagelength // Length of error message ); - if (ierr <= 0) // Success (or a warning, which is silently squelched for now) + if (static_cast(ierr) <= 0) // Success (or a warning, which is silently squelched for now) { this->Ncomp = N; mole_fractions.resize(N); @@ -438,11 +438,12 @@ void REFPROPMixtureBackend::set_REFPROP_fluids(const std::vector &f return; } else if (k < number_of_endings-1){ // Keep going - if (CoolProp::get_debug_level() > 5){std::cout << "REFPROP error/warning:" << herr << std::endl;} + if (CoolProp::get_debug_level() > 5){std::cout << format("REFPROP error/warning [ierr: %d]: %s",ierr, herr) << std::endl;} continue; } else { + if (CoolProp::get_debug_level() > 5){std::cout << format("k: %d #endings: %d", k, number_of_endings) << std::endl;} throw ValueError(format("Could not load these fluids: %s", components_joined_raw.c_str())); } } @@ -517,21 +518,21 @@ long double REFPROPMixtureBackend::calc_T_critical(){ char herr[255]; double Tcrit, pcrit_kPa, dcrit_mol_L; CRITPdll(&(mole_fractions[0]),&Tcrit,&pcrit_kPa,&dcrit_mol_L,&ierr,herr,255); - if (ierr > 0) { throw ValueError(format("%s",herr).c_str()); } //else if (ierr < 0) {set_warning(format("%s",herr).c_str());} + if (static_cast(ierr) > 0) { throw ValueError(format("%s",herr).c_str()); } //else if (ierr < 0) {set_warning(format("%s",herr).c_str());} return static_cast(Tcrit); }; long double REFPROPMixtureBackend::calc_p_critical(){ long ierr = 0; char herr[255]; double Tcrit, pcrit_kPa, dcrit_mol_L; - CRITPdll(&(mole_fractions[0]),&Tcrit,&pcrit_kPa,&dcrit_mol_L,&ierr,herr,255); if (ierr > 0) { throw ValueError(format("%s",herr).c_str()); } //else if (ierr < 0) {set_warning(format("%s",herr).c_str());} + CRITPdll(&(mole_fractions[0]),&Tcrit,&pcrit_kPa,&dcrit_mol_L,&ierr,herr,255); if (static_cast(ierr) > 0) { throw ValueError(format("%s",herr).c_str()); } //else if (ierr < 0) {set_warning(format("%s",herr).c_str());} return static_cast(pcrit_kPa*1000); }; long double REFPROPMixtureBackend::calc_rhomolar_critical(){ long ierr = 0; char herr[255]; double Tcrit, pcrit_kPa, dcrit_mol_L; - CRITPdll(&(mole_fractions[0]),&Tcrit,&pcrit_kPa,&dcrit_mol_L,&ierr,herr,255); if (ierr > 0) { throw ValueError(format("%s",herr).c_str()); } //else if (ierr < 0) {set_warning(format("%s",herr).c_str());} + CRITPdll(&(mole_fractions[0]),&Tcrit,&pcrit_kPa,&dcrit_mol_L,&ierr,herr,255); if (static_cast(ierr) > 0) { throw ValueError(format("%s",herr).c_str()); } //else if (ierr < 0) {set_warning(format("%s",herr).c_str());} return static_cast(dcrit_mol_L*1000); }; long double REFPROPMixtureBackend::calc_T_reducing(){ @@ -575,7 +576,7 @@ double REFPROPMixtureBackend::calc_melt_Tmax() MELTPdll(&pmax_kPa, &(mole_fractions[0]), &Tmax_melt, &ierr,herr,errormessagelength); // Error message - if (ierr > 0) { throw ValueError(format("%s",herr).c_str()); } + if (static_cast(ierr) > 0) { throw ValueError(format("%s",herr).c_str()); } //else if (ierr < 0) {set_warning(format("%s",herr).c_str());} return Tmax_melt; } @@ -589,7 +590,7 @@ long double REFPROPMixtureBackend::calc_melting_line(int param, int given, long MELTTdll(&_T, &(mole_fractions[0]), &p_kPa, &ierr,herr,errormessagelength); // Error message - if (ierr > 0) { throw ValueError(format("%s",herr).c_str()); } //else if (ierr < 0) {set_warning(format("%s",herr).c_str());} + if (static_cast(ierr) > 0) { throw ValueError(format("%s",herr).c_str()); } //else if (ierr < 0) {set_warning(format("%s",herr).c_str());} return p_kPa*1000; } else if (param == iT && given == iP){ @@ -597,7 +598,7 @@ long double REFPROPMixtureBackend::calc_melting_line(int param, int given, long MELTPdll(&p_kPa, &(mole_fractions[0]), &_T, &ierr,herr,errormessagelength); // Error message - if (ierr > 0) { throw ValueError(format("%s",herr).c_str()); } //else if (ierr < 0) {set_warning(format("%s",herr).c_str());} + if (static_cast(ierr) > 0) { throw ValueError(format("%s",herr).c_str()); } //else if (ierr < 0) {set_warning(format("%s",herr).c_str());} return p_kPa*1000; } else{ @@ -619,7 +620,7 @@ long double REFPROPMixtureBackend::calc_viscosity(void) TRNPRPdll(&_T,&rhomol_L,&(mole_fractions[0]), // Inputs &eta,&tcx, // Outputs &ierr,herr,errormessagelength); // Error message - if (ierr > 0) { throw ValueError(format("%s",herr).c_str()); } + if (static_cast(ierr) > 0) { throw ValueError(format("%s",herr).c_str()); } //else if (ierr < 0) {set_warning(format("%s",herr).c_str());} _viscosity = 1e-6*eta; _conductivity = tcx; @@ -639,7 +640,7 @@ long double REFPROPMixtureBackend::calc_surface_tension(void) SURFTdll(&_T, &rho_mol_L, &(mole_fractions[0]), // Inputs &sigma, // Outputs &ierr, herr, errormessagelength); // Error message - if (ierr > 0) { throw ValueError(format("%s",herr).c_str()); } + if (static_cast(ierr) > 0) { throw ValueError(format("%s",herr).c_str()); } //else if (ierr < 0) {set_warning(format("%s",herr).c_str());} _surface_tension = sigma; return static_cast(_surface_tension); @@ -654,7 +655,7 @@ long double REFPROPMixtureBackend::calc_fugacity_coefficient(int i) FUGCOFdll(&_T, &rho_mol_L, &(mole_fractions[0]), // Inputs &(fug_cof[0]), // Outputs &ierr, herr, errormessagelength); // Error message - if (ierr > 0) { throw ValueError(format("%s",herr).c_str()); } + if (static_cast(ierr) > 0) { throw ValueError(format("%s",herr).c_str()); } //else if (ierr < 0) {set_warning(format("%s",herr).c_str());} return static_cast(fug_cof[i]); } @@ -665,7 +666,7 @@ void REFPROPMixtureBackend::calc_phase_envelope(const std::string &type) char herr[255]; SATSPLNdll(&(mole_fractions[0]), // Inputs &ierr, herr, errormessagelength); // Error message - if (ierr > 0) { throw ValueError(format("%s",herr).c_str()); } + if (static_cast(ierr) > 0) { throw ValueError(format("%s",herr).c_str()); } } long double REFPROPMixtureBackend::calc_cpmolar_idealgas(void) { @@ -704,7 +705,7 @@ void REFPROPMixtureBackend::update(CoolProp::input_pairs input_pair, double valu &rhoLmol_L,&rhoVmol_L,&(mole_fractions_liq[0]),&(mole_fractions[0]), // Saturation terms &q,&emol,&hmol,&smol,&cvmol,&cpmol,&w, &ierr,herr,errormessagelength); // - if (ierr > 0) { throw ValueError(format("PT: %s",herr).c_str()); }// TODO: else if (ierr < 0) {set_warning(format("%s",herr).c_str());} + if (static_cast(ierr) > 0) { throw ValueError(format("PT: %s",herr).c_str()); }// TODO: else if (ierr < 0) {set_warning(format("%s",herr).c_str());} // Set all cache values that can be set with unit conversion to SI _p = value1; @@ -726,7 +727,7 @@ void REFPROPMixtureBackend::update(CoolProp::input_pairs input_pair, double valu &rhoLmol_L,&rhoVmol_L,&(mole_fractions_liq[0]),&(mole_fractions_vap[0]), // Saturation terms &q,&emol,&hmol,&smol,&cvmol,&cpmol,&w, &ierr,herr,errormessagelength); - if (ierr > 0) { throw ValueError(format("DmolarT: %s",herr).c_str()); }// TODO: else if (ierr < 0) {set_warning(format("%s",herr).c_str());} + if (static_cast(ierr) > 0) { throw ValueError(format("DmolarT: %s",herr).c_str()); }// TODO: else if (ierr < 0) {set_warning(format("%s",herr).c_str());} // Set all cache values that can be set with unit conversion to SI _p = p_kPa*1000; @@ -755,7 +756,7 @@ void REFPROPMixtureBackend::update(CoolProp::input_pairs input_pair, double valu &rhoLmol_L,&rhoVmol_L,&(mole_fractions_liq[0]),&(mole_fractions_vap[0]), // Saturation terms &q,&emol,&hmol,&smol,&cvmol,&cpmol,&w, // Other thermodynamic terms &ierr,herr,errormessagelength); // Error terms - if (ierr > 0) { throw ValueError(format("DmolarP: %s",herr).c_str()); }// TODO: else if (ierr < 0) {set_warning(format("%s",herr).c_str());} + if (static_cast(ierr) > 0) { throw ValueError(format("DmolarP: %s",herr).c_str()); }// TODO: else if (ierr < 0) {set_warning(format("%s",herr).c_str());} // Set all cache values that can be set with unit conversion to SI _rhomolar = value1; @@ -785,7 +786,7 @@ void REFPROPMixtureBackend::update(CoolProp::input_pairs input_pair, double valu &rhoLmol_L,&rhoVmol_L,&(mole_fractions_liq[0]),&(mole_fractions_vap[0]), // Saturation terms &q,&emol,&smol,&cvmol,&cpmol,&w, &ierr,herr,errormessagelength); - if (ierr > 0) { throw ValueError(format("DmolarHmolar: %s",herr).c_str()); }// TODO: else if (ierr < 0) {set_warning(format("%s",herr).c_str());} + if (static_cast(ierr) > 0) { throw ValueError(format("DmolarHmolar: %s",herr).c_str()); }// TODO: else if (ierr < 0) {set_warning(format("%s",herr).c_str());} // Set all cache values that can be set with unit conversion to SI _p = p_kPa*1000; @@ -815,7 +816,7 @@ void REFPROPMixtureBackend::update(CoolProp::input_pairs input_pair, double valu &rhoLmol_L,&rhoVmol_L,&(mole_fractions_liq[0]),&(mole_fractions_vap[0]), // Saturation terms &q,&emol,&hmol,&cvmol,&cpmol,&w, &ierr,herr,errormessagelength); - if (ierr > 0) { throw ValueError(format("DmolarSmolar: %s",herr).c_str()); }// TODO: else if (ierr < 0) {set_warning(format("%s",herr).c_str());} + if (static_cast(ierr) > 0) { throw ValueError(format("DmolarSmolar: %s",herr).c_str()); }// TODO: else if (ierr < 0) {set_warning(format("%s",herr).c_str());} // Set all cache values that can be set with unit conversion to SI _p = p_kPa*1000; @@ -845,7 +846,7 @@ void REFPROPMixtureBackend::update(CoolProp::input_pairs input_pair, double valu &rhoLmol_L,&rhoVmol_L,&(mole_fractions_liq[0]),&(mole_fractions_vap[0]), // Saturation terms &q,&hmol,&hmol,&cvmol,&cpmol,&w, &ierr,herr,errormessagelength); - if (ierr > 0) { throw ValueError(format("DmolarUmolar: %s",herr).c_str()); }// TODO: else if (ierr < 0) {set_warning(format("%s",herr).c_str());} + if (static_cast(ierr) > 0) { throw ValueError(format("DmolarUmolar: %s",herr).c_str()); }// TODO: else if (ierr < 0) {set_warning(format("%s",herr).c_str());} // Set all cache values that can be set with unit conversion to SI _p = p_kPa*1000; @@ -874,7 +875,7 @@ void REFPROPMixtureBackend::update(CoolProp::input_pairs input_pair, double valu &rhoLmol_L,&rhoVmol_L,&(mole_fractions_liq[0]),&(mole_fractions_vap[0]), // Saturation terms &q,&emol,&smol,&cvmol,&cpmol,&w, // Other thermodynamic terms &ierr,herr,errormessagelength); // Error terms - if (ierr > 0) { throw ValueError(format("HmolarPmolar: %s",herr).c_str()); }// TODO: else if (ierr < 0) {set_warning(format("%s",herr).c_str());} + if (static_cast(ierr) > 0) { throw ValueError(format("HmolarPmolar: %s",herr).c_str()); }// TODO: else if (ierr < 0) {set_warning(format("%s",herr).c_str());} // Set all cache values that can be set with unit conversion to SI _p = value2; @@ -904,7 +905,7 @@ void REFPROPMixtureBackend::update(CoolProp::input_pairs input_pair, double valu &q,&emol,&hmol,&cvmol,&cpmol,&w, // Other thermodynamic terms &ierr,herr,errormessagelength); // Error terms - if (ierr > 0) { throw ValueError(format("PSmolar: %s",herr).c_str()); }// TODO: else if (ierr < 0) {set_warning(format("%s",herr).c_str());} + if (static_cast(ierr) > 0) { throw ValueError(format("PSmolar: %s",herr).c_str()); }// TODO: else if (ierr < 0) {set_warning(format("%s",herr).c_str());} // Set all cache values that can be set with unit conversion to SI _p = value1; @@ -935,7 +936,7 @@ void REFPROPMixtureBackend::update(CoolProp::input_pairs input_pair, double valu &q,&hmol,&smol,&cvmol,&cpmol,&w, // Other thermodynamic terms &ierr,herr,errormessagelength); // Error terms - if (ierr > 0) { throw ValueError(format("PUmolar: %s",herr).c_str()); }// TODO: else if (ierr < 0) {set_warning(format("%s",herr).c_str());} + if (static_cast(ierr) > 0) { throw ValueError(format("PUmolar: %s",herr).c_str()); }// TODO: else if (ierr < 0) {set_warning(format("%s",herr).c_str());} // Set all cache values that can be set with unit conversion to SI _p = value1; @@ -964,7 +965,7 @@ void REFPROPMixtureBackend::update(CoolProp::input_pairs input_pair, double valu &q,&emol,&cvmol,&cpmol,&w, // Other thermodynamic terms &ierr,herr,errormessagelength); // Error terms - if (ierr > 0) { throw ValueError(format("HmolarSmolar: %s",herr).c_str()); }// TODO: else if (ierr < 0) {set_warning(format("%s",herr).c_str());} + if (static_cast(ierr) > 0) { throw ValueError(format("HmolarSmolar: %s",herr).c_str()); }// TODO: else if (ierr < 0) {set_warning(format("%s",herr).c_str());} // Set all cache values that can be set with unit conversion to SI _p = p_kPa*1000; // 1000 for conversion from kPa to Pa @@ -995,7 +996,7 @@ void REFPROPMixtureBackend::update(CoolProp::input_pairs input_pair, double valu &q,&smol,&cvmol,&cpmol,&w, // Other thermodynamic terms &ierr,herr,errormessagelength); // Error terms - if (ierr > 0) { throw ValueError(format("SmolarUmolar: %s",herr).c_str()); }// TODO: else if (ierr < 0) {set_warning(format("%s",herr).c_str());} + if (static_cast(ierr) > 0) { throw ValueError(format("SmolarUmolar: %s",herr).c_str()); }// TODO: else if (ierr < 0) {set_warning(format("%s",herr).c_str());} // Set all cache values that can be set with unit conversion to SI _p = p_kPa*1000; // 1000 for conversion from kPa to Pa @@ -1034,7 +1035,7 @@ void REFPROPMixtureBackend::update(CoolProp::input_pairs input_pair, double valu &q,&emol,&hmol,&cvmol,&cpmol,&w, // Other thermodynamic terms &ierr,herr,errormessagelength); // Error terms - if (ierr > 0) { throw ValueError(format("SmolarT: %s",herr).c_str()); }// TODO: else if (ierr < 0) {set_warning(format("%s",herr).c_str());} + if (static_cast(ierr) > 0) { throw ValueError(format("SmolarT: %s",herr).c_str()); }// TODO: else if (ierr < 0) {set_warning(format("%s",herr).c_str());} // Set all cache values that can be set with unit conversion to SI _p = p_kPa*1000; // 1000 for conversion from kPa to Pa @@ -1072,7 +1073,7 @@ void REFPROPMixtureBackend::update(CoolProp::input_pairs input_pair, double valu &q,&emol,&smol,&cvmol,&cpmol,&w, // Other thermodynamic terms &ierr,herr,errormessagelength); // Error terms - if (ierr > 0) { throw ValueError(format("HmolarT: %s",herr).c_str()); }// TODO: else if (ierr < 0) {set_warning(format("%s",herr).c_str());} + if (static_cast(ierr) > 0) { throw ValueError(format("HmolarT: %s",herr).c_str()); }// TODO: else if (ierr < 0) {set_warning(format("%s",herr).c_str());} // Set all cache values that can be set with unit conversion to SI _p = p_kPa*1000; // 1000 for conversion from kPa to Pa @@ -1110,7 +1111,7 @@ void REFPROPMixtureBackend::update(CoolProp::input_pairs input_pair, double valu &q,&hmol,&smol,&cvmol,&cpmol,&w, // Other thermodynamic terms &ierr,herr,errormessagelength); // Error terms - if (ierr > 0) { throw ValueError(format("TUmolar: %s",herr).c_str()); }// TODO: else if (ierr < 0) {set_warning(format("%s",herr).c_str());} + if (static_cast(ierr) > 0) { throw ValueError(format("TUmolar: %s",herr).c_str()); }// TODO: else if (ierr < 0) {set_warning(format("%s",herr).c_str());} // Set all cache values that can be set with unit conversion to SI _p = p_kPa*1000; // 1000 for conversion from kPa to Pa @@ -1148,7 +1149,7 @@ void REFPROPMixtureBackend::update(CoolProp::input_pairs input_pair, double valu &emol,&hmol,&smol,&cvmol,&cpmol,&w, // Other thermodynamic terms &ierr,herr,errormessagelength); // Error terms - if (ierr > 0) { throw ValueError(format("PQ: %s",herr).c_str()); }// TODO: else if (ierr < 0) {set_warning(format("%s",herr).c_str());} + if (static_cast(ierr) > 0) { throw ValueError(format("PQ: %s",herr).c_str()); }// TODO: else if (ierr < 0) {set_warning(format("%s",herr).c_str());} // Set all cache values that can be set with unit conversion to SI _p = value1; @@ -1179,7 +1180,7 @@ void REFPROPMixtureBackend::update(CoolProp::input_pairs input_pair, double valu &emol,&hmol,&smol,&cvmol,&cpmol,&w, // Other thermodynamic terms &ierr,herr,errormessagelength); // Error terms - if (ierr > 0) { + if (static_cast(ierr) > 0) { throw ValueError(format("TQ(%s): %s",LoadedREFPROPRef.c_str(), herr).c_str()); }// TODO: else if (ierr < 0) {set_warning(format("%s",herr).c_str()); From 660210b49a0927fb3fcbbaf8dc99cd082e09b72a Mon Sep 17 00:00:00 2001 From: Ian Bell Date: Mon, 12 Jan 2015 21:02:32 -0700 Subject: [PATCH 12/14] Do not deploy platform-independent C# files; See #392 Signed-off-by: Ian Bell --- CMakeLists.txt | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index af9173a6..6944f1a9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -458,11 +458,6 @@ if (COOLPROP_CSHARP_MODULE) COMMAND 7z a "${CMAKE_CURRENT_BINARY_DIR}/platform-independent.7z" "${CMAKE_CURRENT_BINARY_DIR}/*.cs" WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") - # Install all the generated cs files - install( - CODE "file( GLOB _GeneratedCsharpSources \"${CMAKE_CURRENT_BINARY_DIR}/*.cs\" )" - CODE "file( INSTALL \${_GeneratedCsharpSources} DESTINATION ${CMAKE_INSTALL_PREFIX}/Csharp/platform-independent )" - ) install (FILES ${CMAKE_SOURCE_DIR}/Web/coolprop/wrappers/Csharp/Example.cs DESTINATION Csharp) install (FILES "${CMAKE_CURRENT_BINARY_DIR}/platform-independent.7z" DESTINATION ${CMAKE_INSTALL_PREFIX}/Csharp) install (TARGETS ${app_name} DESTINATION Csharp/${CMAKE_SYSTEM_NAME}_${BITNESS}bit) @@ -472,7 +467,7 @@ if (COOLPROP_CSHARP_MODULE) # Copy the shared object to the folder with the executable - no idea like java.library.path in C# install (TARGETS ${app_name} DESTINATION ${CMAKE_SOURCE_DIR}/testing_root/Csharp${BITNESS}) endif() - file(TO_NATIVE_PATH ${CMAKE_INSTALL_PREFIX}/Csharp/platform-independent/*.cs cp_cs_path) + file(TO_NATIVE_PATH ${CMAKE_CURRENT_BINARY_DIR}/*.cs cp_cs_path) file(TO_NATIVE_PATH ${CMAKE_INSTALL_PREFIX}/Csharp/Example.cs cp_example_path) if (${BITNESS} EQUAL "32") set(CSHARP_PLAT "-platform:x86") From 633a9c3a5c75458a2b7d4e8ce9ffa1888faa6b78 Mon Sep 17 00:00:00 2001 From: Ian Bell Date: Mon, 12 Jan 2015 21:23:17 -0700 Subject: [PATCH 13/14] Updated integration docs for C# and Java; See #392 Signed-off-by: Ian Bell --- Web/coolprop/wrappers/Csharp/index.rst | 19 ++++++++++++++++--- Web/coolprop/wrappers/Java/index.rst | 15 ++++++++++++++- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/Web/coolprop/wrappers/Csharp/index.rst b/Web/coolprop/wrappers/Csharp/index.rst index 72a8a777..5eac45f9 100644 --- a/Web/coolprop/wrappers/Csharp/index.rst +++ b/Web/coolprop/wrappers/Csharp/index.rst @@ -6,13 +6,24 @@ C# Wrapper Pre-compiled Binaries ===================== -Pre-compiled release binaries can be downloaded from :sfdownloads:`Csharp`. Development binaries coming from the buildbot server can be found at :sfnightly:`Csharp`. To Use ------ -Copy all the platform-independent .cs files to a folder on your computer you want, here we call it ``platform-independent``. Copy the DLL for your system architecture to the same location. Copy the Example.cs file to the same location. You will need to have a copy of some version of C#. +Pre-compiled binaries can be downloaded from :sfdownloads:`Csharp`. Development binaries coming from the buildbot server can be found at :sfnightly:`Csharp`. +Download the platform-independent.7z file and expand it to a folder called ``platform-independent``. Download the special C# shared library for your system architecture to the same location from either :sfdownloads:`Csharp` (release) or :sfnightly:`Csharp` (development). Copy the Example.cs file to the same location. You will need to have a copy of some version of C#. + +When you are finished, you should have a folder layout something like :: + + main + |- CoolProp.dll + |- Example.cs + |- platform-independent + |- AbstractState.cs + |- Configuration.cs + |- ... + Windows ^^^^^^^ @@ -24,7 +35,7 @@ At the command prompt, run:: where you might need to update the path to visual studio depending on your version installed. Use `-platform:x86` to tell C# that your DLL is 32-bit if you are on 32-bit, or `-platform:x64` if you are on 64-bit. -Alternatively, you can add all the .cs files to a visual studio project. +Alternatively, you can add all the .cs files to a visual studio project. If you do that, add the DLL to the project as well, right-click on the DLL, and select the option to copy it to the output directory. Linux/OSX ^^^^^^^^^ @@ -33,6 +44,8 @@ Same idea as windows, but command line is just a bit different:: mcs Example.cs platform-independent/*.cs -platform:x64 ./Example + +Use `-platform:x86` to tell C# that your shared library is 32-bit if you are on 32-bit, or `-platform:x64` if you are on a 64-bit platform. User-Compiled Binaries ====================== diff --git a/Web/coolprop/wrappers/Java/index.rst b/Web/coolprop/wrappers/Java/index.rst index 632ad247..7dd2500a 100644 --- a/Web/coolprop/wrappers/Java/index.rst +++ b/Web/coolprop/wrappers/Java/index.rst @@ -6,7 +6,20 @@ Java Wrapper Pre-compiled Binaries ===================== -Pre-compiled binaries can be downloaded from :sfdownloads:`Java`, which come from :sfnightly:`the nightly snapshots `. + +Pre-compiled binaries can be downloaded from :sfdownloads:`Java`. Development binaries coming from the buildbot server can be found at :sfnightly:`Java`. + +Download the ``platform-independent.7z`` file and expand it to a folder called ``platform-independent`` using 7-zip. Download the special Java shared library for your system architecture to the same location from either :sfdownloads:`Java` (release) or :sfnightly:`Java` (development). Copy the Example.java file to the same location. You will need to have a copy of some version of java. + +When you are finished, you should have a folder layout something like :: + + main + |- CoolProp.dll + |- Example.java + |- platform-independent + |- AbstractState.java + |- Configuration.java + |- ... Usage ----- From e81833b38c126533903e5f9e7b4f2dcdeeb8d11f Mon Sep 17 00:00:00 2001 From: Ian Bell Date: Mon, 12 Jan 2015 21:26:03 -0700 Subject: [PATCH 14/14] Tiny updates to C# docs Signed-off-by: Ian Bell --- Web/coolprop/wrappers/Csharp/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Web/coolprop/wrappers/Csharp/index.rst b/Web/coolprop/wrappers/Csharp/index.rst index 5eac45f9..acf51bb7 100644 --- a/Web/coolprop/wrappers/Csharp/index.rst +++ b/Web/coolprop/wrappers/Csharp/index.rst @@ -12,7 +12,7 @@ To Use Pre-compiled binaries can be downloaded from :sfdownloads:`Csharp`. Development binaries coming from the buildbot server can be found at :sfnightly:`Csharp`. -Download the platform-independent.7z file and expand it to a folder called ``platform-independent``. Download the special C# shared library for your system architecture to the same location from either :sfdownloads:`Csharp` (release) or :sfnightly:`Csharp` (development). Copy the Example.cs file to the same location. You will need to have a copy of some version of C#. +Download the ``platform-independent.7z`` file and expand it to a folder called ``platform-independent`` using 7-zip. Download the special C# shared library for your system architecture to the same location from either :sfdownloads:`Csharp` (release) or :sfnightly:`Csharp` (development). Copy the Example.cs file to the same location. You will need to have a copy of some version of C#. When you are finished, you should have a folder layout something like ::