All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.synerset.hvacengine.process.drycooling.DryCoolingStrategy Maven / Gradle / Ivy

Go to download

HVAC|Engine is a comprehensive library for calculating moist air properties, including crucial thermodynamic processes such as heating, dry cooling, real cooling with condensate discharge, mixing single or multiple air streams, and more. Immutable, thread-safe, very accurate.

The newest version!
package com.synerset.hvacengine.process.drycooling;

import com.synerset.hvacengine.common.Validators;
import com.synerset.hvacengine.common.exceptions.HvacEngineArgumentException;
import com.synerset.hvacengine.fluids.humidair.FlowOfHumidAir;
import com.synerset.unitility.unitsystem.thermodynamic.Power;
import com.synerset.unitility.unitsystem.thermodynamic.Temperature;

/**
 * The DryCoolingStrategy interface defines methods for applying dry cooling processes to a flow of humid air.
 * Implementations of this interface represent different strategies for cooling the incoming air using either
 * input power or a target temperature.
 */
public interface DryCoolingStrategy {

    /**
     * Apply the dry cooling process and calculate the resulting air properties.
     *
     * @return A DryAirCoolingResult object containing the properties of the cooled air.
     */
    DryAirCoolingResult applyDryCooling();

    /**
     * Get the inlet air flow properties.
     *
     * @return The FlowOfHumidAir representing the properties of the incoming air.
     */
    FlowOfHumidAir inletAir();

    /**
     * Create a DryCoolingStrategy instance based on the specified input parameters representing cooling power.
     *
     * @param inletAirFlow The incoming air flow properties.
     * @param inputPower   The cooling power (negative value).
     * @return A DryCoolingStrategy instance for dry cooling based on input power.
     * @throws HvacEngineArgumentException If the input parameters are invalid.
     */
    static DryCoolingStrategy of(FlowOfHumidAir inletAirFlow, Power inputPower) {
        Validators.requireNotNull(inletAirFlow);
        Validators.requireNotNull(inputPower);

        if (inputPower.isPositive()) {
            throw new HvacEngineArgumentException("Cooling power must be negative value. Q_in = " + inputPower);
        }

        return new DryCoolingFromPower(inletAirFlow, inputPower);
    }

    /**
     * Create a DryCoolingStrategy instance based on the specified input parameters representing target temperature.
     *
     * @param inletAirFlow      The incoming air flow properties.
     * @param targetTemperature The desired target temperature.
     * @return A DryCoolingStrategy instance for dry cooling based on a target temperature.
     * @throws HvacEngineArgumentException If the input parameters are invalid.
     */
    static DryCoolingStrategy of(FlowOfHumidAir inletAirFlow, Temperature targetTemperature) {
        Validators.requireNotNull(inletAirFlow);
        Validators.requireNotNull(targetTemperature);

        if (targetTemperature.isGreaterThan(inletAirFlow.getTemperature())) {
            throw new HvacEngineArgumentException("Expected outlet temperature must be lower than inlet for cooling process. "
                    + "DBT_in = " + inletAirFlow.getRelativeHumidity() + " DBT_target = " + inletAirFlow.getTemperature());
        }

        return new DryCoolingFromTemperature(inletAirFlow, targetTemperature);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy