Skip to content

Commit

Permalink
Merge branch 'develop' into afn_dx_clg_var_spd_coil
Browse files Browse the repository at this point in the history
  • Loading branch information
lymereJ committed Oct 16, 2024
2 parents 5a57a68 + ec7398a commit 93e5c1b
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 87 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
path: ./dist

- name: Deploy on Test PyPi
uses: pypa/[email protected].1
uses: pypa/[email protected].3
with:
repository-url: https://test.pypi.org/legacy/
user: __token__
Expand Down
34 changes: 2 additions & 32 deletions .github/workflows/test_code_integrity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
jobs:
code_integrity_checks:
name: Static Code Analysis
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4

Expand All @@ -33,44 +33,14 @@ jobs:

- name: Install cppcheck
if: always()
run: |
mkdir cppcheck
cd cppcheck
wget https://github.com/danmar/cppcheck/archive/2.10.tar.gz
tar xfz 2.10.tar.gz
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ../cppcheck-2.10/
make -j $(nproc)
sudo make install
cd ..
rm -Rf cppcheck
- name: Cache cppcheck-build-directory
if: always()
id: cppcheckcache
uses: actions/cache@v4
with:
path: .cppcheck-build-dir/
key: cppcheckcache

- name: cppcheck-build-directory not found
# If the build cache wasn't found in the cache
if: always() && steps.cppcheckcache.outputs.cache-hit != 'true'
run: mkdir .cppcheck-build-dir

- name: cppcheck-build-directory was found
# If the build cache wasn't found in the cache
if: always() && steps.cppcheckcache.outputs.cache-hit == 'true'
run: ls .cppcheck-build-dir/ || true
run: sudo apt-get install cppcheck

- name: Run CppCheck
id: cpp_check_run
if: always()
# TODO: Evaluate the long list of flags here
run: >
cppcheck
--cppcheck-build-dir=.cppcheck-build-dir
-D__cppcheck__ -UEP_Count_Calls -DEP_NO_OPENGL -UGROUND_PLOT -DLINK_WITH_PYTHON -DMSVC_DEBUG -DSKYLINE_MATRIX_REMOVE_ZERO_COLUMNS -U_OPENMP -Ugeneratetestdata
-DEP_cache_GlycolSpecificHeat -DEP_cache_PsyTsatFnPb -UEP_nocache_Psychrometrics -UEP_psych_errors -UEP_psych_stats
--force
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2667,41 +2667,41 @@ \subsubsection{Inputs}\label{inputs-24-003}

\paragraph{Field: Slat Width}\label{field-slat-width-1}

The width (m) of the venetian slats.~ Used only for ShadingLayerType = Venetian.
The width (m) of the venetian slats.~ Used only for ShadingLayerType = VenetianHorizontal or VenetianVertical.

\paragraph{Field: Slat Spacing}\label{field-slat-spacing}

The distance (m) between front sides of the venetian slats.~ Used only for ShadingLayerType = Venetian.
The distance (m) between front sides of the venetian slats.~ Used only for ShadingLayerType = VenetianHorizontal or VenetianVertical.

\paragraph{Field: Slat Thickness}\label{field-slat-thickness-1}

The thickness (m) of the venetian slats.~ Used only for ShadingLayerType = Venetian.
The thickness (m) of the venetian slats.~ Used only for ShadingLayerType = VenetianHorizontal or VenetianVertical.

\paragraph{Field: Slat Angle}\label{field-slat-angle-1}

The slat tilt angle (degrees) of the venetian slats.~ Used only for ShadingLayerType = Venetian.~ Range of slat angle is from -90 to 90 degrees.
The slat tilt angle (degrees) of the venetian slats.~ Used only for ShadingLayerType = VenetianHorizontal or VenetianVertical.~ Range of slat angle is from -90 to 90 degrees.

\paragraph{Field: Slat Conductivity}\label{field-slat-conductivity-1}

The conductivity (W/mK) of the venetian slats.~ Used only for ShadingLayerType = Venetian.
The conductivity (W/mK) of the venetian slats.~ Used only for ShadingLayerType = VenetianHorizontal or VenetianVertical.

\paragraph{Field: Slat Curve}\label{field-slat-curve}

The curvature radius (m) of the venetian slats.~ Setting this value to zero means there is no curvature in the slat (it is flat), while a non-zero value is the radius of the slat curve.~ This value cannot be smaller than Slat Width / 2.~ Used only for ShadingLayerType = Venetian.
The curvature radius (m) of the venetian slats.~ Setting this value to zero means there is no curvature in the slat (it is flat), while a non-zero value is the radius of the slat curve.~ This value cannot be smaller than Slat Width / 2.~ Used only for ShadingLayerType = VenetianHorizontal or VenetianVertical.

\begin{figure}[hbtp] % fig 18
\centering
\includegraphics[width=0.9\textwidth, height=0.9\textheight, keepaspectratio=true]{media/image042.png}
\caption{Side view of horizontal venetian blind slats or top view of blinds with vertical slats. Front face of slats is marked with red line. \protect \label{fig:side-view-of-horizontal-venetian-blind-slats}}
\end{figure}

An IDF example for ShadingLayerType = Venetian
An IDF example for ShadingLayerType = VenetianHorizontal

\begin{lstlisting}

WindowMaterial:ComplexShade, !- venetian blind layer
Shade_30001_Layer, !- name
Venetian, !- shading layer type
VenetianHorizontal, !- shading layer type
0.005, !- thickness
160, !- layer conductivity
0.0, !- IR transmittance
Expand Down
57 changes: 12 additions & 45 deletions src/EnergyPlus/Material.cc
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ constexpr std::array<Material::Gas, 10> gases = {

constexpr std::array<std::string_view, (int)EcoRoofCalcMethod::Num> ecoRoofCalcMethodNamesUC = {"SIMPLE", "ADVANCED"};

int GetMaterialNum(EnergyPlusData &state, std::string const &matName)
int GetMaterialNum(EnergyPlusData const &state, std::string const &matName)
{
auto const &s_mat = state.dataMaterial;
auto found = s_mat->materialMap.find(Util::makeUPPER(matName));
Expand Down Expand Up @@ -2496,14 +2496,14 @@ void GetMaterialData(EnergyPlusData &state, bool &ErrorsFound) // set to true if
continue;
}

auto const &instances = itInstances.value();
auto itObj = instances.begin();
auto const &instances2 = itInstances.value();
auto itObj = instances2.begin();
// Can't use find here because epJSON keys are not upper-cased
for (; itObj != instances.end(); ++itObj) {
for (; itObj != instances2.end(); ++itObj) {
if (Util::makeUPPER(itObj.key()) == s_ipsc->cAlphaArgs(3)) break;
}

if (itObj == instances.end()) {
if (itObj == instances2.end()) {
ShowSevereItemNotFound(state, eoh, s_ipsc->cAlphaFieldNames(3), s_ipsc->cAlphaArgs(3));
ErrorsFound = true;
continue;
Expand All @@ -2523,15 +2523,15 @@ void GetMaterialData(EnergyPlusData &state, bool &ErrorsFound) // set to true if
continue;
}

auto const &instances = itInstances.value();
auto const &instances3 = itInstances.value();

auto itObj = instances.begin();
auto itObj = instances3.begin();
// Can't use find here because epJSON keys are not upper-cased
for (; itObj != instances.end(); ++itObj) {
for (; itObj != instances3.end(); ++itObj) {
if (Util::makeUPPER(itObj.key()) == s_ipsc->cAlphaArgs(4)) break;
}

if (itObj == instances.end()) {
if (itObj == instances3.end()) {
ShowSevereItemNotFound(state, eoh, s_ipsc->cAlphaFieldNames(4), s_ipsc->cAlphaArgs(4));
ErrorsFound = true;
continue;
Expand Down Expand Up @@ -2668,45 +2668,12 @@ void GetMaterialData(EnergyPlusData &state, bool &ErrorsFound) // set to true if
}

if ((mat->LayerType == TARCOGParams::TARCOGLayerType::VENETBLIND_HORIZ) ||
(mat->LayerType == TARCOGParams::TARCOGLayerType::VENETBLIND_HORIZ)) {
if (s_ipsc->rNumericArgs(11) <= 0.0) {
ErrorsFound = true;
ShowSevereCustomMessage(
state, eoh, format("{} must be >0, entered value = {:.2R}", s_ipsc->cNumericFieldNames(11), s_ipsc->rNumericArgs(11)));
}

if (s_ipsc->rNumericArgs(12) <= 0.0) {
ErrorsFound = true;
ShowSevereCustomMessage(
state, eoh, format("{} must be >0, entered value = {:.2R}", s_ipsc->cNumericFieldNames(12), s_ipsc->rNumericArgs(12)));
}

if (s_ipsc->rNumericArgs(13) <= 0.0) {
ErrorsFound = true;
ShowSevereCustomMessage(
state, eoh, format("{} must be >0, entered value = {:.2R}", s_ipsc->cNumericFieldNames(13), s_ipsc->rNumericArgs(13)));
}

if ((s_ipsc->rNumericArgs(14) < -90.0) || (s_ipsc->rNumericArgs(14) > 90.0)) {
ErrorsFound = true;
ShowSevereCustomMessage(
state,
eoh,
format("{} must be >=-90 and <=90, entered value = {:.2R}", s_ipsc->cNumericFieldNames(14), s_ipsc->rNumericArgs(14)));
}

if (s_ipsc->rNumericArgs(15) <= 0.0) {
ErrorsFound = true;
ShowSevereCustomMessage(
state, eoh, format("{} must be >0, entered value = {:.2R}", s_ipsc->cNumericFieldNames(15), s_ipsc->rNumericArgs(15)));
}

if ((s_ipsc->rNumericArgs(16) < 0.0) ||
((s_ipsc->rNumericArgs(16) > 0.0) && (s_ipsc->rNumericArgs(16) < (s_ipsc->rNumericArgs(11) / 2)))) {
(mat->LayerType == TARCOGParams::TARCOGLayerType::VENETBLIND_VERT)) {
if ((s_ipsc->rNumericArgs(16) > 0.0) && (s_ipsc->rNumericArgs(16) < (s_ipsc->rNumericArgs(11) / 2))) {
ErrorsFound = true;
ShowSevereCustomMessage(state,
eoh,
format("{} must be =0 or greater than SlatWidth/2, entered value = {:.2R}",
format("{} must be = 0 or greater than SlatWidth/2, entered value = {:.2R}",
s_ipsc->cNumericFieldNames(16),
s_ipsc->rNumericArgs(16)));
}
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/Material.hh
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,7 @@ namespace Material {
~MaterialGlassTC() = default;
};

int GetMaterialNum(EnergyPlusData &state, std::string const &matName);
int GetMaterialNum(EnergyPlusData const &state, std::string const &matName);
MaterialBase *GetMaterial(EnergyPlusData &state, std::string const &matName);

void GetMaterialData(EnergyPlusData &state, bool &errorsFound); // set to true if errors found in input
Expand Down

4 comments on commit 93e5c1b

@nrel-bot-2b
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

afn_dx_clg_var_spd_coil (lymereJ) - x86_64-Linux-Ubuntu-22.04-gcc-11.4-UnitTestsCoverage-RelWithDebInfo: Tests Failed (0 of 0 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

afn_dx_clg_var_spd_coil (lymereJ) - x86_64-Linux-Ubuntu-22.04-gcc-11.4-IntegrationCoverage-RelWithDebInfo: Tests Failed (0 of 0 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

afn_dx_clg_var_spd_coil (lymereJ) - Win64-Windows-10-VisualStudio-16: OK (2895 of 2895 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

afn_dx_clg_var_spd_coil (lymereJ) - x86_64-Linux-Ubuntu-22.04-gcc-11.4: OK (2917 of 2917 tests passed, 0 test warnings)

Build Badge Test Badge

Please sign in to comment.