From 80cf5afca7404f71277ce34a73a1e3137ebb3197 Mon Sep 17 00:00:00 2001 From: Piotr Jazdzyk Date: Sun, 28 Jan 2024 11:15:17 +0100 Subject: [PATCH] feat(SNSHLI-57): refactor getters, fix dryBulbTemperatureIX to use X not RH, fixed validation exception msgs, update unitility version to 2.2.0 --- pom.xml | 10 +- .../hvacengine/common/Validators.java | 8 +- .../com/synerset/hvacengine/fluids/Flow.java | 16 +-- .../com/synerset/hvacengine/fluids/Fluid.java | 14 +-- .../hvacengine/fluids/dryair/DryAir.java | 18 +-- .../fluids/dryair/FlowOfDryAir.java | 28 ++--- .../fluids/humidair/FlowOfHumidAir.java | 46 ++++---- .../hvacengine/fluids/humidair/HumidAir.java | 106 +++++++++--------- .../fluids/humidair/HumidAirEquations.java | 9 +- .../fluids/liquidwater/FlowOfLiquidWater.java | 28 ++--- .../fluids/liquidwater/LiquidWater.java | 10 +- .../fluids/watervapour/FlowOfWaterVapour.java | 28 ++--- .../fluids/watervapour/WaterVapour.java | 18 +-- .../hvacengine/process/cooling/Cooling.java | 24 ++-- .../process/cooling/CoolingFromPower.java | 6 +- .../process/cooling/CoolingFromRH.java | 10 +- .../cooling/CoolingFromTemperature.java | 20 ++-- .../process/cooling/CoolingStrategy.java | 8 +- .../process/drycooling/DryCooling.java | 18 +-- .../drycooling/DryCoolingFromPower.java | 8 +- .../drycooling/DryCoolingFromTemperature.java | 10 +- .../drycooling/DryCoolingStrategy.java | 4 +- .../hvacengine/process/heating/Heating.java | 18 +-- .../process/heating/HeatingFromPower.java | 10 +- .../process/heating/HeatingFromRH.java | 8 +- .../heating/HeatingFromTemperature.java | 10 +- .../process/heating/HeatingStrategy.java | 12 +- .../hvacengine/process/mixing/Mixing.java | 14 +-- .../process/mixing/MixingOfMultipleFlows.java | 10 +- .../process/mixing/MixingOfTwoFlows.java | 6 +- .../process/mixing/MixingStrategy.java | 6 +- .../synerset/hvacengine/solids/ice/Ice.java | 10 +- .../hvacengine/fluids/FlowEquationsTest.java | 28 ++--- .../hvacengine/fluids/dryair/DryAirTest.java | 14 +-- .../fluids/dryair/FlowOfDryAirTest.java | 16 +-- .../fluids/humidair/FlowOfHumidAirTest.java | 26 ++--- .../humidair/HumidAirEquationsTest.java | 4 +- .../fluids/humidair/HumidAirTest.java | 34 +++--- .../liquidwater/FlowOfLiquidWaterTest.java | 16 +-- .../fluids/liquidwater/LiquidWaterTest.java | 10 +- .../FlowOfLiquidWaterVapourTest.java | 16 +-- .../fluids/vaterwapour/WaterVapourTest.java | 14 +-- .../cooling/AirCoolingStrategiesTest.java | 22 ++-- .../process/cooling/CoolingTest.java | 18 +-- .../DryAirCoolingStrategiesTest.java | 4 +- .../process/drycooling/DryCoolingTest.java | 4 +- .../heating/AirHeatingEquationsTest.java | 6 +- .../process/heating/HeatingTest.java | 6 +- .../mixing/AirMixingStrategiesTest.java | 12 +- .../hvacengine/process/mixing/MixingTest.java | 4 +- .../hvacengine/solids/ice/IceTest.java | 10 +- 51 files changed, 408 insertions(+), 407 deletions(-) diff --git a/pom.xml b/pom.xml index 7a381e3..3df78ac 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.synerset hvac-engine - 1.0.2 + 1.1.0 hvac-engine HVAC|Engine is a comprehensive library for calculating moist air properties, including crucial thermodynamic @@ -38,17 +38,17 @@ UTF-8 1.1.4 - 2.1.1 + 2.2.0 - 3.25.0 + 3.25.2 5.10.1 - 0.8.9 + 0.8.11 3.0.0 1.6.13 3.3.0 3.6.3 - 1.5.0 + 1.6.0 synerset pjazdzyk_hvac-engine diff --git a/src/main/java/com/synerset/hvacengine/common/Validators.java b/src/main/java/com/synerset/hvacengine/common/Validators.java index 63e305f..befc69f 100644 --- a/src/main/java/com/synerset/hvacengine/common/Validators.java +++ b/src/main/java/com/synerset/hvacengine/common/Validators.java @@ -29,13 +29,13 @@ public static void requireNotEmpty(Collection collection) { public static void requireAboveLowerBound(PhysicalQuantity quantityToCheck, PhysicalQuantity lowerBoundLimit) { if (quantityToCheck.equalsOrLowerThan(lowerBoundLimit)) { - throw new InvalidArgumentException(String.format("Lower bound limit exceeded: Quantity: %s, Limit: %s", quantityToCheck, lowerBoundLimit)); + throw new InvalidArgumentException(String.format("Lower bound limit exceeded. Actual: %s, limit: %s", quantityToCheck, lowerBoundLimit)); } } public static void requireBelowUpperBound(PhysicalQuantity quantityToCheck, PhysicalQuantity upperBoundLimit) { if (quantityToCheck.equalsOrGreaterThan(upperBoundLimit)) { - throw new InvalidArgumentException(String.format("Upper bound limit exceeded: Quantity: %s, Limit: %s", quantityToCheck, upperBoundLimit)); + throw new InvalidArgumentException(String.format("Upper bound limit exceeded. Actual: %s, limit: %s", quantityToCheck, upperBoundLimit)); } } @@ -46,13 +46,13 @@ public static void requireBetweenBounds(PhysicalQuantity qua public static void requireAboveLowerBoundInclusive(PhysicalQuantity quantityToCheck, PhysicalQuantity lowerBoundLimit) { if (quantityToCheck.isLowerThan(lowerBoundLimit)) { - throw new InvalidArgumentException(String.format("Lower bound limit reached or exceeded: Quantity: %s, Limit: %s", quantityToCheck, lowerBoundLimit)); + throw new InvalidArgumentException(String.format("Lower bound limit reached or exceeded. Actual: %s, limit: %s", quantityToCheck, lowerBoundLimit)); } } public static void requireBelowUpperBoundInclusive(PhysicalQuantity quantityToCheck, PhysicalQuantity upperBoundLimit) { if (quantityToCheck.isGreaterThan(upperBoundLimit)) { - throw new InvalidArgumentException(String.format("Upper bound limit reached or exceeded: Quantity: %s, Limit: %s", quantityToCheck, upperBoundLimit)); + throw new InvalidArgumentException(String.format("Upper bound limit reached or exceeded: Actual: %s, limit: %s", quantityToCheck, upperBoundLimit)); } } diff --git a/src/main/java/com/synerset/hvacengine/fluids/Flow.java b/src/main/java/com/synerset/hvacengine/fluids/Flow.java index b9cdd80..0a0fbe2 100644 --- a/src/main/java/com/synerset/hvacengine/fluids/Flow.java +++ b/src/main/java/com/synerset/hvacengine/fluids/Flow.java @@ -23,49 +23,49 @@ public interface Flow { * * @return The mass flow rate in appropriate units. */ - MassFlow massFlow(); + MassFlow getMassFlow(); /** * Get the volumetric flow rate of the fluid flow. * * @return The volumetric flow rate in appropriate units. */ - VolumetricFlow volumetricFlow(); + VolumetricFlow getVolumetricFlow(); /** * Get the temperature of the fluid flow. * * @return The temperature in appropriate units. */ - Temperature temperature(); + Temperature getTemperature(); /** * Get the pressure of the fluid flow. * * @return The pressure in appropriate units. */ - Pressure pressure(); + Pressure getPressure(); /** * Get the density of the fluid flow. * * @return The density in appropriate units. */ - Density density(); + Density getDensity(); /** * Get the specific heat capacity of the fluid flow. * * @return The specific heat capacity in appropriate units. */ - SpecificHeat specificHeat(); + SpecificHeat getSpecificHeat(); /** * Get the specific enthalpy of the fluid flow. * * @return The specific enthalpy in appropriate units. */ - SpecificEnthalpy specificEnthalpy(); + SpecificEnthalpy getSpecificEnthalpy(); /** * Convert the flow properties to a formatted string. @@ -88,6 +88,6 @@ default boolean isEqualsWithPrecision(Flow flowOfFluid, dou if (this.getClass() != flowOfFluid.getClass()) return false; return fluid().isEqualsWithPrecision(flowOfFluid.fluid(), epsilon) - && massFlow().equalsWithPrecision(flowOfFluid.massFlow(), epsilon); + && getMassFlow().equalsWithPrecision(flowOfFluid.getMassFlow(), epsilon); } } diff --git a/src/main/java/com/synerset/hvacengine/fluids/Fluid.java b/src/main/java/com/synerset/hvacengine/fluids/Fluid.java index 17358ec..497e3aa 100644 --- a/src/main/java/com/synerset/hvacengine/fluids/Fluid.java +++ b/src/main/java/com/synerset/hvacengine/fluids/Fluid.java @@ -12,35 +12,35 @@ public interface Fluid { * * @return The temperature in appropriate units. */ - Temperature temperature(); + Temperature getTemperature(); /** * Get the pressure of the fluid. * * @return The pressure in appropriate units. */ - Pressure pressure(); + Pressure getPressure(); /** * Get the density of the fluid. * * @return The density in appropriate units. */ - Density density(); + Density getDensity(); /** * Get the specific heat capacity of the fluid. * * @return The specific heat capacity in appropriate units. */ - SpecificHeat specificHeat(); + SpecificHeat getSpecificHeat(); /** * Get the specific enthalpy of the fluid. * * @return The specific enthalpy in appropriate units. */ - SpecificEnthalpy specificEnthalpy(); + SpecificEnthalpy getSpecificEnthalpy(); /** * Convert the fluid properties to a formatted string. @@ -62,7 +62,7 @@ default boolean isEqualsWithPrecision(K fluid, double epsilon) if (fluid == null) return false; if (this.getClass() != fluid.getClass()) return false; - return pressure().equalsWithPrecision(fluid.pressure(), epsilon) - && temperature().equalsWithPrecision(fluid.temperature(), epsilon); + return getPressure().equalsWithPrecision(fluid.getPressure(), epsilon) + && getTemperature().equalsWithPrecision(fluid.getTemperature(), epsilon); } } diff --git a/src/main/java/com/synerset/hvacengine/fluids/dryair/DryAir.java b/src/main/java/com/synerset/hvacengine/fluids/dryair/DryAir.java index f2c21ba..fc45c93 100644 --- a/src/main/java/com/synerset/hvacengine/fluids/dryair/DryAir.java +++ b/src/main/java/com/synerset/hvacengine/fluids/dryair/DryAir.java @@ -50,39 +50,39 @@ public DryAir(Pressure pressure, Temperature temperature) { this.prandtlNumber = SharedEquations.prandtlNumber(dynamicViscosity, thermalConductivity, specificHeat); } - public Temperature temperature() { + public Temperature getTemperature() { return temperature; } - public Pressure pressure() { + public Pressure getPressure() { return pressure; } - public Density density() { + public Density getDensity() { return density; } - public SpecificHeat specificHeat() { + public SpecificHeat getSpecificHeat() { return specificHeat; } - public SpecificEnthalpy specificEnthalpy() { + public SpecificEnthalpy getSpecificEnthalpy() { return specificEnthalpy; } - public DynamicViscosity dynamicViscosity() { + public DynamicViscosity getDynamicViscosity() { return dynamicViscosity; } - public KinematicViscosity kinematicViscosity() { + public KinematicViscosity getKinematicViscosity() { return kinematicViscosity; } - public ThermalConductivity thermalConductivity() { + public ThermalConductivity getThermalConductivity() { return thermalConductivity; } - public PrandtlNumber prandtlNumber() { + public PrandtlNumber getPrandtlNumber() { return prandtlNumber; } diff --git a/src/main/java/com/synerset/hvacengine/fluids/dryair/FlowOfDryAir.java b/src/main/java/com/synerset/hvacengine/fluids/dryair/FlowOfDryAir.java index 4b5f83c..a3f64fa 100644 --- a/src/main/java/com/synerset/hvacengine/fluids/dryair/FlowOfDryAir.java +++ b/src/main/java/com/synerset/hvacengine/fluids/dryair/FlowOfDryAir.java @@ -33,7 +33,7 @@ public FlowOfDryAir(DryAir dryAir, MassFlow massFlow) { Validators.requireBetweenBoundsInclusive(massFlow, MASS_FLOW_MIN_LIMIT, MASS_FLOW_MAX_LIMIT); this.dryAir = dryAir; this.massFlow = massFlow; - this.volFlow = FlowEquations.massFlowToVolFlow(dryAir.density(), massFlow); + this.volFlow = FlowEquations.massFlowToVolFlow(dryAir.getDensity(), massFlow); } @Override @@ -42,38 +42,38 @@ public DryAir fluid() { } @Override - public MassFlow massFlow() { + public MassFlow getMassFlow() { return massFlow; } @Override - public VolumetricFlow volumetricFlow() { + public VolumetricFlow getVolumetricFlow() { return volFlow; } @Override - public Temperature temperature() { - return dryAir.temperature(); + public Temperature getTemperature() { + return dryAir.getTemperature(); } @Override - public Pressure pressure() { - return dryAir.pressure(); + public Pressure getPressure() { + return dryAir.getPressure(); } @Override - public Density density() { - return dryAir.density(); + public Density getDensity() { + return dryAir.getDensity(); } @Override - public SpecificHeat specificHeat() { - return dryAir.specificHeat(); + public SpecificHeat getSpecificHeat() { + return dryAir.getSpecificHeat(); } @Override - public SpecificEnthalpy specificEnthalpy() { - return dryAir.specificEnthalpy(); + public SpecificEnthalpy getSpecificEnthalpy() { + return dryAir.getSpecificEnthalpy(); } @Override @@ -166,7 +166,7 @@ public static FlowOfDryAir of(DryAir dryAir, MassFlow massFlow) { */ public static FlowOfDryAir of(DryAir dryAir, VolumetricFlow volFlow) { Validators.requireNotNull(volFlow); - MassFlow massFlow = FlowEquations.volFlowToMassFlow(dryAir.density(), volFlow); + MassFlow massFlow = FlowEquations.volFlowToMassFlow(dryAir.getDensity(), volFlow); return new FlowOfDryAir(dryAir, massFlow); } diff --git a/src/main/java/com/synerset/hvacengine/fluids/humidair/FlowOfHumidAir.java b/src/main/java/com/synerset/hvacengine/fluids/humidair/FlowOfHumidAir.java index f3655c2..492545e 100644 --- a/src/main/java/com/synerset/hvacengine/fluids/humidair/FlowOfHumidAir.java +++ b/src/main/java/com/synerset/hvacengine/fluids/humidair/FlowOfHumidAir.java @@ -38,9 +38,9 @@ public FlowOfHumidAir(HumidAir humidAir, MassFlow massFlowHa) { Validators.requireBetweenBoundsInclusive(massFlowHa, MASS_FLOW_MIN_LIMIT, MASS_FLOW_MAX_LIMIT); this.humidAir = humidAir; this.massFlow = massFlowHa; - this.volFlow = FlowEquations.massFlowToVolFlow(humidAir.density(), massFlowHa); - MassFlow massFlowDa = FlowEquations.massFlowHaToMassFlowDa(humidAir.humidityRatio(), massFlowHa); - this.flowOfDryAir = FlowOfDryAir.of(DryAir.of(humidAir.temperature()), massFlowDa); + this.volFlow = FlowEquations.massFlowToVolFlow(humidAir.getDensity(), massFlowHa); + MassFlow massFlowDa = FlowEquations.massFlowHaToMassFlowDa(humidAir.getHumidityRatio(), massFlowHa); + this.flowOfDryAir = FlowOfDryAir.of(DryAir.of(humidAir.getTemperature()), massFlowDa); } // Primary properties @@ -50,47 +50,47 @@ public HumidAir fluid() { } @Override - public MassFlow massFlow() { + public MassFlow getMassFlow() { return massFlow; } @Override - public VolumetricFlow volumetricFlow() { + public VolumetricFlow getVolumetricFlow() { return volFlow; } public MassFlow dryAirMassFlow() { - return flowOfDryAir.massFlow(); + return flowOfDryAir.getMassFlow(); } public VolumetricFlow dryAirVolumetricFlow() { - return flowOfDryAir.volumetricFlow(); + return flowOfDryAir.getVolumetricFlow(); } // Secondary properties @Override - public Temperature temperature() { - return humidAir.temperature(); + public Temperature getTemperature() { + return humidAir.getTemperature(); } @Override - public Pressure pressure() { - return humidAir.pressure(); + public Pressure getPressure() { + return humidAir.getPressure(); } @Override - public Density density() { - return humidAir.density(); + public Density getDensity() { + return humidAir.getDensity(); } @Override - public SpecificHeat specificHeat() { - return humidAir.specificHeat(); + public SpecificHeat getSpecificHeat() { + return humidAir.getSpecificHeat(); } @Override - public SpecificEnthalpy specificEnthalpy() { - return humidAir.specificEnthalpy(); + public SpecificEnthalpy getSpecificEnthalpy() { + return humidAir.getSpecificEnthalpy(); } public FlowOfDryAir flowOfDryAir() { @@ -98,19 +98,19 @@ public FlowOfDryAir flowOfDryAir() { } public HumidityRatio humidityRatio() { - return humidAir.humidityRatio(); + return humidAir.getHumidityRatio(); } public HumidityRatio maxHumidityRatio() { - return humidAir.maxHumidityRatio(); + return humidAir.getMaxHumidityRatio(); } public RelativeHumidity relativeHumidity() { - return humidAir.relativeHumidity(); + return humidAir.getRelativeHumidity(); } public Pressure saturationPressure() { - return humidAir.saturationPressure(); + return humidAir.getSaturationPressure(); } // Class factory methods @@ -206,7 +206,7 @@ public static FlowOfHumidAir of(HumidAir humidAir, MassFlow massFlowHa) { public static FlowOfHumidAir of(HumidAir humidAir, VolumetricFlow volFlowHa) { Validators.requireNotNull(humidAir); Validators.requireNotNull(volFlowHa); - return new FlowOfHumidAir(humidAir, FlowEquations.volFlowToMassFlow(humidAir.density(), volFlowHa)); + return new FlowOfHumidAir(humidAir, FlowEquations.volFlowToMassFlow(humidAir.getDensity(), volFlowHa)); } /** @@ -220,7 +220,7 @@ public static FlowOfHumidAir ofDryAirMassFlow(HumidAir humidAir, MassFlow massFl Validators.requireNotNull(humidAir); Validators.requireNotNull(massFlowDa); Validators.requireBetweenBoundsInclusive(massFlowDa, MASS_FLOW_MIN_LIMIT, MASS_FLOW_MAX_LIMIT); - HumidityRatio humRatio = humidAir.humidityRatio(); + HumidityRatio humRatio = humidAir.getHumidityRatio(); MassFlow humidAirMassFlow = FlowEquations.massFlowDaToMassFlowHa(humRatio, massFlowDa); return FlowOfHumidAir.of(humidAir, humidAirMassFlow); } diff --git a/src/main/java/com/synerset/hvacengine/fluids/humidair/HumidAir.java b/src/main/java/com/synerset/hvacengine/fluids/humidair/HumidAir.java index 12eeeb4..6c5b90f 100644 --- a/src/main/java/com/synerset/hvacengine/fluids/humidair/HumidAir.java +++ b/src/main/java/com/synerset/hvacengine/fluids/humidair/HumidAir.java @@ -22,8 +22,8 @@ public class HumidAir implements Fluid { public static final Temperature TEMPERATURE_MIN_LIMIT = Temperature.ofCelsius(-150); public static final Temperature TEMPERATURE_MAX_LIMIT = Temperature.ofCelsius(200); public static final HumidityRatio HUMIDITY_RATIO_MAX_LIMIT = HumidityRatio.ofKilogramPerKilogram(3); - private final Temperature dryBulbTemperature; - private final Pressure absPressure; + private final Temperature temperature; + private final Pressure pressure; private final Density density; private final RelativeHumidity relativeHumidity; private final Pressure saturationPressure; @@ -44,112 +44,112 @@ public class HumidAir implements Fluid { /** * Constructs a `HumidAir` instance with the specified absolute pressure, dry bulb temperature, and humidity ratio. * - * @param absPressure The absolute pressure of the humid air in pascals (Pa). - * @param dryBulbTemperature The dry bulb temperature of the humid air in degrees Celsius (°C). + * @param pressure The absolute pressure of the humid air in pascals (Pa). + * @param temperature The dry bulb temperature of the humid air in degrees Celsius (°C). * @param humidityRatio The humidity ratio of the humid air in kilograms of water vapor per kilogram of dry air (kg/kg). */ - public HumidAir(Pressure absPressure, - Temperature dryBulbTemperature, + public HumidAir(Pressure pressure, + Temperature temperature, HumidityRatio humidityRatio) { - Validators.requireNotNull(absPressure); - Validators.requireNotNull(dryBulbTemperature); + Validators.requireNotNull(pressure); + Validators.requireNotNull(temperature); Validators.requireNotNull(humidityRatio); - Validators.requireBetweenBoundsInclusive(absPressure, PRESSURE_MIN_LIMIT, PRESSURE_MAX_LIMIT); - Validators.requireBetweenBoundsInclusive(dryBulbTemperature, TEMPERATURE_MIN_LIMIT, TEMPERATURE_MAX_LIMIT); + Validators.requireBetweenBoundsInclusive(pressure, PRESSURE_MIN_LIMIT, PRESSURE_MAX_LIMIT); + Validators.requireBetweenBoundsInclusive(temperature, TEMPERATURE_MIN_LIMIT, TEMPERATURE_MAX_LIMIT); Validators.requireBetweenBoundsInclusive(humidityRatio, HumidityRatio.HUM_RATIO_MIN_LIMIT, HUMIDITY_RATIO_MAX_LIMIT); - Pressure satPressure = HumidAirEquations.saturationPressure(dryBulbTemperature); - Validators.requireValidSaturationPressure(satPressure, absPressure, dryBulbTemperature); + Pressure satPressure = HumidAirEquations.saturationPressure(temperature); + Validators.requireValidSaturationPressure(satPressure, pressure, temperature); - this.absPressure = absPressure; - this.dryBulbTemperature = dryBulbTemperature; + this.pressure = pressure; + this.temperature = temperature; this.humidityRatio = humidityRatio; this.saturationPressure = satPressure; - this.density = HumidAirEquations.density(dryBulbTemperature, humidityRatio, absPressure); - this.relativeHumidity = HumidAirEquations.relativeHumidity(dryBulbTemperature, humidityRatio, absPressure); - this.maxHumidityRatio = HumidAirEquations.maxHumidityRatio(saturationPressure, absPressure); - this.vapourState = determineVapourState(dryBulbTemperature, humidityRatio, maxHumidityRatio); - this.wetBulbTemperature = HumidAirEquations.wetBulbTemperature(dryBulbTemperature, relativeHumidity, absPressure); - this.dewPointTemperature = HumidAirEquations.dewPointTemperature(dryBulbTemperature, relativeHumidity, absPressure); - this.specificHeat = HumidAirEquations.specificHeat(dryBulbTemperature, humidityRatio); - this.specificEnthalpy = HumidAirEquations.specificEnthalpy(dryBulbTemperature, humidityRatio, absPressure); - this.dynamicViscosity = HumidAirEquations.dynamicViscosity(dryBulbTemperature, humidityRatio); - this.kinematicViscosity = HumidAirEquations.kinematicViscosity(dryBulbTemperature, humidityRatio, density); - this.thermalConductivity = HumidAirEquations.thermalConductivity(dryBulbTemperature, humidityRatio); + this.density = HumidAirEquations.density(temperature, humidityRatio, pressure); + this.relativeHumidity = HumidAirEquations.relativeHumidity(temperature, humidityRatio, pressure); + this.maxHumidityRatio = HumidAirEquations.maxHumidityRatio(saturationPressure, pressure); + this.vapourState = determineVapourState(temperature, humidityRatio, maxHumidityRatio); + this.wetBulbTemperature = HumidAirEquations.wetBulbTemperature(temperature, relativeHumidity, pressure); + this.dewPointTemperature = HumidAirEquations.dewPointTemperature(temperature, relativeHumidity, pressure); + this.specificHeat = HumidAirEquations.specificHeat(temperature, humidityRatio); + this.specificEnthalpy = HumidAirEquations.specificEnthalpy(temperature, humidityRatio, pressure); + this.dynamicViscosity = HumidAirEquations.dynamicViscosity(temperature, humidityRatio); + this.kinematicViscosity = HumidAirEquations.kinematicViscosity(temperature, humidityRatio, density); + this.thermalConductivity = HumidAirEquations.thermalConductivity(temperature, humidityRatio); this.thermalDiffusivity = SharedEquations.thermalDiffusivity(density, thermalConductivity, specificHeat); this.prandtlNumber = SharedEquations.prandtlNumber(dynamicViscosity, thermalConductivity, specificHeat); - this.dryAirComponent = DryAir.of(absPressure, dryBulbTemperature); + this.dryAirComponent = DryAir.of(pressure, temperature); } - public Temperature temperature() { - return dryBulbTemperature; + public Temperature getTemperature() { + return temperature; } - public Pressure pressure() { - return absPressure; + public Pressure getPressure() { + return pressure; } - public Density density() { + public Density getDensity() { return density; } - public RelativeHumidity relativeHumidity() { + public RelativeHumidity getRelativeHumidity() { return relativeHumidity; } - public Pressure saturationPressure() { + public Pressure getSaturationPressure() { return saturationPressure; } - public HumidityRatio humidityRatio() { + public HumidityRatio getHumidityRatio() { return humidityRatio; } - public HumidityRatio maxHumidityRatio() { + public HumidityRatio getMaxHumidityRatio() { return maxHumidityRatio; } - public VapourState vapourState() { + public VapourState getVapourState() { return vapourState; } - public Temperature wetBulbTemperature() { + public Temperature getWetBulbTemperature() { return wetBulbTemperature; } - public Temperature dewPointTemperature() { + public Temperature getDewPointTemperature() { return dewPointTemperature; } - public SpecificHeat specificHeat() { + public SpecificHeat getSpecificHeat() { return specificHeat; } - public SpecificEnthalpy specificEnthalpy() { + public SpecificEnthalpy getSpecificEnthalpy() { return specificEnthalpy; } - public DynamicViscosity dynamicViscosity() { + public DynamicViscosity getDynamicViscosity() { return dynamicViscosity; } - public KinematicViscosity kinematicViscosity() { + public KinematicViscosity getKinematicViscosity() { return kinematicViscosity; } - public ThermalConductivity thermalConductivity() { + public ThermalConductivity getThermalConductivity() { return thermalConductivity; } - public ThermalDiffusivity thermalDiffusivity() { + public ThermalDiffusivity getThermalDiffusivity() { return thermalDiffusivity; } - public PrandtlNumber prandtlNumber() { + public PrandtlNumber getPrandtlNumber() { return prandtlNumber; } - public DryAir dryAirComponent() { + public DryAir getDryAirComponent() { return dryAirComponent; } @@ -159,8 +159,8 @@ public String toConsoleOutput() { String end = "\n\t"; int digits = 3; return "HumidAir:" + end + - absPressure.toEngineeringFormat("P_abs", digits) + separator + - dryBulbTemperature.toEngineeringFormat("DBT", digits) + separator + + pressure.toEngineeringFormat("P_abs", digits) + separator + + temperature.toEngineeringFormat("DBT", digits) + separator + relativeHumidity.toEngineeringFormat("RH", digits) + separator + humidityRatio.toEngineeringFormat("x", digits) + separator + maxHumidityRatio.toEngineeringFormat("x\"", digits) + end + @@ -189,21 +189,21 @@ public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; HumidAir that = (HumidAir) o; - return Objects.equals(dryBulbTemperature, that.dryBulbTemperature) - && Objects.equals(absPressure, that.absPressure) + return Objects.equals(temperature, that.temperature) + && Objects.equals(pressure, that.pressure) && Objects.equals(humidityRatio, that.humidityRatio); } @Override public int hashCode() { - return Objects.hash(dryBulbTemperature, absPressure, humidityRatio); + return Objects.hash(temperature, pressure, humidityRatio); } @Override public String toString() { return "HumidAir{" + - "dryBulbTemperature=" + dryBulbTemperature + - ", absPressure=" + absPressure + + "dryBulbTemperature=" + temperature + + ", absPressure=" + pressure + ", density=" + density + ", relativeHumidity=" + relativeHumidity + ", saturationPressure=" + saturationPressure + diff --git a/src/main/java/com/synerset/hvacengine/fluids/humidair/HumidAirEquations.java b/src/main/java/com/synerset/hvacengine/fluids/humidair/HumidAirEquations.java index e1a7318..f00ef26 100644 --- a/src/main/java/com/synerset/hvacengine/fluids/humidair/HumidAirEquations.java +++ b/src/main/java/com/synerset/hvacengine/fluids/humidair/HumidAirEquations.java @@ -602,12 +602,13 @@ public static double dryBulbTemperatureIX(double ix, double x, double pat) { return solver.calcForFunction(tx -> ix - HumidAirEquations.specificEnthalpy(tx, x, pat)); } - public static Temperature dryBulbTemperatureIX(SpecificEnthalpy specEnthalpy, RelativeHumidity relHum, Pressure absPressure) { + public static Temperature dryBulbTemperatureIX(SpecificEnthalpy specEnthalpy, HumidityRatio humidityRatio, Pressure absPressure) { Validators.requireNotNull(specEnthalpy); - Validators.requireNotNull(relHum); + Validators.requireNotNull(humidityRatio); Validators.requireNotNull(absPressure); - double dryBulbTemp = dryBulbTemperatureIX(specEnthalpy.getInKiloJoulesPerKiloGram(), - relHum.getInPercent(), + double dryBulbTemp = dryBulbTemperatureIX( + specEnthalpy.getInKiloJoulesPerKiloGram(), + humidityRatio.getInKilogramPerKilogram(), absPressure.getInPascals()); return Temperature.ofCelsius(dryBulbTemp); } diff --git a/src/main/java/com/synerset/hvacengine/fluids/liquidwater/FlowOfLiquidWater.java b/src/main/java/com/synerset/hvacengine/fluids/liquidwater/FlowOfLiquidWater.java index dbe0ec1..8ac90bd 100644 --- a/src/main/java/com/synerset/hvacengine/fluids/liquidwater/FlowOfLiquidWater.java +++ b/src/main/java/com/synerset/hvacengine/fluids/liquidwater/FlowOfLiquidWater.java @@ -35,7 +35,7 @@ public FlowOfLiquidWater(LiquidWater liquidWater, MassFlow massFlow) { Validators.requireBetweenBoundsInclusive(massFlow, MASS_FLOW_MIN_LIMIT, MASS_FLOW_MAX_LIMIT); this.liquidWater = liquidWater; this.massFlow = massFlow; - this.volFlow = FlowEquations.massFlowToVolFlow(liquidWater.density(), massFlow); + this.volFlow = FlowEquations.massFlowToVolFlow(liquidWater.getDensity(), massFlow); } @Override @@ -44,38 +44,38 @@ public LiquidWater fluid() { } @Override - public MassFlow massFlow() { + public MassFlow getMassFlow() { return massFlow; } @Override - public VolumetricFlow volumetricFlow() { + public VolumetricFlow getVolumetricFlow() { return volFlow; } @Override - public Temperature temperature() { - return liquidWater.temperature(); + public Temperature getTemperature() { + return liquidWater.getTemperature(); } @Override - public Pressure pressure() { - return liquidWater.pressure(); + public Pressure getPressure() { + return liquidWater.getPressure(); } @Override - public Density density() { - return liquidWater.density(); + public Density getDensity() { + return liquidWater.getDensity(); } @Override - public SpecificHeat specificHeat() { - return liquidWater.specificHeat(); + public SpecificHeat getSpecificHeat() { + return liquidWater.getSpecificHeat(); } @Override - public SpecificEnthalpy specificEnthalpy() { - return liquidWater.specificEnthalpy(); + public SpecificEnthalpy getSpecificEnthalpy() { + return liquidWater.getSpecificEnthalpy(); } /** @@ -174,7 +174,7 @@ public static FlowOfLiquidWater of(LiquidWater liquidWater, MassFlow massFlow) { public static FlowOfLiquidWater of(LiquidWater liquidWater, VolumetricFlow volFlow) { Validators.requireNotNull(liquidWater); Validators.requireNotNull(volFlow); - MassFlow massFlow = FlowEquations.volFlowToMassFlow(liquidWater.density(), volFlow); + MassFlow massFlow = FlowEquations.volFlowToMassFlow(liquidWater.getDensity(), volFlow); return new FlowOfLiquidWater(liquidWater, massFlow); } diff --git a/src/main/java/com/synerset/hvacengine/fluids/liquidwater/LiquidWater.java b/src/main/java/com/synerset/hvacengine/fluids/liquidwater/LiquidWater.java index 9c2e815..f304728 100644 --- a/src/main/java/com/synerset/hvacengine/fluids/liquidwater/LiquidWater.java +++ b/src/main/java/com/synerset/hvacengine/fluids/liquidwater/LiquidWater.java @@ -42,23 +42,23 @@ public LiquidWater(Pressure pressure, Temperature temperature) { this.specificEnthalpy = LiquidWaterEquations.specificEnthalpy(temperature); } - public Temperature temperature() { + public Temperature getTemperature() { return temperature; } - public Pressure pressure() { + public Pressure getPressure() { return pressure; } - public Density density() { + public Density getDensity() { return density; } - public SpecificHeat specificHeat() { + public SpecificHeat getSpecificHeat() { return specificHeat; } - public SpecificEnthalpy specificEnthalpy() { + public SpecificEnthalpy getSpecificEnthalpy() { return specificEnthalpy; } diff --git a/src/main/java/com/synerset/hvacengine/fluids/watervapour/FlowOfWaterVapour.java b/src/main/java/com/synerset/hvacengine/fluids/watervapour/FlowOfWaterVapour.java index 7e2f308..aaeb878 100644 --- a/src/main/java/com/synerset/hvacengine/fluids/watervapour/FlowOfWaterVapour.java +++ b/src/main/java/com/synerset/hvacengine/fluids/watervapour/FlowOfWaterVapour.java @@ -23,7 +23,7 @@ public FlowOfWaterVapour(WaterVapour waterVapour, MassFlow massFlow) { Validators.requireBetweenBoundsInclusive(massFlow, MASS_FLOW_MIN_LIMIT, MASS_FLOW_MAX_LIMIT); this.waterVapour = waterVapour; this.massFlow = massFlow; - this.volFlow = FlowEquations.massFlowToVolFlow(waterVapour.density(), massFlow); + this.volFlow = FlowEquations.massFlowToVolFlow(waterVapour.getDensity(), massFlow); } @Override @@ -32,38 +32,38 @@ public WaterVapour fluid() { } @Override - public MassFlow massFlow() { + public MassFlow getMassFlow() { return massFlow; } @Override - public VolumetricFlow volumetricFlow() { + public VolumetricFlow getVolumetricFlow() { return volFlow; } @Override - public Temperature temperature() { - return waterVapour.temperature(); + public Temperature getTemperature() { + return waterVapour.getTemperature(); } @Override - public Pressure pressure() { - return waterVapour.pressure(); + public Pressure getPressure() { + return waterVapour.getPressure(); } @Override - public Density density() { - return waterVapour.density(); + public Density getDensity() { + return waterVapour.getDensity(); } @Override - public SpecificHeat specificHeat() { - return waterVapour.specificHeat(); + public SpecificHeat getSpecificHeat() { + return waterVapour.getSpecificHeat(); } @Override - public SpecificEnthalpy specificEnthalpy() { - return waterVapour.specificEnthalpy(); + public SpecificEnthalpy getSpecificEnthalpy() { + return waterVapour.getSpecificEnthalpy(); } @Override @@ -122,7 +122,7 @@ public static FlowOfWaterVapour of(WaterVapour waterVapour, MassFlow massFlow) { public static FlowOfWaterVapour of(WaterVapour waterVapour, VolumetricFlow volFlow) { Validators.requireNotNull(waterVapour); Validators.requireNotNull(volFlow); - MassFlow massFlow = FlowEquations.volFlowToMassFlow(waterVapour.density(), volFlow); + MassFlow massFlow = FlowEquations.volFlowToMassFlow(waterVapour.getDensity(), volFlow); return new FlowOfWaterVapour(waterVapour, massFlow); } diff --git a/src/main/java/com/synerset/hvacengine/fluids/watervapour/WaterVapour.java b/src/main/java/com/synerset/hvacengine/fluids/watervapour/WaterVapour.java index 4fc1dd9..22c92e5 100644 --- a/src/main/java/com/synerset/hvacengine/fluids/watervapour/WaterVapour.java +++ b/src/main/java/com/synerset/hvacengine/fluids/watervapour/WaterVapour.java @@ -58,39 +58,39 @@ public WaterVapour(Pressure pressure, this.prandtlNumber = SharedEquations.prandtlNumber(dynamicViscosity, thermalConductivity, specificHeat); } - public Temperature temperature() { + public Temperature getTemperature() { return temperature; } - public Pressure pressure() { + public Pressure getPressure() { return pressure; } - public Density density() { + public Density getDensity() { return density; } - public SpecificHeat specificHeat() { + public SpecificHeat getSpecificHeat() { return specificHeat; } - public SpecificEnthalpy specificEnthalpy() { + public SpecificEnthalpy getSpecificEnthalpy() { return specificEnthalpy; } - public DynamicViscosity dynamicViscosity() { + public DynamicViscosity getDynamicViscosity() { return dynamicViscosity; } - public KinematicViscosity kinematicViscosity() { + public KinematicViscosity getKinematicViscosity() { return kinematicViscosity; } - public ThermalConductivity thermalConductivity() { + public ThermalConductivity getThermalConductivity() { return thermalConductivity; } - public PrandtlNumber prandtlNumber() { + public PrandtlNumber getPrandtlNumber() { return prandtlNumber; } diff --git a/src/main/java/com/synerset/hvacengine/process/cooling/Cooling.java b/src/main/java/com/synerset/hvacengine/process/cooling/Cooling.java index 02c7dec..e5ecdc7 100644 --- a/src/main/java/com/synerset/hvacengine/process/cooling/Cooling.java +++ b/src/main/java/com/synerset/hvacengine/process/cooling/Cooling.java @@ -54,14 +54,14 @@ private void applyProcess() { bypassFactor = coolingBulkResults.bypassFactor(); outletFlow = coolingBulkResults.outletFlow(); outletAir = outletFlow.fluid(); - outPressure = outletFlow.pressure(); - outTemperature = outletFlow.temperature(); + outPressure = outletFlow.getPressure(); + outTemperature = outletFlow.getTemperature(); outRelativeHumidity = outletFlow.relativeHumidity(); outHumidityRatio = outletFlow.humidityRatio(); - outSpecificEnthalpy = outletFlow.specificEnthalpy(); + outSpecificEnthalpy = outletFlow.getSpecificEnthalpy(); condensateFlow = coolingBulkResults.condensateFlow(); - condensateTemperature = condensateFlow.temperature(); - condensateEnthalpy = condensateFlow.specificEnthalpy(); + condensateTemperature = condensateFlow.getTemperature(); + condensateEnthalpy = condensateFlow.getSpecificEnthalpy(); } public CoolingStrategy getCoolingStrategy() { @@ -141,14 +141,14 @@ public String toConsoleOutput() { return "PROCESS OF COOLING:" + end + "INPUT FLOW:" + end + - inputInletAir.volumetricFlow().toCubicMetersPerHour().toEngineeringFormat("V_in", digits) + separator + - inputInletAir.massFlow().toEngineeringFormat("G_in", digits) + separator + + inputInletAir.getVolumetricFlow().toCubicMetersPerHour().toEngineeringFormat("V_in", digits) + separator + + inputInletAir.getMassFlow().toEngineeringFormat("G_in", digits) + separator + inputInletAir.dryAirMassFlow().toEngineeringFormat("G_in.da", digits) + end + - inputInletAir.temperature().toEngineeringFormat("DBT_in", digits) + separator + + inputInletAir.getTemperature().toEngineeringFormat("DBT_in", digits) + separator + inputInletAir.relativeHumidity().toEngineeringFormat("RH_in", digits) + separator + inputInletAir.humidityRatio().toEngineeringFormat("x_in", digits) + separator + - inputInletAir.specificEnthalpy().toEngineeringFormat("i", digits) + end + + inputInletAir.getSpecificEnthalpy().toEngineeringFormat("i", digits) + end + "COOLANT DATA:" + end + coolantData.getSupplyTemperature().toEngineeringFormat("t_su", digits) + separator + @@ -161,8 +161,8 @@ public String toConsoleOutput() { bypassFactor.toEngineeringFormat("BF", digits) + end + "OUTLET FLOW:" + end + - outletFlow.volumetricFlow().toCubicMetersPerHour().toEngineeringFormat("V_out", digits) + separator + - outletFlow.massFlow().toEngineeringFormat("G_out", digits) + separator + + outletFlow.getVolumetricFlow().toCubicMetersPerHour().toEngineeringFormat("V_out", digits) + separator + + outletFlow.getMassFlow().toEngineeringFormat("G_out", digits) + separator + outletFlow.dryAirMassFlow().toEngineeringFormat("G_out.da", digits) + end + outTemperature.toEngineeringFormat("DBT_out", digits) + separator + @@ -170,7 +170,7 @@ public String toConsoleOutput() { outHumidityRatio.toEngineeringFormat("x_out", digits) + separator + outSpecificEnthalpy.toEngineeringFormat("i", digits) + end + "CONDENSATE:" + end + - condensateFlow.massFlow().toEngineeringFormat("G_cond", digits) + separator + + condensateFlow.getMassFlow().toEngineeringFormat("G_cond", digits) + separator + condensateTemperature.toEngineeringFormat("t_cond", digits) + separator + condensateEnthalpy.toEngineeringFormat("i_cond", digits) + end; } diff --git a/src/main/java/com/synerset/hvacengine/process/cooling/CoolingFromPower.java b/src/main/java/com/synerset/hvacengine/process/cooling/CoolingFromPower.java index bc22324..69d75d3 100644 --- a/src/main/java/com/synerset/hvacengine/process/cooling/CoolingFromPower.java +++ b/src/main/java/com/synerset/hvacengine/process/cooling/CoolingFromPower.java @@ -27,15 +27,15 @@ record CoolingFromPower(FlowOfHumidAir inletAir, public AirCoolingResult applyCooling() { if (inputPower.equalsZero()) { - LiquidWater liquidWater = LiquidWater.of(inletAir.temperature()); + LiquidWater liquidWater = LiquidWater.of(inletAir.getTemperature()); FlowOfLiquidWater flowOfLiquidWater = FlowOfLiquidWater.of(liquidWater, MassFlow.ofKilogramsPerSecond(0.0)); new AirCoolingResult(inletAir, inputPower, flowOfLiquidWater, - CoolingHelpers.coilBypassFactor(coolantData.getAverageTemperature(), inletAir.temperature(), inletAir.temperature())); + CoolingHelpers.coilBypassFactor(coolantData.getAverageTemperature(), inletAir.getTemperature(), inletAir.getTemperature())); } // For the provided inputHeat, maximum possible cooling will occur for completely dry air, where no energy will be used for condensate discharge DryCooling dryCooling = DryCooling.of(DryCoolingStrategy.of(inletAir, inputPower)); - double tmin = inletAir.temperature().getInCelsius(); + double tmin = inletAir.getTemperature().getInCelsius(); double tmax = dryCooling.getOutTemperature().getInCelsius(); BrentSolver solver = new BrentSolver("[CoolingFromPower]"); solver.setCounterpartPoints(tmin, tmax); diff --git a/src/main/java/com/synerset/hvacengine/process/cooling/CoolingFromRH.java b/src/main/java/com/synerset/hvacengine/process/cooling/CoolingFromRH.java index e4838b0..8741443 100644 --- a/src/main/java/com/synerset/hvacengine/process/cooling/CoolingFromRH.java +++ b/src/main/java/com/synerset/hvacengine/process/cooling/CoolingFromRH.java @@ -28,21 +28,21 @@ record CoolingFromRH(FlowOfHumidAir inletAir, @Override public AirCoolingResult applyCooling() { - double pIn = inletAir.pressure().getInPascals(); + double pIn = inletAir.getPressure().getInPascals(); Temperature averageWallTemp = coolantData.getAverageTemperature(); if (inletAir.relativeHumidity().equals(targetRelativeHumidity)) { - LiquidWater liquidWater = LiquidWater.of(inletAir.temperature()); + LiquidWater liquidWater = LiquidWater.of(inletAir.getTemperature()); FlowOfLiquidWater flowOfLiquidWater = FlowOfLiquidWater.of(liquidWater, MassFlow.ofKilogramsPerSecond(0.0)); - BypassFactor bypassFactor = CoolingHelpers.coilBypassFactor(averageWallTemp, inletAir.temperature(), inletAir.temperature()); + BypassFactor bypassFactor = CoolingHelpers.coilBypassFactor(averageWallTemp, inletAir.getTemperature(), inletAir.getTemperature()); return new AirCoolingResult(inletAir, Power.ofWatts(0.0), flowOfLiquidWater, bypassFactor); } // Iterative procedure to determine which outlet temperature will result in expected RH. BrentSolver solver = new BrentSolver("calcCoolingFromOutletRH SOLVER"); - double tIn = inletAir.temperature().getInCelsius(); - double tdpIn = inletAir.temperature().getInCelsius(); + double tIn = inletAir.getTemperature().getInCelsius(); + double tdpIn = inletAir.getTemperature().getInCelsius(); solver.setCounterpartPoints(tIn, tdpIn); double rhOut = targetRelativeHumidity.getInPercent(); Cooling[] coolingResults = new Cooling[1]; diff --git a/src/main/java/com/synerset/hvacengine/process/cooling/CoolingFromTemperature.java b/src/main/java/com/synerset/hvacengine/process/cooling/CoolingFromTemperature.java index 0e38ff1..8f7598b 100644 --- a/src/main/java/com/synerset/hvacengine/process/cooling/CoolingFromTemperature.java +++ b/src/main/java/com/synerset/hvacengine/process/cooling/CoolingFromTemperature.java @@ -31,30 +31,30 @@ record CoolingFromTemperature(FlowOfHumidAir inletAir, public AirCoolingResult applyCooling() { // Determining Bypass Factor and direct near-wall contact airflow and bypassing airflow HumidAir inletHumidAir = inletAir.fluid(); - double tIn = inletHumidAir.temperature().getInCelsius(); + double tIn = inletHumidAir.getTemperature().getInCelsius(); double tOut = targetOutTemperature.getInCelsius(); double mCond = 0.0; - LiquidWater liquidWater = LiquidWater.of(inletAir.temperature()); + LiquidWater liquidWater = LiquidWater.of(inletAir.getTemperature()); FlowOfLiquidWater condensateFlow = FlowOfLiquidWater.of(liquidWater, MassFlow.ofKilogramsPerSecond(mCond)); Temperature averageWallTemp = coolantData.getAverageTemperature(); if (tOut == tIn) { return new AirCoolingResult(inletAir, Power.ofWatts(0.0), condensateFlow, - CoolingHelpers.coilBypassFactor(averageWallTemp, inletHumidAir.temperature(), targetOutTemperature)); + CoolingHelpers.coilBypassFactor(averageWallTemp, inletHumidAir.getTemperature(), targetOutTemperature)); } double mdaIn = inletAir.dryAirMassFlow().getInKilogramsPerSecond(); - double xIn = inletHumidAir.humidityRatio().getInKilogramPerKilogram(); - double pIn = inletHumidAir.pressure().getInPascals(); + double xIn = inletHumidAir.getHumidityRatio().getInKilogramPerKilogram(); + double pIn = inletHumidAir.getPressure().getInPascals(); double tmWall = averageWallTemp.getInCelsius(); double tCond = tmWall; - BypassFactor bf = CoolingHelpers.coilBypassFactor(averageWallTemp, inletHumidAir.temperature(), targetOutTemperature); + BypassFactor bf = CoolingHelpers.coilBypassFactor(averageWallTemp, inletHumidAir.getTemperature(), targetOutTemperature); double mDaDirectContact = (1.0 - bf.getValue()) * mdaIn; double mDaBypassing = mdaIn - mDaDirectContact; // Determining direct near-wall air properties - double tdpIn = inletHumidAir.dewPointTemperature().getInCelsius(); + double tdpIn = inletHumidAir.getDewPointTemperature().getInCelsius(); double psTm = HumidAirEquations.saturationPressure(tmWall); double xTm = tmWall >= tdpIn ? xIn : HumidAirEquations.maxHumidityRatio(psTm, pIn); double iTm = HumidAirEquations.specificEnthalpy(tmWall, xTm, pIn); @@ -64,13 +64,13 @@ public AirCoolingResult applyCooling() { ? 0.0 : CoolingHelpers.condensateDischarge( MassFlow.ofKilogramsPerSecond(mDaDirectContact), - inletHumidAir.humidityRatio(), + inletHumidAir.getHumidityRatio(), HumidityRatio.ofKilogramPerKilogram(xTm)) .getInKilogramsPerSecond(); // Determining required cooling performance double iCond = LiquidWaterEquations.specificEnthalpy(tCond); - double iIn = inletHumidAir.specificEnthalpy().getInKiloJoulesPerKiloGram(); + double iIn = inletHumidAir.getSpecificEnthalpy().getInKiloJoulesPerKiloGram(); double qCond = mCond * iCond; double qCool = (mDaDirectContact * (iTm - iIn) + qCond); @@ -80,7 +80,7 @@ public AirCoolingResult applyCooling() { liquidWater = LiquidWater.of(Temperature.ofCelsius(tCond)); condensateFlow = FlowOfLiquidWater.of(liquidWater, MassFlow.ofKilogramsPerSecond(mCond)); HumidAir outletHumidAir = HumidAir.of( - inletAir.pressure(), + inletAir.getPressure(), Temperature.ofCelsius(tOut), HumidityRatio.ofKilogramPerKilogram(xOut) ); diff --git a/src/main/java/com/synerset/hvacengine/process/cooling/CoolingStrategy.java b/src/main/java/com/synerset/hvacengine/process/cooling/CoolingStrategy.java index 48a6454..e9e6802 100644 --- a/src/main/java/com/synerset/hvacengine/process/cooling/CoolingStrategy.java +++ b/src/main/java/com/synerset/hvacengine/process/cooling/CoolingStrategy.java @@ -52,9 +52,9 @@ static CoolingStrategy of(FlowOfHumidAir inletAirFlow, CoolantData inletCoolantD throw new InvalidArgumentException("Cooling power must be negative value. Q_in = " + inputPower); } // Mox cooling power quick estimate to reach 0 degrees Qcool.max= G * (i_0 - i_in) - double estimatedMaxPowerKw = inletAirFlow.specificEnthalpy().toKiloJoulePerKiloGram() + double estimatedMaxPowerKw = inletAirFlow.getSpecificEnthalpy().toKiloJoulePerKiloGram() .minusFromValue(0) - .multiply(inletAirFlow.massFlow().toKilogramsPerSecond()); + .multiply(inletAirFlow.getMassFlow().toKilogramsPerSecond()); Power estimatedPowerLimit = Power.ofKiloWatts(estimatedMaxPowerKw); if (inputPower.isLowerThan(estimatedPowerLimit)) { throw new InvalidArgumentException("To large cooling power for provided flow. " @@ -98,9 +98,9 @@ static CoolingStrategy of(FlowOfHumidAir inletAirFlow, CoolantData inletCoolantD Validators.requireNotNull(inletCoolantData); Validators.requireNotNull(targetTemperature); Validators.requireAboveLowerBound(targetTemperature, Temperature.ofCelsius(0)); - if (targetTemperature.isGreaterThan(inletAirFlow.temperature())) { + if (targetTemperature.isGreaterThan(inletAirFlow.getTemperature())) { throw new InvalidArgumentException("Expected outlet temperature must be lower than inlet for cooling process. " - + "DBT_in = " + inletAirFlow.relativeHumidity() + " DBT_target = " + inletAirFlow.temperature()); + + "DBT_in = " + inletAirFlow.relativeHumidity() + " DBT_target = " + inletAirFlow.getTemperature()); } return new CoolingFromTemperature(inletAirFlow, inletCoolantData, targetTemperature); } diff --git a/src/main/java/com/synerset/hvacengine/process/drycooling/DryCooling.java b/src/main/java/com/synerset/hvacengine/process/drycooling/DryCooling.java index 7962394..2a48efc 100644 --- a/src/main/java/com/synerset/hvacengine/process/drycooling/DryCooling.java +++ b/src/main/java/com/synerset/hvacengine/process/drycooling/DryCooling.java @@ -48,11 +48,11 @@ private void applyProcess() { heatOfProcess = dryCoolingBulkResult.heatOfProcess(); outletFlow = dryCoolingBulkResult.outletFlow(); outletAir = outletFlow.fluid(); - outPressure = outletFlow.pressure(); - outTemperature = outletFlow.temperature(); + outPressure = outletFlow.getPressure(); + outTemperature = outletFlow.getTemperature(); outRelativeHumidity = outletFlow.relativeHumidity(); outHumidityRatio = outletFlow.humidityRatio(); - outSpecificEnthalpy = outletFlow.specificEnthalpy(); + outSpecificEnthalpy = outletFlow.getSpecificEnthalpy(); } public DryCoolingStrategy getDryCoolingStrategy() { @@ -112,21 +112,21 @@ public String toConsoleOutput() { return "PROCESS OF DRY COOLING:" + end + "INPUT FLOW:" + end + - inputInletAir.volumetricFlow().toCubicMetersPerHour().toEngineeringFormat("V_in", digits) + separator + - inputInletAir.massFlow().toEngineeringFormat("G_in", digits) + separator + + inputInletAir.getVolumetricFlow().toCubicMetersPerHour().toEngineeringFormat("V_in", digits) + separator + + inputInletAir.getMassFlow().toEngineeringFormat("G_in", digits) + separator + inputInletAir.dryAirMassFlow().toEngineeringFormat("G_in.da", digits) + end + - inputInletAir.temperature().toEngineeringFormat("DBT_in", digits) + separator + + inputInletAir.getTemperature().toEngineeringFormat("DBT_in", digits) + separator + inputInletAir.relativeHumidity().toEngineeringFormat("RH_in", digits) + separator + inputInletAir.humidityRatio().toEngineeringFormat("x_in", digits) + separator + - inputInletAir.specificEnthalpy().toEngineeringFormat("i_in", digits) + end + + inputInletAir.getSpecificEnthalpy().toEngineeringFormat("i_in", digits) + end + "HEAT OF PROCESS:" + end + heatOfProcess.toEngineeringFormat("Q_cool", digits) + end + "OUTLET FLOW:" + end + - outletFlow.volumetricFlow().toCubicMetersPerHour().toEngineeringFormat("V_out", digits) + separator + - outletFlow.massFlow().toEngineeringFormat("G_out", digits) + separator + + outletFlow.getVolumetricFlow().toCubicMetersPerHour().toEngineeringFormat("V_out", digits) + separator + + outletFlow.getMassFlow().toEngineeringFormat("G_out", digits) + separator + outletFlow.dryAirMassFlow().toEngineeringFormat("G_out.da", digits) + end + outTemperature.toEngineeringFormat("DBT_out", digits) + separator + outRelativeHumidity.toEngineeringFormat("RH_out", digits) + separator + diff --git a/src/main/java/com/synerset/hvacengine/process/drycooling/DryCoolingFromPower.java b/src/main/java/com/synerset/hvacengine/process/drycooling/DryCoolingFromPower.java index f16bb02..ea1083e 100644 --- a/src/main/java/com/synerset/hvacengine/process/drycooling/DryCoolingFromPower.java +++ b/src/main/java/com/synerset/hvacengine/process/drycooling/DryCoolingFromPower.java @@ -24,19 +24,19 @@ record DryCoolingFromPower(FlowOfHumidAir inletAir, @Override public DryAirCoolingResult applyDryCooling() { - if (inputPower.equalsZero() || inletAir.massFlow().equalsZero()) { + if (inputPower.equalsZero() || inletAir.getMassFlow().equalsZero()) { return new DryAirCoolingResult(inletAir, inputPower.withValue(0)); } double qCool = inputPower.getInKiloWatts(); double xIn = inletAir.humidityRatio().getInKilogramPerKilogram(); double mdaIn = inletAir.dryAirMassFlow().getInKilogramsPerSecond(); - double pIn = inletAir.pressure().getInPascals(); - double iIn = inletAir.specificEnthalpy().getInKiloJoulesPerKiloGram(); + double pIn = inletAir.getPressure().getInPascals(); + double iIn = inletAir.getSpecificEnthalpy().getInKiloJoulesPerKiloGram(); double iOut = (mdaIn * iIn + qCool) / mdaIn; double tOut = HumidAirEquations.dryBulbTemperatureIX(iOut, xIn, pIn); - HumidAir outletHumidAir = HumidAir.of(inletAir.pressure(), Temperature.ofCelsius(tOut), inletAir.humidityRatio()); + HumidAir outletHumidAir = HumidAir.of(inletAir.getPressure(), Temperature.ofCelsius(tOut), inletAir.humidityRatio()); FlowOfHumidAir outletFlow = FlowOfHumidAir.ofDryAirMassFlow(outletHumidAir, inletAir.dryAirMassFlow()); return new DryAirCoolingResult(outletFlow, inputPower); diff --git a/src/main/java/com/synerset/hvacengine/process/drycooling/DryCoolingFromTemperature.java b/src/main/java/com/synerset/hvacengine/process/drycooling/DryCoolingFromTemperature.java index f13da00..5d77055 100644 --- a/src/main/java/com/synerset/hvacengine/process/drycooling/DryCoolingFromTemperature.java +++ b/src/main/java/com/synerset/hvacengine/process/drycooling/DryCoolingFromTemperature.java @@ -26,25 +26,25 @@ record DryCoolingFromTemperature(FlowOfHumidAir inletAir, public DryAirCoolingResult applyDryCooling() { // The Target temperature must be lower than inlet temperature for a valid cooling case. - if (outletTemperature.equalsOrGreaterThan(inletAir.temperature())) { + if (outletTemperature.equalsOrGreaterThan(inletAir.getTemperature())) { return new DryAirCoolingResult(inletAir, Power.ofWatts(0)); } // If the target temperature is below dew point temperature, it is certain that this is no longer dry cooling - if (outletTemperature.isLowerThan(inletAir.fluid().dewPointTemperature())) { + if (outletTemperature.isLowerThan(inletAir.fluid().getDewPointTemperature())) { return new DryAirCoolingResult(inletAir, Power.ofWatts(0)); } double xIn = inletAir.humidityRatio().getInKilogramPerKilogram(); double mdaIn = inletAir.dryAirMassFlow().getInKilogramsPerSecond(); double tOut = outletTemperature.getInCelsius(); - double pIn = inletAir.pressure().getInPascals(); - double iIn = inletAir.specificEnthalpy().getInKiloJoulesPerKiloGram(); + double pIn = inletAir.getPressure().getInPascals(); + double iIn = inletAir.getSpecificEnthalpy().getInKiloJoulesPerKiloGram(); double i2 = HumidAirEquations.specificEnthalpy(tOut, xIn, pIn); double qHeat = (mdaIn * i2 - mdaIn * iIn) * 1000d; Power requiredHeat = Power.ofWatts(qHeat); - HumidAir outletHumidAir = HumidAir.of(inletAir.pressure(), Temperature.ofCelsius(tOut), inletAir.humidityRatio()); + HumidAir outletHumidAir = HumidAir.of(inletAir.getPressure(), Temperature.ofCelsius(tOut), inletAir.humidityRatio()); FlowOfHumidAir outletFlow = FlowOfHumidAir.ofDryAirMassFlow(outletHumidAir, MassFlow.ofKilogramsPerSecond(mdaIn)); return new DryAirCoolingResult(outletFlow, requiredHeat); diff --git a/src/main/java/com/synerset/hvacengine/process/drycooling/DryCoolingStrategy.java b/src/main/java/com/synerset/hvacengine/process/drycooling/DryCoolingStrategy.java index 097a49a..a4e7bb2 100644 --- a/src/main/java/com/synerset/hvacengine/process/drycooling/DryCoolingStrategy.java +++ b/src/main/java/com/synerset/hvacengine/process/drycooling/DryCoolingStrategy.java @@ -58,9 +58,9 @@ static DryCoolingStrategy of(FlowOfHumidAir inletAirFlow, Temperature targetTemp Validators.requireNotNull(inletAirFlow); Validators.requireNotNull(targetTemperature); - if (targetTemperature.isGreaterThan(inletAirFlow.temperature())) { + if (targetTemperature.isGreaterThan(inletAirFlow.getTemperature())) { throw new InvalidArgumentException("Expected outlet temperature must be lower than inlet for cooling process. " - + "DBT_in = " + inletAirFlow.relativeHumidity() + " DBT_target = " + inletAirFlow.temperature()); + + "DBT_in = " + inletAirFlow.relativeHumidity() + " DBT_target = " + inletAirFlow.getTemperature()); } return new DryCoolingFromTemperature(inletAirFlow, targetTemperature); diff --git a/src/main/java/com/synerset/hvacengine/process/heating/Heating.java b/src/main/java/com/synerset/hvacengine/process/heating/Heating.java index e95470a..8d39bf4 100644 --- a/src/main/java/com/synerset/hvacengine/process/heating/Heating.java +++ b/src/main/java/com/synerset/hvacengine/process/heating/Heating.java @@ -47,12 +47,12 @@ private void applyProcess() { heatingBulkResults = heatingStrategy.applyHeating(); heatOfProcess = heatingBulkResults.heatOfProcess(); outletFlow = heatingBulkResults.outletFlow(); - outPressure = outletFlow.pressure(); + outPressure = outletFlow.getPressure(); outletAir = outletFlow.fluid(); - outTemperature = outletFlow.temperature(); + outTemperature = outletFlow.getTemperature(); outRelativeHumidity = outletFlow.relativeHumidity(); outHumidityRatio = outletFlow.humidityRatio(); - outSpecificEnthalpy = outletFlow.specificEnthalpy(); + outSpecificEnthalpy = outletFlow.getSpecificEnthalpy(); } public HeatingStrategy getHeatingStrategy() { @@ -112,21 +112,21 @@ public String toConsoleOutput() { return "PROCESS OF HEATING:" + end + "INPUT FLOW:" + end + - inputInletAir.volumetricFlow().toCubicMetersPerHour().toEngineeringFormat("V_in", digits) + separator + - inputInletAir.massFlow().toEngineeringFormat("G_in", digits) + separator + + inputInletAir.getVolumetricFlow().toCubicMetersPerHour().toEngineeringFormat("V_in", digits) + separator + + inputInletAir.getMassFlow().toEngineeringFormat("G_in", digits) + separator + inputInletAir.dryAirMassFlow().toEngineeringFormat("G_in.da", digits) + end + - inputInletAir.temperature().toEngineeringFormat("DBT_in", digits) + separator + + inputInletAir.getTemperature().toEngineeringFormat("DBT_in", digits) + separator + inputInletAir.relativeHumidity().toEngineeringFormat("RH_in", digits) + separator + inputInletAir.humidityRatio().toEngineeringFormat("x_in", digits) + separator + - inputInletAir.specificEnthalpy().toEngineeringFormat("i_in", digits) + end + + inputInletAir.getSpecificEnthalpy().toEngineeringFormat("i_in", digits) + end + "HEAT OF PROCESS:" + end + heatOfProcess.toEngineeringFormat("Q_heat", digits) + end + "OUTLET FLOW:" + end + - outletFlow.volumetricFlow().toCubicMetersPerHour().toEngineeringFormat("V_out", digits) + separator + - outletFlow.massFlow().toEngineeringFormat("G_out", digits) + separator + + outletFlow.getVolumetricFlow().toCubicMetersPerHour().toEngineeringFormat("V_out", digits) + separator + + outletFlow.getMassFlow().toEngineeringFormat("G_out", digits) + separator + outletFlow.dryAirMassFlow().toEngineeringFormat("G_out.da", digits) + end + outTemperature.toEngineeringFormat("DBT_out", digits) + separator + diff --git a/src/main/java/com/synerset/hvacengine/process/heating/HeatingFromPower.java b/src/main/java/com/synerset/hvacengine/process/heating/HeatingFromPower.java index b9751d1..e7f52f1 100644 --- a/src/main/java/com/synerset/hvacengine/process/heating/HeatingFromPower.java +++ b/src/main/java/com/synerset/hvacengine/process/heating/HeatingFromPower.java @@ -21,20 +21,20 @@ record HeatingFromPower(FlowOfHumidAir inletAir, @Override public AirHeatingResult applyHeating() { - if (inputPower.equalsZero() || inletAir.massFlow().equalsZero()) { + if (inputPower.equalsZero() || inletAir.getMassFlow().equalsZero()) { return new AirHeatingResult(inletAir, inputPower); } HumidAir inletHumidAir = inletAir.fluid(); double qHeat = inputPower.getInKiloWatts(); - double xIn = inletHumidAir.humidityRatio().getInKilogramPerKilogram(); + double xIn = inletHumidAir.getHumidityRatio().getInKilogramPerKilogram(); double mdaIn = inletAir.dryAirMassFlow().getInKilogramsPerSecond(); - double pIn = inletHumidAir.pressure().getInPascals(); - double iIn = inletHumidAir.specificEnthalpy().getInKiloJoulesPerKiloGram(); + double pIn = inletHumidAir.getPressure().getInPascals(); + double iIn = inletHumidAir.getSpecificEnthalpy().getInKiloJoulesPerKiloGram(); double iOut = (mdaIn * iIn + qHeat) / mdaIn; double tOut = HumidAirEquations.dryBulbTemperatureIX(iOut, xIn, pIn); - HumidAir outletHumidAir = HumidAir.of(inletAir.pressure(), Temperature.ofCelsius(tOut), inletAir.humidityRatio()); + HumidAir outletHumidAir = HumidAir.of(inletAir.getPressure(), Temperature.ofCelsius(tOut), inletAir.humidityRatio()); FlowOfHumidAir outletFlow = FlowOfHumidAir.ofDryAirMassFlow(outletHumidAir, MassFlow.ofKilogramsPerSecond(mdaIn)); return new AirHeatingResult(outletFlow, inputPower); diff --git a/src/main/java/com/synerset/hvacengine/process/heating/HeatingFromRH.java b/src/main/java/com/synerset/hvacengine/process/heating/HeatingFromRH.java index c920440..0b33f29 100644 --- a/src/main/java/com/synerset/hvacengine/process/heating/HeatingFromRH.java +++ b/src/main/java/com/synerset/hvacengine/process/heating/HeatingFromRH.java @@ -27,16 +27,16 @@ public AirHeatingResult applyHeating() { HumidAir inletHumidAir = inletAir.fluid(); double rhOut = targetRelativeHumidity.getInPercent(); - double xIn = inletHumidAir.humidityRatio().getInKilogramPerKilogram(); + double xIn = inletHumidAir.getHumidityRatio().getInKilogramPerKilogram(); double mdaIn = inletAir.dryAirMassFlow().getInKilogramsPerSecond(); - double pIn = inletHumidAir.pressure().getInPascals(); - double iIn = inletHumidAir.specificEnthalpy().getInKiloJoulesPerKiloGram(); + double pIn = inletHumidAir.getPressure().getInPascals(); + double iIn = inletHumidAir.getSpecificEnthalpy().getInKiloJoulesPerKiloGram(); double tOut = HumidAirEquations.dryBulbTemperatureXRH(xIn, rhOut, pIn); double iOut = HumidAirEquations.specificEnthalpy(tOut, xIn, pIn); double qHeat = (mdaIn * iOut - mdaIn * iIn) * 1000d; Power requiredHeat = Power.ofWatts(qHeat); - HumidAir outletHumidAir = HumidAir.of(inletAir.pressure(), Temperature.ofCelsius(tOut), inletAir.humidityRatio()); + HumidAir outletHumidAir = HumidAir.of(inletAir.getPressure(), Temperature.ofCelsius(tOut), inletAir.humidityRatio()); FlowOfHumidAir outletFlow = FlowOfHumidAir.ofDryAirMassFlow(outletHumidAir, MassFlow.ofKilogramsPerSecond(mdaIn)); return new AirHeatingResult(outletFlow, requiredHeat); diff --git a/src/main/java/com/synerset/hvacengine/process/heating/HeatingFromTemperature.java b/src/main/java/com/synerset/hvacengine/process/heating/HeatingFromTemperature.java index e97e645..994e4dd 100644 --- a/src/main/java/com/synerset/hvacengine/process/heating/HeatingFromTemperature.java +++ b/src/main/java/com/synerset/hvacengine/process/heating/HeatingFromTemperature.java @@ -21,23 +21,23 @@ record HeatingFromTemperature(FlowOfHumidAir inletAir, @Override public AirHeatingResult applyHeating() { - if (inletAir.temperature().equals(targetTemperature)) { + if (inletAir.getTemperature().equals(targetTemperature)) { return new AirHeatingResult(inletAir, Power.ofWatts(0)); } HumidAir inletHumidAir = inletAir.fluid(); - double xIn = inletHumidAir.humidityRatio().getInKilogramPerKilogram(); + double xIn = inletHumidAir.getHumidityRatio().getInKilogramPerKilogram(); double mdaIn = inletAir.dryAirMassFlow().getInKilogramsPerSecond(); double tOut = targetTemperature.getInCelsius(); - double pIn = inletHumidAir.pressure().getInPascals(); - double iIn = inletHumidAir.specificEnthalpy().getInKiloJoulesPerKiloGram(); + double pIn = inletHumidAir.getPressure().getInPascals(); + double iIn = inletHumidAir.getSpecificEnthalpy().getInKiloJoulesPerKiloGram(); double i2 = HumidAirEquations.specificEnthalpy(tOut, xIn, pIn); double qHeat = (mdaIn * i2 - mdaIn * iIn) * 1000d; Power requiredHeat = Power.ofWatts(qHeat); HumidAir outletHumidAir = HumidAir.of( - inletAir.pressure(), + inletAir.getPressure(), Temperature.ofCelsius(tOut), inletAir.humidityRatio() ); diff --git a/src/main/java/com/synerset/hvacengine/process/heating/HeatingStrategy.java b/src/main/java/com/synerset/hvacengine/process/heating/HeatingStrategy.java index f295ecb..accb33b 100644 --- a/src/main/java/com/synerset/hvacengine/process/heating/HeatingStrategy.java +++ b/src/main/java/com/synerset/hvacengine/process/heating/HeatingStrategy.java @@ -48,11 +48,11 @@ static HeatingStrategy of(FlowOfHumidAir inletAirFlow, Power inputPower) { } // Mox heating power estimate to reach t_max: Qheat.max= G * (imax - i_in) - Temperature tMax = HumidAirEquations.dryBulbTemperatureMax(inletAirFlow.pressure()).multiply(0.98); + Temperature tMax = HumidAirEquations.dryBulbTemperatureMax(inletAirFlow.getPressure()).multiply(0.98); SpecificEnthalpy iMax = HumidAirEquations.specificEnthalpy(tMax, inletAirFlow.humidityRatio(), - inletAirFlow.pressure()); - double qMax = iMax.minus(inletAirFlow.specificEnthalpy()) - .multiply(inletAirFlow.massFlow().toKilogramsPerSecond()); + inletAirFlow.getPressure()); + double qMax = iMax.minus(inletAirFlow.getSpecificEnthalpy()) + .multiply(inletAirFlow.getMassFlow().toKilogramsPerSecond()); Power estimatedPowerLimit = Power.ofKiloWatts(qMax); if (inputPower.isGreaterThan(estimatedPowerLimit)) { throw new InvalidArgumentException("To large heating power for provided flow. " @@ -92,9 +92,9 @@ static HeatingStrategy of(FlowOfHumidAir inletAirFlow, Temperature targetTempera Validators.requireNotNull(inletAirFlow); Validators.requireNotNull(targetTemperature); Validators.requireBelowUpperBoundInclusive(targetTemperature, HumidAir.TEMPERATURE_MAX_LIMIT); - if (targetTemperature.isLowerThan(inletAirFlow.temperature())) { + if (targetTemperature.isLowerThan(inletAirFlow.getTemperature())) { throw new InvalidArgumentException("Expected outlet temperature must be greater than inlet for cooling process. " - + "DBT_in = " + inletAirFlow.relativeHumidity() + " DBT_target = " + inletAirFlow.temperature()); + + "DBT_in = " + inletAirFlow.relativeHumidity() + " DBT_target = " + inletAirFlow.getTemperature()); } return new HeatingFromTemperature(inletAirFlow, targetTemperature); } diff --git a/src/main/java/com/synerset/hvacengine/process/mixing/Mixing.java b/src/main/java/com/synerset/hvacengine/process/mixing/Mixing.java index 8d819eb..b35af20 100644 --- a/src/main/java/com/synerset/hvacengine/process/mixing/Mixing.java +++ b/src/main/java/com/synerset/hvacengine/process/mixing/Mixing.java @@ -44,12 +44,12 @@ public Mixing(MixingStrategy mixingStrategy) { private void applyProcess() { airMixingBulkResult = mixingStrategy.applyMixing(); outletFlow = airMixingBulkResult.outletFlow(); - outPressure = outletFlow.pressure(); + outPressure = outletFlow.getPressure(); outletAir = outletFlow.fluid(); - outTemperature = outletFlow.temperature(); + outTemperature = outletFlow.getTemperature(); outRelativeHumidity = outletFlow.relativeHumidity(); outHumidityRatio = outletFlow.humidityRatio(); - outSpecificEnthalpy = outletFlow.specificEnthalpy(); + outSpecificEnthalpy = outletFlow.getSpecificEnthalpy(); } public MixingStrategy getMixingStrategy() { @@ -119,13 +119,13 @@ private String toConsoleOutputGenericForFlow(FlowOfHumidAir flowOfAir, String ti String end = "\n\t"; int digits = 3; return title + end + - flowOfAir.volumetricFlow().toCubicMetersPerHour().toEngineeringFormat("V_" + suffix, digits) + separator + - flowOfAir.massFlow().toEngineeringFormat("G_" + suffix, digits) + separator + + flowOfAir.getVolumetricFlow().toCubicMetersPerHour().toEngineeringFormat("V_" + suffix, digits) + separator + + flowOfAir.getMassFlow().toEngineeringFormat("G_" + suffix, digits) + separator + flowOfAir.dryAirMassFlow().toEngineeringFormat("G_" + suffix + ".da", digits) + end + - flowOfAir.temperature().toEngineeringFormat("DBT_" + suffix, digits) + separator + + flowOfAir.getTemperature().toEngineeringFormat("DBT_" + suffix, digits) + separator + flowOfAir.relativeHumidity().toEngineeringFormat("RH_" + suffix, digits) + separator + flowOfAir.humidityRatio().toEngineeringFormat("x_" + suffix, digits) + separator + - flowOfAir.specificEnthalpy().toEngineeringFormat("i_" + suffix, digits); + flowOfAir.getSpecificEnthalpy().toEngineeringFormat("i_" + suffix, digits); } @Override diff --git a/src/main/java/com/synerset/hvacengine/process/mixing/MixingOfMultipleFlows.java b/src/main/java/com/synerset/hvacengine/process/mixing/MixingOfMultipleFlows.java index 840b409..dbac388 100644 --- a/src/main/java/com/synerset/hvacengine/process/mixing/MixingOfMultipleFlows.java +++ b/src/main/java/com/synerset/hvacengine/process/mixing/MixingOfMultipleFlows.java @@ -27,14 +27,14 @@ record MixingOfMultipleFlows(FlowOfHumidAir inletAir, public AirMixingResult applyMixing() { double mdaOut = inletAir.dryAirMassFlow().getInKilogramsPerSecond(); double xMda = mdaOut * inletAir.humidityRatio().getInKilogramPerKilogram(); - double iMda = mdaOut * inletAir.specificEnthalpy().getInKiloJoulesPerKiloGram(); - double pOut = inletAir.pressure().getInPascals(); + double iMda = mdaOut * inletAir.getSpecificEnthalpy().getInKiloJoulesPerKiloGram(); + double pOut = inletAir.getPressure().getInPascals(); for (FlowOfHumidAir flow : recirculationAirFlows) { mdaOut += flow.dryAirMassFlow().getInKilogramsPerSecond(); - xMda += flow.dryAirMassFlow().getInKilogramsPerSecond() * flow.fluid().humidityRatio().getInKilogramPerKilogram(); - iMda += flow.dryAirMassFlow().getInKilogramsPerSecond() * flow.fluid().specificEnthalpy().getInKiloJoulesPerKiloGram(); - pOut = Double.max(pOut, flow.pressure().getInPascals()); + xMda += flow.dryAirMassFlow().getInKilogramsPerSecond() * flow.fluid().getHumidityRatio().getInKilogramPerKilogram(); + iMda += flow.dryAirMassFlow().getInKilogramsPerSecond() * flow.fluid().getSpecificEnthalpy().getInKiloJoulesPerKiloGram(); + pOut = Double.max(pOut, flow.getPressure().getInPascals()); } if (mdaOut == 0) { diff --git a/src/main/java/com/synerset/hvacengine/process/mixing/MixingOfTwoFlows.java b/src/main/java/com/synerset/hvacengine/process/mixing/MixingOfTwoFlows.java index 5ab69c7..0c522c4 100644 --- a/src/main/java/com/synerset/hvacengine/process/mixing/MixingOfTwoFlows.java +++ b/src/main/java/com/synerset/hvacengine/process/mixing/MixingOfTwoFlows.java @@ -38,9 +38,9 @@ public AirMixingResult applyMixing() { double xIn = inletAir.humidityRatio().getInKilogramPerKilogram(); double xRec = recirculationAirFlow.humidityRatio().getInKilogramPerKilogram(); - double pIn = inletAir.pressure().getInPascals(); - double iIn = inletAir.specificEnthalpy().getInKiloJoulesPerKiloGram(); - double iRec = recirculationAirFlow.specificEnthalpy().getInKiloJoulesPerKiloGram(); + double pIn = inletAir.getPressure().getInPascals(); + double iIn = inletAir.getSpecificEnthalpy().getInKiloJoulesPerKiloGram(); + double iRec = recirculationAirFlow.getSpecificEnthalpy().getInKiloJoulesPerKiloGram(); double xOut = (mdaIn * xIn + mdaRec * xRec) / mdaOut; double iOut = (mdaIn * iIn + mdaRec * iRec) / mdaOut; diff --git a/src/main/java/com/synerset/hvacengine/process/mixing/MixingStrategy.java b/src/main/java/com/synerset/hvacengine/process/mixing/MixingStrategy.java index ec50fe6..fd0bd71 100644 --- a/src/main/java/com/synerset/hvacengine/process/mixing/MixingStrategy.java +++ b/src/main/java/com/synerset/hvacengine/process/mixing/MixingStrategy.java @@ -46,7 +46,7 @@ public interface MixingStrategy { static MixingStrategy of(FlowOfHumidAir inletAir, List recirculationAirFlows) { Validators.requireNotNull(inletAir); Validators.requireNotEmpty(recirculationAirFlows); - MassFlow totalMassFlow = sumOfAllFlows(recirculationAirFlows).plus(inletAir.massFlow()); + MassFlow totalMassFlow = sumOfAllFlows(recirculationAirFlows).plus(inletAir.getMassFlow()); Validators.requireBelowUpperBoundInclusive(totalMassFlow, FlowOfHumidAir.MASS_FLOW_MAX_LIMIT); return new MixingOfMultipleFlows(inletAir, recirculationAirFlows); } @@ -74,7 +74,7 @@ static MixingStrategy of(FlowOfHumidAir inletAir, FlowOfHumidAir... recirculatio static MixingStrategy of(FlowOfHumidAir inletAir, FlowOfHumidAir recirculationAirFlow) { Validators.requireNotNull(inletAir); Validators.requireNotNull(recirculationAirFlow); - MassFlow totalMassFlow = inletAir.massFlow().plus(recirculationAirFlow.massFlow()); + MassFlow totalMassFlow = inletAir.getMassFlow().plus(recirculationAirFlow.getMassFlow()); Validators.requireBelowUpperBoundInclusive(totalMassFlow, FlowOfHumidAir.MASS_FLOW_MAX_LIMIT); return new MixingOfTwoFlows(inletAir, recirculationAirFlow); } @@ -82,7 +82,7 @@ static MixingStrategy of(FlowOfHumidAir inletAir, FlowOfHumidAir recirculationAi private static MassFlow sumOfAllFlows(List airFlows) { MassFlow resultingFlow = MassFlow.ofKilogramsPerSecond(0); for (FlowOfHumidAir flow : airFlows) { - resultingFlow = resultingFlow.plus(flow.massFlow()); + resultingFlow = resultingFlow.plus(flow.getMassFlow()); } return resultingFlow; } diff --git a/src/main/java/com/synerset/hvacengine/solids/ice/Ice.java b/src/main/java/com/synerset/hvacengine/solids/ice/Ice.java index 6f15be6..e51fd36 100644 --- a/src/main/java/com/synerset/hvacengine/solids/ice/Ice.java +++ b/src/main/java/com/synerset/hvacengine/solids/ice/Ice.java @@ -37,23 +37,23 @@ public Ice(Pressure pressure, Temperature temperature) { this.specificEnthalpy = IceEquations.specificEnthalpy(temperature); } - public Temperature temperature() { + public Temperature getTemperature() { return temperature; } - public Pressure pressure() { + public Pressure getPressure() { return pressure; } - public Density density() { + public Density getDensity() { return density; } - public SpecificHeat specificHeat() { + public SpecificHeat getSpecificHeat() { return specificHeat; } - public SpecificEnthalpy specificEnthalpy() { + public SpecificEnthalpy getSpecificEnthalpy() { return specificEnthalpy; } diff --git a/src/test/java/com/synerset/hvacengine/fluids/FlowEquationsTest.java b/src/test/java/com/synerset/hvacengine/fluids/FlowEquationsTest.java index a531e1e..115cf42 100644 --- a/src/test/java/com/synerset/hvacengine/fluids/FlowEquationsTest.java +++ b/src/test/java/com/synerset/hvacengine/fluids/FlowEquationsTest.java @@ -28,7 +28,7 @@ class FlowEquationsTest { void calcVolFlowFromMassFlow_shouldReturnVolumetricFlow_whenMassFlowAndFluidDensityIsGiven() { // Arrange // ACT - var actualWaterVolFlow = FlowEquations.massFlowToVolFlow(SAMPLE_LIQ_WATER.density().getInKilogramsPerCubicMeters(), + var actualWaterVolFlow = FlowEquations.massFlowToVolFlow(SAMPLE_LIQ_WATER.getDensity().getInKilogramsPerCubicMeters(), SAMPLE_MASS_FLOW); // Assert @@ -40,7 +40,7 @@ void calcVolFlowFromMassFlow_shouldReturnVolumetricFlow_whenMassFlowAndFluidDens void calcMassFlowFromVolFlow_shouldReturnMassFlow_whenVolumetricFlowAndFluidDensityIsGiven() { // Arrange // ACT - var actualWaterMassFlow = FlowEquations.volFlowToMassFlow(SAMPLE_LIQ_WATER.density().getInKilogramsPerCubicMeters(), + var actualWaterMassFlow = FlowEquations.volFlowToMassFlow(SAMPLE_LIQ_WATER.getDensity().getInKilogramsPerCubicMeters(), SAMPLE_FLUID_VOL_FLOW); // Assert @@ -53,11 +53,11 @@ void calcMassFlowFromVolFlow_shouldReturnMassFlow_whenVolumetricFlowAndFluidDens @DisplayName("should calculate moist air mass flow when dry air mass flow and moist air density is given") void calcMaMassFlowFromDaMassFlow_shouldReturnMoistAirMassFlow_whenDryAirMassFlowAndMoistAirDensityIsGiven() { // Arrange - var dryAirMassFlow = FlowEquations.massFlowHaToMassFlowDa(SAMPLE_AIR.humidityRatio().getInKilogramPerKilogram(), + var dryAirMassFlow = FlowEquations.massFlowHaToMassFlowDa(SAMPLE_AIR.getHumidityRatio().getInKilogramPerKilogram(), SAMPLE_MASS_FLOW); // ACT - var actualMaAirMassFlow = FlowEquations.massFlowDaToMassFlowHa(SAMPLE_AIR.humidityRatio().getInKilogramPerKilogram(), + var actualMaAirMassFlow = FlowEquations.massFlowDaToMassFlowHa(SAMPLE_AIR.getHumidityRatio().getInKilogramPerKilogram(), dryAirMassFlow); // Assert @@ -69,7 +69,7 @@ void calcMaMassFlowFromDaMassFlow_shouldReturnMoistAirMassFlow_whenDryAirMassFlo void calcDaMassFlowFromMaMassFlow_shouldReturnDryAirMassFlow_whenMoistAirMassAndHumidityRatioIsGiven() { // Arrange // ACT - var actualDaAirMassFlow = FlowEquations.massFlowHaToMassFlowDa(SAMPLE_AIR.humidityRatio().getInKilogramPerKilogram(), + var actualDaAirMassFlow = FlowEquations.massFlowHaToMassFlowDa(SAMPLE_AIR.getHumidityRatio().getInKilogramPerKilogram(), SAMPLE_MASS_FLOW); // Assert @@ -83,8 +83,8 @@ void calcDaMassFlowFromMaVolFlow_shouldReturnDryAirMassFlow_whenMoistAirVolFlowH var volFlowMa = 0.8403259531006995; // Act - var actualDaAirMassFlow = FlowEquations.volFlowHaToMassFlowDa(SAMPLE_AIR.density().getInKilogramsPerCubicMeters(), - SAMPLE_AIR.humidityRatio().getInKilogramPerKilogram(), volFlowMa); + var actualDaAirMassFlow = FlowEquations.volFlowHaToMassFlowDa(SAMPLE_AIR.getDensity().getInKilogramsPerCubicMeters(), + SAMPLE_AIR.getHumidityRatio().getInKilogramPerKilogram(), volFlowMa); // Assert assertThat(actualDaAirMassFlow).isEqualTo(SAMPLE_AIR_DA_MASS_FLOW, withPrecision(MATH_ACCURACY)); @@ -94,11 +94,11 @@ void calcDaMassFlowFromMaVolFlow_shouldReturnDryAirMassFlow_whenMoistAirVolFlowH @DisplayName("should calculate dry air mass flow when dry air volumetric flow and dry air density is given") void calcDaMassFlowFromDaVolFlow_shouldReturnDryAirMassFlow_whenDryAirVolFlowAndDryAirDensityIsGiven() { // Arrange - var volFlowDa = FlowEquations.massFlowToVolFlow(SAMPLE_AIR.dryAirComponent().density().getInKilogramsPerCubicMeters(), + var volFlowDa = FlowEquations.massFlowToVolFlow(SAMPLE_AIR.getDryAirComponent().getDensity().getInKilogramsPerCubicMeters(), SAMPLE_AIR_DA_MASS_FLOW); // Act - var actualDaAirMassFlow = FlowEquations.volFlowToMassFlow(SAMPLE_AIR.dryAirComponent().density().getInKilogramsPerCubicMeters(), + var actualDaAirMassFlow = FlowEquations.volFlowToMassFlow(SAMPLE_AIR.getDryAirComponent().getDensity().getInKilogramsPerCubicMeters(), volFlowDa); // Assert @@ -111,12 +111,12 @@ void calcDaMassFlowFromDaVolFlow_shouldReturnDryAirMassFlow_whenDryAirVolFlowAnd @DisplayName("should calculate dry air volumetric flow when dry air mass flow and dry air density is given") void calcDaVolFlowFromDaMassFlow_shouldReturnDryAirVolumetricFlow_whenDryAirMassFlowAndDryAirDensityIsGiven() { // Arrange - var dryAirMassFlow = FlowEquations.massFlowHaToMassFlowDa(SAMPLE_AIR.humidityRatio().getInKilogramPerKilogram(), + var dryAirMassFlow = FlowEquations.massFlowHaToMassFlowDa(SAMPLE_AIR.getHumidityRatio().getInKilogramPerKilogram(), SAMPLE_MASS_FLOW); var expectedDryAirVolFlow = 0.8245101441496746; // ACT - var actualDaAirMassFlow = FlowEquations.massFlowToVolFlow(SAMPLE_AIR.dryAirComponent().density().getInKilogramsPerCubicMeters(), + var actualDaAirMassFlow = FlowEquations.massFlowToVolFlow(SAMPLE_AIR.getDryAirComponent().getDensity().getInKilogramsPerCubicMeters(), dryAirMassFlow); // Assert @@ -127,13 +127,13 @@ void calcDaVolFlowFromDaMassFlow_shouldReturnDryAirVolumetricFlow_whenDryAirMass @DisplayName("should calculate moist air mass flow when dry air mass flow and moist air density is given") void calcMaVolFlowFromDaMassFlow_shouldReturnMoistAirVolumetricFlow_whenDryAirMassFlowAndHumidityRatioAndAndMoistAirDensityIsGiven() { // Arrange - var dryAirMassFlow = FlowEquations.massFlowHaToMassFlowDa(SAMPLE_AIR.humidityRatio().getInKilogramPerKilogram(), + var dryAirMassFlow = FlowEquations.massFlowHaToMassFlowDa(SAMPLE_AIR.getHumidityRatio().getInKilogramPerKilogram(), SAMPLE_MASS_FLOW); var expectedMaVolFLow = 0.8403259531006995; // ACT - var actualMaAirMassFlow = FlowEquations.massFlowDaToVolFlowHa(SAMPLE_AIR.density().getInKilogramsPerCubicMeters(), - SAMPLE_AIR.humidityRatio().getInKilogramPerKilogram(), dryAirMassFlow); + var actualMaAirMassFlow = FlowEquations.massFlowDaToVolFlowHa(SAMPLE_AIR.getDensity().getInKilogramsPerCubicMeters(), + SAMPLE_AIR.getHumidityRatio().getInKilogramPerKilogram(), dryAirMassFlow); // Assert assertThat(actualMaAirMassFlow).isEqualTo(expectedMaVolFLow, withPrecision(MATH_ACCURACY)); diff --git a/src/test/java/com/synerset/hvacengine/fluids/dryair/DryAirTest.java b/src/test/java/com/synerset/hvacengine/fluids/dryair/DryAirTest.java index c251aa3..c991336 100644 --- a/src/test/java/com/synerset/hvacengine/fluids/dryair/DryAirTest.java +++ b/src/test/java/com/synerset/hvacengine/fluids/dryair/DryAirTest.java @@ -27,13 +27,13 @@ void shouldCreateDryAirInstance() { Temperature.ofCelsius(inputAirTemp) ); - double actualPressure = dryAir.pressure().getValue(); - double actualTemperature = dryAir.temperature().getValue(); - double actualSpecHeat = dryAir.specificHeat().getValue(); - double actualSpecEnthalpy = dryAir.specificEnthalpy().getValue(); - double actualDynVis = dryAir.dynamicViscosity().getValue(); - double actualKinViscosity = dryAir.kinematicViscosity().getValue(); - double actualThermalConductivity = dryAir.thermalConductivity().getValue(); + double actualPressure = dryAir.getPressure().getValue(); + double actualTemperature = dryAir.getTemperature().getValue(); + double actualSpecHeat = dryAir.getSpecificHeat().getValue(); + double actualSpecEnthalpy = dryAir.getSpecificEnthalpy().getValue(); + double actualDynVis = dryAir.getDynamicViscosity().getValue(); + double actualKinViscosity = dryAir.getKinematicViscosity().getValue(); + double actualThermalConductivity = dryAir.getThermalConductivity().getValue(); // Then assertThat(actualPressure).isEqualTo(inputPressure); diff --git a/src/test/java/com/synerset/hvacengine/fluids/dryair/FlowOfDryAirTest.java b/src/test/java/com/synerset/hvacengine/fluids/dryair/FlowOfDryAirTest.java index afce998..70386d4 100644 --- a/src/test/java/com/synerset/hvacengine/fluids/dryair/FlowOfDryAirTest.java +++ b/src/test/java/com/synerset/hvacengine/fluids/dryair/FlowOfDryAirTest.java @@ -16,24 +16,24 @@ class FlowOfDryAirTest { @DisplayName("FlowOfDryAir: should create instance with properly calculated flows when valid input is given") void flowOfFluidInstance_shouldCreateValidFlowOfFluidInstance_whenValidSampleInputIsGiven() { // Given - double waterDensity = SAMPLE_AIR.density().getInKilogramsPerCubicMeters(); + double waterDensity = SAMPLE_AIR.getDensity().getInKilogramsPerCubicMeters(); double expectedVolFlow = SAMPLE_MASS_FLOW_RATE / waterDensity; // When FlowOfDryAir flowOfDryAir = FlowOfDryAir.of(SAMPLE_AIR, MassFlow.ofKilogramsPerSecond(SAMPLE_MASS_FLOW_RATE)); DryAir dryAir = flowOfDryAir.fluid(); - double actualMassFlow = flowOfDryAir.massFlow().getInKilogramsPerSecond(); - double actualVolFlow = flowOfDryAir.volumetricFlow().getInCubicMetersPerSecond(); + double actualMassFlow = flowOfDryAir.getMassFlow().getInKilogramsPerSecond(); + double actualVolFlow = flowOfDryAir.getVolumetricFlow().getInCubicMetersPerSecond(); // Then assertThat(actualMassFlow).isEqualTo(SAMPLE_MASS_FLOW_RATE); assertThat(actualVolFlow).isEqualTo(expectedVolFlow); - assertThat(flowOfDryAir.temperature()).isEqualTo(dryAir.temperature()); - assertThat(flowOfDryAir.pressure()).isEqualTo(dryAir.pressure()); - assertThat(flowOfDryAir.density()).isEqualTo(dryAir.density()); - assertThat(flowOfDryAir.specificHeat()).isEqualTo(dryAir.specificHeat()); - assertThat(flowOfDryAir.specificEnthalpy()).isEqualTo(dryAir.specificEnthalpy()); + assertThat(flowOfDryAir.getTemperature()).isEqualTo(dryAir.getTemperature()); + assertThat(flowOfDryAir.getPressure()).isEqualTo(dryAir.getPressure()); + assertThat(flowOfDryAir.getDensity()).isEqualTo(dryAir.getDensity()); + assertThat(flowOfDryAir.getSpecificHeat()).isEqualTo(dryAir.getSpecificHeat()); + assertThat(flowOfDryAir.getSpecificEnthalpy()).isEqualTo(dryAir.getSpecificEnthalpy()); } } \ No newline at end of file diff --git a/src/test/java/com/synerset/hvacengine/fluids/humidair/FlowOfHumidAirTest.java b/src/test/java/com/synerset/hvacengine/fluids/humidair/FlowOfHumidAirTest.java index 51c39de..289540f 100644 --- a/src/test/java/com/synerset/hvacengine/fluids/humidair/FlowOfHumidAirTest.java +++ b/src/test/java/com/synerset/hvacengine/fluids/humidair/FlowOfHumidAirTest.java @@ -19,9 +19,9 @@ void flowOfMoistAirInstance_shouldCreateValidFlowOfMoistAirInstance_whenValidSam // Arrange HumidAir sampleAir = HumidAir.of(Temperature.ofCelsius(45.0), RelativeHumidity.ofPercentage(60.1)); - double densityMa = sampleAir.density().getInKilogramsPerCubicMeters(); - double densityDa = sampleAir.dryAirComponent().density().getInKilogramsPerCubicMeters(); - double humidRatio = sampleAir.humidityRatio().getInKilogramPerKilogram(); + double densityMa = sampleAir.getDensity().getInKilogramsPerCubicMeters(); + double densityDa = sampleAir.getDryAirComponent().getDensity().getInKilogramsPerCubicMeters(); + double humidRatio = sampleAir.getHumidityRatio().getInKilogramPerKilogram(); double expectedVolFlow_Ma = INIT_MASS_FLOW_MA / densityMa; double expectedMassFlow_Da = FlowEquations.massFlowHaToMassFlowDa(humidRatio, INIT_MASS_FLOW_MA); double expectedVolFlow_Da = expectedMassFlow_Da / densityDa; @@ -30,8 +30,8 @@ void flowOfMoistAirInstance_shouldCreateValidFlowOfMoistAirInstance_whenValidSam FlowOfHumidAir flowAir = FlowOfHumidAir.of(sampleAir, MassFlow.ofKilogramsPerSecond(INIT_MASS_FLOW_MA)); HumidAir humidAir = flowAir.fluid(); - double actualMassFlowMa = flowAir.massFlow().getInKilogramsPerSecond(); - double actualVolFlowMa = flowAir.volumetricFlow().getInCubicMetersPerSecond(); + double actualMassFlowMa = flowAir.getMassFlow().getInKilogramsPerSecond(); + double actualVolFlowMa = flowAir.getVolumetricFlow().getInCubicMetersPerSecond(); double actualMassFlowDa = flowAir.dryAirMassFlow().getInKilogramsPerSecond(); double actualVolFlowDa = flowAir.dryAirVolumetricFlow().getInCubicMetersPerSecond(); @@ -42,13 +42,13 @@ void flowOfMoistAirInstance_shouldCreateValidFlowOfMoistAirInstance_whenValidSam assertThat(actualVolFlowDa).isEqualTo(expectedVolFlow_Da); assertThat(flowAir.fluid()).isEqualTo(sampleAir); - assertThat(flowAir.temperature()).isEqualTo(humidAir.temperature()); - assertThat(flowAir.relativeHumidity()).isEqualTo(humidAir.relativeHumidity()); - assertThat(flowAir.humidityRatio()).isEqualTo(humidAir.humidityRatio()); - assertThat(flowAir.pressure()).isEqualTo(humidAir.pressure()); - assertThat(flowAir.density()).isEqualTo(humidAir.density()); - assertThat(flowAir.specificHeat()).isEqualTo(humidAir.specificHeat()); - assertThat(flowAir.specificEnthalpy()).isEqualTo(humidAir.specificEnthalpy()); - assertThat(flowAir.saturationPressure()).isEqualTo(humidAir.saturationPressure()); + assertThat(flowAir.getTemperature()).isEqualTo(humidAir.getTemperature()); + assertThat(flowAir.relativeHumidity()).isEqualTo(humidAir.getRelativeHumidity()); + assertThat(flowAir.humidityRatio()).isEqualTo(humidAir.getHumidityRatio()); + assertThat(flowAir.getPressure()).isEqualTo(humidAir.getPressure()); + assertThat(flowAir.getDensity()).isEqualTo(humidAir.getDensity()); + assertThat(flowAir.getSpecificHeat()).isEqualTo(humidAir.getSpecificHeat()); + assertThat(flowAir.getSpecificEnthalpy()).isEqualTo(humidAir.getSpecificEnthalpy()); + assertThat(flowAir.saturationPressure()).isEqualTo(humidAir.getSaturationPressure()); } } diff --git a/src/test/java/com/synerset/hvacengine/fluids/humidair/HumidAirEquationsTest.java b/src/test/java/com/synerset/hvacengine/fluids/humidair/HumidAirEquationsTest.java index d048dac..78971f3 100644 --- a/src/test/java/com/synerset/hvacengine/fluids/humidair/HumidAirEquationsTest.java +++ b/src/test/java/com/synerset/hvacengine/fluids/humidair/HumidAirEquationsTest.java @@ -530,7 +530,7 @@ void shouldAllDryAirMethodsWithPrimitiveArguments_returnTheSameOutput() { expectedRelHumFromDbT, absPressureVal); double expectedDryBulbTempFromIX = HumidAirEquations.dryBulbTemperatureIX(expectedSpecEnthalpy, - expectedRelHumFromDbT, + expectedHumRatio, absPressureVal); double expectedDryBulbTempFromWbtRH = HumidAirEquations.dryBulbTemperatureWbtRH(expectedWetBulbTemp, expectedRelHumFromDbT, @@ -570,7 +570,7 @@ void shouldAllDryAirMethodsWithPrimitiveArguments_returnTheSameOutput() { RelativeHumidity.ofPercentage(actualRelHumFromDbT), absPressure).getInCelsius(); double actualDryBulbTempFromIX = HumidAirEquations.dryBulbTemperatureIX(SpecificEnthalpy.ofKiloJoulePerKiloGram(actualSpecEnthalpy), - RelativeHumidity.ofPercentage(actualRelHumFromDbT), + HumidityRatio.ofKilogramPerKilogram(actualHumRatio), absPressure).getInCelsius(); double actualDryBulbTempFromWbtRH = HumidAirEquations.dryBulbTemperatureWbtRH(Temperature.ofCelsius(actualWetBulbTemp), RelativeHumidity.ofPercentage(actualRelHumFromDbT), diff --git a/src/test/java/com/synerset/hvacengine/fluids/humidair/HumidAirTest.java b/src/test/java/com/synerset/hvacengine/fluids/humidair/HumidAirTest.java index bd3cd2a..12bd06d 100644 --- a/src/test/java/com/synerset/hvacengine/fluids/humidair/HumidAirTest.java +++ b/src/test/java/com/synerset/hvacengine/fluids/humidair/HumidAirTest.java @@ -42,23 +42,23 @@ void shouldCreateHumidAirInstance() { HumidityRatio.ofKilogramPerKilogram(inputHumidRatio) ); - double actualPressure = humidAir.pressure().getValue(); - double actualDryBulbTemp = humidAir.temperature().getValue(); - double actualHumRatio = humidAir.humidityRatio().getValue(); - double actualRhoVal = humidAir.density().getValue(); - double actualRHVal = humidAir.relativeHumidity().getValue(); - double actualSatPressureVal = humidAir.saturationPressure().getValue(); - double actualMaxHumRatioVal = humidAir.maxHumidityRatio().getValue(); - double actualWBTVal = humidAir.wetBulbTemperature().getValue(); - double actualDPTVal = humidAir.dewPointTemperature().getValue(); - double actualCpVal = humidAir.specificHeat().getValue(); - double actualSpecEnthalpyVal = humidAir.specificEnthalpy().getValue(); - double actualDynVisVal = humidAir.dynamicViscosity().getValue(); - double actualKinVisVal = humidAir.kinematicViscosity().getValue(); - double actualKVal = humidAir.thermalConductivity().getValue(); - double actualThDiffVal = humidAir.thermalDiffusivity().getValue(); - double actualPrandtlVal = humidAir.prandtlNumber().getValue(); - VapourState actualVapourState = humidAir.vapourState(); + double actualPressure = humidAir.getPressure().getValue(); + double actualDryBulbTemp = humidAir.getTemperature().getValue(); + double actualHumRatio = humidAir.getHumidityRatio().getValue(); + double actualRhoVal = humidAir.getDensity().getValue(); + double actualRHVal = humidAir.getRelativeHumidity().getValue(); + double actualSatPressureVal = humidAir.getSaturationPressure().getValue(); + double actualMaxHumRatioVal = humidAir.getMaxHumidityRatio().getValue(); + double actualWBTVal = humidAir.getWetBulbTemperature().getValue(); + double actualDPTVal = humidAir.getDewPointTemperature().getValue(); + double actualCpVal = humidAir.getSpecificHeat().getValue(); + double actualSpecEnthalpyVal = humidAir.getSpecificEnthalpy().getValue(); + double actualDynVisVal = humidAir.getDynamicViscosity().getValue(); + double actualKinVisVal = humidAir.getKinematicViscosity().getValue(); + double actualKVal = humidAir.getThermalConductivity().getValue(); + double actualThDiffVal = humidAir.getThermalDiffusivity().getValue(); + double actualPrandtlVal = humidAir.getPrandtlNumber().getValue(); + VapourState actualVapourState = humidAir.getVapourState(); // Then assertThat(actualPressure).isEqualTo(inputPressure); diff --git a/src/test/java/com/synerset/hvacengine/fluids/liquidwater/FlowOfLiquidWaterTest.java b/src/test/java/com/synerset/hvacengine/fluids/liquidwater/FlowOfLiquidWaterTest.java index 8b57743..41de01d 100644 --- a/src/test/java/com/synerset/hvacengine/fluids/liquidwater/FlowOfLiquidWaterTest.java +++ b/src/test/java/com/synerset/hvacengine/fluids/liquidwater/FlowOfLiquidWaterTest.java @@ -16,24 +16,24 @@ class FlowOfLiquidWaterTest { @DisplayName("FlowOfWater: should create instance with properly calculated flows when valid input is given") void flowOfFluidInstance_shouldCreateValidFlowOfFluidInstance_whenValidSampleInputIsGiven() { // Given - double waterDensity = SAMPLE_WATER.density().getInKilogramsPerCubicMeters(); + double waterDensity = SAMPLE_WATER.getDensity().getInKilogramsPerCubicMeters(); double expectedVolFlow = SAMPLE_MASS_FLOW_RATE / waterDensity; // When FlowOfLiquidWater flowOfLiquidWater = FlowOfLiquidWater.of(SAMPLE_WATER, MassFlow.ofKilogramsPerSecond(SAMPLE_MASS_FLOW_RATE)); LiquidWater water = flowOfLiquidWater.fluid(); - double actualMassFlow = flowOfLiquidWater.massFlow().getInKilogramsPerSecond(); - double actualVolFlow = flowOfLiquidWater.volumetricFlow().getInCubicMetersPerSecond(); + double actualMassFlow = flowOfLiquidWater.getMassFlow().getInKilogramsPerSecond(); + double actualVolFlow = flowOfLiquidWater.getVolumetricFlow().getInCubicMetersPerSecond(); // Then assertThat(actualMassFlow).isEqualTo(SAMPLE_MASS_FLOW_RATE); assertThat(actualVolFlow).isEqualTo(expectedVolFlow); - assertThat(flowOfLiquidWater.temperature()).isEqualTo(water.temperature()); - assertThat(flowOfLiquidWater.pressure()).isEqualTo(water.pressure()); - assertThat(flowOfLiquidWater.density()).isEqualTo(water.density()); - assertThat(flowOfLiquidWater.specificHeat()).isEqualTo(water.specificHeat()); - assertThat(flowOfLiquidWater.specificEnthalpy()).isEqualTo(water.specificEnthalpy()); + assertThat(flowOfLiquidWater.getTemperature()).isEqualTo(water.getTemperature()); + assertThat(flowOfLiquidWater.getPressure()).isEqualTo(water.getPressure()); + assertThat(flowOfLiquidWater.getDensity()).isEqualTo(water.getDensity()); + assertThat(flowOfLiquidWater.getSpecificHeat()).isEqualTo(water.getSpecificHeat()); + assertThat(flowOfLiquidWater.getSpecificEnthalpy()).isEqualTo(water.getSpecificEnthalpy()); } } \ No newline at end of file diff --git a/src/test/java/com/synerset/hvacengine/fluids/liquidwater/LiquidWaterTest.java b/src/test/java/com/synerset/hvacengine/fluids/liquidwater/LiquidWaterTest.java index 0524e8f..1d26488 100644 --- a/src/test/java/com/synerset/hvacengine/fluids/liquidwater/LiquidWaterTest.java +++ b/src/test/java/com/synerset/hvacengine/fluids/liquidwater/LiquidWaterTest.java @@ -25,11 +25,11 @@ void shouldCreateDryAirInstance() { Temperature.ofCelsius(inputAirTemp) ); - double actualPressure = liquidWater.pressure().getValue(); - double actualTemperature = liquidWater.temperature().getValue(); - double actualSpecHeat = liquidWater.specificHeat().getValue(); - double actualSpecEnthalpy = liquidWater.specificEnthalpy().getValue(); - double actualDensity = liquidWater.density().getValue(); + double actualPressure = liquidWater.getPressure().getValue(); + double actualTemperature = liquidWater.getTemperature().getValue(); + double actualSpecHeat = liquidWater.getSpecificHeat().getValue(); + double actualSpecEnthalpy = liquidWater.getSpecificEnthalpy().getValue(); + double actualDensity = liquidWater.getDensity().getValue(); // Then assertThat(actualPressure).isEqualTo(inputPressure); diff --git a/src/test/java/com/synerset/hvacengine/fluids/vaterwapour/FlowOfLiquidWaterVapourTest.java b/src/test/java/com/synerset/hvacengine/fluids/vaterwapour/FlowOfLiquidWaterVapourTest.java index ef2cc5b..d4206f3 100644 --- a/src/test/java/com/synerset/hvacengine/fluids/vaterwapour/FlowOfLiquidWaterVapourTest.java +++ b/src/test/java/com/synerset/hvacengine/fluids/vaterwapour/FlowOfLiquidWaterVapourTest.java @@ -18,24 +18,24 @@ class FlowOfLiquidWaterVapourTest { @DisplayName("FlowOfWaterVapour: should create instance with properly calculated flows when valid input is given") void flowOfFluidInstance_shouldCreateValidFlowOfFluidInstance_whenValidSampleInputIsGiven() { // Given - double waterDensity = SAMPLE_WATER_VAPOUR.density().getInKilogramsPerCubicMeters(); + double waterDensity = SAMPLE_WATER_VAPOUR.getDensity().getInKilogramsPerCubicMeters(); double expectedVolFlow = SAMPLE_MASS_FLOW_RATE / waterDensity; // When FlowOfWaterVapour flowOfWaterVapour = FlowOfWaterVapour.of(SAMPLE_WATER_VAPOUR, MassFlow.ofKilogramsPerSecond(SAMPLE_MASS_FLOW_RATE)); WaterVapour waterVapour = flowOfWaterVapour.fluid(); - double actualMassFlow = flowOfWaterVapour.massFlow().getInKilogramsPerSecond(); - double actualVolFlow = flowOfWaterVapour.volumetricFlow().getInCubicMetersPerSecond(); + double actualMassFlow = flowOfWaterVapour.getMassFlow().getInKilogramsPerSecond(); + double actualVolFlow = flowOfWaterVapour.getVolumetricFlow().getInCubicMetersPerSecond(); // Then assertThat(actualMassFlow).isEqualTo(SAMPLE_MASS_FLOW_RATE); assertThat(actualVolFlow).isEqualTo(expectedVolFlow); - assertThat(flowOfWaterVapour.temperature()).isEqualTo(waterVapour.temperature()); - assertThat(flowOfWaterVapour.pressure()).isEqualTo(waterVapour.pressure()); - assertThat(flowOfWaterVapour.density()).isEqualTo(waterVapour.density()); - assertThat(flowOfWaterVapour.specificHeat()).isEqualTo(waterVapour.specificHeat()); - assertThat(flowOfWaterVapour.specificEnthalpy()).isEqualTo(waterVapour.specificEnthalpy()); + assertThat(flowOfWaterVapour.getTemperature()).isEqualTo(waterVapour.getTemperature()); + assertThat(flowOfWaterVapour.getPressure()).isEqualTo(waterVapour.getPressure()); + assertThat(flowOfWaterVapour.getDensity()).isEqualTo(waterVapour.getDensity()); + assertThat(flowOfWaterVapour.getSpecificHeat()).isEqualTo(waterVapour.getSpecificHeat()); + assertThat(flowOfWaterVapour.getSpecificEnthalpy()).isEqualTo(waterVapour.getSpecificEnthalpy()); } } \ No newline at end of file diff --git a/src/test/java/com/synerset/hvacengine/fluids/vaterwapour/WaterVapourTest.java b/src/test/java/com/synerset/hvacengine/fluids/vaterwapour/WaterVapourTest.java index 5c60cb1..de5bc94 100644 --- a/src/test/java/com/synerset/hvacengine/fluids/vaterwapour/WaterVapourTest.java +++ b/src/test/java/com/synerset/hvacengine/fluids/vaterwapour/WaterVapourTest.java @@ -33,13 +33,13 @@ void shouldCreateWaterVapourInstance() { RelativeHumidity.ofPercentage(inputAirRH) ); - double actualPressure = waterVapour.pressure().getValue(); - double actualTemperature = waterVapour.temperature().getValue(); - double actualSpecHeat = waterVapour.specificHeat().getValue(); - double actualSpecEnthalpy = waterVapour.specificEnthalpy().getValue(); - double actualDynVis = waterVapour.dynamicViscosity().getValue(); - double actualKinViscosity = waterVapour.kinematicViscosity().getValue(); - double actualThermalConductivity = waterVapour.thermalConductivity().getValue(); + double actualPressure = waterVapour.getPressure().getValue(); + double actualTemperature = waterVapour.getTemperature().getValue(); + double actualSpecHeat = waterVapour.getSpecificHeat().getValue(); + double actualSpecEnthalpy = waterVapour.getSpecificEnthalpy().getValue(); + double actualDynVis = waterVapour.getDynamicViscosity().getValue(); + double actualKinViscosity = waterVapour.getKinematicViscosity().getValue(); + double actualThermalConductivity = waterVapour.getThermalConductivity().getValue(); // Then assertThat(actualPressure).isEqualTo(inputPressure); diff --git a/src/test/java/com/synerset/hvacengine/process/cooling/AirCoolingStrategiesTest.java b/src/test/java/com/synerset/hvacengine/process/cooling/AirCoolingStrategiesTest.java index 33dd7da..5464c8c 100644 --- a/src/test/java/com/synerset/hvacengine/process/cooling/AirCoolingStrategiesTest.java +++ b/src/test/java/com/synerset/hvacengine/process/cooling/AirCoolingStrategiesTest.java @@ -47,7 +47,7 @@ void processOfDryCooling_shouldCoolDownAirWithoutCondensateDischarge_whenTargetO // When DryAirCoolingResult airCoolingResult = DryCoolingStrategy.of(inletFlow, expectedOutAirTemp).applyDryCooling(); Power actualHeatOfProcess = airCoolingResult.heatOfProcess(); - Temperature actualOutAirTemp = airCoolingResult.outletFlow().temperature(); + Temperature actualOutAirTemp = airCoolingResult.outletFlow().getTemperature(); HumidityRatio actualHumRatio = airCoolingResult.outletFlow().humidityRatio(); // Then @@ -69,7 +69,7 @@ void processOfDryCooling_shouldCoolDownAirWithoutCondensateDischarge_whenTargetO // When DryAirCoolingResult airCoolingResult = DryCoolingStrategy.of(inletFlow, expectedHeatOfProcess).applyDryCooling(); Power actualHeatOfProcess = airCoolingResult.heatOfProcess(); - Temperature actualOutAirTemp = airCoolingResult.outletFlow().temperature(); + Temperature actualOutAirTemp = airCoolingResult.outletFlow().getTemperature(); HumidityRatio actualHumRatio = airCoolingResult.outletFlow().humidityRatio(); // Then @@ -92,10 +92,10 @@ void processOfRealCooling_shouldCoolDownInletAir_whenTargetOutletAirTempAndAvera // When AirCoolingResult airCoolingResult = CoolingStrategy.of(inletFlow, COOLANT_DATA, expectedOutAirTemp).applyCooling(); Power actualHeatOfProcess = airCoolingResult.heatOfProcess(); - Temperature actualOutAirTemp = airCoolingResult.outletFlow().temperature(); + Temperature actualOutAirTemp = airCoolingResult.outletFlow().getTemperature(); HumidityRatio actualHumRatio = airCoolingResult.outletFlow().humidityRatio(); - Temperature actualCondensateTemp = airCoolingResult.condensateFlow().temperature(); - MassFlow actualCondensateFlow = airCoolingResult.condensateFlow().massFlow(); + Temperature actualCondensateTemp = airCoolingResult.condensateFlow().getTemperature(); + MassFlow actualCondensateFlow = airCoolingResult.condensateFlow().getMassFlow(); // Then assertThat(actualHeatOfProcess).isEqualTo(expectedHeatOfProcess); @@ -119,11 +119,11 @@ void processOfRealCooling_shouldCoolDownInletAir_whenTargetOutletRHAndAverageCoi // When AirCoolingResult airCoolingResult = CoolingStrategy.of(inletFlow, COOLANT_DATA, expectedRelativeHumidity).applyCooling(); Power actualHeatOfProcess = airCoolingResult.heatOfProcess(); - Temperature actualOutAirTemp = airCoolingResult.outletFlow().temperature(); + Temperature actualOutAirTemp = airCoolingResult.outletFlow().getTemperature(); RelativeHumidity actualRelativeHumidity = airCoolingResult.outletFlow().relativeHumidity(); HumidityRatio actualHumRatio = airCoolingResult.outletFlow().humidityRatio(); - Temperature actualCondensateTemp = airCoolingResult.condensateFlow().temperature(); - MassFlow actualCondensateFlow = airCoolingResult.condensateFlow().massFlow(); + Temperature actualCondensateTemp = airCoolingResult.condensateFlow().getTemperature(); + MassFlow actualCondensateFlow = airCoolingResult.condensateFlow().getMassFlow(); // Then assertThat(actualHeatOfProcess.getInWatts()).isEqualTo(expectedHeatOfProcess.getInWatts(), withPrecision(1E-10)); @@ -147,10 +147,10 @@ void processOfRealCooling_shouldCoolDownInletAir_whenHeatOfProcessIsGiven() { // When AirCoolingResult airCoolingResult = CoolingStrategy.of(inletFlow, COOLANT_DATA, expectedHeatOfProcess).applyCooling(); Power actualHeatOfProcess = airCoolingResult.heatOfProcess(); - Temperature actualOutAirTemp = airCoolingResult.outletFlow().temperature(); + Temperature actualOutAirTemp = airCoolingResult.outletFlow().getTemperature(); HumidityRatio actualHumRatio = airCoolingResult.outletFlow().humidityRatio(); - Temperature actualCondensateTemp = airCoolingResult.condensateFlow().temperature(); - MassFlow actualCondensateFlow = airCoolingResult.condensateFlow().massFlow(); + Temperature actualCondensateTemp = airCoolingResult.condensateFlow().getTemperature(); + MassFlow actualCondensateFlow = airCoolingResult.condensateFlow().getMassFlow(); // Then assertThat(actualHeatOfProcess).isEqualTo(expectedHeatOfProcess); diff --git a/src/test/java/com/synerset/hvacengine/process/cooling/CoolingTest.java b/src/test/java/com/synerset/hvacengine/process/cooling/CoolingTest.java index 14591c1..406c987 100644 --- a/src/test/java/com/synerset/hvacengine/process/cooling/CoolingTest.java +++ b/src/test/java/com/synerset/hvacengine/process/cooling/CoolingTest.java @@ -50,18 +50,18 @@ void shouldCoolInletAirWhenTargetTemperatureIsGiven() { assertThat(cooling.getInputInletAir()).isEqualTo(inletAir); assertThat(cooling.getHeatOfProcess().getInWatts()).isEqualTo(expectedPower.getInWatts(), withPrecision(1E-9)); assertThat(cooling.getCoolingStrategy()).isEqualTo(coolingStrategy); - assertThat(cooling.getOutPressure()).isEqualTo(humidAir.pressure()); + assertThat(cooling.getOutPressure()).isEqualTo(humidAir.getPressure()); assertThat(cooling.getOutTemperature().getInCelsius()).isEqualTo(targetTemperature.getInCelsius(), withPrecision(3.5E-2)); assertThat(cooling.getOutRelativeHumidity().getInPercent()).isEqualTo(expectedRH.getInPercent(), withPrecision(1.5E-2)); SpecificEnthalpy expectedEnthalpy = HumidAirEquations.specificEnthalpy(cooling.getOutTemperature(), cooling.getOutHumidityRatio(), cooling.getOutPressure()); assertThat(cooling.getOutSpecificEnthalpy()).isEqualTo(expectedEnthalpy); // Cooling specific assertions - BypassFactor expectedBypassFactor = CoolingHelpers.coilBypassFactor(coolantData.getAverageTemperature(), humidAir.temperature(), cooling.getOutTemperature()); + BypassFactor expectedBypassFactor = CoolingHelpers.coilBypassFactor(coolantData.getAverageTemperature(), humidAir.getTemperature(), cooling.getOutTemperature()); assertThat(cooling.getBypassFactor()).isEqualTo(expectedBypassFactor); assertThat(cooling.getCoolantData()).isEqualTo(coolantData); // Condensate specific assertions assertThat(cooling.getCondensateTemperature()).isEqualTo(coolantData.getAverageTemperature()); - assertThat(cooling.getCondensateFlow().massFlow()).isEqualTo(expectedCondensateFlow); + assertThat(cooling.getCondensateFlow().getMassFlow()).isEqualTo(expectedCondensateFlow); assertThat(cooling.getCondensateEnthalpy()).isEqualTo(LiquidWaterEquations.specificEnthalpy(coolantData.getAverageTemperature())); } @@ -93,18 +93,18 @@ void shouldHCoolInletAirWhenInputPowerIsGiven() { assertThat(cooling.getInputInletAir()).isEqualTo(inletAir); assertThat(cooling.getHeatOfProcess()).isEqualTo(inputPower); assertThat(cooling.getCoolingStrategy()).isEqualTo(coolingStrategy); - assertThat(cooling.getOutPressure()).isEqualTo(humidAir.pressure()); + assertThat(cooling.getOutPressure()).isEqualTo(humidAir.getPressure()); assertThat(cooling.getOutTemperature().getValue()).isEqualTo(expectedTemperature.getValue(), withPrecision(3.5E-2)); assertThat(cooling.getOutRelativeHumidity()).isEqualTo(expectedRH); SpecificEnthalpy expectedEnthalpy = HumidAirEquations.specificEnthalpy(cooling.getOutTemperature(), cooling.getOutHumidityRatio(), cooling.getOutPressure()); assertThat(cooling.getOutSpecificEnthalpy()).isEqualTo(expectedEnthalpy); // Cooling specific assertions - BypassFactor expectedBypassFactor = CoolingHelpers.coilBypassFactor(coolantData.getAverageTemperature(), humidAir.temperature(), cooling.getOutTemperature()); + BypassFactor expectedBypassFactor = CoolingHelpers.coilBypassFactor(coolantData.getAverageTemperature(), humidAir.getTemperature(), cooling.getOutTemperature()); assertThat(cooling.getBypassFactor()).isEqualTo(expectedBypassFactor); assertThat(cooling.getCoolantData()).isEqualTo(coolantData); // Condensate specific assertions assertThat(cooling.getCondensateTemperature()).isEqualTo(coolantData.getAverageTemperature()); - assertThat(cooling.getCondensateFlow().massFlow()).isEqualTo(expectedCondensateFlow); + assertThat(cooling.getCondensateFlow().getMassFlow()).isEqualTo(expectedCondensateFlow); assertThat(cooling.getCondensateEnthalpy()).isEqualTo(LiquidWaterEquations.specificEnthalpy(coolantData.getAverageTemperature())); } @@ -135,18 +135,18 @@ void shouldCoolInletAirWhenTargetRelativeHumidityIsGiven() { assertThat(cooling.getInputInletAir()).isEqualTo(inletAir); assertThat(cooling.getHeatOfProcess().getInWatts()).isEqualTo(expectedPower.getInWatts(), withPrecision(1.8E-6)); assertThat(cooling.getCoolingStrategy()).isEqualTo(coolingStrategy); - assertThat(cooling.getOutPressure()).isEqualTo(humidAir.pressure()); + assertThat(cooling.getOutPressure()).isEqualTo(humidAir.getPressure()); assertThat(cooling.getOutTemperature().getInCelsius()).isEqualTo(expectedTemperature.getInCelsius(), withPrecision(3.5E-2)); assertThat(cooling.getOutRelativeHumidity().getInPercent()).isEqualTo(targetRH.getInPercent(), withPrecision(1.5E-2)); SpecificEnthalpy expectedEnthalpy = HumidAirEquations.specificEnthalpy(cooling.getOutTemperature(), cooling.getOutHumidityRatio(), cooling.getOutPressure()); assertThat(cooling.getOutSpecificEnthalpy()).isEqualTo(expectedEnthalpy); // Cooling specific assertions - BypassFactor expectedBypassFactor = CoolingHelpers.coilBypassFactor(coolantData.getAverageTemperature(), humidAir.temperature(), cooling.getOutTemperature()); + BypassFactor expectedBypassFactor = CoolingHelpers.coilBypassFactor(coolantData.getAverageTemperature(), humidAir.getTemperature(), cooling.getOutTemperature()); assertThat(cooling.getBypassFactor()).isEqualTo(expectedBypassFactor); assertThat(cooling.getCoolantData()).isEqualTo(coolantData); // Condensate specific assertions assertThat(cooling.getCondensateTemperature()).isEqualTo(coolantData.getAverageTemperature()); - assertThat(cooling.getCondensateFlow().massFlow().getInKilogramsPerSecond()).isEqualTo(expectedCondensateFlow.getInKilogramsPerSecond(), withPrecision(1E-8)); + assertThat(cooling.getCondensateFlow().getMassFlow().getInKilogramsPerSecond()).isEqualTo(expectedCondensateFlow.getInKilogramsPerSecond(), withPrecision(1E-8)); assertThat(cooling.getCondensateEnthalpy()).isEqualTo(LiquidWaterEquations.specificEnthalpy(coolantData.getAverageTemperature())); } diff --git a/src/test/java/com/synerset/hvacengine/process/drycooling/DryAirCoolingStrategiesTest.java b/src/test/java/com/synerset/hvacengine/process/drycooling/DryAirCoolingStrategiesTest.java index 86476b1..8557cc9 100644 --- a/src/test/java/com/synerset/hvacengine/process/drycooling/DryAirCoolingStrategiesTest.java +++ b/src/test/java/com/synerset/hvacengine/process/drycooling/DryAirCoolingStrategiesTest.java @@ -42,7 +42,7 @@ void processOfDryCooling_shouldCoolDownAirWithoutCondensateDischarge_whenTargetO // When DryAirCoolingResult airCoolingResult = DryCoolingStrategy.of(inletFlow, expectedOutAirTemp).applyDryCooling(); Power actualHeatOfProcess = airCoolingResult.heatOfProcess(); - Temperature actualOutAirTemp = airCoolingResult.outletFlow().temperature(); + Temperature actualOutAirTemp = airCoolingResult.outletFlow().getTemperature(); HumidityRatio actualHumRatio = airCoolingResult.outletFlow().humidityRatio(); // Then @@ -64,7 +64,7 @@ void processOfDryCooling_shouldCoolDownAirWithoutCondensateDischarge_whenTargetO // When DryAirCoolingResult airCoolingResult = DryCoolingStrategy.of(inletFlow, expectedHeatOfProcess).applyDryCooling(); Power actualHeatOfProcess = airCoolingResult.heatOfProcess(); - Temperature actualOutAirTemp = airCoolingResult.outletFlow().temperature(); + Temperature actualOutAirTemp = airCoolingResult.outletFlow().getTemperature(); HumidityRatio actualHumRatio = airCoolingResult.outletFlow().humidityRatio(); // Then diff --git a/src/test/java/com/synerset/hvacengine/process/drycooling/DryCoolingTest.java b/src/test/java/com/synerset/hvacengine/process/drycooling/DryCoolingTest.java index 916251d..f8c6fe6 100644 --- a/src/test/java/com/synerset/hvacengine/process/drycooling/DryCoolingTest.java +++ b/src/test/java/com/synerset/hvacengine/process/drycooling/DryCoolingTest.java @@ -46,7 +46,7 @@ void shouldCoolInletAirWhenTargetTemperatureIsGiven() { assertThat(cooling.getInputInletAir()).isEqualTo(inletAir); assertThat(cooling.getHeatOfProcess().getInWatts()).isEqualTo(expectedPower.getInWatts(), withPrecision(1E-1)); assertThat(cooling.getDryCoolingStrategy()).isEqualTo(dryCoolingStrategy); - assertThat(cooling.getOutPressure()).isEqualTo(humidAir.pressure()); + assertThat(cooling.getOutPressure()).isEqualTo(humidAir.getPressure()); assertThat(cooling.getOutTemperature().getInCelsius()).isEqualTo(targetTemperature.getInCelsius(), withPrecision(3.5E-2)); assertThat(cooling.getOutRelativeHumidity().getInPercent()).isEqualTo(expectedRH.getInPercent(), withPrecision(1.5E-2)); SpecificEnthalpy expectedEnthalpy = HumidAirEquations.specificEnthalpy(cooling.getOutTemperature(), cooling.getOutHumidityRatio(), cooling.getOutPressure()); @@ -80,7 +80,7 @@ void shouldHCoolInletAirWhenInputPowerIsGiven() { assertThat(cooling.getInputInletAir()).isEqualTo(inletAir); assertThat(cooling.getHeatOfProcess()).isEqualTo(inputPower); assertThat(cooling.getDryCoolingStrategy()).isEqualTo(dryCoolingStrategy); - assertThat(cooling.getOutPressure()).isEqualTo(humidAir.pressure()); + assertThat(cooling.getOutPressure()).isEqualTo(humidAir.getPressure()); assertThat(cooling.getOutTemperature().getValue()).isEqualTo(expectedTemperature.getValue(), withPrecision(3.5E-2)); assertThat(cooling.getOutRelativeHumidity().getValue()).isEqualTo(expectedRH.getValue(), withPrecision(1E-2)); SpecificEnthalpy expectedEnthalpy = HumidAirEquations.specificEnthalpy(cooling.getOutTemperature(), cooling.getOutHumidityRatio(), cooling.getOutPressure()); diff --git a/src/test/java/com/synerset/hvacengine/process/heating/AirHeatingEquationsTest.java b/src/test/java/com/synerset/hvacengine/process/heating/AirHeatingEquationsTest.java index ab8058b..ccca433 100644 --- a/src/test/java/com/synerset/hvacengine/process/heating/AirHeatingEquationsTest.java +++ b/src/test/java/com/synerset/hvacengine/process/heating/AirHeatingEquationsTest.java @@ -39,7 +39,7 @@ void processOfHeating_shouldHeatUpInletAir_whenHeatOfProcessIsGiven() { AirHeatingResult airHeatingResult = HeatingStrategy.of(inletFlow, inputHeat).applyHeating(); Power actualProcessHeat = airHeatingResult.heatOfProcess(); - Temperature actualOutAirTemp = airHeatingResult.outletFlow().temperature(); + Temperature actualOutAirTemp = airHeatingResult.outletFlow().getTemperature(); // Then assertThat(actualOutAirTemp).isEqualTo(expectedOutTemp); @@ -56,7 +56,7 @@ void processOfHeating_shouldHeatUpInletAir_whenTargetOutletTempIsGiven() { // When AirHeatingResult airHeatingResult = HeatingStrategy.of(inletFlow, targetOutTemp).applyHeating(); Power actualHeatPower = airHeatingResult.heatOfProcess(); - Temperature actualOutTemp = airHeatingResult.outletFlow().temperature(); + Temperature actualOutTemp = airHeatingResult.outletFlow().getTemperature(); // Then assertThat(actualHeatPower).isEqualTo(inputHeat); @@ -74,7 +74,7 @@ void processOfHeating_shouldHeatUpInletAir_whenTargetRelativeHumidityIsGiven() { // Act AirHeatingResult airHeatingResult = HeatingStrategy.of(inletFlow, expectedOutRH).applyHeating(); Power actualHeatOfProcess = airHeatingResult.heatOfProcess(); - Temperature actualOutAirTemp = airHeatingResult.outletFlow().temperature(); + Temperature actualOutAirTemp = airHeatingResult.outletFlow().getTemperature(); // Assert assertThat(actualHeatOfProcess.equalsWithPrecision(expectedHeatOfProcess, 1E-9)).isTrue(); diff --git a/src/test/java/com/synerset/hvacengine/process/heating/HeatingTest.java b/src/test/java/com/synerset/hvacengine/process/heating/HeatingTest.java index e41ea17..3541b93 100644 --- a/src/test/java/com/synerset/hvacengine/process/heating/HeatingTest.java +++ b/src/test/java/com/synerset/hvacengine/process/heating/HeatingTest.java @@ -48,7 +48,7 @@ void shouldHeatUpInletAirWhenInputPowerIsGiven() { assertThat(heating.getInputInletAir()).isEqualTo(inletAir); assertThat(heating.getHeatOfProcess()).isEqualTo(inputPower); assertThat(heating.getHeatingStrategy()).isEqualTo(calculationStrategy); - assertThat(heating.getOutPressure()).isEqualTo(humidAir.pressure()); + assertThat(heating.getOutPressure()).isEqualTo(humidAir.getPressure()); assertThat(heating.getOutTemperature().getInCelsius()).isEqualTo(expectedTemperature.getInCelsius(), withPrecision(3.5E-2)); assertThat(heating.getOutRelativeHumidity().getInPercent()).isEqualTo(expectedRH.getInPercent(), withPrecision(1.5E-2)); assertThat(heating.getOutHumidityRatio()).isEqualTo(inletAir.humidityRatio()); @@ -82,7 +82,7 @@ void shouldHeatUpInletAirWhenTargetTemperatureIsGiven() { assertThat(heating.getInputInletAir()).isEqualTo(inletAir); assertThat(heating.getHeatOfProcess().getInWatts()).isEqualTo(expectedPower.getInWatts(), withPrecision(1E-10)); assertThat(heating.getHeatingStrategy()).isEqualTo(calculationStrategy); - assertThat(heating.getOutPressure()).isEqualTo(humidAir.pressure()); + assertThat(heating.getOutPressure()).isEqualTo(humidAir.getPressure()); assertThat(heating.getOutTemperature().getValue()).isEqualTo(targetTemperature.getValue(), withPrecision(1E-13)); assertThat(heating.getOutRelativeHumidity().getInPercent()).isEqualTo(expectedRH.getInPercent()); assertThat(heating.getOutHumidityRatio()).isEqualTo(inletAir.humidityRatio()); @@ -116,7 +116,7 @@ void shouldHeatUpInletAirWhenTargetRelativeHumidityIsGiven() { assertThat(heating.getInputInletAir()).isEqualTo(inletAir); assertThat(heating.getHeatOfProcess().getValue()).isEqualTo(expectedPower.getValue(), withPrecision(1E-9)); assertThat(heating.getHeatingStrategy()).isEqualTo(calculationStrategy); - assertThat(heating.getOutPressure()).isEqualTo(humidAir.pressure()); + assertThat(heating.getOutPressure()).isEqualTo(humidAir.getPressure()); assertThat(heating.getOutTemperature().getInCelsius()).isEqualTo(expectedTemperature.getInCelsius(), withPrecision(1E-10)); assertThat(heating.getOutRelativeHumidity().getInPercent()).isEqualTo(targetRH.getInPercent()); assertThat(heating.getOutHumidityRatio()).isEqualTo(inletAir.humidityRatio()); diff --git a/src/test/java/com/synerset/hvacengine/process/mixing/AirMixingStrategiesTest.java b/src/test/java/com/synerset/hvacengine/process/mixing/AirMixingStrategiesTest.java index 06d2aab..f0db628 100644 --- a/src/test/java/com/synerset/hvacengine/process/mixing/AirMixingStrategiesTest.java +++ b/src/test/java/com/synerset/hvacengine/process/mixing/AirMixingStrategiesTest.java @@ -35,11 +35,11 @@ void calcMixing_shouldReturnResultsForMixingOfTwoDifferentMoistAirFlows() { RelativeHumidity.ofPercentage(55.0)); FlowOfHumidAir airFlow_rec = FlowOfHumidAir.ofDryAirMassFlow(air_rec, MassFlow.ofKilogramsPerSecond(mda_rec)); - double x_in = air_in.humidityRatio().getValue(); - double x_rec = air_rec.humidityRatio().getValue(); + double x_in = air_in.getHumidityRatio().getValue(); + double x_rec = air_rec.getHumidityRatio().getValue(); double x_out = (mda_in * x_in + mda_rec * x_rec) / mda_out; - double i_in = air_in.specificEnthalpy().getValue(); - double i_rec = air_rec.specificEnthalpy().getValue(); + double i_in = air_in.getSpecificEnthalpy().getValue(); + double i_rec = air_rec.getSpecificEnthalpy().getValue(); double i_out = (mda_in * i_in + mda_rec * i_rec) / mda_out; double expectedOutAirTempVal = HumidAirEquations.dryBulbTemperatureIX(i_out, x_out, p_atm); HumidityRatio expectedHumidityRatio = HumidityRatio.ofKilogramPerKilogram(x_out); @@ -50,7 +50,7 @@ void calcMixing_shouldReturnResultsForMixingOfTwoDifferentMoistAirFlows() { FlowOfHumidAir actualOutletFlow = mixingStrategy.applyMixing().outletFlow(); MassFlow actualOutDryAirMassFlow = actualOutletFlow.dryAirMassFlow(); - Temperature actualOutAirTemp = actualOutletFlow.temperature(); + Temperature actualOutAirTemp = actualOutletFlow.getTemperature(); HumidityRatio actualOutHumidityRatio = actualOutletFlow.humidityRatio(); // Then @@ -78,7 +78,7 @@ void mixMultipleHumidAirFlows_shouldMixMultipleFlowsTogether() { FlowOfHumidAir actualOutletFlow = mixingStrategy.applyMixing().outletFlow(); // Then - assertThat(actualOutletFlow.temperature()).isEqualTo(expectedTemp); + assertThat(actualOutletFlow.getTemperature()).isEqualTo(expectedTemp); assertThat(actualOutletFlow.relativeHumidity().getInPercent()).isEqualTo(expectedRH.getInPercent(), withPrecision(1E-11)); assertThat(actualOutletFlow.dryAirMassFlow()).isEqualTo(expectedDryAirMassFlow); diff --git a/src/test/java/com/synerset/hvacengine/process/mixing/MixingTest.java b/src/test/java/com/synerset/hvacengine/process/mixing/MixingTest.java index e185259..5721987 100644 --- a/src/test/java/com/synerset/hvacengine/process/mixing/MixingTest.java +++ b/src/test/java/com/synerset/hvacengine/process/mixing/MixingTest.java @@ -56,7 +56,7 @@ void shouldMixTwoHumidAirFlows() { assertThat(mixing.getOutletAir()).isNotNull(); assertThat(mixing.getInputInletAir()).isEqualTo(inletFlow); assertThat(mixing.getMixingStrategy()).isEqualTo(mixingStrategy); - assertThat(mixing.getOutPressure()).isEqualTo(inletAir.pressure()); + assertThat(mixing.getOutPressure()).isEqualTo(inletAir.getPressure()); assertThat(mixing.getOutTemperature().getInCelsius()).isEqualTo(expectedTemperature.getInCelsius(), withPrecision(3.5E-2)); assertThat(mixing.getOutRelativeHumidity().getInPercent()).isEqualTo(expectedRH.getInPercent(), withPrecision(1E-2)); assertThat(mixing.getOutHumidityRatio().getInKilogramPerKilogram()).isEqualTo(expectedHumRatio.getInKilogramPerKilogram(), withPrecision(5E-5)); @@ -103,7 +103,7 @@ void shouldMixMultipleHumidAirFlows() { assertThat(mixing.getOutletAir()).isNotNull(); assertThat(mixing.getInputInletAir()).isEqualTo(inletFlow); assertThat(mixing.getMixingStrategy()).isEqualTo(mixingStrategy); - assertThat(mixing.getOutPressure()).isEqualTo(inletAir.pressure()); + assertThat(mixing.getOutPressure()).isEqualTo(inletAir.getPressure()); assertThat(mixing.getOutTemperature().getInCelsius()).isEqualTo(expectedTemperature.getInCelsius(), withPrecision(3.5E-2)); assertThat(mixing.getOutRelativeHumidity().getInPercent()).isEqualTo(expectedRH.getInPercent(), withPrecision(1E-2)); assertThat(mixing.getOutHumidityRatio().getInKilogramPerKilogram()).isEqualTo(expectedHumRatio.getInKilogramPerKilogram(), withPrecision(5E-5)); diff --git a/src/test/java/com/synerset/hvacengine/solids/ice/IceTest.java b/src/test/java/com/synerset/hvacengine/solids/ice/IceTest.java index 9f3b5fe..ba54556 100644 --- a/src/test/java/com/synerset/hvacengine/solids/ice/IceTest.java +++ b/src/test/java/com/synerset/hvacengine/solids/ice/IceTest.java @@ -25,11 +25,11 @@ void shouldCreateIceInstance() { Temperature.ofCelsius(inputAirTemp) ); - double actualPressure = ice.pressure().getValue(); - double actualTemperature = ice.temperature().getValue(); - double actualSpecHeat = ice.specificHeat().getValue(); - double actualSpecEnthalpy = ice.specificEnthalpy().getValue(); - double actualDensity = ice.density().getValue(); + double actualPressure = ice.getPressure().getValue(); + double actualTemperature = ice.getTemperature().getValue(); + double actualSpecHeat = ice.getSpecificHeat().getValue(); + double actualSpecEnthalpy = ice.getSpecificEnthalpy().getValue(); + double actualDensity = ice.getDensity().getValue(); // Then assertThat(actualPressure).isEqualTo(inputPressure);