37 double pistonRodDiameter,
double airPressure,
double cyclesPerMin)
38 : pistonType(pistonType), cylinderDiameter(cylinderDiameter), cylinderStroke(cylinderStroke),
39 pistonRodDiameter(pistonRodDiameter), airPressure(airPressure), cyclesPerMin(cyclesPerMin) {
40 if (pistonType != PistonType::DoubleActing) {
41 throw std::runtime_error(
"You must have a DoubleActing piston type to use piston rod diameter");
59 : pistonType(pistonType), cylinderDiameter(cylinderDiameter), cylinderStroke(cylinderStroke),
60 airPressure(airPressure), cyclesPerMin(cyclesPerMin) {
61 if (pistonType != PistonType::SingleActing) {
62 throw std::runtime_error(
"You must have a SingleActing piston type if you do not use piston rod diameter");
91 auto const volumeAirIntakeSingle =
92 (0.785 * std::pow(cylinderDiameter, 2) * cylinderStroke * cyclesPerMin) / 1728;
93 auto const compressionRatio = (airPressure + 14.7) / 14.7;
95 if (pistonType == PneumaticAirRequirement::PistonType::SingleActing) {
96 return {volumeAirIntakeSingle, compressionRatio, volumeAirIntakeSingle * compressionRatio};
98 auto const volumeAirIntakeDouble = (2 * 1728 * volumeAirIntakeSingle -
99 (0.785 * std::pow(pistonRodDiameter, 2) * cylinderStroke * cyclesPerMin)) /
101 return {volumeAirIntakeDouble, compressionRatio, volumeAirIntakeDouble * compressionRatio};
106 double cylinderDiameter, cylinderStroke, pistonRodDiameter = 0, airPressure, cyclesPerMin;