-
Notifications
You must be signed in to change notification settings - Fork 0
/
solverwa.hpp
111 lines (83 loc) · 1.86 KB
/
solverwa.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
#ifndef _SOLVERWA_HPP_
#define _SOLVERWA_HPP_
#include "solver.hpp"
class solverwa : public solver{
protected:
/**
* @a: analitic solution
*/
hyd a;
/**
* Relative and absolute difference.
*/
std::vector<dtype> rd, ad;
/**
* @XYVW: scale variables.
*/
dtype X, Y, V, W;
/**
* Kappa.
*/
dtype kappa;
/**
* Init values.
*/
struct iv_t {dtype n0, p0;} iv;
/**
* Analitic solution.
*/
virtual void analitic(const uint&, const uint&);
/**
* Calulate errors.
*/
void error(const uint&, const uint&);
/**
* Start/End time step calc function.
*/
virtual void start_step();
virtual void end_step();
/**
* Loop index.
*/
uint ik;
/**
* P correction.
*/
dtype p_s_corr;
public:
solverwa(io*);
virtual ~solverwa() = 0;
/**
* Initialization function.
*/
void init();
/**
* Forwarder functions.
*/
friend void fw_calc(void *, const uint&, const uint&);
};
/**
* Exact 2+1D solution with const p.
* @n = n0*(tau/tau0)^3*exp(-s/2)
* @u = u0*(1, dX/X*x, dY/Y*y)
* @p = p0*(tau/tau0)^{3+3/kappa}
* @XY = X=dX*t, Y=dY*t
* @tau = t/u0
*/
class solpconst : public solverwa{
dtype t0, tau, tau0;
void start_step();
void end_step();
void analitic(const uint&, const uint&);
public:
solpconst(io*);
};
class accsol : public solverwa{
dtype tau, tau0, eta, t0;
void start_step();
void end_step();
void analitic(const uint&, const uint&);
public:
accsol(io*);
};
#endif // _SOLVERWA_HPP_