! MinimalDX version 0.1.0 (https://www.github.com/dmey/minimal-dx). ! Copyright 2018 D. Meyer and R. Raustad. Licensed under MIT. module MinimalDXHeatingDriver !+ Contains a simplified EnergyPlus subroutine for simulating the performance of a DX heating coil. ! Import Fortran 2008 standard to represent double-precision floating-point format use, intrinsic :: iso_fortran_env implicit none private public SimMinimalDXHeating contains subroutine SimMinimalDXHeating(OutdoorDryBulb, OutdoorHumRatio, OutdoorPressure, & !I InletAirDryBulbTemp, InletAirHumRat, & !I RatedCOP, RatedTotCap, SensibleHeatingLoad, RatedAirMassFlowRate, & !I COP, TotalHeatingCapacity, & !I OutletAirTemp, OutletAirHumRat, & !O ElecHeatingPower, TotalHeatingEnergyRate, TotalSensibleHeatOut) !O !+ Simplified EnergyPlus subroutine for calculating the performance of a DX heating coil. !+ This is the subroutine to call from your program. use MinimalDXHeating, only: CalcMinimalDXHeating ! Using fortran 2008 standard to represent double-precision floating-point format integer, parameter :: dp = REAL64 ! Subroutine arguments real(dp), intent(in) :: OutdoorDryBulb !+ Outdoor dry bulb air temperature `[°C]` real(dp), intent(in) :: OutdoorHumRatio !+ Outdoor air humidity ratio `[kgH₂O kgAIR⁻¹]` real(dp), intent(in) :: OutdoorPressure !+ Outdoor barometric pressure `[Pa]` real(dp), intent(in) :: InletAirDryBulbTemp !+ Indoor (inlet) dry bulb air temperature `[°C]` real(dp), intent(in) :: InletAirHumRat !+ Indoor (inlet) air humidity ratio `[kgH₂O kgAIR⁻¹]` real(dp), intent(in) :: RatedCOP !+ Rated Coefficient Of Performance (COP) `[1]` real(dp), intent(in) :: RatedTotCap !+ Rated (total) system capacity `[W]` real(dp), intent(in) :: SensibleHeatingLoad !+ Building sensible load to be met `[W]` real(dp), intent(in) :: RatedAirMassFlowRate !+ rated air mass flow rate `[kg s⁻¹]` real(dp), intent(out) :: COP !+ Actual (calculated) Coefficient Of Performance (COP) `[1]` real(dp), intent(out) :: TotalHeatingCapacity !+ Actual (calculated) total system capacity `[W]` real(dp), intent(out) :: OutletAirTemp !+ Actual (calculated) outlet air dry bulb temperature existing the cooling coil `[°C]` real(dp), intent(out) :: OutletAirHumRat !+ Actual (calculated) outlet air humidity ratio existing the cooling coil `[kgH₂O kgAIR⁻¹]` real(dp), intent(out) :: ElecHeatingPower !+ Calculated electrical power consumed by the DX unit `[W]` real(dp), intent(out) :: TotalHeatingEnergyRate !+ Total cooling power of the DX unit (energy rate extracted by DX unit from the indoor environment) `[W]` real(dp), intent(out) :: TotalSensibleHeatOut !+ Total energy rate rejected by the evaporator into the outdoor environment !+ i.e. TotalHeatingEnergyRate + ElecHeatingPower `[W]` ! Local variables real(dp) :: PartLoadRatio ! Get SensibleHeatingLoad and SensCoolingEnergyRates to calculate actual PartLoadRatio PartLoadRatio = 1.0_dp call CalcMinimalDXHeating(OutdoorDryBulb, OutdoorHumRatio, OutdoorPressure, & !I InletAirDryBulbTemp, InletAirHumRat, & !I RatedCOP, RatedTotCap, PartLoadRatio, RatedAirMassFlowRate, & !I OutletAirTemp, OutletAirHumRat, & !O ElecHeatingPower, TotalHeatingEnergyRate, TotalSensibleHeatOut) !O ! Calculate PartLoadRatio from previous call PartLoadRatio = SensibleHeatingLoad / TotalHeatingEnergyRate ! Keep PartLoadRatio bounded between 0 and 1 if ( PartLoadRatio < 0.0_dp ) PartLoadRatio = 0.0_dp if ( PartLoadRatio > 1.0_dp ) PartLoadRatio = 1.0_dp call CalcMinimalDXHeating(OutdoorDryBulb, OutdoorHumRatio, OutdoorPressure, & !I InletAirDryBulbTemp, InletAirHumRat, & !I RatedCOP, RatedTotCap, PartLoadRatio, RatedAirMassFlowRate, & !I OutletAirTemp, OutletAirHumRat, & !O ElecHeatingPower, TotalHeatingEnergyRate, TotalSensibleHeatOut) !O ! Calculate the actual COP for the DX unit under specified conditions COP = TotalHeatingEnergyRate / ElecHeatingPower TotalHeatingCapacity = TotalHeatingEnergyRate / PartLoadRatio end subroutine SimMinimalDXHeating end module MinimalDXHeatingDriver