Skip to content

Commit 7d71665

Browse files
committed
introduce blast wave setup
1 parent a3bf3b6 commit 7d71665

File tree

3 files changed

+84
-0
lines changed

3 files changed

+84
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#define COMPONENTS 3
2+
#define DIMENSIONS 3
3+
4+
#define GEOMETRY CARTESIAN

test/HD/SedovBlastWave/idefix.ini

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
[Grid]
2+
X1-grid 1 -0.5 256 u 0.5
3+
X2-grid 1 -0.5 256 u 0.5
4+
X3-grid 1 -0.5 256 u 0.5
5+
6+
[TimeIntegrator]
7+
CFL 0.9
8+
tstop 5.0
9+
first_dt 1.e-6
10+
nstages 2
11+
12+
[Hydro]
13+
solver hllc
14+
gamma 1.666666666666666666
15+
16+
[Boundary]
17+
X1-beg periodic
18+
X1-end periodic
19+
X2-beg periodic
20+
X2-end periodic
21+
X3-beg periodic
22+
X3-end periodic
23+
24+
[Output]
25+
vtk 0.01

test/HD/SedovBlastWave/setup.cpp

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#include "idefix.hpp"
2+
#include "setup.hpp"
3+
4+
5+
// Default constructor
6+
7+
8+
// Initialisation routine. Can be used to allocate
9+
// Arrays or variables which are used later on
10+
Setup::Setup(Input &input, Grid &grid, DataBlock &data, Output &output) {
11+
12+
}
13+
14+
// This routine initialize the flow
15+
// Note that data is on the device.
16+
// One can therefore define locally
17+
// a datahost and sync it, if needed
18+
void Setup::InitFlow(DataBlock &data) {
19+
// Create a host copy
20+
DataBlockHost d(data);
21+
22+
23+
for(int k = 0; k < d.np_tot[KDIR] ; k++) {
24+
for(int j = 0; j < d.np_tot[JDIR] ; j++) {
25+
for(int i = 0; i < d.np_tot[IDIR] ; i++) {
26+
real x = d.x[IDIR](i);
27+
real y = d.x[JDIR](j);
28+
real z = d.x[KDIR](k);
29+
30+
// Sedov Blast Wave Following Stone+2018, 3.4.4
31+
d.Vc(RHO,k,j,i) = 1.0;
32+
d.Vc(VX1,k,j,i) = 0.0;
33+
d.Vc(VX2,k,j,i) = 0.0;
34+
d.Vc(VX3,k,j,i) = 0.0;
35+
36+
d.Vc(PRS,k,j,i) = 0.01;
37+
38+
real r=sqrt(x*x+y*y+z*z);
39+
if(r<0.01) {
40+
d.Vc(PRS,k,j,i) = 1.6e5;
41+
}
42+
43+
44+
}
45+
}
46+
}
47+
48+
// Send it all, if needed
49+
d.SyncToDevice();
50+
}
51+
52+
// Analyse data to produce an output
53+
void MakeAnalysis(DataBlock & data) {
54+
55+
}

0 commit comments

Comments
 (0)