Skip to content

Commit

Permalink
Fluid properties API with one usage example (VRF)
Browse files Browse the repository at this point in the history
  • Loading branch information
amirroth committed Jul 15, 2024
1 parent 5d4b8d2 commit f864177
Show file tree
Hide file tree
Showing 116 changed files with 3,326 additions and 3,204 deletions.
6 changes: 3 additions & 3 deletions src/EnergyPlus/AirLoopHVACDOAS.cc
Original file line number Diff line number Diff line change
Expand Up @@ -889,7 +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 = Fluid::GetDensityGlycol(state,
rho = FluidProperties::GetDensityGlycol(state,
state.dataPlnt->PlantLoop(this->HWPlantLoc.loopNum).FluidName,
Constant::HWInitConvTemp,
state.dataPlnt->PlantLoop(this->HWPlantLoc.loopNum).FluidIndex,
Expand All @@ -903,7 +903,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 = Fluid::GetDensityGlycol(state,
rho = FluidProperties::GetDensityGlycol(state,
state.dataPlnt->PlantLoop(this->CWPlantLoc.loopNum).FluidName,
Constant::CWInitConvTemp,
state.dataPlnt->PlantLoop(this->CWPlantLoc.loopNum).FluidIndex,
Expand All @@ -918,7 +918,7 @@ namespace AirLoopHVACDOAS {
WaterCoils::SimulateWaterCoilComponents(state, CompName, FirstHVACIteration, this->m_CoolCoilNum);
Real64 CoilMaxVolFlowRate =
WaterCoils::GetCoilMaxWaterFlowRate(state, "Coil:Cooling:Water:DetailedGeometry", CompName, ErrorsFound);
rho = Fluid::GetDensityGlycol(state,
rho = FluidProperties::GetDensityGlycol(state,
state.dataPlnt->PlantLoop(this->CWPlantLoc.loopNum).FluidName,
Constant::CWInitConvTemp,
state.dataPlnt->PlantLoop(this->CWPlantLoc.loopNum).FluidIndex,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ Real64 CoolingWaterDesAirOutletTempSizer::size(EnergyPlusData &state, Real64 _or
this->autoSizedValue = _originalValue;
} else {
if (this->termUnitIU) {
Real64 Cp = Fluid::GetSpecificHeatGlycol(state,
Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state,
state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidName,
Constant::CWInitConvTemp,
state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidIndex,
this->callingRoutine);
Real64 rho = Fluid::GetDensityGlycol(state,
Real64 rho = FluidProperties::GetDensityGlycol(state,
state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidName,
Constant::CWInitConvTemp,
state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidIndex,
Expand Down
8 changes: 4 additions & 4 deletions src/EnergyPlus/Autosizing/CoolingWaterflowSizing.cc
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +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 = Fluid::GetSpecificHeatGlycol(state,
Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state,
state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidName,
Constant::CWInitConvTemp,
state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidIndex,
this->callingRoutine);
Real64 rho = Fluid::GetDensityGlycol(state,
Real64 rho = FluidProperties::GetDensityGlycol(state,
state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidName,
Constant::CWInitConvTemp,
state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidIndex,
Expand All @@ -120,12 +120,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 = Fluid::GetSpecificHeatGlycol(state,
Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state,
state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidName,
Constant::CWInitConvTemp,
state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidIndex,
this->callingRoutine);
Real64 rho = Fluid::GetDensityGlycol(state,
Real64 rho = FluidProperties::GetDensityGlycol(state,
state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidName,
Constant::CWInitConvTemp,
state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidIndex,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,38 +69,38 @@ Real64 HeatingWaterDesCoilLoadUsedForUASizer::size(EnergyPlusData &state, Real64
this->autoSizedValue = _originalValue;
} else {
if (this->termUnitSingDuct && (this->curTermUnitSizingNum > 0)) {
Real64 const Cp = Fluid::GetSpecificHeatGlycol(state,
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 = Fluid::GetDensityGlycol(state,
Real64 const rho = FluidProperties::GetDensityGlycol(state,
state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidName,
Constant::HWInitConvTemp,
state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidIndex,
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 = Fluid::GetSpecificHeatGlycol(state,
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 = Fluid::GetDensityGlycol(state,
Real64 const rho = FluidProperties::GetDensityGlycol(state,
state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidName,
Constant::HWInitConvTemp,
state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidIndex,
this->callingRoutine);
this->autoSizedValue = this->dataWaterFlowUsedForSizing * this->dataWaterCoilSizHeatDeltaT * Cp * rho *
this->termUnitSizing(this->curTermUnitSizingNum).ReheatLoadMult;
} else if (this->zoneEqFanCoil || this->zoneEqUnitHeater) {
Real64 const Cp = Fluid::GetSpecificHeatGlycol(state,
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 = Fluid::GetDensityGlycol(state,
Real64 const rho = FluidProperties::GetDensityGlycol(state,
state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidName,
Constant::HWInitConvTemp,
state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidIndex,
Expand Down
8 changes: 4 additions & 4 deletions src/EnergyPlus/Autosizing/HeatingWaterflowSizing.cc
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,12 @@ 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 = Fluid::GetSpecificHeatGlycol(state,
Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state,
state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidName,
Constant::HWInitConvTemp,
state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidIndex,
this->callingRoutine);
Real64 rho = Fluid::GetDensityGlycol(state,
Real64 rho = FluidProperties::GetDensityGlycol(state,
state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidName,
Constant::HWInitConvTemp,
state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidIndex,
Expand All @@ -123,12 +123,12 @@ 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 = Fluid::GetSpecificHeatGlycol(state,
Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state,
state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidName,
Constant::HWInitConvTemp,
state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidIndex,
this->callingRoutine);
Real64 rho = Fluid::GetDensityGlycol(state,
Real64 rho = FluidProperties::GetDensityGlycol(state,
state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidName,
Constant::HWInitConvTemp,
state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidIndex,
Expand Down
8 changes: 4 additions & 4 deletions src/EnergyPlus/Autosizing/WaterHeatingCapacitySizing.cc
Original file line number Diff line number Diff line change
Expand Up @@ -72,25 +72,25 @@ Real64 WaterHeatingCapacitySizer::size(EnergyPlusData &state, Real64 _originalVa
Real64 CoilOutHumRat = 0.0;
if ((this->termUnitSingDuct || this->termUnitPIU || this->termUnitIU) && (this->curTermUnitSizingNum > 0)) {
DesMassFlow = this->termUnitSizing(this->curTermUnitSizingNum).MaxHWVolFlow;
Real64 Cp = Fluid::GetSpecificHeatGlycol(state,
Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state,
state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidName,
Constant::HWInitConvTemp,
state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidIndex,
this->callingRoutine);
Real64 rho = Fluid::GetDensityGlycol(state,
Real64 rho = FluidProperties::GetDensityGlycol(state,
state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidName,
Constant::HWInitConvTemp,
state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidIndex,
this->callingRoutine);
NominalCapacityDes = DesMassFlow * this->dataWaterCoilSizHeatDeltaT * Cp * rho;
} else if (this->zoneEqFanCoil || this->zoneEqUnitHeater) {
DesMassFlow = this->zoneEqSizing(this->curZoneEqNum).MaxHWVolFlow;
Real64 Cp = Fluid::GetSpecificHeatGlycol(state,
Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state,
state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidName,
Constant::HWInitConvTemp,
state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidIndex,
this->callingRoutine);
Real64 rho = Fluid::GetDensityGlycol(state,
Real64 rho = FluidProperties::GetDensityGlycol(state,
state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidName,
Constant::HWInitConvTemp,
state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidIndex,
Expand Down
4 changes: 2 additions & 2 deletions src/EnergyPlus/BaseboardRadiator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ namespace BaseboardRadiator {

// Use statements for access to subroutines in other modules
using namespace ScheduleManager;
using Fluid::GetDensityGlycol;
using Fluid::GetSpecificHeatGlycol;
using FluidProperties::GetDensityGlycol;
using FluidProperties::GetSpecificHeatGlycol;
using Psychrometrics::PsyCpAirFnW;
using Psychrometrics::PsyRhoAirFnPbTdbW;

Expand Down
Loading

5 comments on commit f864177

@nrel-bot-3
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FluidAPI (amirroth) - x86_64-MacOS-10.18-clang-15.0.0: Tests Failed (2946 of 3627 tests passed, 107 test warnings)

Messages:\n

  • 788 tests had: AUD diffs.
  • 604 tests had: EIO diffs.
  • 10 tests had: ESO big diffs.
  • 644 tests had: Table big diffs.
  • 469 tests had: Table string diffs.
  • 1 test had: MTD diffs.
  • 70 tests had: ESO small diffs.
  • 51 tests had: MTR small diffs.
  • 40 tests had: ERR diffs.
  • 45 tests had: Table small diffs.
  • 1 test had: MTR big diffs.
  • 1 test had: RDD diffs.
  • 2 tests had: BND diffs.

Failures:\n

regression Test Summary

  • Passed: 108
  • Failed: 681

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.

FluidAPI (amirroth) - x86_64-Linux-Ubuntu-22.04-gcc-11.4: Tests Failed (2984 of 3668 tests passed, 108 test warnings)

Messages:\n

  • 792 tests had: AUD diffs.
  • 604 tests had: EIO diffs.
  • 11 tests had: ESO big diffs.
  • 1 test had: MTD diffs.
  • 647 tests had: Table big diffs.
  • 469 tests had: Table string diffs.
  • 71 tests had: ESO small diffs.
  • 49 tests had: MTR small diffs.
  • 40 tests had: ERR diffs.
  • 45 tests had: Table small diffs.
  • 1 test had: MTR big diffs.
  • 1 test had: RDD diffs.
  • 2 tests had: BND diffs.

Failures:\n

regression Test Summary

  • Passed: 125
  • Failed: 684

Build Badge Test Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FluidAPI (amirroth) - Win64-Windows-10-VisualStudio-16: OK (2837 of 2837 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FluidAPI (amirroth) - x86_64-Linux-Ubuntu-22.04-gcc-11.4-UnitTestsCoverage-Debug: OK (2047 of 2047 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

@nrel-bot-2b
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FluidAPI (amirroth) - x86_64-Linux-Ubuntu-22.04-gcc-11.4-IntegrationCoverage-Debug: OK (793 of 793 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

Please sign in to comment.