Skip to content

Add ability to simulate ASHRAE 205 representations #151

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 32 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
c744936
Initial json.hpp experiments
chipbarnaby Aug 19, 2020
d8595f0
Further json.hpp experiments
chipbarnaby Aug 21, 2020
64571c2
Merge branch 'master' into ashrae205
chipbarnaby Sep 2, 2020
bbb449d
Merge branch 'master' into ashrae205
chipbarnaby May 17, 2021
0192a0e
Merge branch 'ashrae205' of https://github.com/cse-sim/cse into ashra…
chipbarnaby May 17, 2021
cc210da
Initial ASHRAE 205 interface
chipbarnaby May 17, 2021
1dc3c0d
Add new files
chipbarnaby May 17, 2021
983c152
Link to libtk205.
nealkruis May 25, 2021
1f8835f
Fix CI poetry install step.
nealkruis May 25, 2021
222c7e7
User recursive submodule checkouts on CI.
nealkruis May 25, 2021
21495b7
Merge remote-tracking branch 'origin/master' into ashrae205
nealkruis May 25, 2021
e4dbcff
Use bash for CI build.
nealkruis May 25, 2021
bf078eb
Test code generation separately.
nealkruis May 25, 2021
be1a588
Don't use Build.bat on CI.
nealkruis May 25, 2021
e686c10
Update CI cache.
nealkruis May 25, 2021
6bc87bb
Fix code generation path in CI test.
nealkruis May 25, 2021
67eea57
Install python dependencies in all relevant submodules.
nealkruis May 25, 2021
e92d137
Update toolkit-205 submodule.
nealkruis May 25, 2021
f47a610
Use separate CI cache ids.
nealkruis May 25, 2021
c0c60f3
Use bash as default CI shell.
nealkruis May 25, 2021
ca35d04
Add poetry to CI path.
nealkruis May 25, 2021
2afd52e
Merge master.
nealkruis Oct 4, 2021
de45bb9
Start basic input structure.
nealkruis Oct 14, 2021
d81b234
Add code to load 205 instance.
nealkruis Oct 18, 2021
9d2cd31
Refresh CI caches, fix branch name.
nealkruis Oct 26, 2021
f438428
Add standby energy and clean up type conversion warnings.
nealkruis Oct 27, 2021
41c5858
Use iterative searches with 205 representations.
nealkruis Nov 24, 2021
07d193f
Update reference results.
nealkruis Nov 24, 2021
fcfe5d8
Merge master.
nealkruis Dec 21, 2021
1fd5ab7
Move to stand-alone libtk205 dependency.
nealkruis Dec 23, 2021
5481183
Merge master.
nealkruis Dec 23, 2021
5c95b71
Clean up solution explorer folders and CMake variables.
nealkruis Dec 23, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v1
with:
submodules: recursive
- name: Configure CMake
run: cmake -P cmake/configure.cmake
- name: Build wcmp
Expand Down Expand Up @@ -69,6 +71,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v1
with:
submodules: recursive
- name: Configure CMake
run: cmake -P cmake/configure.cmake
- name: Download executable artifact
Expand All @@ -78,7 +82,6 @@ jobs:
path: msvc
- name: Install pandoc
run: 'cinst -y pandoc --version=1.17.2 --ia=ALLUSERS=1'
shell: bash
- name: Add pandoc to path
run: echo "C:\Program Files (x86)\Pandoc" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Add MSVC developer commands to PATH
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
types:
- created

env:
CI_GIT_BRANCH: ${GITHUB_REF#refs/heads/}
jobs:
release-cse:
name: Deploy CSE release
Expand Down Expand Up @@ -34,8 +36,8 @@ jobs:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install pandoc
run: 'cinst -y pandoc --version=1.17.2 --ia=ALLUSERS=1'
shell: bash
- name: Add pandoc to path
shell: pwsh
run: echo "C:\Program Files (x86)\Pandoc" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Add MSVC developer commands to PATH
uses: ilammy/msvc-dev-cmd@v1
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@
[submodule "vendor/btwxt"]
path = vendor/btwxt
url = https://github.com/bigladder/btwxt.git
[submodule "vendor/libtk205"]
path = vendor/libtk205
url = https://github.com/open205/libtk205.git
1 change: 1 addition & 0 deletions cmake/BuildFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ if (MSVC AND NOT ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel"))
/fp:precise #+Specifies floating-point behavior.
/fp:except- # Specifies floating-point behavior.
/arch:IA32 # Specifies the architecture for code generation (no special instructions).
/std:c++14 #+Enable supported C and C++ language features from the specified version of the C or C++ language standard.
)
string(REPLACE ";" " " CMAKE_CXX_FLAGS "${CompileCommon}")

Expand Down
7 changes: 7 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ set(source
WFPAK.CPP
XIOPAK.CPP
YACAM.CPP
A205FACE.CPP
)

set(precomp
Expand Down Expand Up @@ -199,6 +200,7 @@ set(headers
WFPAK.H
XIOPAK.H
YACAM.H
A205FACE.H
)

if(USE_XMODULE) # Runtime Share Library interface - Not used since Version 0.899. (Windows only)
Expand All @@ -212,6 +214,10 @@ include_directories(
"${CMAKE_SOURCE_DIR}/vendor/Penumbra/include"
"${CMAKE_SOURCE_DIR}/vendor/HPWHsim/src"
"${CMAKE_BINARY_DIR}/vendor/HPWHsim/src"
"${CMAKE_SOURCE_DIR}/vendor/toolkit-205/schema-205/build/include"
"${CMAKE_SOURCE_DIR}/vendor/toolkit-205/libtk205/vendor/json/single_include"
"${CMAKE_SOURCE_DIR}/vendor/toolkit-205/libtk205/include"
"${CMAKE_SOURCE_DIR}/vendor/toolkit-205/schema-205/schema205/src"
"${btwxt_SOURCE_DIR}/src"
)

Expand Down Expand Up @@ -252,6 +258,7 @@ set(libs
libHPWHsim
libkiva
btwxt
libtk205
)

source_group("Source Files" FILES ${source})
Expand Down
18 changes: 18 additions & 0 deletions src/CNCULT.CPP
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ makAncMTR(MtriB); // Meters input records basAnc
makAncAFMTR(AfMtriB); // Airflow meters input records basAnc

// simple HVAC and DHW (for CSE T24 residential compliance)
makAncEQUIPDATA(EDiB); // residential HVAC system
makAncRSYS( RSiB); // residential HVAC system
makAncDHWMTR( WMtriB); // DHW meters
makAncDHWSYS( WSiB); // DHW system
Expand Down Expand Up @@ -144,6 +145,7 @@ void FC iRatsFree() // free record storage for all input basAncs.
AfMtriB.free();
GniB.free();
MtriB.free();
EDiB.free();
RSiB.free();
WMtriB.free();
WSiB.free();
Expand Down Expand Up @@ -1575,6 +1577,20 @@ CULT()
}; // izxT
#undef ZFAN

//========== EQUIPDATA command (ASHRAE 205 equipment data) ==============

static CULT edT[] = //-------------- EQUIPDATA cmd table, used from cnTopCult
{
// id cs fn f uc evf ty b dfls p2 ckf
//"*", STAR, 0, 0, 0, 0, 0, 0, N, 0.f, N, edStarCkf),
CULT("edFilePath", DAT, EQUIPDATA_FILEPATH, RQD, 0, VEOI, TYSTR, 0, N, 0.f, N, N),
CULT("edExpectedRS", DAT, EQUIPDATA_EXPECTEDRS, RQD, 0, VEOI, TYCH, 0, N, 0.f, N, N),
CULT("edDoValidation", DAT, EQUIPDATA_DOVALIDATION, RQD, 0, VEOI, TYCH, 0, N, 0.f, N, N),
CULT("endEquipmentData", ENDER, 0, 0, 0, 0, 0, 0, N, 0.f, N, N),
CULT()
}; // edT



//=================== DUCTSEG command ( duct segment) ===================
RC DUCTSEG::ds_Ckf()
Expand Down Expand Up @@ -1678,6 +1694,7 @@ CULT( "*", STAR, 0, 0, 0, 0, 0, 0,
CULT( "rsType", DAT, RSYS_TYPE, 0, 0, VEOI, TYCH, 0, C_RSYSTYCH_ACFURN, N, N),
CULT( "rsDesc", DAT, RSYS_DESC, 0, 0, VEOI, TYSTR, 0, 0, N, N),
CULT( "rsPerfMap", DAT, RSYS_PERFMAP, 0, 0, VEOI, TYCH, 0, C_NOYESCH_NO, N, N),
CULT( "rsRep205", DAT, RSYS_REP205, 0, 0, VEOI, TYREF, &EDiB, N, N, N),
CULT( "rsFanTy", DAT, RSFAN( FANTY), 0, 0, VEOI, TYCH, 0, C_FANTYCH_BLOWTHRU, N, N ),
CULT( "rsFanMotTy", DAT, RSFAN( MOTTY), 0, 0, VEOI, TYCH, 0, C_MOTTYCH_PSC, N, N ),
CULT( "rsAdjForFanHt", DAT, RSYS_ADJFORFANHT,0, 0, VEOI, TYCH, 0, C_NOYESCH_YES, N, N),
Expand Down Expand Up @@ -2856,6 +2873,7 @@ CULT cnTopCult[] = // Top level table, points to all other tables, used in cal
CULT( "zone", RATE, 0, NM_RQD/*|RQD*/, 0, 0, 0, &ZiB, N, 0.f, znT, N),
CULT( "izXfer", RATE, 0, 0, 0, 0, 0, &IzxiB, N, 0.f, izxT, N),
CULT("afmeter", RATE, 0, NM_RQD, 0, 0, 0, &AfMtriB,N, 0.f, afMeterT, N),
CULT( "equipdata", RATE, 0, NM_RQD, 0, 0, 0, &EDiB, N, 0.f, edT, N),
CULT( "rsys", RATE, 0, NM_RQD, 0, 0, 0, &RSiB, N, 0.f, rsysT, N),
CULT( "dhwdayuse", RATE, 0, NM_RQD, 0, 0, 0, &WDUiB, N, 0.f, dhwDayUseT, N),
CULT( "dhwmeter", RATE, 0, NM_RQD, 0, 0, 0, &WMtriB, N, 0.f, dhwMeterT, N),
Expand Down
1 change: 1 addition & 0 deletions src/CNCULT2.CPP
Original file line number Diff line number Diff line change
Expand Up @@ -1455,6 +1455,7 @@ LOCAL RC topMtr() // check/dup all types of meters (energy, dhw, airflow)
LOCAL RC topRSys1() // check RSYS / copy to run rat
{
RC rc = RCOK;
CSE_E(EdR.RunDup(EDiB)); // TODO: Move to its own function?
CSE_E( RsR.al( RSiB.n, WRN) ) // delete old records, alloc to needed size now for min fragmentation
if (rc == RCOK)
{ RSYS* pRSi;
Expand Down
6 changes: 6 additions & 0 deletions src/CNDTYPES.DEF
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,12 @@ PIPESEGP -- "class PIPESEG*" 4 none
DOE2 "DOE2"
UNIFIED "Unified"
}
*choicb EDRSCH {
RS0002 "RS0002"
RS0003 "RS0003"
RS0004 "RS0004"
RS0005 "RS0005"
}
*choicb RSYSMODECTRLCH {
OFF "Off"
HEAT "Heat"
Expand Down
1 change: 1 addition & 0 deletions src/CNFIELDS.DEF
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ GROUNDMODELCH GROUNDMODELCH LMNONE UNNONE
FBXREFCH FBXREFCH LMNONE UNNONE
FBZREFCH FBZREFCH LMNONE UNNONE
CONVMODELCH CONVMODELCH LMNONE UNNONE
EDRSCH EDRSCH LMNONE UNNONE
RSYSMODECTRLCH RSYSMODECTRLCH LMNONE UNNONE
RSYSTYCH RSYSTYCH LMNONE UNNONE
RSYSOAVTYCH RSYSOAVTYCH LMNONE UNNONE
Expand Down
6 changes: 6 additions & 0 deletions src/CNGLOB.H
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,7 @@ struct RXPORTINFO;
namespace Pumbra { class Penumbra; }
namespace Kiva { class Instance; class Aggregator; class Foundation; }
namespace Btwxt { class RegularGridInterpolator; }
namespace tk205 { namespace RS0002_NS { class RS0002; } }



Expand Down Expand Up @@ -654,6 +655,11 @@ const double cfV = 1./2.23694; // m/s / mph
template< typename T> inline T VIPtoSI(T mph) { return T( mph*cfV); }
template< typename T> inline T VSItoIP(T ms) { return T( ms/cfV); }

// pressure inHg <-> Pa
const double cfP = 3386.39;
template< typename T> inline T inHGtoPa(T inHG) { return T(inHG * cfP); }
template< typename T> inline T PatoinHG(T Pa) { return T(Pa / cfP); }

// air mass flow <--> air volume flow
// amf in lbm/hr
// cfm in ft3/min std air
Expand Down
1 change: 1 addition & 0 deletions src/CNGUTS.CPP
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ void FC runFazDataFree()

ZrB.free(); // Zones runtime info
ZnresB.free(); // zone simulation results
EdR.free(); // EQUIPDATA
RsResR.free(); // RSYS results
DsResR.free(); // DUCTSEG results
WsResR.free(); // DHWSYS results
Expand Down
1 change: 1 addition & 0 deletions src/CNGUTS.H
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ extern anc<DESCOND> DcR; // design conditions
extern anc<ZNR> ZrB; // zones runtime info
extern anc<ZNRES> ZnresB; // Zones simulation results info
extern anc<IZXRAT> IzxR; // interzone transfers
extern anc<EQUIPDATA> EdR; // ASHRAE 205 equipment data
extern anc<RSYS> RsR; // residential system
extern anc<RSYSRES> RsResR; // residential system results
extern anc<DUCTSEG> DsR; // duct segments
Expand Down
Loading