-
Notifications
You must be signed in to change notification settings - Fork 0
/
hydro.hpp
118 lines (93 loc) · 2.5 KB
/
hydro.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
#ifndef _HYDRO_HPP_
#define _HYDRO_HPP_
#include "matrix.hpp"
#include "eos.hpp"
#include <cmath>
class hydro{
protected:
/**
* Spacetime resolution.
*/
dtype dt, dx, dy;
/**
* Square of speed of sound.
*/
dtype kappa;
/**
* Viscosity parameters.
*/
dtype u1, u2;
/**
* Kinematic viscosity.
*/
dtype visc1, visc2;
/**
* @p: physical quantity: n, vx, vy, eps! eps contains M! (eps'+rho*v^2/2) => (eps+n*v^2/2)
* @q: transformed quantity
*/
hyd *p, q;
dtype gamma;
/**
* Temperature.
*/
dtype T;
/**
* EoS
*/
EoS *eos;
/**
* Check settings.
*/
void check();
/**
* Calculate fluxes from q1, q2, q3, q4.
*/
void flux_f(std::vector<dtype>&, const dtype&, const dtype&, const dtype&, const dtype&);
void flux_g(std::vector<dtype>&, const dtype&, const dtype&, const dtype&, const dtype&);
/**
* Calculate viscosus fluxes from v, derivates of v and entropy.
*/
void vflux_f(std::vector<dtype>&, const dtype&, const dtype&, const dtype&, const dtype&, const dtype&, const dtype&, const dtype&);
void vflux_g(std::vector<dtype>&, const dtype&, const dtype&, const dtype&, const dtype&, const dtype&, const dtype&, const dtype&);
uint r, c;
/**
* Boundary condition.
*/
virtual void boundary(const uint&, const uint&) = 0;
/**
* Set variables.
*/
void set(const dtype&, const dtype&,const dtype&, hyd*);
/**
* Number of nan in rho.
* Number of zero in rho.
*/
uint non;
public:
hydro();
hydro(const dtype&, const dtype&,const dtype&, hyd*);
/**
* Set variables.
*/
void set(const dtype&);
void set(const dtype&, const dtype&);
/**
* Makes p to q transformation.
*/
void pq();
/**
* Makes q to p transformation.
*/
void qp(const uint&, const uint&);
dtype& get_dt(){return dt;}
virtual void step() = 0;
/**
* Get non.
* Get noz.
* Get num of points.
*/
uint& get_non();
uint get_noz();
uint get_nop();
};
#endif // _HYDRO_HPP_