Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion src/EnergyPlus/FluidProperties.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4594,7 +4594,7 @@ namespace Fluid {
if (!state.dataGlobal->WarmupFlag && error != GlycolError::Invalid) {
df->glycolErrorLimits[(int)error] = ++this->errors[(int)error].count;

if (error == GlycolError::ViscosityHigh) {
if (error == GlycolError::ViscosityLow) {
if (df->glycolErrorLimits[(int)error] <= df->GlycolErrorLimitTest) {
ShowWarningMessage(
state, EnergyPlus::format("{}: Temperature is out of range (too low) for fluid [{}] viscosity **", routineName, this->Name));
Expand Down
22 changes: 22 additions & 0 deletions tst/EnergyPlus/unit/FluidProperties.unit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,28 @@ TEST_F(EnergyPlusFixture, FluidProperties_GetSpecificHeatGlycol)
EXPECT_NEAR(4137, fluid->getSpecificHeat(*state, 125.0, "UnitTest"), 0.01);
}

TEST_F(EnergyPlusFixture, FluidProperties_GetViscosityGlycolOutOfRangeWarnings)
{
std::string const idf_objects = delimited_string({"FluidProperties:GlycolConcentration,",
" GLHXFluid, !- Name",
" PropyleneGlycol, !- Glycol Type",
" , !- User Defined Glycol Name",
" 0.3; !- Glycol Concentration",
" "});

ASSERT_TRUE(process_idf(idf_objects));
EXPECT_FALSE(has_err_output());

state->init_state(*state);
auto *fluid = Fluid::GetGlycol(*state, "GLHXFLUID");

fluid->getViscosity(*state, -100.0, "UnitTest");
EXPECT_TRUE(compare_err_stream_substring("Temperature is out of range (too low) for fluid [GLHXFLUID] viscosity **", true));

fluid->getViscosity(*state, 200.0, "UnitTest");
EXPECT_TRUE(compare_err_stream_substring("Temperature is out of range (too high) for fluid [GLHXFLUID] viscosity **", true));
}

TEST_F(EnergyPlusFixture, FluidProperties_InterpValuesForGlycolConc)
{
// Test fluid property interpolations with only one concentration
Expand Down