Skip to content

Commit

Permalink
Fix steam loop issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Amir Roth committed Jan 6, 2025
1 parent 96a7a97 commit 95d9dea
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions src/EnergyPlus/Plant/PlantManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -385,15 +385,26 @@ void GetPlantLoopData(EnergyPlusData &state)
this_loop.Name = Alpha(1); // Load the Plant Loop Name

if (Util::SameString(Alpha(2), "STEAM")) {
// A steam loop needs both the refrigerant (i.e.,
// liquid-vapor mixture) properties and the glycol (liquid
// properties) for the condensate. The way this was done
// is that both Water (glycol) and Steam (refrig) were at
// index 1 in their respective arrays and so they could
// use a single index, and because the index was pre-set
// the FluidName was never consulted. That's not a very
// robust way of doing things.
this_loop.FluidType = DataLoopNode::NodeFluidType::Steam;
this_loop.FluidName = Alpha(2);
this_loop.FluidIndex = 0;
this_loop.FluidIndex = 1;
this_loop.glycol = FluidProperties::GetWater(state);
this_loop.steam = FluidProperties::GetSteam(state);

} else if (Util::SameString(Alpha(2), "WATER")) {
this_loop.FluidType = DataLoopNode::NodeFluidType::Water;
this_loop.FluidName = Alpha(2);
this_loop.FluidIndex = FluidProperties::GetGlycolNum(state, Alpha(2));
this_loop.FluidIndex = 1;
this_loop.glycol = FluidProperties::GetWater(state);

} else if (Util::SameString(Alpha(2), "USERDEFINEDFLUIDTYPE")) {
this_loop.FluidType = DataLoopNode::NodeFluidType::Water;
this_loop.FluidName = Alpha(3);
Expand All @@ -404,15 +415,13 @@ void GetPlantLoopData(EnergyPlusData &state)
ShowSevereItemNotFound(state, eoh, state.dataIPShortCut->cAlphaFieldNames(3), Alpha(3));
ErrorsFound = true;
}

} else {
ShowWarningError(state,
"Input error: " + state.dataIPShortCut->cAlphaFieldNames(2) + '=' + Alpha(2) + " entered, in " + CurrentModuleObject +
'=' + Alpha(1));
ShowContinueError(state, "Will default to Water.");
ShowWarningInvalidKey(state, eoh, state.dataIPShortCut->cAlphaFieldNames(2), Alpha(2), "Water");

this_loop.FluidType = DataLoopNode::NodeFluidType::Water;
this_loop.FluidName = "WATER";
this_loop.FluidIndex = FluidProperties::GetGlycolNum(state, "WATER");
this_loop.FluidIndex = 1;
this_loop.glycol = FluidProperties::GetWater(state);
}

Expand Down

3 comments on commit 95d9dea

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

FluidAPI2 (Unknown) - x86_64-Linux-Ubuntu-24.04-gcc-13.3: OK (2919 of 2919 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.

FluidAPI2 (Unknown) - x86_64-Linux-Ubuntu-24.04-gcc-13.3-UnitTestsCoverage-RelWithDebInfo: OK (2101 of 2101 tests passed, 0 test warnings)

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

FluidAPI2 (Unknown) - x86_64-Linux-Ubuntu-24.04-gcc-13.3-IntegrationCoverage-RelWithDebInfo: OK (801 of 801 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

Please sign in to comment.