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