Browse code

Добавил второй тест Власенко

Dmitrii Kashin authored on 04/09/2014 09:18:17
Showing 3 changed files
... ...
@@ -24,6 +24,11 @@ test-shock1:
24 24
 	ln -f grid-init-shock1.o grid-init.o
25 25
 	make build
26 26
 
27
+test-shock2a:
28
+	make grid-init-shock2a.o
29
+	ln -f grid-init-shock2a.o grid-init.o
30
+	make build
31
+
27 32
 # the main aim
28 33
 $(EXECUTABLE): $(OBJECTS) 
29 34
 	$(CC) $(CFLAGS) $(LDFLAGS) $(OBJECTS) -o $@
... ...
@@ -11,7 +11,7 @@ set output "Rg.png"
11 11
 plot "gridXXX" using 1:3 title "Density of Gas" with lines;
12 12
 
13 13
 set output "U.png"
14
-set yrange [150:450]
14
+#set yrange [150:450]
15 15
 plot "gridXXX" using 1:4 title "Velocity of Gas" with lines,\
16 16
      "gridXXX" using 1:5 title "Velocity of Liquid" with lines;
17 17
 
18 18
new file mode 100644
... ...
@@ -0,0 +1,33 @@
0
+/*
1
+  Здесь содержатся установки начального поля для того, чтобы
2
+  исследовать устойчивость метода на СУ. 
3
+  Для сравнения с Власенко: test-2a
4
+*/
5
+
6
+#include "grid-init.h"
7
+
8
+void
9
+set_initial_field(Grid1D& grid)
10
+{
11
+  double phi_L = 0.9;
12
+  double rho_L = 1; // [kg/m^3]
13
+  double Ug_L = 1000; // [m/s]
14
+  double Ul_L = 1000; // [m/s]
15
+  
16
+  double Ug_R = Ug_L;
17
+  double Ul_R = (rho_L*R0*T + (1-phi_L)*u3def*Ug_L*Ug_L )/(u3def*Ug_L);
18
+  double phi_R = 1 - (1-phi_L)*Ul_L/Ul_R;
19
+  double rho_R = rho_L * phi_L/phi_R;
20
+  
21
+  ConservVars lv = primitive2conserv((PrimitiveVars){phi_L,rho_L,Ug_L,Ul_L});
22
+  ConservVars rv = primitive2conserv((PrimitiveVars){phi_R,rho_R,Ug_R,Ul_R});
23
+  
24
+  grid.lbc.vars = lv;
25
+  grid.rbc.vars = rv;
26
+  
27
+  for (unsigned int i=0; i<grid.N; i++)
28
+    if (i<grid.N/2)
29
+      grid.cells[i].vars = lv;
30
+    else
31
+      grid.cells[i].vars = rv;
32
+}