-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheuler2Dtests.cpp
75 lines (55 loc) · 1.73 KB
/
euler2Dtests.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
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
#include "euler2Dtests.hpp"
double test1DensityX(double x, __attribute__((unused)) double y) {
return x <= 0.5 ? 1 : 0.125;
}
double test1DensityY(__attribute__((unused)) double x, double y) {
return y <= 0.5 ? 1 : 0.125;
}
double test1VelocityX(__attribute__((unused)) double x, __attribute__((unused)) double y) {
return 0;
}
double test1VelocityY(__attribute__((unused)) double x, __attribute__((unused)) double y) {
return 0;
}
double test1PressureX(double x, __attribute__((unused)) double y) {
return x <= 0.5 ? 1 : 0.1;
}
double test1PressureY(__attribute__((unused)) double x, double y) {
return y <= 0.5 ? 1 : 0.1;
}
double constantVX(__attribute__((unused)) double x, __attribute__((unused)) double y) {
return 0;
}
double constantVY(__attribute__((unused)) double x, __attribute__((unused)) double y) {
return 0;
}
double explLS(double x, double y) {
double r = 0.4;
return r*r - x*x - y*y;
}
double cylExplDensity(double x, double y) {
double phi = explLS(x, y);
return phi >= 0 ? 1 : 0.125;
}
double cylExplVelocityX(__attribute__((unused)) double x, __attribute__((unused)) double y) {
return 0;
}
double cylExplVelocityY(__attribute__((unused)) double x, __attribute__((unused)) double y) {
return 0;
}
double cylExplPressure(double x, double y) {
double phi = explLS(x, y);
return phi >= 0 ? 1 : 0.1;
}
double rigidTestDensity(double x, __attribute__((unused)) double y) {
return x <= 0.2 ? 1.3764 : 1;
}
double rigidTestVelocityX(double x, __attribute__((unused)) double y) {
return x <= 0.2 ? 0.394 : 0;
}
double rigidTestVelocityY(__attribute__((unused)) double x, __attribute__((unused)) double y) {
return 0;
}
double rigidTestPressure(double x, __attribute__((unused)) double y) {
return x <= 0.2 ? 1.5698 : 1;
}