Skip to content

Commit b9e7565

Browse files
committed
kh test setup
1 parent 55b2fcb commit b9e7565

2 files changed

Lines changed: 90 additions & 0 deletions

File tree

exec/hydro/Init.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,16 @@ void InitVel(std::array< MultiFab, AMREX_SPACEDIM >& umac,
200200
*(1.+std::tanh(k2_inv*((width1/2.) - relpos[1])));
201201

202202
}
203+
else if (prob_type == 4) {
204+
Real quarter = reallo[1] + 0.25*(realhi[1]-reallo[1]);
205+
Real threequarter = reallo[1] + 0.75*(realhi[1]-reallo[1]);
206+
Real y = reallo[1] + (j+0.5)*dx[1];
207+
if (y < quarter || y > threequarter) {
208+
u(i,j,k) = -1.;
209+
} else {
210+
u(i,j,k) = 1.;
211+
}
212+
}
203213
},
204214
[=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
205215
{
@@ -239,6 +249,8 @@ void InitVel(std::array< MultiFab, AMREX_SPACEDIM >& umac,
239249
v(i,j,k) = slope*fun_ptrb;
240250
} else if (prob_type == 3) {
241251
v(i,j,k) = 0.;
252+
} else if (prob_type == 4) {
253+
v(i,j,k) = 0.;
242254
}
243255
}
244256
#if (AMREX_SPACEDIM == 3)

exec/hydro/inputs_kh_2d

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# Problem specification
2+
prob_lo = 0.0 0.0 # physical lo coordinate
3+
prob_hi = 1.0 1.0 # physical hi coordinate
4+
5+
# if prob_type = 0, zero initial velocity
6+
# if prob_type = 1, vortex
7+
# if prob_type = 2, KH - sine
8+
# if prob_type = 3, KH - smooth
9+
# if prob_type = 4, new KH
10+
prob_type = 4
11+
12+
# number of cells in domain
13+
n_cells = 32 32
14+
# max number of cells in a box
15+
max_grid_size = 16 16
16+
17+
# Time-step control
18+
fixed_dt = 0.005
19+
20+
# Controls for number of steps between actions
21+
max_step = 100000
22+
plot_int = 1000
23+
24+
# Viscous friction L phi operator
25+
# if abs(visc_type) = 1, L = div beta grad
26+
# if abs(visc_type) = 2, L = div [ beta (grad + grad^T) ]
27+
# if abs(visc_type) = 3, L = div [ beta (grad + grad^T) + I (gamma - (2/3)*beta) div ]
28+
# positive = assume constant coefficients
29+
# negative = assume spatially-varying coefficients
30+
# visc_coef = 1.
31+
visc_coef = 1.e-5
32+
visc_type = 1
33+
34+
# Stochastic parameters
35+
variance_coef_mom = 1.
36+
initial_variance_mom = 0.
37+
38+
cell_depth = 1000000.
39+
k_B = 1.
40+
T_init = 1.
41+
42+
# Boundary conditions
43+
# ----------------------
44+
# BC specifications:
45+
# -1 = periodic
46+
# 1 = slip
47+
# 2 = no-slip
48+
bc_vel_lo = -1 -1
49+
bc_vel_hi = -1 -1
50+
51+
mg_verbose = 0 # multigrid verbosity
52+
53+
# Staggered multigrid solver parameters
54+
stag_mg_verbosity = 0 # verbosity
55+
stag_mg_max_vcycles = 1 # max number of v-cycles
56+
stag_mg_minwidth = 2 # length of box at coarsest multigrid level
57+
stag_mg_bottom_solver = 0 # bottom solver type
58+
# 0 = smooths only, controlled by mg_nsmooths_bottom
59+
# 4 = Fancy bottom solve that coarsens additionally
60+
# and then applies stag_mg_nsmooths_bottom smooths
61+
stag_mg_nsmooths_down = 2 # number of smooths at each level on the way down
62+
stag_mg_nsmooths_up = 2 # number of smooths at each level on the way up
63+
stag_mg_nsmooths_bottom = 8 # number of smooths at the bottom
64+
stag_mg_max_bottom_nlevels = 10 # for stag_mg_bottom_solver 4, number of additional levels of multigrid
65+
stag_mg_omega = 1. # weightee-jacobi omega coefficient
66+
stag_mg_smoother = 1 # 0 = jacobi; 1 = 2*dm-color Gauss-Seidel
67+
stag_mg_rel_tol = 1.e-9 # relative tolerance stopping criteria
68+
69+
70+
# GMRES solver parameters
71+
gmres_rel_tol = 1.e-12 # relative tolerance stopping criteria
72+
gmres_abs_tol = 0 # absolute tolerance stopping criteria
73+
gmres_verbose = 1 # gmres verbosity; if greater than 1, more residuals will be printed out
74+
gmres_max_outer = 20 # max number of outer iterations
75+
gmres_max_inner = 5 # max number of inner iterations, or restart number
76+
gmres_max_iter = 100 # max number of gmres iterations
77+
gmres_min_iter = 1 # min number of gmres iterations
78+

0 commit comments

Comments
 (0)