Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify the moist air specific heat capacity psychrometric function #7479

Merged
merged 16 commits into from
Feb 7, 2020
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
#ifndef AIRDENSITY
#include "../../../Psychrometrics.hh"
#define AIRDENSITY(P, T, W) Psychrometrics::PsyRhoAirFnPbTdbW(P, T, W)
#define AIRCP(W, T) Psychrometrics::PsyCpAirFnWTdb(W, T)
#define AIRCP(W) Psychrometrics::PsyCpAirFnW(W)
#else
// Need a fallback
#endif
Expand All @@ -64,7 +64,7 @@

#ifndef TOKELVIN
#include "../../../DataGlobals.hh"
#define TOKELVIN(T) (T+DataGlobals::KelvinConv)
#define TOKELVIN(T) (T + DataGlobals::KelvinConv)
#else
// Need a fallback
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/AirflowNetwork/src/Properties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ namespace AirflowNetwork {
T = UpperLimit;
}

return airThermConductivity(T) / (AIRCP(W, T) * AIRDENSITY(P, T, W));
return airThermConductivity(T) / (AIRCP(W) * AIRDENSITY(P, T, W));
}

Real64 airPrandtl(Real64 T, // Temperature in Celsius
Expand Down
180 changes: 83 additions & 97 deletions src/EnergyPlus/AirflowNetworkBalanceManager.cc

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/EnergyPlus/BaseboardElectric.cc
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ namespace BaseboardElectric {
// Using/Aliasing
using DataHVACGlobals::SmallLoad;
using DataLoopNode::Node;
using Psychrometrics::PsyCpAirFnWTdb;
using Psychrometrics::PsyCpAirFnW;

// Locals
// SUBROUTINE ARGUMENT DEFINITIONS:
Expand All @@ -675,7 +675,7 @@ namespace BaseboardElectric {

AirInletTemp = Baseboard(BaseboardNum).AirInletTemp;
AirOutletTemp = AirInletTemp;
CpAir = PsyCpAirFnWTdb(Baseboard(BaseboardNum).AirInletHumRat, AirInletTemp);
CpAir = PsyCpAirFnW(Baseboard(BaseboardNum).AirInletHumRat);
AirMassFlowRate = SimpConvAirFlowSpeed;
CapacitanceAir = CpAir * AirMassFlowRate;
// currently only the efficiency is used to calculate the electric consumption. There could be some
Expand Down
4 changes: 2 additions & 2 deletions src/EnergyPlus/BaseboardRadiator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ namespace BaseboardRadiator {
using namespace ScheduleManager;
using FluidProperties::GetDensityGlycol;
using FluidProperties::GetSpecificHeatGlycol;
using Psychrometrics::PsyCpAirFnWTdb;
using Psychrometrics::PsyCpAirFnW;
using Psychrometrics::PsyRhoAirFnPbTdbW;

// Data
Expand Down Expand Up @@ -1156,7 +1156,7 @@ namespace BaseboardRadiator {

CpWater = GetSpecificHeatGlycol(
PlantLoop(Baseboard(BaseboardNum).LoopNum).FluidName, WaterInletTemp, PlantLoop(Baseboard(BaseboardNum).LoopNum).FluidIndex, RoutineName);
CpAir = PsyCpAirFnWTdb(Baseboard(BaseboardNum).AirInletHumRat, AirInletTemp);
CpAir = PsyCpAirFnW(Baseboard(BaseboardNum).AirInletHumRat);

if (Baseboard(BaseboardNum).DesAirMassFlowRate > 0.0) { // If UA is autosized, assign design condition
AirMassFlowRate = Baseboard(BaseboardNum).DesAirMassFlowRate;
Expand Down
6 changes: 3 additions & 3 deletions src/EnergyPlus/ChillerElectricEIR.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2169,9 +2169,9 @@ namespace ChillerElectricEIR {
// If Heat Recovery specified for this vapor compression chiller, then Qcondenser will be adjusted by this subroutine
if (this->HeatRecActive) this->calcHeatRecovery(this->QCondenser, this->CondMassFlowRate, condInletTemp, this->QHeatRecovered);

if (this->CondMassFlowRate > 0.0) {
Cp = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(this->CondInletNodeNum).HumRat, condInletTemp);
this->CondOutletTemp = condInletTemp + this->QCondenser / this->CondMassFlowRate / Cp;
if (CondMassFlowRate > 0.0) {
Cp = Psychrometrics::PsyCpAirFnW(DataLoopNode::Node(this->CondInletNodeNum).HumRat);
CondOutletTemp = CondInletTemp + QCondenser / CondMassFlowRate / Cp;
} else {
this->CondOutletTemp = condInletTemp;
}
Expand Down
4 changes: 2 additions & 2 deletions src/EnergyPlus/ChillerExhaustAbsorption.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1582,7 +1582,7 @@ namespace ChillerExhaustAbsorption {

lExhaustInTemp = DataLoopNode::Node(lExhaustAirInletNodeNum).Temp;
lExhaustInFlow = DataLoopNode::Node(lExhaustAirInletNodeNum).MassFlowRate;
CpAir = Psychrometrics::PsyCpAirFnWTdb(lExhaustAirHumRat, lExhaustInTemp);
CpAir = Psychrometrics::PsyCpAirFnW(lExhaustAirHumRat);
lExhHeatRecPotentialCool = lExhaustInFlow * CpAir * (lExhaustInTemp - AbsLeavingTemp);
// If Microturbine Exhaust temperature and flow rate is not sufficient to run the chiller, then chiller will not run
// lCoolThermalEnergyUseRate , lTowerLoad and lCoolElectricPower will be set to 0.0
Expand Down Expand Up @@ -1874,7 +1874,7 @@ namespace ChillerExhaustAbsorption {

lExhaustInTemp = DataLoopNode::Node(lExhaustAirInletNodeNum).Temp;
lExhaustInFlow = DataLoopNode::Node(lExhaustAirInletNodeNum).MassFlowRate;
CpAir = Psychrometrics::PsyCpAirFnWTdb(lExhaustAirHumRat, lExhaustInTemp);
CpAir = Psychrometrics::PsyCpAirFnW(lExhaustAirHumRat);
lExhHeatRecPotentialHeat = lExhaustInFlow * CpAir * (lExhaustInTemp - AbsLeavingTemp);
if (lExhHeatRecPotentialHeat < lHeatThermalEnergyUseRate) {
if (this->ExhTempLTAbsLeavingHeatingTempIndex == 0) {
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/CondenserLoopTowers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5182,7 +5182,7 @@ namespace CondenserLoopTowers {
// set water and air properties
Real64 AirDensity = Psychrometrics::PsyRhoAirFnPbTdbW(this->AirPress, InletAirTemp, this->AirHumRat); // Density of air [kg/m3]
Real64 AirMassFlowRate = AirFlowRate * AirDensity; // Mass flow rate of air [kg/s]
Real64 CpAir = Psychrometrics::PsyCpAirFnWTdb(this->AirHumRat, InletAirTemp); // Heat capacity of air [J/kg/K]
Real64 CpAir = Psychrometrics::PsyCpAirFnW(this->AirHumRat); // Heat capacity of air [J/kg/K]
Real64 CpWater = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(this->LoopNum).FluidName,
this->WaterTemp,
DataPlant::PlantLoop(this->LoopNum).FluidIndex,
Expand Down
Loading