Skip to content

Commit

Permalink
Merge branch 'master' into heat-exchange-models
Browse files Browse the repository at this point in the history
  • Loading branch information
Phil Ahrenkiel authored and Phil Ahrenkiel committed Nov 29, 2023
2 parents 92d5edf + a336249 commit 19ae202
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 24 deletions.
4 changes: 2 additions & 2 deletions cmake/git-version.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,6 @@ endif()
message("Building ${PROJECT_NAME} ${${PROJECT_NAME}_VRSN_MAJOR}.${${PROJECT_NAME}_VRSN_MINOR}.${${PROJECT_NAME}_VRSN_PATCH}${${PROJECT_NAME}_VRSN_META}")

configure_file(
"${PROJECT_SOURCE_DIR}/src/HPWH.in.hh"
"${PROJECT_BINARY_DIR}/src/HPWH.hh"
"${PROJECT_SOURCE_DIR}/src/HPWHversion.in.hh"
"${PROJECT_BINARY_DIR}/src/HPWHversion.hh"
)
8 changes: 5 additions & 3 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Set HPWHsim Version
add_custom_target(${PROJECT_NAME}_version_header
DEPENDS ${PROJECT_SOURCE_DIR}/src/HPWH.in.hh
DEPENDS ${PROJECT_SOURCE_DIR}/src/HPWHversion.in.hh
COMMAND ${CMAKE_COMMAND}
ARGS -DPROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR}
-DPROJECT_BINARY_DIR=${PROJECT_BINARY_DIR}
Expand All @@ -10,13 +10,15 @@ add_custom_target(${PROJECT_NAME}_version_header
)

set_target_properties(${PROJECT_NAME}_version_header PROPERTIES FOLDER Dependencies/HPWHsim)
include_directories("${PROJECT_BINARY_DIR}/src")
include_directories("${PROJECT_BINARY_DIR}/src" "${PROJECT_SOURCE_DIR}/src")

set(headers
HPWH.in.hh
HPWHversion.in.hh
HPWH.hh
)

set(source
HPWHversion.cc
HPWH.cc
HPWHHeatSources.cc
HPWHHeatingLogics.cc
Expand Down
11 changes: 0 additions & 11 deletions src/HPWH.cc
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,6 @@ void HPWH::setMinutesPerStep(const double minutesPerStep_in)
hoursPerStep = minutesPerStep / 60.0;
};

//ugh, this should be in the header
const std::string HPWH::version_maint = HPWHVRSN_META;

// public HPWH functions
HPWH::HPWH(): messageCallback(NULL),messageCallbackContextPtr(NULL),hpwhVerbosity(VRB_silent)
{
Expand Down Expand Up @@ -271,14 +268,6 @@ HPWH & HPWH::operator=(const HPWH &hpwh) {
HPWH::~HPWH() {
}

string HPWH::getVersion() {
std::stringstream version;

version << version_major << '.' << version_minor << '.' << version_patch << version_maint;

return version.str();
}

int HPWH::runOneStep(double drawVolume_L,
double tankAmbientT_C,double heatSourceAmbientT_C,
DRMODES DRstatus,
Expand Down
5 changes: 1 addition & 4 deletions src/HPWH.in.hh → src/HPWH.hh
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ namespace Btwxt { class RegularGridInterpolator; };
* excluded from compiling. This is done in order to reduce the size of the
* final compiled code. */

#define HPWHVRSN_MAJOR @HPWHsim_VRSN_MAJOR@
#define HPWHVRSN_MINOR @HPWHsim_VRSN_MINOR@
#define HPWHVRSN_PATCH @HPWHsim_VRSN_PATCH@
#define HPWHVRSN_META "@HPWHsim_VRSN_META@"
#include "HPWHversion.hh"

class HPWH {
public:
Expand Down
4 changes: 1 addition & 3 deletions src/HPWHpresets.cc
Original file line number Diff line number Diff line change
Expand Up @@ -515,9 +515,7 @@ int HPWH::HPWHinit_presets(MODELS presetNum) {

else if (presetNum == MODELS_StorageTank) {
setNumNodes(12);
setpoint_C = 52;

setpoint_C = 800;
setpoint_C = F_TO_C(127.0);

tankSizeFixed = false;
tankVolume_L = GAL_TO_L(80);
Expand Down
17 changes: 17 additions & 0 deletions src/HPWHversion.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* Version control
*/

#include "HPWHVersion.hh"
#include "HPWH.hh"

//ugh, this should be in the header
const std::string HPWH::version_maint = HPWHVRSN_META;

std::string HPWH::getVersion() {
std::stringstream version;

version << version_major << '.' << version_minor << '.' << version_patch << version_maint;

return version.str();
}
13 changes: 13 additions & 0 deletions src/HPWHversion.in.hh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
* Version control
*/

#ifndef HPWHversion_hh
#define HPWHversion_hh

#define HPWHVRSN_MAJOR @HPWHsim_VRSN_MAJOR@
#define HPWHVRSN_MINOR @HPWHsim_VRSN_MINOR@
#define HPWHVRSN_PATCH @HPWHsim_VRSN_PATCH@
#define HPWHVRSN_META "@HPWHsim_VRSN_META@"

#endif
2 changes: 1 addition & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build test tool
include_directories("${PROJECT_BINARY_DIR}/src")
include_directories("${PROJECT_SOURCE_DIR}/src" "${PROJECT_BINARY_DIR}/src")

add_executable(testTool main.cc )
add_executable(testTankSizeFixed testTankSizeFixed.cc)
Expand Down

0 comments on commit 19ae202

Please sign in to comment.