Skip to content

Commit

Permalink
Add source side CP as an output variable for PLHP
Browse files Browse the repository at this point in the history
  • Loading branch information
Myoldmopar committed Sep 20, 2023
1 parent 1c467df commit 5de2874
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/EnergyPlus/PlantLoopHeatPumpEIR.cc
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,7 @@ void EIRPlantLoopHeatPump::doPhysics(EnergyPlusData &state, Real64 currentLoad)
} else {
CpSrc = Psychrometrics::PsyCpAirFnW(state.dataEnvrn->OutHumRat);
}
this->sourceSideCp = CpSrc;
Real64 const sourceMCp = this->sourceSideMassFlowRate * CpSrc;
this->sourceSideOutletTemp = this->calcSourceOutletTemp(this->sourceSideInletTemp, this->sourceSideHeatTransfer / sourceMCp);

Expand Down Expand Up @@ -1747,6 +1748,13 @@ void EIRPlantLoopHeatPump::oneTimeInit(EnergyPlusData &state)
OutputProcessor::SOVTimeStepType::System,
OutputProcessor::SOVStoreType::Average,
this->name);
SetupOutputVariable(state,
"Heat Pump Source Side Specific Heat",
OutputProcessor::Unit::J_kgK,
this->sourceSideCp,
OutputProcessor::SOVTimeStepType::System,
OutputProcessor::SOVStoreType::Average,
this->name);

// find this component on the plant
bool thisErrFlag = false;
Expand Down Expand Up @@ -2246,11 +2254,20 @@ void EIRFuelFiredHeatPump::doPhysics(EnergyPlusData &state, Real64 currentLoad)
// calculate source side outlet conditions
Real64 CpSrc = 0.0;
if (this->waterSource) {
auto &thisSourcePlantLoop = state.dataPlnt->PlantLoop(this->sourceSidePlantLoc.loopNum);
CpSrc = FluidProperties::GetSpecificHeatGlycol(
state, thisLoadPlantLoop.FluidName, thisInletNode.Temp, thisLoadPlantLoop.FluidIndex, "PLFFHPEIR::simulate()");
state, thisSourcePlantLoop.FluidName, this->sourceSideInletTemp, thisSourcePlantLoop.FluidIndex, "PLFFHPEIR::simulate()");
} else if (this->airSource) {
CpSrc = Psychrometrics::PsyCpAirFnW(state.dataEnvrn->OutHumRat);
}
this->sourceSideCp = CpSrc;
SetupOutputVariable(state,
"Heat Pump Source Side Specific Heat",
OutputProcessor::Unit::J_kgK,
this->sourceSideCp,
OutputProcessor::SOVTimeStepType::System,
OutputProcessor::SOVStoreType::Average,
this->name);
// Real64 const sourceMCp = this->sourceSideMassFlowRate * CpSrc;
Real64 const sourceMCp = (this->sourceSideMassFlowRate < 1e-6 ? 1.0 : this->sourceSideMassFlowRate) * CpSrc;
this->sourceSideOutletTemp = this->calcSourceOutletTemp(this->sourceSideInletTemp, this->sourceSideHeatTransfer / sourceMCp);
Expand Down
1 change: 1 addition & 0 deletions src/EnergyPlus/PlantLoopHeatPumpEIR.hh
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ namespace EIRPlantLoopHeatPumps {
Real64 loadSideEnergy = 0.0;
Real64 sourceSideEnergy = 0.0;
Real64 powerEnergy = 0.0;
Real64 sourceSideCp = 0.0;
bool running = false;

// topology variables
Expand Down

0 comments on commit 5de2874

Please sign in to comment.