Skip to content

Commit

Permalink
Fix issue with user defined fluid
Browse files Browse the repository at this point in the history
  • Loading branch information
Amir Roth committed Jan 4, 2025
1 parent 4c68eb3 commit 149f568
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/EnergyPlus/Plant/Loop.hh
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ namespace DataPlant {
std::string Name; // Name of the component list
std::string FluidName; // Name of the fluid specified for this loop
DataLoopNode::NodeFluidType FluidType; // Type of fluid in the loop
int FluidIndex; // Index for Fluid in FluidProperties
int FluidIndex = 0;

FluidProperties::GlycolProps *glycol = nullptr;
FluidProperties::RefrigProps *steam = nullptr;
Expand Down Expand Up @@ -154,7 +154,7 @@ namespace DataPlant {

// Default Constructor
PlantLoopData()
: FluidType(DataLoopNode::NodeFluidType::Blank), FluidIndex(1), // default to water
: FluidType(DataLoopNode::NodeFluidType::Blank),
MFErrIndex(0), MFErrIndex1(0), MFErrIndex2(0), TempSetPointNodeNum(0), MaxBranch(0), MinTemp(0.0), MaxTemp(0.0), MinTempErrIndex(0),
MaxTempErrIndex(0), MinVolFlowRate(0.0), MaxVolFlowRate(0.0), MaxVolFlowRateWasAutoSized(false), MinMassFlowRate(0.0),
MaxMassFlowRate(0.0), Volume(0.0), VolumeWasAutoSized(false), CirculationTime(2.0), Mass(0.0), EMSCtrl(false), EMSValue(0.0),
Expand Down
4 changes: 3 additions & 1 deletion src/EnergyPlus/Plant/PlantManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@ void GetPlantLoopData(EnergyPlusData &state)
if (Util::SameString(Alpha(2), "STEAM")) {
this_loop.FluidType = DataLoopNode::NodeFluidType::Steam;
this_loop.FluidName = Alpha(2);
this_loop.FluidIndex = 0;
this_loop.steam = FluidProperties::GetSteam(state);
} else if (Util::SameString(Alpha(2), "WATER")) {
this_loop.FluidType = DataLoopNode::NodeFluidType::Water;
Expand All @@ -395,7 +396,8 @@ void GetPlantLoopData(EnergyPlusData &state)
this_loop.glycol = FluidProperties::GetWater(state);
} else if (Util::SameString(Alpha(2), "USERDEFINEDFLUIDTYPE")) {
this_loop.FluidType = DataLoopNode::NodeFluidType::Water;
// this_loop.FluidName = Alpha(3);
this_loop.FluidName = Alpha(3);
this_loop.FluidIndex = 0;
// check for valid fluid name
this_loop.glycol = FluidProperties::GetGlycol(state, Alpha(3));
if (this_loop.glycol == nullptr) {
Expand Down

3 comments on commit 149f568

@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 (2880 of 2919 tests passed, 0 test warnings)

Failures:\n

EnergyPlusFixture Test Summary

  • Passed: 1569
  • Failed: 37

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 (2062 of 2101 tests passed, 0 test warnings)

Failures:\n

EnergyPlusFixture Test Summary

  • Passed: 1569
  • Failed: 37

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.