-
Notifications
You must be signed in to change notification settings - Fork 27
/
transport.hpp
150 lines (122 loc) · 5.37 KB
/
transport.hpp
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
/* This file is part of aither.
Copyright (C) 2015-18 Michael Nucci (michael.nucci@gmail.com)
Aither is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Aither is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#ifndef TRANSPORTHEADERDEF
#define TRANSPORTHEADERDEF
// This header file contains the classes for all viscous transport models
#include <math.h> // sqrt
#include <memory>
#include <vector>
#include "vector3d.hpp"
#include "thermodynamic.hpp"
using std::vector;
using std::unique_ptr;
// forward class declarations
class fluid;
// abstract base class for transport models
class transport {
double scaling_;
double invScaling_;
protected:
void SetScaling(const double &rho, const double &l, const double &mu,
const double &a) {
scaling_ = mu / (rho * a * l);
invScaling_ = 1.0 / scaling_;
}
public:
// Constructor
transport() : scaling_(0), invScaling_(0) {}
transport(const double &rho, const double &l, const double &mu,
const double &a) {
this->SetScaling(rho, l, mu, a);
}
// move constructor and assignment operator
transport(transport&&) noexcept = default;
transport& operator=(transport&&) noexcept = default;
// copy constructor and assignment operator
transport(const transport&) = default;
transport& operator=(const transport&) = default;
// Member functions for abstract base class
virtual int NumSpecies() const = 0;
virtual double SpeciesViscosity(const double &, const int &) const = 0;
virtual double SpeciesConductivity(const double &, const int &) const = 0;
virtual double Viscosity(const double &, const vector<double> &) const = 0;
virtual double EffectiveViscosity(const double &,
const vector<double> &) const = 0;
virtual double Lambda(const double &) const = 0;
virtual double TRef() const = 0;
virtual double MuRef() const = 0;
virtual double Conductivity(const double &, const vector<double> &) const = 0;
virtual double EffectiveConductivity(const double &,
const vector<double> &) const = 0;
virtual double TurbConductivity(const double &, const double &,
const double &,
const unique_ptr<thermodynamic> &,
const vector<double> &mf) const = 0;
double NondimScaling() const { return scaling_; }
double InvNondimScaling() const {return invScaling_;}
virtual vector<double> MoleFractions(const vector<double> &) const = 0;
// Destructor
virtual ~transport() noexcept {}
};
// this class models viscous transport using Sutherland's law
class sutherland : public transport {
vector<double> viscC1_;
vector<double> viscS_;
vector<double> condC1_;
vector<double> condS_;
vector<double> molarMass_;
double tRef_;
double muMixRef_;
double kNonDim_;
double bulkVisc_ = 0.0;
// private member functions
double WilkesVisc(const vector<double> &, const vector<double> &) const;
double WilkesCond(const vector<double> &, const vector<double> &) const;
public:
// Constructors
// Stoke's hypothesis -- bulk viscosity = 0
// Sutherland's Law -- mu = muref * (C1 * Tref^1.5) / (T + S_)
sutherland(const vector<fluid> &, const double &, const double &,
const double &, const double &, const vector<double> &);
// move constructor and assignment operator
sutherland(sutherland&&) noexcept = default;
sutherland& operator=(sutherland&&) noexcept = default;
// copy constructor and assignment operator
sutherland(const sutherland&) = default;
sutherland& operator=(const sutherland&) = default;
// Member functions
int NumSpecies() const override { return molarMass_.size(); }
double SpeciesViscosity(const double &, const int &) const override;
double SpeciesConductivity(const double &, const int &) const override;
double Viscosity(const double &, const vector<double> &) const override;
double EffectiveViscosity(const double &,
const vector<double> &) const override;
double Lambda(const double &) const override;
double TRef() const override {return tRef_;}
double MuRef() const override {return muMixRef_;}
double Conductivity(const double &, const vector<double> &) const override;
double EffectiveConductivity(const double &,
const vector<double> &) const override;
double TurbConductivity(const double &eddyVisc, const double &prt,
const double &t,
const unique_ptr<thermodynamic> &thermo,
const vector<double> &mf) const override {
return eddyVisc * thermo->Cp(t, mf) / prt;
}
vector<double> MoleFractions(const vector<double> &) const override;
// Destructor
~sutherland() noexcept {}
};
// --------------------------------------------------------------------------
// function declarations
#endif