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