-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcondition.cpp
44 lines (36 loc) · 1.07 KB
/
condition.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Standard libraries
#include "headers.hpp"
// My libraries
#ifndef INCLUDE_CONDITION
#include "condition.hpp"
#define INCLUDE_CONDITION
#endif
Condition::Condition(const ConditionType &_conditionType, const double &_a) {
conditionType = _conditionType;
a = _a;
b = 0.0;
}
Condition::Condition(const ConditionType &_conditionType, const double &_a, const double &_b) {
conditionType = _conditionType;
a = _a;
b = _b;
}
ConditionType Condition::get_conditionType() const {
return conditionType;
}
double Condition::get_alpha() const {
if (conditionType == CONVECTION) return a;
else throw std::logic_error("ERROR: Wrong ConditionType.");
}
double Condition::get_Tg() const {
if (conditionType == CONVECTION) return b;
else throw std::logic_error("ERROR: Wrong ConditionType.");
}
double Condition::get_Qflow() const {
if (conditionType == FLOW) return a;
else throw std::logic_error("ERROR: Wrong ConditionType.");
}
double Condition::get_T(const double &t) const {
if (conditionType == ISOTHERM) return a + b*t;
else throw std::logic_error("ERROR: Wrong ConditionType.");
}