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#pragma once
2
12#include "PipeData.h"
13
15 public:
16 struct Output {
17 Output(const double totalPipeVolume, std::vector<double> receiverCapacities, const double totalReceiverVol,
18 const double totalCapacityOfCompressedAirSystem, PipeData pipeLengths)
19 : totalPipeVolume(totalPipeVolume), totalReceiverVol(totalReceiverVol),
20 totalCapacityOfCompressedAirSystem(totalCapacityOfCompressedAirSystem),
21 receiverCapacities(std::move(receiverCapacities)), pipeLengths(pipeLengths) {}
22
23 const double totalPipeVolume, totalReceiverVol, totalCapacityOfCompressedAirSystem;
24 const std::vector<double> receiverCapacities;
25 const PipeData pipeLengths;
26 };
27
35 AirSystemCapacity(PipeData pipeLengths, std::vector<double> receivers)
36 : pipeLengths(pipeLengths), receivers(std::move(receivers)) {}
37
38 Output calculate() {
39
40 auto totalReceiverVol = 0.0;
41 for (auto& gallons : receivers) {
42 gallons /= 7.480515625;
43 totalReceiverVol += gallons;
44 }
45
46 return {pipeLengths.totalPipeVolume, receivers, totalReceiverVol,
47 pipeLengths.totalPipeVolume + totalReceiverVol, pipeLengths};
48 }
49
50 private:
51 PipeData pipeLengths;
52 std::vector<double> receivers;
53};
54
Implementations of Pipe Data of a compressed air system.
AirSystemCapacity(PipeData pipeLengths, std::vector< double > receivers)