Skip to content

Commit

Permalink
Begin propagating FluidAPI to plant loop
Browse files Browse the repository at this point in the history
  • Loading branch information
Amir Roth committed Jan 4, 2025
1 parent 6b3caaa commit 4c68eb3
Show file tree
Hide file tree
Showing 41 changed files with 708 additions and 1,074 deletions.
18 changes: 3 additions & 15 deletions src/EnergyPlus/AirLoopHVACDOAS.cc
Original file line number Diff line number Diff line change
Expand Up @@ -889,11 +889,7 @@ namespace AirLoopHVACDOAS {
if (Util::SameString(CompType, "COIL:HEATING:WATER")) {
WaterCoils::SimulateWaterCoilComponents(state, CompName, FirstHVACIteration, this->m_HeatCoilNum);
Real64 CoilMaxVolFlowRate = WaterCoils::GetCoilMaxWaterFlowRate(state, "Coil:Heating:Water", CompName, ErrorsFound);
rho = FluidProperties::GetDensityGlycol(state,
state.dataPlnt->PlantLoop(this->HWPlantLoc.loopNum).FluidName,
Constant::HWInitConvTemp,
state.dataPlnt->PlantLoop(this->HWPlantLoc.loopNum).FluidIndex,
RoutineName);
rho = state.dataPlnt->PlantLoop(this->HWPlantLoc.loopNum).glycol->getDensity(state, Constant::HWInitConvTemp, RoutineName);
PlantUtilities::InitComponentNodes(state,
0.0,
CoilMaxVolFlowRate * rho,
Expand All @@ -903,11 +899,7 @@ namespace AirLoopHVACDOAS {
if (Util::SameString(CompType, "COIL:COOLING:WATER")) {
WaterCoils::SimulateWaterCoilComponents(state, CompName, FirstHVACIteration, this->m_CoolCoilNum);
Real64 CoilMaxVolFlowRate = WaterCoils::GetCoilMaxWaterFlowRate(state, "Coil:Cooling:Water", CompName, ErrorsFound);
rho = FluidProperties::GetDensityGlycol(state,
state.dataPlnt->PlantLoop(this->CWPlantLoc.loopNum).FluidName,
Constant::CWInitConvTemp,
state.dataPlnt->PlantLoop(this->CWPlantLoc.loopNum).FluidIndex,
RoutineName);
rho = state.dataPlnt->PlantLoop(this->CWPlantLoc.loopNum).glycol->getDensity(state, Constant::CWInitConvTemp, RoutineName);
PlantUtilities::InitComponentNodes(state,
0.0,
CoilMaxVolFlowRate * rho,
Expand All @@ -918,11 +910,7 @@ namespace AirLoopHVACDOAS {
WaterCoils::SimulateWaterCoilComponents(state, CompName, FirstHVACIteration, this->m_CoolCoilNum);
Real64 CoilMaxVolFlowRate =
WaterCoils::GetCoilMaxWaterFlowRate(state, "Coil:Cooling:Water:DetailedGeometry", CompName, ErrorsFound);
rho = FluidProperties::GetDensityGlycol(state,
state.dataPlnt->PlantLoop(this->CWPlantLoc.loopNum).FluidName,
Constant::CWInitConvTemp,
state.dataPlnt->PlantLoop(this->CWPlantLoc.loopNum).FluidIndex,
RoutineName);
rho = state.dataPlnt->PlantLoop(this->CWPlantLoc.loopNum).glycol->getDensity(state, Constant::CWInitConvTemp, RoutineName);
PlantUtilities::InitComponentNodes(state,
0.0,
CoilMaxVolFlowRate * rho,
Expand Down
16 changes: 6 additions & 10 deletions src/EnergyPlus/Autosizing/CoolingWaterDesAirOutletTempSizing.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,12 @@ Real64 CoolingWaterDesAirOutletTempSizer::size(EnergyPlusData &state, Real64 _or
this->autoSizedValue = _originalValue;
} else {
if (this->termUnitIU) {
Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state,
state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidName,
Constant::CWInitConvTemp,
state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidIndex,
this->callingRoutine);
Real64 rho = FluidProperties::GetDensityGlycol(state,
state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidName,
Constant::CWInitConvTemp,
state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidIndex,
this->callingRoutine);
Real64 Cp = state.dataPlnt->PlantLoop(this->dataWaterLoopNum).glycol->getSpecificHeat(state,
Constant::CWInitConvTemp,
this->callingRoutine);
Real64 rho = state.dataPlnt->PlantLoop(this->dataWaterLoopNum).glycol->getDensity(state,
Constant::CWInitConvTemp,
this->callingRoutine);
Real64 DesCoilLoad = this->dataWaterFlowUsedForSizing * this->dataWaterCoilSizCoolDeltaT * Cp * rho;
Real64 T1Out =
this->dataDesInletAirTemp - DesCoilLoad / (state.dataEnvrn->StdRhoAir * Psychrometrics::PsyCpAirFnW(this->dataDesInletAirHumRat) *
Expand Down
32 changes: 12 additions & 20 deletions src/EnergyPlus/Autosizing/CoolingWaterflowSizing.cc
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,12 @@ Real64 CoolingWaterflowSizer::size(EnergyPlusData &state, Real64 _originalValue,
if (DesCoilLoad >= HVAC::SmallLoad) {
if (this->dataWaterLoopNum > 0 && this->dataWaterLoopNum <= (int)state.dataPlnt->PlantLoop.size() &&
this->dataWaterCoilSizCoolDeltaT > 0.0) {
Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state,
state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidName,
Constant::CWInitConvTemp,
state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidIndex,
this->callingRoutine);
Real64 rho = FluidProperties::GetDensityGlycol(state,
state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidName,
Constant::CWInitConvTemp,
state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidIndex,
this->callingRoutine);
Real64 Cp = state.dataPlnt->PlantLoop(this->dataWaterLoopNum).glycol->getSpecificHeat(state,
Constant::CWInitConvTemp,
this->callingRoutine);
Real64 rho = state.dataPlnt->PlantLoop(this->dataWaterLoopNum).glycol->getDensity(state,
Constant::CWInitConvTemp,
this->callingRoutine);
this->autoSizedValue = DesCoilLoad / (CoilDesWaterDeltaT * Cp * rho);
} else {
this->autoSizedValue = 0.0;
Expand All @@ -120,16 +116,12 @@ Real64 CoolingWaterflowSizer::size(EnergyPlusData &state, Real64 _originalValue,
if (this->curOASysNum > 0) CoilDesWaterDeltaT *= 0.5;
if (this->dataCapacityUsedForSizing >= HVAC::SmallLoad) {
if (this->dataWaterLoopNum > 0 && this->dataWaterLoopNum <= (int)state.dataPlnt->PlantLoop.size() && CoilDesWaterDeltaT > 0.0) {
Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state,
state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidName,
Constant::CWInitConvTemp,
state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidIndex,
this->callingRoutine);
Real64 rho = FluidProperties::GetDensityGlycol(state,
state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidName,
Constant::CWInitConvTemp,
state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidIndex,
this->callingRoutine);
Real64 Cp = state.dataPlnt->PlantLoop(this->dataWaterLoopNum).glycol->getSpecificHeat(state,
Constant::CWInitConvTemp,
this->callingRoutine);
Real64 rho = state.dataPlnt->PlantLoop(this->dataWaterLoopNum).glycol->getDensity(state,
Constant::CWInitConvTemp,
this->callingRoutine);
this->autoSizedValue = this->dataCapacityUsedForSizing / (CoilDesWaterDeltaT * Cp * rho);
} else {
this->autoSizedValue = 0.0;
Expand Down
48 changes: 18 additions & 30 deletions src/EnergyPlus/Autosizing/HeatingWaterDesCoilLoadUsedForUASizing.cc
Original file line number Diff line number Diff line change
Expand Up @@ -69,42 +69,30 @@ Real64 HeatingWaterDesCoilLoadUsedForUASizer::size(EnergyPlusData &state, Real64
this->autoSizedValue = _originalValue;
} else {
if (this->termUnitSingDuct && (this->curTermUnitSizingNum > 0)) {
Real64 const Cp = FluidProperties::GetSpecificHeatGlycol(state,
state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidName,
Constant::HWInitConvTemp,
state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidIndex,
this->callingRoutine);
Real64 const rho = FluidProperties::GetDensityGlycol(state,
state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidName,
Constant::HWInitConvTemp,
state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidIndex,
this->callingRoutine);
Real64 const Cp = state.dataPlnt->PlantLoop(this->dataWaterLoopNum).glycol->getSpecificHeat(state,
Constant::HWInitConvTemp,
this->callingRoutine);
Real64 const rho = state.dataPlnt->PlantLoop(this->dataWaterLoopNum).glycol->getDensity(state,
Constant::HWInitConvTemp,
this->callingRoutine);
this->autoSizedValue = this->dataWaterFlowUsedForSizing * this->dataWaterCoilSizHeatDeltaT * Cp * rho;
state.dataRptCoilSelection->coilSelectionReportObj->setCoilReheatMultiplier(state, this->compName, this->compType, 1.0);
} else if ((this->termUnitPIU || this->termUnitIU) && (this->curTermUnitSizingNum > 0)) {
Real64 const Cp = FluidProperties::GetSpecificHeatGlycol(state,
state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidName,
Constant::HWInitConvTemp,
state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidIndex,
this->callingRoutine);
Real64 const rho = FluidProperties::GetDensityGlycol(state,
state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidName,
Constant::HWInitConvTemp,
state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidIndex,
this->callingRoutine);
Real64 const Cp = state.dataPlnt->PlantLoop(this->dataWaterLoopNum).glycol->getSpecificHeat(state,
Constant::HWInitConvTemp,
this->callingRoutine);
Real64 const rho = state.dataPlnt->PlantLoop(this->dataWaterLoopNum).glycol->getDensity(state,
Constant::HWInitConvTemp,
this->callingRoutine);
this->autoSizedValue = this->dataWaterFlowUsedForSizing * this->dataWaterCoilSizHeatDeltaT * Cp * rho *
this->termUnitSizing(this->curTermUnitSizingNum).ReheatLoadMult;
} else if (this->zoneEqFanCoil || this->zoneEqUnitHeater) {
Real64 const Cp = FluidProperties::GetSpecificHeatGlycol(state,
state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidName,
Constant::HWInitConvTemp,
state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidIndex,
this->callingRoutine);
Real64 const rho = FluidProperties::GetDensityGlycol(state,
state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidName,
Constant::HWInitConvTemp,
state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidIndex,
this->callingRoutine);
Real64 const Cp = state.dataPlnt->PlantLoop(this->dataWaterLoopNum).glycol->getSpecificHeat(state,
Constant::HWInitConvTemp,
this->callingRoutine);
Real64 const rho = state.dataPlnt->PlantLoop(this->dataWaterLoopNum).glycol->getDensity(state,
Constant::HWInitConvTemp,
this->callingRoutine);
this->autoSizedValue = this->dataWaterFlowUsedForSizing * this->dataWaterCoilSizHeatDeltaT * Cp * rho;
state.dataRptCoilSelection->coilSelectionReportObj->setCoilReheatMultiplier(state, this->compName, this->compType, 1.0);
} else {
Expand Down
Loading

3 comments on commit 4c68eb3

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