Skip to content

Commit f9a1384

Browse files
author
tomo-ono
committed
fix input files, ssheet test, and jgg.cpp
1 parent 1eeff0c commit f9a1384

File tree

9 files changed

+15
-95
lines changed

9 files changed

+15
-95
lines changed

inputs/hydro/athinput.disk_cyl

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ dfloor = 1.e-6
5252
pfloor = 1.e-9
5353

5454
<orbital_advection>
55-
OAorder = 0 # 0: w/o OA, 1: w/ OA(1st), 2: w/ OA (2nd)
55+
OAorder = 0 # 0: w/o OA, 1: w/ OA (1st), 2: w/ OA (2nd)
5656
Omega0 = 0.0 # angular velocity of the system
5757

5858
<problem>

inputs/hydro/athinput.disk_sph

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ dfloor = 1.e-9
5252
pfloor = 1.e-12
5353

5454
<orbital_advection>
55-
OAorder = 0 # 0: w/o OA, 1: w/ OA(1st), 2: w/ OA (2nd)
55+
OAorder = 0 # 0: w/o OA, 1: w/ OA (1st), 2: w/ OA (2nd)
5656
Omega0 = 0.0 # angular velocity of the system
5757

5858
<problem>

inputs/hydro/athinput.ssheet

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<comment>
22
problem = HD shwave test
3-
reference = Johnson & Gammie, 2008, ApJS, 177, 373
3+
reference = Johnson & Gammie, 2005, ApJ, 626, 978
44
configure = --prob=ssheet --eos=isothermal
55

66
<job>
@@ -55,7 +55,7 @@ gamma = 1.666666666666667 # gamma = C_p/C_v
5555
iso_sound_speed = 0.001 # isothermal sound speed
5656

5757
<orbital_advection>
58-
OAorder = 0 # 0: w/o OA, 1: w/ OA(1st), 2: w/ OA (2nd)
58+
OAorder = 0 # 0: w/o OA, 1: w/ OA (1st), 2: w/ OA (2nd)
5959
qshear = 1.5 # shear rate
6060
Omega0 = 0.001 # angular velocity of the system
6161
shboxcoord = 1 # 1=xy (default); 2=xz

inputs/mhd/athinput.hgb

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ gamma = 1.666666666666667 # gamma = C_p/C_v
5454
iso_sound_speed = 1.0 # isothermal sound speed
5555

5656
<orbital_advection>
57-
OAorder = 0 # 0: w/o OA, 1: w/ OA(1st), 2: w/ OA (2nd)
57+
OAorder = 0 # 0: w/o OA, 1: w/ OA (1st), 2: w/ OA (2nd)
5858
qshear = 1.5 # shear rate
5959
Omega0 = 1.0 # angular velocity of the system
6060

inputs/mhd/athinput.jgg

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ gamma = 1.666666666666667 # gamma = C_p/C_v
5555
iso_sound_speed = 1.0 # isothermal sound speed
5656

5757
<orbital_advection>
58-
OAorder = 0 # 0: w/o OA, 1: w/ OA(1st), 2: w/ OA (2nd)
58+
OAorder = 0 # 0: w/o OA, 1: w/ OA (1st), 2: w/ OA (2nd)
5959
qshear = 1.5 # shear rate
6060
Omega0 = 1.0 # angular velocity of the system
6161

inputs/mhd/athinput.mshwave

-66
This file was deleted.

inputs/mhd/athinput.strat

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ dfloor = 1.e-6
6060
pfloor = 5e-13
6161

6262
<orbital_advection>
63-
OAorder = 0 # 0: w/o OA, 1: w/ OA(1st), 2: w/ OA (2nd)
63+
OAorder = 0 # 0: w/o OA, 1: w/ OA (1st), 2: w/ OA (2nd)
6464
qshear = 1.5 # shear rate
6565
Omega0 = 0.001 # angular velocity of the system
6666

src/pgen/jgg.cpp

+4-16
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@ void Mesh::UserWorkInLoop() {
630630
if (ipert == 2) {
631631
int exe_rank_dby = (Globals::nranks>1)? 1 : 0;
632632
Real inv_nik = 1.0/static_cast<Real>(mesh_size.nx3*mesh_size.nx1);
633-
Real inv_half_nx2 = static_cast<Real>(mesh_size.nx2/2);
633+
Real inv_half_nx2 = 1.0/static_cast<Real>(mesh_size.nx2/2);
634634
int abs_nwy = std::abs(nwy);
635635
// calculate FFT of dbx
636636
if (Globals::my_rank == 0) {
@@ -647,19 +647,13 @@ void Mesh::UserWorkInLoop() {
647647
// calculation
648648
Real amp_wave;
649649
Real amp_others = 0.0;
650-
Real x1 = (static_cast<Real>(i)+0.5)*Lx
651-
/static_cast<Real>(mesh_size.nx1)
652-
+mesh_size.x1min;
653-
Real x3 = (static_cast<Real>(k)+0.5)*Lz
654-
/static_cast<Real>(mesh_size.nx3)
655-
+mesh_size.x3min;
656650
for (int j=0; j<mesh_size.nx2/2; j++) {
657651
if (j == abs_nwy) {
658652
amp_wave = std::sqrt(SQR(fft_data[j][0])+SQR(fft_data[j][1]))
659-
/inv_half_nx2;
653+
*inv_half_nx2;
660654
} else {
661655
amp_others += std::sqrt(SQR(fft_data[j][0])+SQR(fft_data[j][1]))
662-
/inv_half_nx2;
656+
*inv_half_nx2;
663657
}
664658
}
665659
ruser_mesh_data[2](0) += amp_wave*inv_nik;
@@ -680,14 +674,8 @@ void Mesh::UserWorkInLoop() {
680674
}
681675
fftw_execute(fplan);
682676
// calculation
683-
Real x1 = (static_cast<Real>(i)+0.5)*Lx
684-
/static_cast<Real>(mesh_size.nx1)
685-
+mesh_size.x1min;
686-
Real x3 = (static_cast<Real>(k)+0.5)*Lz
687-
/static_cast<Real>(mesh_size.nx3)
688-
+mesh_size.x3min;
689677
Real amp_wave = std::sqrt(SQR(fft_data[abs_nwy][0])
690-
+SQR(fft_data[abs_nwy][1]))/inv_half_nx2;
678+
+SQR(fft_data[abs_nwy][1]))*inv_half_nx2;
691679
ruser_mesh_data[3](0) += amp_wave*inv_nik;
692680
}
693681
}

tst/regression/scripts/tests/shearingbox/ssheet.py

+4-6
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,8 @@ def analyze():
7474
kappa2 = 2.0*(2.0-qshear)*Omega0**2.0
7575
cs = 0.001
7676
constC = 0.5*(cs**2.0*ky**2.0+kappa2)/(qshear*Omega0*cs*ky)
77-
78-
dvy0 = 1.0e-7
79-
c1 = -1.82088e-07
80-
c2 = -8.20766e-08
77+
c1 = -1.82085106245
78+
c2 = -0.8208057072217868
8179

8280
# read results of SSEET_SHWAVE
8381
fname = 'bin/SSHEET_SHWAVE.hst'
@@ -98,7 +96,7 @@ def analyze():
9896
sterm_ = exp_*T_*mp.hyp1f1(0.75-0.5j*constC, 1.5, 0.5j*T_*T_)
9997
second_ = sterm_.real
10098
advy = c1*first_+c2*second_
101-
norm1c += abs(dvyc1[n]-advy/dvy0)
99+
norm1c += abs(dvyc1[n]-advy)
102100
norm1s += abs(dvys1[n])
103101
norm1c /= nf1
104102
norm1s /= nf1
@@ -122,7 +120,7 @@ def analyze():
122120
sterm_ = exp_*T_*mp.hyp1f1(0.75-0.5j*constC, 1.5, 0.5j*T_*T_)
123121
second_ = sterm_.real
124122
advy = c1*first_+c2*second_
125-
norm2c += abs(dvyc2[n]-advy/dvy0)
123+
norm2c += abs(dvyc2[n]-advy)
126124
norm2s += abs(dvys2[n])
127125
norm2c /= nf2
128126
norm2s /= nf2

0 commit comments

Comments
 (0)