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
PipeData.h
Go to the documentation of this file.
1
10#ifndef TOOLS_SUITE_PIPEDATA_H
11#define TOOLS_SUITE_PIPEDATA_H
12
13#include <cmath>
14#include <functional>
15#include <stdexcept>
16#include <vector>
17
18struct PipeData {
24 PipeData(const double oneHalf, const double threeFourths, const double one, const double oneAndOneFourth,
25 const double oneAndOneHalf, const double two, const double twoAndOneHalf, const double three,
26 const double threeAndOneHalf, const double four, const double five, const double six, const double eight,
27 const double ten, const double twelve, const double fourteen, const double sixteen, const double eighteen,
28 const double twenty, const double twentyFour)
29 : oneHalf(oneHalf * 0.0021), threeFourths(threeFourths * 0.0037), one(one * 0.006),
30 oneAndOneFourth(oneAndOneFourth * 0.0104), oneAndOneHalf(oneAndOneHalf * 0.0141), two(two * 0.0233),
31 twoAndOneHalf(twoAndOneHalf * 0.0333), three(three * 0.0513), threeAndOneHalf(threeAndOneHalf * 0.0687),
32 four(four * 0.0884), five(five * 0.1389), six(six * 0.2006), eight(eight * 0.3442), ten(ten * 0.5476),
33 twelve(twelve * 0.7763), fourteen(fourteen * 0.9354), // **ten and twelve**
34 sixteen(sixteen * 1.223), eighteen(eighteen * 1.555), twenty(twenty * 1.926), twentyFour(twentyFour * 2.793),
35 totalPipeVolume(this->oneHalf + this->threeFourths + this->one + this->oneAndOneFourth + this->oneAndOneHalf +
36 this->two + this->twoAndOneHalf + this->three + this->threeAndOneHalf + this->four +
37 this->five + this->six + this->eight + this->ten + this->twelve + this->fourteen +
38 this->sixteen + this->eighteen + this->twenty + this->twentyFour) {}
39
46 explicit PipeData(std::function<double(const double)> const& compVel)
47 : oneHalf(compVel(0.3)), threeFourths(compVel(0.53)), one(compVel(0.86)), oneAndOneFourth(compVel(1.5)),
48 oneAndOneHalf(compVel(2.04)), two(compVel(3.36)), twoAndOneHalf(compVel(4.79)), three(compVel(7.39)),
49 threeAndOneHalf(compVel(9.89)), four(compVel(12.73)), five(compVel(20)), six(compVel(28.89)),
50 eight(compVel(50.02)), ten(compVel(78.85)), twelve(compVel(111.9)), fourteen(compVel(135.3)),
51 sixteen(compVel(176.7)), eighteen(compVel(224)), twenty(compVel(278)), twentyFour(compVel(402.10)) {}
52
53 const double oneHalf, threeFourths, one, oneAndOneFourth, oneAndOneHalf, two;
54 const double twoAndOneHalf, three, threeAndOneHalf, four, five, six;
55 const double eight, ten, twelve, fourteen, sixteen, eighteen, twenty, twentyFour;
56 const double totalPipeVolume = 0;
57};
58
59#endif
PipeData(std::function< double(const double)> const &compVel)
Definition PipeData.h:46
PipeData(const double oneHalf, const double threeFourths, const double one, const double oneAndOneFourth, const double oneAndOneHalf, const double two, const double twoAndOneHalf, const double three, const double threeAndOneHalf, const double four, const double five, const double six, const double eight, const double ten, const double twelve, const double fourteen, const double sixteen, const double eighteen, const double twenty, const double twentyFour)
Definition PipeData.h:24