Skip to content

Commit 222ddad

Browse files
committed
update readme and some input file
1 parent 816956b commit 222ddad

File tree

3 files changed

+103
-18
lines changed

3 files changed

+103
-18
lines changed

Exec/unit_tests/diffusion_test/README.md

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,29 @@ analytic solution, giving:
6363
(256, 512) 2.437072009e-05
6464
```
6565

66+
## 2-d Spherical Geometry
67+
68+
An analytic convergence test with 2D spherical geometry is done
69+
using the initial condition constructed with spherical-bessel function
70+
and legendre polynomial, which tests both radial and theta dependence.
71+
Run with:
72+
73+
```
74+
./Castro2d.gnu.MPI.ex inputs.2d.sph.bessel amr.n_cell=64 64
75+
./Castro2d.gnu.MPI.ex inputs.2d.sph.bessel amr.n_cell=128 128
76+
./Castro2d.gnu.MPI.ex inputs.2d.sph.bessel amr.n_cell=256 256
77+
```
78+
79+
After each run, the norm of the errror against the analytic solution
80+
shows 2nd order accuracy:
81+
82+
```
83+
base resolution L-inf error
84+
(64 , 64) 0.0008168088258
85+
(128, 128) 0.0002035772451
86+
(256, 256) 5.109916938e-05
87+
```
88+
6689

6790
## SDC-4 in 1-d
6891

@@ -252,3 +275,72 @@ Temp& 1.770452e-06 & 3.966033724 & 1.132894e-07 \\
252275
```
253276

254277
e.g. we see fourth-order convergence in the temperature
278+
279+
280+
## 2-d spherical geometry (with AMR)
281+
282+
We use a non-center Gaussian initial condition to test
283+
resolution convergence and AMR for 2D spherical geometry.
284+
285+
First compile with power law conductivity:
286+
287+
```
288+
make DIM=2 CONDUCTIVITY_DIR=powerlaw -j 20
289+
```
290+
291+
Now run using:
292+
293+
```
294+
./Castro2d.gnu.MPI.ex inputs.2d.sph.gaussian amr.plot_per = 0.001 amr.n_cell=32 32 castro.fixed_dt=3.2e-6
295+
mv diffuse_plt00314 diffuse_sph_32
296+
./Castro2d.gnu.MPI.ex inputs.2d.sph.gaussian amr.plot_per = 0.001 amr.n_cell=64 64 castro.fixed_dt=1.6e-6
297+
mv diffuse_plt00626 diffuse_sph_64
298+
./Castro2d.gnu.MPI.ex inputs.2d.sph.gaussian amr.plot_per = 0.001 amr.n_cell=128 128 castro.fixed_dt=8.e-7
299+
mv diffuse_plt01251 diffuse_sph_128
300+
./Castro2d.gnu.MPI.ex inputs.2d.sph.gaussian amr.plot_per = 0.001 amr.n_cell=256 256 castro.fixed_dt=4.e-7
301+
mv diffuse_plt02501 diffuse_sph_256
302+
```
303+
304+
Now use the RichardsonConvergence Script:
305+
306+
```
307+
./RichardsonConvergenceTest2d.gnu.ex coarFile=diffuse_sph_32 mediFile=diffuse_sph_64 fineFile=diffuse_sph_128 > convergence_diffusion.2d.lo.out
308+
./RichardsonConvergenceTest2d.gnu.ex coarFile=diffuse_sph_64 mediFile=diffuse_sph_128 fineFile=diffuse_sph_256 > convergence_diffusion.2d.hi.out
309+
```
310+
311+
For the lower resolution runs, e.g. `convergence_diffusion.2d.lo.out`:
312+
313+
```
314+
Level L1 norm of Error in Each Component
315+
-----------------------------------------------
316+
rho_E 2.681136e-04 1.811933 7.636120e-05
317+
rho_e 2.681136e-04 1.811933 7.636120e-05
318+
Temp 2.681136e-04 1.811933 7.636120e-05
319+
pressure 1.787424e-04 1.811933 5.090747e-05
320+
soundspeed 1.458607e+00 1.797880 4.194908e-01
321+
entropy 2.867059e+04 1.786225 8.312456e+03
322+
thermal_cond 6.322558e-04 1.841497 1.764196e-04
323+
diff_coeff 6.322558e-04 1.841497 1.764196e-04
324+
diff_term 2.631251e-01 1.915835 6.973300e-02
325+
```
326+
327+
For the higher resolution run, e.g. `convergence_diffusion.2d.hi.out`:
328+
329+
```
330+
Level L1 norm of Error in Each Component
331+
-----------------------------------------------
332+
Warning: BoxArray lengths are not the same at level 0
333+
level: 0
334+
Warning: BoxArray lengths are not the same at level 1
335+
level: 1
336+
Warning: BoxArray lengths are not the same at level 0
337+
rho_E 7.636120e-05 2.046783 1.848118e-05
338+
rho_e 7.636120e-05 2.046783 1.848118e-05
339+
Temp 7.636120e-05 2.046783 1.848118e-05
340+
pressure 5.090747e-05 2.046783 1.232079e-05
341+
soundspeed 4.194908e-01 2.034310 1.024081e-01
342+
entropy 8.312456e+03 2.020431 2.048891e+03
343+
thermal_cond 1.764196e-04 2.066769 4.211021e-05
344+
diff_coeff 1.764196e-04 2.066769 4.211021e-05
345+
diff_term 6.973300e-02 1.903361 1.864102e-02
346+
```

Exec/unit_tests/diffusion_test/inputs.2d.sph.bessel

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ castro.hi_bc = 1 3
2323
castro.do_hydro = 0
2424
castro.diffuse_temp = 1
2525
castro.do_react = 0
26+
castro.diffuse_use_amrex_mlmg = 0
2627

2728
# TIME STEP CONTROL
2829

@@ -43,16 +44,6 @@ amr.regrid_int = 2 # how often to regrid
4344
amr.blocking_factor = 8 # block factor in grid generation
4445
amr.max_grid_size = 32
4546

46-
amr.refinement_indicators = temperr tempgrad
47-
48-
amr.refine.temperr.value_greater = 1.1
49-
amr.refine.temperr.field_name = Temp
50-
amr.refine.temperr.max_level = 3
51-
52-
amr.refine.tempgrad.gradient = 0.1
53-
amr.refine.tempgrad.field_name = Temp
54-
amr.refine.tempgrad.max_level = 3
55-
5647
# CHECKPOINT FILES
5748
amr.check_file = diffuse_chk # root name of checkpoint file
5849
amr.check_int = 1000 # number of timesteps between checkpoints
@@ -81,7 +72,6 @@ problem.gaussian_init = 0
8172

8273
# CONDUCTIVITY
8374
conductivity.const_conductivity = 10.0
84-
castro.diffuse_use_amrex_mlmg = 0
8575

8676
# EOS
8777
eos.eos_assume_neutral = 1

Exec/unit_tests/diffusion_test/inputs.2d.sph.gaussian

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ stop_time = 0.001
55
# PROBLEM SIZE & GEOMETRY
66
geometry.is_periodic = 0 0
77
geometry.coord_sys = 2 # 2 = SPHERICAL
8-
geometry.prob_lo = 0.1 0.0
8+
geometry.prob_lo = 0.2 0.0
99
geometry.prob_hi = 1.0 3.141592653589793238
10-
amr.n_cell = 64 64
10+
amr.n_cell = 32 32
1111

1212
castro.allow_non_unit_aspect_zones = 1
1313

@@ -23,6 +23,7 @@ castro.hi_bc = 2 3
2323
castro.do_hydro = 0
2424
castro.diffuse_temp = 1
2525
castro.do_react = 0
26+
castro.diffuse_use_amrex_mlmg = 0
2627

2728
# TIME STEP CONTROL
2829

@@ -37,7 +38,7 @@ amr.v = 1 # verbosity in Amr.cpp
3738
#amr.grid_log = grdlog # name of grid logging file
3839

3940
# REFINEMENT / REGRIDDING
40-
amr.max_level = 0 # maximum level number allowed
41+
amr.max_level = 1 # maximum level number allowed
4142
amr.ref_ratio = 2 2 2 2 # refinement ratio
4243
amr.regrid_int = 2 # how often to regrid
4344
amr.blocking_factor = 8 # block factor in grid generation
@@ -59,8 +60,8 @@ amr.check_int = 1000 # number of timesteps between checkpoints
5960

6061
# PLOTFILES
6162
amr.plot_file = diffuse_plt
62-
#amr.plot_int = 10
63-
amr.plot_per = 0.0001
63+
amr.plot_int = -1
64+
amr.plot_per = 0.001
6465
amr.derive_plot_vars=ALL
6566

6667
# PROBLEM PARAMETERS
@@ -79,11 +80,13 @@ problem.diff_coeff = 1.0
7980
# Note that changing problem::center only works with gaussian initial condition,
8081
# i.e. problem.gaussian_init=1
8182

82-
problem.center = 0.5 1.57079632679 0
83+
problem.center = 0.6 1.57079632679 0
8384

8485
# CONDUCTIVITY
8586
conductivity.const_conductivity = 10.0
86-
castro.diffuse_use_amrex_mlmg = 0
8787

88+
# For powerlaw conductivity of form k_th = k_th0 T^v
89+
conductivity.cond_coeff=1
90+
conductivity.cond_exponent=2
8891
# EOS
8992
eos.eos_assume_neutral = 1

0 commit comments

Comments
 (0)