diff --git a/README.md b/README.md index 179377f0..d4e5063b 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ HPWHsim is configured as a CMake project. Currently, CMake is only configured to - Microsoft Visual Studio 2017 with Visual C++ (which can be installed after from the Microsoft Visual Studio Installer) - CMake 3.5 or later - Git -- Btwxt 0.2.0 +- Btwxt 1.0.0 ### Building HPWHsim from source diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 115a45f2..0be9497d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -10,7 +10,6 @@ add_custom_target(${PROJECT_NAME}_version_header ) set_target_properties(${PROJECT_NAME}_version_header PROPERTIES FOLDER Dependencies/HPWHsim) -include_directories("${PROJECT_BINARY_DIR}/src" "${PROJECT_SOURCE_DIR}/src") set(headers HPWHversion.in.hh @@ -26,10 +25,13 @@ set(source ) add_library(libHPWHsim ${source} ${headers}) +target_include_directories(libHPWHsim PUBLIC ${PROJECT_BINARY_DIR}/src ${PROJECT_SOURCE_DIR}/src) + +target_link_libraries( libHPWHsim PUBLIC btwxt) + add_dependencies(libHPWHsim ${PROJECT_NAME}_version_header) set_target_properties(libHPWHsim PROPERTIES OUTPUT_NAME HPWHsim) set_target_properties(libHPWHsim PROPERTIES PDB_NAME libHPWHsim) target_compile_features(libHPWHsim PUBLIC cxx_std_17) -target_include_directories(libHPWHsim PUBLIC ${PROJECT_SOURCE_DIR}/vendor/btwxt/src) \ No newline at end of file diff --git a/src/HPWH.cc b/src/HPWH.cc index f2813efd..be7e54bf 100644 --- a/src/HPWH.cc +++ b/src/HPWH.cc @@ -39,7 +39,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "HPWH.hh" -#include "btwxt.h" +#include #include #include diff --git a/src/HPWHHeatSources.cc b/src/HPWHHeatSources.cc index ba8986d9..33f72a4e 100644 --- a/src/HPWHHeatSources.cc +++ b/src/HPWHHeatSources.cc @@ -6,7 +6,7 @@ #include // vendor -#include "btwxt.h" +#include #include "HPWH.hh" diff --git a/src/HPWHpresets.cc b/src/HPWHpresets.cc index 5e1da715..80580138 100644 --- a/src/HPWHpresets.cc +++ b/src/HPWHpresets.cc @@ -3,7 +3,7 @@ File Containing all of the presets available in HPWHsim */ #include "HPWH.hh" -#include "btwxt.h" +#include #include @@ -1661,10 +1661,14 @@ int HPWH::HPWHinit_presets(MODELS presetNum) { 3.993147, 3.713376, 3.616836, 3.710957, 3.470484, 3.264466, 3.14959 }); - // Set up regular grid interpolator. - Btwxt::GriddedData gridded_data(compressor.perfGrid, compressor.perfGridValues); - gridded_data.set_axis_extrap_method(2, Btwxt::Method::LINEAR); //Linearly extrapolate on Tin (F) - compressor.perfRGI = new Btwxt::RegularGridInterpolator(gridded_data); + // Set up regular grid interpolator. + Btwxt::GridAxis g0(compressor.perfGrid[0], "TAir", Btwxt::InterpolationMethod::linear, Btwxt::ExtrapolationMethod::constant); + Btwxt::GridAxis g1(compressor.perfGrid[1], "TOut", Btwxt::InterpolationMethod::linear, Btwxt::ExtrapolationMethod::constant); + Btwxt::GridAxis g2(compressor.perfGrid[2], "TIn", Btwxt::InterpolationMethod::linear, Btwxt::ExtrapolationMethod::linear); + + std::vector gx{ g0, g1, g2 }; + + compressor.perfRGI = new Btwxt::RegularGridInterpolator(gx, compressor.perfGridValues); compressor.useBtwxtGrid = true; compressor.secondaryHeatExchanger = { dF_TO_dC(10.), dF_TO_dC(15.), 27. }; diff --git a/vendor/btwxt b/vendor/btwxt index d014b897..2a5926e9 160000 --- a/vendor/btwxt +++ b/vendor/btwxt @@ -1 +1 @@ -Subproject commit d014b897d878eb44289d0c112d7d80dec9bc64b8 +Subproject commit 2a5926e96b594bafbcaa7640a9cabd40b5ae043d