def run(**kwargs):
    # L-going fast wave
    arguments = [
        'time/ncycle_out=0', 'problem/wave_flag=0', 'problem/vflow=0.0',
        'mesh/refinement=static', 'mesh/nx1=32', 'mesh/nx2=16', 'mesh/nx3=16',
        'meshblock/nx1=8', 'meshblock/nx2=8', 'meshblock/nx3=8',
        'output2/dt=-1', 'time/tlim=2.0', 'problem/compute_error=true'
    ]
    athena.run('mhd/athinput.linear_wave3d',
               arguments,
               lcov_test_suffix='serial')

    os.system('rm -rf obj')
    os.system('mv obj_hybrid obj')
    os.system('mv bin/athena_hybrid bin/athena')
    athena.mpirun(kwargs['mpirun_cmd'], kwargs['mpirun_opts'], 1,
                  'mhd/athinput.linear_wave3d',
                  arguments + ['mesh/num_threads=1'])
    # 4 total threads = 2 MPI ranks x 2 OpenMP threads / rank
    athena.mpirun(kwargs['mpirun_cmd'],
                  kwargs['mpirun_opts'],
                  2,
                  'mhd/athinput.linear_wave3d',
                  arguments + ['mesh/num_threads=2'],
                  lcov_test_suffix='hybrid')
    return 'skip_lcov'
Esempio n. 2
0
def run(**kwargs):
    arguments = [
        'time/ncycle_out=10', 'mesh/nx1=64', 'mesh/nx2=32', 'mesh/nx3=32',
        'meshblock/nx1=16', 'meshblock/nx2=16', 'meshblock/nx3=16',
        'output2/dt=-1', 'time/tlim=1.0', 'problem/compute_error=true'
    ]
    # athena.run('hydro/athinput.jeans_3d', arguments)

    os.system('mv bin/athena_fft bin/athena')
    athena.run('hydro/athinput.jeans_3d', arguments)

    # os.system('mv bin/athena_mpi_mg bin/athena')
    # athena.mpirun(kwargs['mpirun_cmd'], kwargs['mpirun_opts'],
    #               1, 'hydro/athinput.jeans_3d', arguments)
    # athena.mpirun(kwargs['mpirun_cmd'], kwargs['mpirun_opts'],
    #               2, 'hydro/athinput.jeans_3d', arguments)
    # athena.mpirun(kwargs['mpirun_cmd'], kwargs['mpirun_opts'],
    #               4, 'hydro/athinput.jeans_3d', arguments)

    os.system('mv bin/athena_mpi_fft bin/athena')
    athena.mpirun(kwargs['mpirun_cmd'], kwargs['mpirun_opts'], 1,
                  'hydro/athinput.jeans_3d', arguments)
    athena.mpirun(kwargs['mpirun_cmd'], kwargs['mpirun_opts'], 2,
                  'hydro/athinput.jeans_3d', arguments)
    athena.mpirun(kwargs['mpirun_cmd'], kwargs['mpirun_opts'], 4,
                  'hydro/athinput.jeans_3d', arguments)
Esempio n. 3
0
def run(**kwargs):
    # L-going fast wave
    arguments = [
        'time/ncycle_out=0', 'problem/wave_flag=0', 'problem/vflow=0.0',
        'mesh/refinement=static', 'mesh/nx1=32', 'mesh/nx2=16', 'mesh/nx3=16',
        'meshblock/nx1=8', 'meshblock/nx2=8', 'meshblock/nx3=8',
        'output2/dt=-1', 'time/tlim=2.0', 'problem/compute_error=true'
    ]
    athena.run('mhd/athinput.linear_wave3d',
               arguments,
               lcov_test_suffix='serial')

    os.system('rm -rf obj')
    os.system('mv obj_mpi obj')
    os.system('mv bin/athena_mpi bin/athena')
    athena.mpirun(kwargs['mpirun_cmd'], kwargs['mpirun_opts'], 1,
                  'mhd/athinput.linear_wave3d', arguments)
    athena.mpirun(kwargs['mpirun_cmd'], kwargs['mpirun_opts'], 2,
                  'mhd/athinput.linear_wave3d', arguments)
    athena.mpirun(kwargs['mpirun_cmd'],
                  kwargs['mpirun_opts'],
                  4,
                  'mhd/athinput.linear_wave3d',
                  arguments,
                  lcov_test_suffix='mpi')
    return 'skip_lcov'
Esempio n. 4
0
def run(**kwargs):
    arguments = {
        'time/ncycle_out': '0',
        'mesh/nx1': '1',
        'mesh/nx2': '1',
        'mesh/nx3': '1',
        'mesh/ix1_bc': 'periodic',
        'mesh/ox1_bc': 'periodic',
        'mesh/ix2_bc': 'periodic',
        'mesh/ox2_bc': 'periodic',
        'mesh/ix3_bc': 'periodic',
        'mesh/ox3_bc': 'periodic',
        'time/cfl_number': '0.3',
        'problem/shock_dir': '1',
        'problem/compute_error': 'true'}
    for flux in _fluxes:
        move(_exec + '_' + flux, _exec)
        os.system('mv obj_' + flux + ' obj')
        for xdir in _xdirs:
            for nx in _nxs:
                args = dict(arguments)
                args['mesh/nx' + repr(xdir)] = repr(nx)
                for i in range(1, xdir):
                    args['mesh/nx' + repr(i)] = '4'
                args['mesh/ix' + repr(xdir) + '_bc'] = 'outflow'
                args['mesh/ox' + repr(xdir) + '_bc'] = 'outflow'
                args['problem/shock_dir'] = repr(xdir)
                athena.run('hydro/athinput.sod', [i + '=' + args[i] for i in args],
                           lcov_test_suffix=flux)
        os.system('rm -rf obj')
    return 'skip_lcov'
Esempio n. 5
0
def run():

    # Parameters
    rho = 1.0
    pgas = 0.5
    vx = 0.1
    vy = 0.15
    vz = 0.05
    bx = 1.0
    by = 2.0 / 3.0
    bz = 1.0 / 3.0
    gamma_adi = 4.0 / 3.0

    # Go through all waves at low and high resolutions
    for wave_flag in range(7):
        wavespeed = calculate_wavespeed(rho, pgas, vx, vy, vz, bx, by, bz,
                                        gamma_adi, wave_flag)
        time = 1.0 / abs(wavespeed)
        for res in (16, 32):
            arguments = [
                'time/tlim=' + repr(time), 'time/cfl_number=0.3',
                'output1/dt=-1', 'mesh/nx1=' + repr(res),
                'mesh/nx2=' + repr(res / 2), 'mesh/nx3=' + repr(res / 2),
                'meshblock/nx1=' + repr(res / 2), 'meshblock/nx2=' +
                repr(res / 2), 'meshblock/nx3=' + repr(res / 2),
                'hydro/gamma=' + repr(gamma_adi), 'problem/wave_flag=' +
                repr(wave_flag), 'problem/compute_error=true',
                'problem/rho=' + repr(rho), 'problem/pgas=' + repr(pgas),
                'problem/vx=' + repr(vx), 'problem/vy=' + repr(vy),
                'problem/vz=' + repr(vz), 'problem/Bx=' + repr(bx),
                'problem/By=' + repr(by), 'problem/Bz=' + repr(bz)
            ]
            athena.run('mhd_sr/athinput.linear_wave', arguments)
Esempio n. 6
0
def run(**kwargs):
    """
    Run the executable.

    This function is called second. It is responsible for calling the Athena++ binary in
    such a way as to produce testable output. It takes no inputs and produces no outputs.
    """

    # Create list of runtime arguments to override the athinput file. Each element in the
    # list is simply a string of the form '<block>/<field>=<value>', where the contents of
    # the string are exactly what one would type on the command line run running Athena++.
    arguments = [
        'time/ncycle_out=0', 'job/problem_id=gr_shock_tube',
        'output1/file_type=vtk', 'output1/variable=cons', 'output1/dt=0.4',
        'time/cfl_number=0.4', 'time/tlim=0.4', 'mesh/nx1=400'
    ]

    # Run Athena++ as though we called
    #     ./athena -i ../inputs/hydro_sr/athinput.mb_1 job/problem_id=gr_shock_tube <...>
    # from the bin/ directory. Note we omit the leading '../inputs/' below when specifying
    # the athinput file.)
    athena.run('hydro_sr/athinput.mb_1', arguments)
    # No return statement/value is ever required from run(), but returning anything other
    # than default None will cause run_tests.py to skip executing the optional Lcov cmd
    # immediately after this module.run() finishes, e.g. if Lcov was already invoked by:
    # athena.run('hydro_sr/athinput.mb_1', arguments, lcov_test_suffix='mb_1')
    return 'skip_lcov'
def run(**kwargs):
    arguments = ['time/ncycle_out=0', 'time/nlim=80']
    athena.run('mhd/athinput.test_outputs', arguments)
    arguments = ['time/ncycle_out=0', 'time/nlim=330']
    athena.restart('TestOutputs.00001.rst', arguments)
    arguments = ['time/ncycle_out=0', 'time/nlim=-1']
    athena.restart('TestOutputs.00004.rst', arguments)
Esempio n. 8
0
def run(**kwargs):
    os.system('mv obj_fft obj')
    os.system('mv bin/athena_fft bin/athena')
    arguments = [
        'time/ncycle_out=10', 'mesh/nx1=64', 'mesh/nx2=32', 'mesh/nx3=32',
        'meshblock/nx1=16', 'meshblock/nx2=16', 'meshblock/nx3=16',
        'problem/turb_flag=3', 'turbulence/rseed=1', 'output2/dt=-1',
        'time/tlim=0.3'
    ]
    athena.run('hydro/athinput.turb',
               arguments + ['job/problem_id=turb_serial'],
               lcov_test_suffix='fft')

    os.system('mv obj_mpi_fft obj')
    os.system('mv bin/athena_mpi_fft bin/athena')
    athena.mpirun(kwargs['mpirun_cmd'], kwargs['mpirun_opts'], 1,
                  'hydro/athinput.turb',
                  arguments + ['job/problem_id=turb_mpi1'])
    athena.mpirun(kwargs['mpirun_cmd'], kwargs['mpirun_opts'], 2,
                  'hydro/athinput.turb',
                  arguments + ['job/problem_id=turb_mpi2'])
    athena.mpirun(kwargs['mpirun_cmd'],
                  kwargs['mpirun_opts'],
                  4,
                  'hydro/athinput.turb',
                  arguments + ['job/problem_id=turb_mpi4'],
                  lcov_test_suffix='mpi_fft')

    return 'skip_lcov'
Esempio n. 9
0
def run():
    arguments = [
        '', 'output1/file_type=vtk', 'output1/variable=cons', 'output1/dt=0.4',
        'time/cfl_number=0.4', 'time/tlim=0.4', 'mesh/nx1=400'
    ]
    for i in range(1, 5):
        arguments[0] = 'job/problem_id=gr_hydro_shock' + repr(i)
        athena.run('hydro_sr/athinput.mb_' + repr(i), arguments)
Esempio n. 10
0
def run(**kwargs):
    arguments = [
        'time/tlim=0', 'time/ncycle_out=0', 'mesh/nx1={0}'.format(nb1 * nx1),
        'mesh/nx2={0}'.format(nx2), 'mesh/nx3={0}'.format(nx3),
        'meshblock/nx1={0}'.format(nx1), 'meshblock/nx2={0}'.format(nx2),
        'meshblock/nx3={0}'.format(nx3),
        'problem/input_filename={0}'.format(filename_input)
    ]
    athena.run('mhd/athinput.from_array', arguments)
def run(**kwargs):
    for flux in _fluxes:
        move(_exec + '_' + flux, _exec)
        os.system('mv obj_' + flux + ' obj')
        for n, test in enumerate(_tests):
            args = [i + '={0:}'.format(test[i]) for i in test]
            args += ['job/problem_id=eos_riemann_{0:}_{1:02d}'.format(flux, n),
                     'time/ncycle_out=0']
            athena.run('hydro/athinput.sod_general_H', args)
def run(**kwargs):
    args = {'time/tlim': '0', 'output2/file_type': 'rst'}
    for n in _nscalars:
        move(_exec + '_' + str(n), _exec)
        os.system('mv obj_' + str(n) + ' obj')
        athena.run('hydro/athinput.sod', [i + '=' + args[i] for i in args],
                   lcov_test_suffix=str(n))
        athena.restart('Sod.00000.rst', [i + '=' + args[i] for i in args])
        os.system('rm -rf obj')
    return 'skip_lcov'
Esempio n. 13
0
def run(**kwargs):
    arguments = [
        'job/problem_id=', 'output1/file_type=vtk', 'output1/variable=cons',
        'output1/dt=', 'time/tlim=', 'mesh/nx1=', 'time/ncycle_out=100'
    ]
    times = [0.4, 0.55, 0.5]
    zones = [400, 800, 800]
    for i, time, zone in zip([1, 2, 4], times, zones):
        arguments_copy = list(arguments)
        arguments_copy[0] += 'sr_mhd_shock' + repr(i)
        arguments_copy[3] += repr(time)
        arguments_copy[4] += repr(time)
        arguments_copy[5] += repr(zone)
        athena.run('mhd_sr/athinput.mub_' + repr(i), arguments_copy)
Esempio n. 14
0
def run():
  # L-going fast wave
  arguments = [
    'problem/wave_flag=0','problem/vflow=0.0','mesh/refinement=static',
    'mesh/nx1=32', 'mesh/nx2=16', 'mesh/nx3=16',
    'meshblock/nx1=8',
    'meshblock/nx2=8',
    'meshblock/nx3=8',
    'output2/dt=-1', 'time/tlim=2.0', 'problem/compute_error=true']
  athena.run('mhd/athinput.linear_wave3d', arguments)

  os.system('mv bin/athena_mpi bin/athena')
  athena.mpirun(1, 'mhd/athinput.linear_wave3d', arguments)
  athena.mpirun(2, 'mhd/athinput.linear_wave3d', arguments)
  athena.mpirun(4, 'mhd/athinput.linear_wave3d', arguments)
Esempio n. 15
0
def run():
    # run R-going wave at two resolutions
    for i in (128, 256):
        arguments = [
            'mesh/refinement=static', 'mesh/nx1=' + repr(i),
            'mesh/nx2=' + repr(i / 2), 'meshblock/nx1=' + repr(i / 4),
            'meshblock/nx2=' + repr(i / 8), 'output2/dt=-1', 'time/tlim=1.0',
            'problem/compute_error=true'
        ]
        athena.run('mhd/athinput.cpaw2d', arguments)
    # run L-going wave
    arguments = [
        'mesh/refinement=static', 'mesh/nx1=256', 'mesh/nx2=128',
        'meshblock/nx1=64', 'meshblock/nx2=32', 'output2/dt=-1',
        'time/tlim=1.0', 'problem/compute_error=true', 'problem/dir=2'
    ]
    athena.run('mhd/athinput.cpaw2d', arguments)
def run(**kwargs):
    for coord_ in coords:
        os.system('mv obj_{} obj'.format(coord_))
        os.system('mv bin/athena_{} bin/athena'.format(coord_))
        for (case_, case_params) in cases.items():
            for (torder, xorder) in solvers:
                for i, nx_ in enumerate(resolution_range):
                    if i > 0:
                        # take sqrt of geometric mesh spacing factor every time the radial
                        # resolution is doubled:
                        x1rat = np.power(base_x1rat, 0.5**i)
                    else:
                        x1rat = base_x1rat
                    dt_tab = 1.0 if plot_profiles and nx_ == nx1_profile else -1
                    arguments = [
                        'time/ncycle_out=0',
                        'time/xorder={}'.format(xorder),
                        'time/integrator={}'.format(torder),
                        'mesh/nx1={}'.format(nx_),
                        'mesh/x1rat={}'.format(x1rat),
                        # suppress .hst output, by default
                        'output1/dt=-1',
                        # .tab output:
                        'output2/dt={}'.format(dt_tab),
                        'problem/iprob={}'.format(iprob),
                        'problem/a_width={}'.format(case_params[0]),
                        'problem/b_center={}'.format(case_params[1]),
                        'problem/compute_error=true'
                    ]
                    athena.run('hydro/athinput.mignone_radial',
                               arguments,
                               lcov_test_suffix=coord_)
                    if plot_profiles and nx_ == nx1_profile:
                        tab_file = os.path.join(
                            'bin', 'MignoneRadial.block0.out2.00001.tab')
                        new_tab_file = os.path.join(
                            'bin', '{}_case_{}_{}_xorder_{}_nx1_{}.tab'.format(
                                coord_, case_, torder, xorder, nx_))
                        os.system('mv {} {}'.format(tab_file, new_tab_file))
                default_error_file = os.path.join('bin',
                                                  'mignone_radial-errors.dat')
                error_file = os.path.join(
                    'bin', 'errors_{}_case_{}_{}_xorder_{}.dat'.format(
                        coord_, case_, torder, xorder))
                os.system('mv {} {}'.format(default_error_file, error_file))
    return 'skip_lcov'
def run(**kwargs):
    arguments = [
        'job/problem_id=HB3', 'output1/file_type=hst', 'output1/dt=62.831853',
        'output2/file_type=vtk', 'output2/variable=prim',
        'output2/dt=62831.853', 'time/cfl_number=0.4', 'time/tlim=50265.482',
        'time/nlim=500000', 'time/xorder=2', 'time/integrator=vl2',
        'time/ncycle_out=10', 'mesh/nx1=64', 'mesh/x1min=-0.5',
        'mesh/x1max=0.5', 'mesh/ix1_bc=periodic', 'mesh/ox1_bc=periodic',
        'mesh/nx2=64', 'mesh/x2min=-0.5', 'mesh/x2max=0.5',
        'mesh/ix2_bc=periodic', 'mesh/ox2_bc=periodic', 'mesh/nx3=1',
        'mesh/x3min=-0.5', 'mesh/x3max=0.5', 'hydro/iso_sound_speed=0.00408',
        'problem/beta=4000', 'problem/amp=0.01', 'problem/ipert=1',
        'problem/ifield=1', 'problem/Omega0=1.0e-3', 'problem/qshear=1.5',
        'problem/shboxcoord=2', 'time/ncycle_out=0'
    ]

    athena.run('mhd/athinput.hb3', arguments)
def run(**kwargs):
    for i in resolution_range:
        arguments0 = [
            'output2/file_type=tab', 'output2/variable=v2',
            'output2/data_format=%24.16e', 'output2/dt={}'.format(_t0),
            'time/cfl_number=0.8', 'time/tlim={}'.format(_t0), 'time/nlim=500',
            'time/ncycle_out=0', 'mesh/nx1=' + repr(i), 'mesh/x1min={}'.format(
                -_Lx1 / 2.), 'mesh/x1max={}'.format(_Lx1 / 2.),
            'mesh/ix1_bc=outflow', 'mesh/ox1_bc=outflow', 'mesh/nx2=1',
            'mesh/x2min=-1.0', 'mesh/x2max=1.0', 'mesh/ix2_bc=periodic',
            'mesh/ox2_bc=periodic', 'mesh/nx3=1', 'mesh/x3min=-1.0',
            'mesh/x3max=1.0', 'mesh/ix3_bc=periodic', 'mesh/ox3_bc=periodic',
            'hydro/iso_sound_speed=1.0', 'problem/v0={}'.format(_amp),
            'problem/iprob=0', 'problem/nu_iso={}'.format(_nu)
        ]
        arguments = arguments0 + ['job/problem_id=visc' + repr(i)]
        athena.run('hydro/athinput.visc', arguments)
def run(**kwargs):
    arguments0 = [
        'output1/file_type=hst',
        'output1/dt=0.01',
        'output2/file_type=vtk',
        'output2/variable=prim',
        'output2/dt=0.03',
        'time/cfl_number=0.3',
        'time/tlim=3.0',
        'time/nlim=-1',
        'time/ncycle_out=0',
        'mesh/nx1=64',
        'mesh/x1min=0.0',
        'mesh/x1max=3.0',
        'mesh/ix1_bc=periodic',
        'mesh/ox1_bc=periodic',
        'mesh/nx2=32',
        'mesh/x2min=0.0',
        'mesh/x2max=1.5',
        'mesh/ix2_bc=periodic',
        'mesh/ox2_bc=periodic',
        'mesh/nx3=32',
        'mesh/x3min=0.0',
        'mesh/x3max=1.5',
        'mesh/ix3_bc=periodic',
        'mesh/ox3_bc=periodic',
        'mesh/num_threads=1',
        'mesh/refinement=none',
        'meshblock/nx1=64',
        'meshblock/nx2=32',
        'meshblock/nx3=32',
        'hydro/gamma=1.666666666666667',
        'hydro/iso_sound_speed=1.0',
        # L-going slow wave
        'problem/compute_error=false',
        'problem/wave_flag=2',
        'problem/amp=1.0e-4',
        'problem/vflow=0.0',
        'problem/nu_iso=0.01',
        'problem/eta_ohm=0.02',
        'problem/kappa_iso=0.02'
    ]
    arguments = arguments0 + ['job/problem_id=DecayLinWave']
    athena.run('mhd/athinput.linear_wave3d', arguments)
def run(**kwargs):
    arguments = [
        'job/problem_id=HGB',
        'output1/file_type=hst', 'output1/dt=0.062831853',
        'output2/file_type=vtk', 'output2/variable=prim', 'output2/dt=31.4616',
        'time/cfl_number=0.3', 'time/tlim=62.83185', 'time/nlim=10000',
        'time/xorder=2', 'time/integrator=vl2', 'time/ncycle_out=10',
        'mesh/nx1=32', 'mesh/x1min=-0.5', 'mesh/x1max=0.5',
        'mesh/ix1_bc=shear_periodic', 'mesh/ox1_bc=shear_periodic',
        'mesh/nx2=24', 'mesh/x2min=-1.57079632679', 'mesh/x2max=1.57079632679',
        'mesh/ix2_bc=periodic', 'mesh/ox2_bc=periodic',
        'mesh/nx3=32', 'mesh/x3min=-0.5', 'mesh/x3max=0.5',
        'mesh/ix3_bc=periodic', 'mesh/ox3_bc=periodic',
        'meshblock/nx1=32', 'meshblock/nx2=24', 'meshblock/nx3=32',
        'hydro/iso_sound_speed=1.0', 'problem/beta=100', 'problem/amp=0.025',
        'problem/ipert=1', 'problem/ifield=1',
        'problem/Omega0=1.0', 'problem/qshear=1.5', 'time/ncycle_out=0']

    athena.run('mhd/athinput.hgb', arguments)
Esempio n. 21
0
def run(**kwargs):
    os.system('mv obj_fft obj')
    os.system('mv bin/athena_fft bin/athena')
    athena.run('hydro/athinput.fft', ['job/problem_id=fft_serial'],
               lcov_test_suffix='fft')

    os.system('mv obj_mpi_fft obj')
    os.system('mv bin/athena_mpi_fft bin/athena')
    athena.mpirun(kwargs['mpirun_cmd'], kwargs['mpirun_opts'], 1,
                  'hydro/athinput.fft', ['job/problem_id=fft_mpi1'])
    athena.mpirun(kwargs['mpirun_cmd'], kwargs['mpirun_opts'], 2,
                  'hydro/athinput.fft', ['job/problem_id=fft_mpi2'])
    athena.mpirun(kwargs['mpirun_cmd'],
                  kwargs['mpirun_opts'],
                  4,
                  'hydro/athinput.fft', ['job/problem_id=fft_mpi4'],
                  lcov_test_suffix='mpi_fft')

    return 'skip_lcov'
Esempio n. 22
0
def run(**kwargs):
    # njeans = 1.5
    # period = 0.3
    # 1/omega = 0.046
    # amp 1e-6
    def arg_res(res):
        arguments = [
            'mesh/nx1=64', 'mesh/nx2=32', 'mesh/nx3=32', 'meshblock/nx1=16',
            'meshblock/nx2=16', 'meshblock/nx3=16', 'problem/njeans=1.5',
            'output2/dt=-1', 'time/tlim=0.046', 'problem/compute_error=true',
            'time/ncycle_out=10'
        ]
        arguments[0] = 'mesh/nx1=' + str(2 * res)
        arguments[1] = 'mesh/nx2=' + str(res)
        arguments[2] = 'mesh/nx3=' + str(res)
        return arguments

    athena.run('hydro/athinput.jeans_3d', arg_res(32))
    athena.run('hydro/athinput.jeans_3d', arg_res(64))
Esempio n. 23
0
def run():
    wavespeeds = wavespeeds_hydro()
    for wave_flag in wave_flags:
        time = 1.0 / abs(wavespeeds[wave_flag])
        arguments = [
            'job/problem_id=sr_hydro_wave_{0}_low'.format(wave_flag),
            'mesh/nx1=' + repr(res_low), 'meshblock/nx1=' + repr(res_low),
            'time/tlim=' + repr(time), 'output1/dt=' + repr(time),
            'hydro/gamma=' + repr(gamma_adi), 'problem/rho=' + repr(rho),
            'problem/pgas=' + repr(pgas), 'problem/vx=' + repr(vx),
            'problem/vy=' + repr(vy), 'problem/vz=' + repr(vz),
            'problem/wave_flag=' + repr(wave_flag), 'problem/amp=' + repr(amp)
        ]
        athena.run('hydro_sr/athinput.linear_wave', arguments)
        arguments[0] = 'job/problem_id=sr_hydro_wave_{0}_high'.format(
            wave_flag)
        arguments[1] = 'mesh/nx1=' + repr(res_high)
        arguments[2] = 'meshblock/nx1=' + repr(res_high)
        athena.run('hydro_sr/athinput.linear_wave', arguments)
Esempio n. 24
0
def run(**kwargs):
    for integrator in sts_integrators:
        for n in resolution_range:
            arguments = [
                'job/problem_id=ViscousDiffusion_' + repr(n) + '_' +
                integrator, 'output2/file_type=tab', 'output2/variable=v2',
                'output2/data_format=%24.16e', 'output2/dt={}'.format(_tf),
                'time/cfl_number=0.8', 'time/tlim={}'.format(_tf),
                'time/nlim=10000', 'time/sts_integrator={}'.format(integrator),
                'time/ncycle_out=0', 'mesh/nx1=' + repr(n),
                'mesh/x1min={}'.format(-_Lx1 / 2.), 'mesh/x1max={}'.format(
                    _Lx1 / 2.), 'mesh/ix1_bc=outflow', 'mesh/ox1_bc=outflow',
                'mesh/nx2=1', 'mesh/x2min=-1.0', 'mesh/x2max=1.0',
                'mesh/ix2_bc=periodic', 'mesh/ox2_bc=periodic', 'mesh/nx3=1',
                'mesh/x3min=-1.0', 'mesh/x3max=1.0', 'mesh/ix3_bc=periodic',
                'mesh/ox3_bc=periodic', 'hydro/iso_sound_speed=1.0',
                'problem/amp={}'.format(_amp), 'problem/iprob=0',
                'problem/t0={}'.format(_t0), 'problem/nu_iso={}'.format(_nu)
            ]
            athena.run('hydro/athinput.visc', arguments)
def run(**kwargs):
    for i in resolution_range:
        arguments = [
            'output1/dt=0.03',
            'output2/dt=-1',  # disable .vtk outputs
            'time/tlim=3.0',
            'time/ncycle_out=0',
            # L-going sound wave
            'problem/wave_flag=0',
            'problem/amp=1.0e-4',
            'problem/vflow=0.0',
            'problem/kappa_iso=0.04',
            'mesh/nx1=' + repr(i),
            'mesh/nx2=' + repr(i / 2),
            'mesh/nx3=' + repr(i / 2),
            'meshblock/nx1=' + repr(i),
            'meshblock/nx2=' + repr(i / 2),
            'meshblock/nx3=' + repr(i / 2),
            'job/problem_id=DecayLinWave-{}'.format(i)
        ]
        athena.run('hydro/athinput.linear_wave3d', arguments)
Esempio n. 26
0
def run(**kwargs):
    # L-going sound wave
    for i in (32, 64):
        arguments = [
            'time/ncycle_out=0', 'problem/wave_flag=0', 'problem/vflow=0.0',
            'mesh/refinement=static', 'mesh/nx1=' + repr(i),
            'mesh/nx2=' + repr(i / 2), 'mesh/nx3=' + repr(i / 2),
            'meshblock/nx1=' + repr(i / 4), 'meshblock/nx2=' + repr(i / 4),
            'meshblock/nx3=' + repr(i / 4), 'output2/dt=-1', 'time/tlim=1.0',
            'problem/compute_error=true'
        ]
        athena.run('hydro/athinput.linear_wave3d', arguments)
    # entropy wave
    for i in (32, 64):
        arguments = [
            'time/ncycle_out=0', 'problem/wave_flag=3', 'problem/vflow=1.0',
            'mesh/refinement=static', 'mesh/nx1=' + repr(i),
            'mesh/nx2=' + repr(i / 2), 'mesh/nx3=' + repr(i / 2),
            'meshblock/nx1=' + repr(i / 4), 'meshblock/nx2=' + repr(i / 4),
            'meshblock/nx3=' + repr(i / 4), 'output2/dt=-1', 'time/tlim=1.0',
            'problem/compute_error=true'
        ]
        athena.run('hydro/athinput.linear_wave3d', arguments)
    # L/R-going sound wave, no SMR
    for w in (0, 4):
        arguments = [
            'time/ncycle_out=0', 'problem/wave_flag=' + repr(w),
            'output2/dt=-1', 'time/tlim=1.0', 'problem/compute_error=true'
        ]
        athena.run('hydro/athinput.linear_wave3d', arguments)
Esempio n. 27
0
def run():
    #case 1
    arguments = [
        'problem/er=10.0', 'problem/tgas=1.0', 'problem/sigma=1.0',
        'radiation/Prat=0.01', 'radiation/Crat=10.0'
    ]
    athena.run('radiation/athinput.thermal_relaxation', arguments)
    bashcommand = "mv bin/thermal.hst bin/thermal1.hst"
    os.system(bashcommand)
    #case 2
    arguments = [
        'problem/er=10.0', 'problem/tgas=1.0', 'problem/sigma=100.0',
        'radiation/Prat=100.0', 'radiation/Crat=10.0'
    ]
    athena.run('radiation/athinput.thermal_relaxation', arguments)
    bashcommand = "mv bin/thermal.hst bin/thermal2.hst"
    os.system(bashcommand)
    #case 3
    arguments = [
        'problem/er=1.0', 'problem/tgas=10.0', 'problem/sigma=100.0',
        'radiation/Prat=1.0', 'radiation/Crat=10.0'
    ]
    athena.run('radiation/athinput.thermal_relaxation', arguments)
    bashcommand = "mv bin/thermal.hst bin/thermal3.hst"
    os.system(bashcommand)
def run(**kwargs):
    # w/o Orbital Advection
    arguments = [
        'job/problem_id=JGG', 'output1/file_type=hst', 'output1/dt=0.01',
        'output1/data_format=%1.16f', 'output2/file_type=vtk',
        'output2/variable=prim', 'output2/dt=-1.0', 'time/cfl_number=0.3',
        'time/tlim=3.0', 'time/nlim=1000', 'time/xorder=3',
        'time/integrator=vl2', 'mesh/nx1=32', 'mesh/x1min=-0.25',
        'mesh/x1max=0.25', 'mesh/ix1_bc=shear_periodic',
        'mesh/ox1_bc=shear_periodic', 'mesh/nx2=16', 'mesh/x2min=-0.25',
        'mesh/x2max=0.25', 'mesh/ix2_bc=periodic', 'mesh/ox2_bc=periodic',
        'mesh/nx3=16', 'mesh/x3min=-0.25', 'mesh/x3max=0.25',
        'mesh/ix3_bc=periodic', 'mesh/ox3_bc=periodic',
        'hydro/iso_sound_speed=1.0', 'problem/d0=1.0', 'problem/amp=1.0e-6',
        'problem/beta=20.0', 'problem/ipert=2', 'problem/nwx=-2',
        'problem/nwy=1', 'problem/nwz=1', 'orbital_advection/Omega0=1.0',
        'orbital_advection/qshear=1.5', 'orbital_advection/OAorder=0',
        'problem/error_output=true', 'time/ncycle_out=0'
    ]
    athena.run('mhd/athinput.jgg', arguments)

    # w/  Orbital Advection
    arguments = [
        'job/problem_id=JGG_ORB', 'output1/file_type=hst', 'output1/dt=0.01',
        'output1/data_format=%1.16f', 'output2/file_type=vtk',
        'output2/variable=prim', 'output2/dt=-1.0', 'time/cfl_number=0.3',
        'time/tlim=3.0', 'time/nlim=1000', 'time/xorder=3',
        'time/integrator=vl2', 'mesh/nx1=32', 'mesh/x1min=-0.25',
        'mesh/x1max=0.25', 'mesh/ix1_bc=shear_periodic',
        'mesh/ox1_bc=shear_periodic', 'mesh/nx2=16', 'mesh/x2min=-0.25',
        'mesh/x2max=0.25', 'mesh/ix2_bc=periodic', 'mesh/ox2_bc=periodic',
        'mesh/nx3=16', 'mesh/x3min=-0.25', 'mesh/x3max=0.25',
        'mesh/ix3_bc=periodic', 'mesh/ox3_bc=periodic',
        'hydro/iso_sound_speed=1.0', 'problem/d0=1.0', 'problem/amp=1.0e-6',
        'problem/beta=20.0', 'problem/ipert=2', 'problem/nwx=-2',
        'problem/nwy=1', 'problem/nwz=1', 'orbital_advection/Omega0=1.0',
        'orbital_advection/qshear=1.5', 'orbital_advection/OAorder=2',
        'problem/error_output=true', 'time/ncycle_out=0'
    ]
    athena.run('mhd/athinput.jgg', arguments)
def run():
    # run in X1 direction
    for i in (128, 256):
        arguments = [
            'mesh/nx1=' + repr(i), 'mesh/nx2=1', 'mesh/nx3=1',
            'mesh/ix1_bc=outflow', 'mesh/ox1_bc=outflow',
            'mesh/ix2_bc=periodic', 'mesh/ox2_bc=periodic',
            'mesh/ix3_bc=periodic', 'mesh/ox3_bc=periodic',
            'time/cfl_number=0.3', 'problem/shock_dir=1',
            'problem/compute_error=true'
        ]
        athena.run('hydro/athinput.sod', arguments)
    # run in X2 direction
    for i in (128, 256):
        arguments = [
            'mesh/nx1=4', 'mesh/nx2=' + repr(i), 'mesh/nx3=1',
            'mesh/ix1_bc=periodic', 'mesh/ox1_bc=periodic',
            'mesh/ix2_bc=outflow', 'mesh/ox2_bc=outflow',
            'mesh/ix3_bc=periodic', 'mesh/ox3_bc=periodic',
            'time/cfl_number=0.3', 'problem/shock_dir=2',
            'problem/compute_error=true'
        ]
        athena.run('hydro/athinput.sod', arguments)
    # run in X3 direction
    for i in (128, 256):
        arguments = [
            'mesh/nx1=4', 'mesh/nx2=4', 'mesh/nx3=' + repr(i),
            'mesh/ix1_bc=periodic', 'mesh/ox1_bc=periodic',
            'mesh/ix2_bc=periodic', 'mesh/ox2_bc=periodic',
            'mesh/ix3_bc=outflow', 'mesh/ox3_bc=outflow',
            'time/cfl_number=0.3', 'problem/shock_dir=3',
            'problem/compute_error=true'
        ]
        athena.run('hydro/athinput.sod', arguments)
Esempio n. 30
0
def run(**kwargs):
    # L-going fast/Alfven/slow waves
    for w in (0, 1, 2):
        tlim = max(0.5, w)
        for i in (32, 64):
            arguments = [
                'time/ncycle_out=0', 'problem/wave_flag=' + repr(w),
                'problem/vflow=0.0', 'mesh/refinement=static',
                'mesh/nx1=' + repr(i), 'mesh/nx2=' + repr(i / 2),
                'mesh/nx3=' + repr(i / 2), 'meshblock/nx1=' + repr(i / 4),
                'meshblock/nx2=' + repr(i / 4), 'meshblock/nx3=' + repr(i / 4),
                'output2/dt=-1', 'time/tlim=' + repr(tlim),
                'problem/compute_error=true'
            ]
            athena.run('mhd/athinput.linear_wave3d', arguments)
    # entropy wave
    for i in (32, 64):
        arguments = [
            'time/ncycle_out=0', 'problem/wave_flag=3', 'problem/vflow=1.0',
            'mesh/refinement=static', 'mesh/nx1=' + repr(i),
            'mesh/nx2=' + repr(i / 2), 'mesh/nx3=' + repr(i / 2),
            'meshblock/nx1=' + repr(i / 4), 'meshblock/nx2=' + repr(i / 4),
            'meshblock/nx3=' + repr(i / 4), 'output2/dt=-1', 'time/tlim=1.0',
            'problem/compute_error=true'
        ]
        athena.run('mhd/athinput.linear_wave3d', arguments)
    # L/R-going fast wave
    for w in (0, 6):
        arguments = [
            'time/ncycle_out=0', 'problem/wave_flag=' + repr(w),
            'output2/dt=-1', 'time/tlim=0.5', 'problem/compute_error=true'
        ]
        athena.run('mhd/athinput.linear_wave3d', arguments)