Skip to content

Commit

Permalink
address comments part 2
Browse files Browse the repository at this point in the history
  • Loading branch information
xuanluo113 committed Feb 25, 2021
1 parent 034c0f8 commit c9f020e
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 20 deletions.
Binary file added doc/engineering-reference/media/ankle_draft.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 11 additions & 8 deletions src/EnergyPlus/InternalHeatGains.cc
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,8 @@ namespace InternalHeatGains {
} else if (ModelWithAdditionalInputs) {
if (Item1 == 1) {
ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", blank " + cAlphaFieldNames(9) +
" is required for this item.");
". " + cAlphaFieldNames(9) + " is required when Thermal Comfort Model Type is one of "
"\"Fanger\", \"Pierce\", \"KSU\", \"CoolingEffectASH55\" or \"AnkleDraftASH55\"" );
ErrorsFound = true;
}
}
Expand All @@ -881,7 +882,7 @@ namespace InternalHeatGains {
if (People(Loop).ClothingPtr == 0 && ModelWithAdditionalInputs) {
if (Item1 == 1) {
ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " +
cAlphaFieldNames(12) + " entered=" + AlphaName(12));
cAlphaFieldNames(12) + " entered=\"" + AlphaName(12) + "\".");
ErrorsFound = true;
}
} else { // check min/max on schedule
Expand Down Expand Up @@ -933,7 +934,7 @@ namespace InternalHeatGains {
if (People(Loop).ClothingMethodPtr == 0) {
if (Item1 == 1) {
ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " +
cAlphaFieldNames(11) + " entered=" + AlphaName(11));
cAlphaFieldNames(11) + " entered=\"" + AlphaName(11) + "\".");
ErrorsFound = true;
}
}
Expand All @@ -942,7 +943,7 @@ namespace InternalHeatGains {
if (People(Loop).ClothingPtr == 0) {
if (Item1 == 1) {
ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " +
cAlphaFieldNames(12) + " entered=" + AlphaName(12));
cAlphaFieldNames(12) + " entered=\"" + AlphaName(12) + "\".");
ErrorsFound = true;
}
}
Expand All @@ -963,7 +964,7 @@ namespace InternalHeatGains {
if (People(Loop).AirVelocityPtr == 0) {
if (Item1 == 1) {
ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " +
cAlphaFieldNames(13) + " entered=" + AlphaName(13));
cAlphaFieldNames(13) + " entered=\"" + AlphaName(13) + "\".");
ErrorsFound = true;
}
} else { // check min/max on schedule
Expand Down Expand Up @@ -995,7 +996,8 @@ namespace InternalHeatGains {
} else if (ModelWithAdditionalInputs) {
if (Item1 == 1) {
ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", blank " + cAlphaFieldNames(13) +
" is required for this item.");
". " + cAlphaFieldNames(13) + " is required when Thermal Comfort Model Type is one of "
"\"Fanger\", \"Pierce\", \"KSU\", \"CoolingEffectASH55\" or \"AnkleDraftASH55\"");
ErrorsFound = true;
}
}
Expand All @@ -1006,14 +1008,15 @@ namespace InternalHeatGains {
if (People(Loop).AnkleAirVelocityPtr == 0) {
if (Item1 == 1) {
ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", invalid " +
cAlphaFieldNames(indexAnkleAirVelPtr) + " entered=" + AlphaName(indexAnkleAirVelPtr));
cAlphaFieldNames(indexAnkleAirVelPtr) + " entered=\"" + AlphaName(indexAnkleAirVelPtr) + "\".");
ErrorsFound = true;
}
}
} else if (People(Loop).AnkleDraftASH55) {
if (Item1 == 1) {
ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\", blank " + cAlphaFieldNames(indexAnkleAirVelPtr) +
" is required for this item.");
". " + cAlphaFieldNames(indexAnkleAirVelPtr) + " is required when Thermal Comfort Model Type is one of "
"\"Fanger\", \"Pierce\", \"KSU\", \"CoolingEffectASH55\" or \"AnkleDraftASH55\"");
ErrorsFound = true;
}
}
Expand Down
39 changes: 29 additions & 10 deletions src/EnergyPlus/ThermalComfort.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1174,12 +1174,10 @@ namespace ThermalComfort {
upperBound, ce_root_termination);
CoolingEffect = (solverResult.first + solverResult.second) / 2;
} catch (const std::exception &e) {
ShowRecurringWarningErrorAtEnd(state, "The cooling effect could not be solved for People=\"" + People(state.dataThermalComforts->PeopleNum).Name + "\"" +
"As a result, no cooling effect will be applied to adjust the PMV and PPD results.",
state.dataThermalComforts->CoolingEffectWarningInd);
CoolingEffect = 0;
if (state.dataThermalComforts->FirstTimeCoolingEffectWarning) {
ShowWarningError(state, "The cooling effect could not be solved for People=\"" + People(state.dataThermalComforts->PeopleNum).Name + "\"");
ShowContinueError(state, "As a result, no cooling effect will be applied to adjust the PMV and PPD results.");
state.dataThermalComforts->FirstTimeCoolingEffectWarning = false;
}
}

if (CoolingEffect > 0) {
Expand Down Expand Up @@ -1214,11 +1212,32 @@ namespace ThermalComfort {
PPD_AD = (std::exp(-2.58 + 3.05 * AnkleAirVel - 1.06 * PMV) / (1 + std::exp(-2.58 + 3.05 * AnkleAirVel - 1.06 * PMV))) * 100.0;

} else {
if (state.dataThermalComforts->FirstTimeAnkleDraftWarning) {
ShowWarningError(state, "Ankle draft PPD calculations are only applicable for relative air velocity is below 0.2 m/s,");
ShowContinueError(state,"and the subject’s metabolic rate and clothing level should be kept below 1.3 met and 0.7 clo.");
ShowContinueError(state,"PPD at ankle draft will be set to -1.0 if if these conditions are not met.");
state.dataThermalComforts->FirstTimeAnkleDraftWarning = false;
if (RelAirVel >= 0.2) {
ShowRecurringWarningErrorAtEnd(state, "Relative air velocity is above 0.2 m/s in Ankle draft PPD calculations. PPD at ankle draft will be set to -1.0.",
state.dataThermalComforts->AnkleDraftAirVelWarningInd,
RelAirVel,
RelAirVel,
_,
"[m/s]",
"[m/s]");
}
if (state.dataThermalComforts->ActMet >= 1.3) {
ShowRecurringWarningErrorAtEnd(state, "Metabolic rate is above 1.3 met in Ankle draft PPD calculations. PPD at ankle draft will be set to -1.0.",
state.dataThermalComforts->AnkleDraftActMetWarningInd,
state.dataThermalComforts->ActMet,
state.dataThermalComforts->ActMet,
_,
"[m/s]",
"[m/s]");
}
if (state.dataThermalComforts->CloUnit >= 0.7) {
ShowRecurringWarningErrorAtEnd(state, "Clothing unit is above 0.7 in Ankle draft PPD calculations. PPD at ankle draft will be set to -1.0.",
state.dataThermalComforts->AnkleDraftCloUnitWarningInd,
state.dataThermalComforts->CloUnit,
state.dataThermalComforts->CloUnit,
_,
"[m/s]",
"[m/s]");
}
}
state.dataThermalComforts->ThermalComfortData(state.dataThermalComforts->PeopleNum).AnkleDraftPPDASH55 = PPD_AD;
Expand Down
6 changes: 4 additions & 2 deletions src/EnergyPlus/ThermalComfort.hh
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,10 @@ struct ThermalComfortsData : BaseGlobalStruct {

bool FirstTimeFlag = true; // Flag set to make sure you get input once
bool FirstTimeSurfaceWeightedFlag = true; // Flag set to make sure certain calcs related to surface weighted option are only done once
bool FirstTimeCoolingEffectWarning = true; // Flag set to make sure certain warnings related to cooling effect calcs are only done once
bool FirstTimeAnkleDraftWarning = true; // Flag set to make sure certain warnings related to ankle draft calcs are only done once
int CoolingEffectWarningInd = 0; // Counter for ankle draft invalid air velocity warnings.
int AnkleDraftAirVelWarningInd = 0; // Counter for ankle draft invalid air velocity warnings.
int AnkleDraftCloUnitWarningInd = 0; // Counter for ankle draft invalid clothing unit warnings.
int AnkleDraftActMetWarningInd = 0; // Counter for ankle draft invalid activity level warnings.

// MODULE PARAMETER DEFINITIONS
Real64 const TAbsConv = DataGlobalConstants::KelvinConv; // Converter for absolute temperature
Expand Down

5 comments on commit c9f020e

@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.

pmv-follow-up (xuanluo113) - x86_64-Linux-Ubuntu-18.04-gcc-7.5: OK (3093 of 3093 tests passed, 1 test warnings)

Messages:\n

  • 1 test had: ERR diffs.

Build Badge Test Badge

@nrel-bot-3
Copy link

Choose a reason for hiding this comment

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

pmv-follow-up (xuanluo113) - x86_64-MacOS-10.15-clang-11.0.0: OK (3053 of 3053 tests passed, 1 test warnings)

Messages:\n

  • 1 test had: ERR diffs.

Build Badge Test 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.

pmv-follow-up (xuanluo113) - Win64-Windows-10-VisualStudio-16: OK (2304 of 2304 tests passed, 0 test warnings)

Build Badge Test Badge

@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.

pmv-follow-up (xuanluo113) - x86_64-Linux-Ubuntu-18.04-gcc-7.5-UnitTestsCoverage-Debug: OK (1607 of 1607 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.

pmv-follow-up (xuanluo113) - x86_64-Linux-Ubuntu-18.04-gcc-7.5-IntegrationCoverage-Debug: OK (727 of 727 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

Please sign in to comment.