MEASUR-Tools-Suite v1.0.11
The MEASUR Tools Suite is a collection of industrial efficiency calculations written in C++ and with bindings for compilation to WebAssembly.
Loading...
Searching...
No Matches
AirSystemCapacity.h
Go to the documentation of this file.
1
10#ifndef TOOLS_SUITE_AIRSYSTEMCAPACITY_H
11#define TOOLS_SUITE_AIRSYSTEMCAPACITY_H
12
13#include "PipeData.h"
14
16 public:
17 struct Output {
18 Output(const double totalPipeVolume, std::vector<double> receiverCapacities, const double totalReceiverVol,
19 const double totalCapacityOfCompressedAirSystem, PipeData pipeLengths)
20 : totalPipeVolume(totalPipeVolume), totalReceiverVol(totalReceiverVol),
21 totalCapacityOfCompressedAirSystem(totalCapacityOfCompressedAirSystem),
22 receiverCapacities(std::move(receiverCapacities)), pipeLengths(pipeLengths) {}
23
24 const double totalPipeVolume, totalReceiverVol, totalCapacityOfCompressedAirSystem;
25 const std::vector<double> receiverCapacities;
26 const PipeData pipeLengths;
27 };
28
36 AirSystemCapacity(PipeData pipeLengths, std::vector<double> receivers)
37 : pipeLengths(pipeLengths), receivers(std::move(receivers)) {}
38
39 Output calculate() {
40
41 auto totalReceiverVol = 0.0;
42 for (auto& gallons : receivers) {
43 gallons /= 7.480515625;
44 totalReceiverVol += gallons;
45 }
46
47 return {pipeLengths.totalPipeVolume, receivers, totalReceiverVol,
48 pipeLengths.totalPipeVolume + totalReceiverVol, pipeLengths};
49 }
50
51 private:
52 PipeData pipeLengths;
53 std::vector<double> receivers;
54};
55
56#endif
Implementations of Pipe Data of a compressed air system.
AirSystemCapacity(PipeData pipeLengths, std::vector< double > receivers)