19 enum class Method { General, DedicatedStorage, MeteredStorage, BridgingCompressorReactionDelay };
61 ReceiverTank(Method method,
double lengthOfDemandOrDistanceToCompressorRoom,
double airFlowRequirementOrSpeedOfAir,
62 double atmosphericPressure,
double initialTankPressureOrAirDemand,
63 double finalTankPressureOrAllowablePressureDrop)
64 : method(method), atmosphericPressure(atmosphericPressure),
65 lengthOfDemandOrDistanceToCompressorRoom(lengthOfDemandOrDistanceToCompressorRoom),
66 airFlowRequirementOrSpeedOfAir(airFlowRequirementOrSpeedOfAir),
67 initialTankPressureOrAirDemand(initialTankPressureOrAirDemand),
68 finalTankPressureOrAllowablePressureDrop(finalTankPressureOrAllowablePressureDrop) {
69 if (method != ReceiverTank::Method::DedicatedStorage &&
70 method != ReceiverTank::Method::BridgingCompressorReactionDelay) {
71 throw std::runtime_error(
"Calculation method must be set to DedicatedStorage or "
72 "BridgingCompressorReactionDelay to use this constructor");
90 ReceiverTank(Method method,
double lengthOfDemand,
double airFlowRequirement,
double atmosphericPressure,
91 double initialTankPressure,
double finalTankPressure,
double meteredFlowControl)
92 : method(method), atmosphericPressure(atmosphericPressure),
93 lengthOfDemandOrDistanceToCompressorRoom(lengthOfDemand), airFlowRequirementOrSpeedOfAir(airFlowRequirement),
94 initialTankPressureOrAirDemand(initialTankPressure),
95 finalTankPressureOrAllowablePressureDrop(finalTankPressure), meteredFlowControl(meteredFlowControl) {
96 if (method != ReceiverTank::Method::MeteredStorage) {
97 throw std::runtime_error(
"Calculation method must be set to MeteredStorage to use this constructor");
117 if (method == ReceiverTank::Method::General) {
118 return airDemand * (atmosphericPressure / allowablePressureDrop) * 7.48;
120 else if (method == ReceiverTank::Method::DedicatedStorage) {
122 (lengthOfDemandOrDistanceToCompressorRoom * airFlowRequirementOrSpeedOfAir * atmosphericPressure) /
123 (initialTankPressureOrAirDemand - finalTankPressureOrAllowablePressureDrop);
125 else if (method == ReceiverTank::Method::MeteredStorage) {
126 return (7.48 * lengthOfDemandOrDistanceToCompressorRoom *
127 (airFlowRequirementOrSpeedOfAir - meteredFlowControl) * atmosphericPressure) /
128 (initialTankPressureOrAirDemand - finalTankPressureOrAllowablePressureDrop);
131 return (lengthOfDemandOrDistanceToCompressorRoom / airFlowRequirementOrSpeedOfAir) *
132 (initialTankPressureOrAirDemand / 60) *
133 (atmosphericPressure / finalTankPressureOrAllowablePressureDrop) * 7.48;
154 double lengthOfDemandOrDistanceToCompressorRoom, airFlowRequirementOrSpeedOfAir, initialTankPressureOrAirDemand;