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