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

FluidAPI Continued #10872

Merged
merged 22 commits into from
Jan 9, 2025
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
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
14 changes: 4 additions & 10 deletions src/EnergyPlus/Autosizing/CoolingWaterDesAirOutletTempSizing.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,10 @@ 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
28 changes: 8 additions & 20 deletions src/EnergyPlus/Autosizing/CoolingWaterflowSizing.cc
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,10 @@ 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 +114,10 @@ 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
42 changes: 12 additions & 30 deletions src/EnergyPlus/Autosizing/HeatingWaterDesCoilLoadUsedForUASizing.cc
Original file line number Diff line number Diff line change
Expand Up @@ -69,42 +69,24 @@ 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
28 changes: 8 additions & 20 deletions src/EnergyPlus/Autosizing/HeatingWaterflowSizing.cc
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,10 @@ Real64 HeatingWaterflowSizer::size(EnergyPlusData &state, Real64 _originalValue,
if (DesCoilLoad >= HVAC::SmallLoad) {
if (this->dataWaterLoopNum > 0 && this->dataWaterLoopNum <= (int)state.dataPlnt->PlantLoop.size() &&
this->dataWaterCoilSizHeatDeltaT > 0.0) {
Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state,
state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidName,
Constant::HWInitConvTemp,
state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidIndex,
this->callingRoutine);
Real64 rho = FluidProperties::GetDensityGlycol(state,
state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidName,
Constant::HWInitConvTemp,
state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidIndex,
this->callingRoutine);
Real64 Cp = state.dataPlnt->PlantLoop(this->dataWaterLoopNum)
.glycol->getSpecificHeat(state, Constant::HWInitConvTemp, this->callingRoutine);
Real64 rho = state.dataPlnt->PlantLoop(this->dataWaterLoopNum)
.glycol->getDensity(state, Constant::HWInitConvTemp, this->callingRoutine);
this->autoSizedValue = DesCoilLoad / (this->dataWaterCoilSizHeatDeltaT * Cp * rho);
} else {
std::string msg = "Developer Error: For autosizing of " + this->compType + ' ' + this->compName +
Expand All @@ -123,16 +117,10 @@ Real64 HeatingWaterflowSizer::size(EnergyPlusData &state, Real64 _originalValue,
if (this->dataCapacityUsedForSizing >= HVAC::SmallLoad) {
if (this->dataWaterLoopNum > 0 && this->dataWaterLoopNum <= (int)state.dataPlnt->PlantLoop.size() &&
this->dataWaterCoilSizHeatDeltaT > 0.0) {
Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state,
state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidName,
Constant::HWInitConvTemp,
state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidIndex,
this->callingRoutine);
Real64 rho = FluidProperties::GetDensityGlycol(state,
state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidName,
Constant::HWInitConvTemp,
state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidIndex,
this->callingRoutine);
Real64 Cp = state.dataPlnt->PlantLoop(this->dataWaterLoopNum)
.glycol->getSpecificHeat(state, Constant::HWInitConvTemp, this->callingRoutine);
Real64 rho = state.dataPlnt->PlantLoop(this->dataWaterLoopNum)
.glycol->getDensity(state, Constant::HWInitConvTemp, this->callingRoutine);
this->autoSizedValue = this->dataCapacityUsedForSizing / (this->dataWaterCoilSizHeatDeltaT * Cp * rho);
} else {
this->autoSizedValue = 0.0;
Expand Down
Loading
Loading