diff --git a/advection_nonuniform/__init__.py b/advection_nonuniform/__init__.py index 942501a8b..c48c17455 100755 --- a/advection_nonuniform/__init__.py +++ b/advection_nonuniform/__init__.py @@ -4,4 +4,4 @@ """ __all__ = ['simulation'] -from .simulation import * +from .simulation import Simulation diff --git a/advection_nonuniform/advective_fluxes.py b/advection_nonuniform/advective_fluxes.py index 9ccbd740c..e58f10fa6 100755 --- a/advection_nonuniform/advective_fluxes.py +++ b/advection_nonuniform/advective_fluxes.py @@ -78,13 +78,13 @@ def unsplit_fluxes(my_data, rp, dt, scalar_name): for index, vel in np.ndenumerate(u.v(buf=1)): if vel < 0: - a_x.v(buf=1)[index] = a.ip(shift_x.v(buf=1)[index], buf=1)[index] - \ - 0.5 * (1.0 + cx.v(buf=1)[index]) * \ - ldelta_ax.ip(shift_x.v(buf=1)[index], buf=1)[index] + a_x.v(buf=1)[index] = a.ip(shift_x.v(buf=1)[index], buf=1)[index] \ + - 0.5*(1.0 + cx.v(buf=1)[index]) \ + * ldelta_ax.ip(shift_x.v(buf=1)[index], buf=1)[index] else: - a_x.v(buf=1)[index] = a.ip(shift_x.v(buf=1)[index], buf=1)[index] + \ - 0.5 * (1.0 - cx.v(buf=1)[index]) * \ - ldelta_ax.ip(shift_x.v(buf=1)[index], buf=1)[index] + a_x.v(buf=1)[index] = a.ip(shift_x.v(buf=1)[index], buf=1)[index] \ + + 0.5*(1.0 - cx.v(buf=1)[index]) \ + * ldelta_ax.ip(shift_x.v(buf=1)[index], buf=1)[index] # upwind in y-direction a_y = myg.scratch_array() @@ -92,13 +92,13 @@ def unsplit_fluxes(my_data, rp, dt, scalar_name): for index, vel in np.ndenumerate(v.v(buf=1)): if vel < 0: - a_y.v(buf=1)[index] = a.jp(shift_y.v(buf=1)[index], buf=1)[index] - \ - 0.5 * (1.0 + cy.v(buf=1)[index]) * \ - ldelta_ay.jp(shift_y.v(buf=1)[index], buf=1)[index] + a_y.v(buf=1)[index] = a.jp(shift_y.v(buf=1)[index], buf=1)[index] \ + - 0.5*(1.0 + cy.v(buf=1)[index]) \ + * ldelta_ay.jp(shift_y.v(buf=1)[index], buf=1)[index] else: - a_y.v(buf=1)[index] = a.jp(shift_y.v(buf=1)[index], buf=1)[index] + \ - 0.5 * (1.0 - cy.v(buf=1)[index]) * \ - ldelta_ay.jp(shift_y.v(buf=1)[index], buf=1)[index] + a_y.v(buf=1)[index] = a.jp(shift_y.v(buf=1)[index], buf=1)[index] \ + + 0.5*(1.0 - cy.v(buf=1)[index]) \ + * ldelta_ay.jp(shift_y.v(buf=1)[index], buf=1)[index] # compute the transverse flux differences. The flux is just (u a) # HOTF @@ -110,17 +110,18 @@ def unsplit_fluxes(my_data, rp, dt, scalar_name): # the zone where we grab the transverse flux derivative from # depends on the sign of the advective velocity - dtdx2 = 0.5 * dt / myg.dx - dtdy2 = 0.5 * dt / myg.dy + dtdx2 = 0.5*dt/myg.dx + dtdy2 = 0.5*dt/myg.dy for index, vel in np.ndenumerate(u.v(buf=1)): - F_x.v(buf=1)[index] = vel * (a_x.v(buf=1)[index] - - dtdy2 * (F_yt.ip_jp(shift_x.v(buf=1)[index], 1, buf=1)[index] - - F_yt.ip(shift_x.v(buf=1)[index], buf=1)[index])) + F_x.v(buf=1)[index] = vel * (a_x.v(buf=1)[index] - dtdy2 + * (F_yt.ip_jp(shift_x.v(buf=1)[index], 1, buf=1)[index] + - F_yt.ip(shift_x.v(buf=1)[index], buf=1)[index])) for index, vel in np.ndenumerate(v.v(buf=1)): - F_y.v(buf=1)[index] = vel * (a_y.v(buf=1)[index] - - dtdx2 * (F_xt.ip_jp(1, shift_y.v(buf=1)[index], buf=1)[index] - - F_xt.jp(shift_y.v(buf=1)[index], buf=1)[index])) + F_y.v(buf=1)[index] = vel * (a_y.v(buf=1)[index] - dtdx2 + * (F_xt.ip_jp(1, shift_y.v(buf=1)[index], buf=1)[index] + - F_xt.jp(shift_y.v(buf=1)[index], buf=1)[index])) return F_x, F_y + diff --git a/advection_nonuniform/problems/_slotted.defaults b/advection_nonuniform/problems/_slotted.defaults index b6844f709..6893dd0e2 100755 --- a/advection_nonuniform/problems/_slotted.defaults +++ b/advection_nonuniform/problems/_slotted.defaults @@ -1,3 +1,3 @@ [slotted] -omega = 0.5 ;angular velocity -offset = 0.25 ;offset of the slot center from domain center +omega = 0.5 ;angular velocity +offset = 0.25 ;offset of the slot center from domain center diff --git a/advection_nonuniform/problems/_smooth.defaults b/advection_nonuniform/problems/_smooth.defaults deleted file mode 100755 index 54764b052..000000000 --- a/advection_nonuniform/problems/_smooth.defaults +++ /dev/null @@ -1,2 +0,0 @@ -[smooth] - diff --git a/advection_nonuniform/problems/_tophat.defaults b/advection_nonuniform/problems/_tophat.defaults deleted file mode 100755 index eddbcb1ca..000000000 --- a/advection_nonuniform/problems/_tophat.defaults +++ /dev/null @@ -1,2 +0,0 @@ -[tophat] - diff --git a/advection_nonuniform/problems/inputs.smooth b/advection_nonuniform/problems/inputs.smooth deleted file mode 100755 index f68352d34..000000000 --- a/advection_nonuniform/problems/inputs.smooth +++ /dev/null @@ -1,39 +0,0 @@ -# simple inputs files for the unsplit CTU hydro scheme - -[driver] -max_steps = 500 -tmax = 1.0 - -max_dt_change = 1.e33 -init_tstep_factor = 1.0 - - -[driver] -cfl = 0.8 - -[io] -basename = smooth_ -dt_out = 0.2 - -[mesh] -nx = 32 -ny = 32 -xmax = 1.0 -ymax = 1.0 - -xlboundary = periodic -xrboundary = periodic - -ylboundary = periodic -yrboundary = periodic - - -[advection] -u = 1.0 -v = 1.0 - -limiter = 2 - -[particles] -do_particles = 1 -particle_generator = grid diff --git a/advection_nonuniform/problems/inputs.tophat b/advection_nonuniform/problems/inputs.tophat deleted file mode 100755 index 803e24bd9..000000000 --- a/advection_nonuniform/problems/inputs.tophat +++ /dev/null @@ -1,34 +0,0 @@ -# simple inputs files for the unsplit CTU hydro scheme - -[driver] -max_steps = 500 -tmax = 1.0 - -max_dt_change = 1.e33 -init_tstep_factor = 1.0 - -cfl = 0.8 - - -[io] -basename = tophat_ -n_out = 10 - -[mesh] -nx = 32 -ny = 32 -xmax = 1.0 -ymax = 1.0 - -xlboundary = periodic -xrboundary = periodic - -ylboundary = periodic -yrboundary = periodic - - -[advection] -u = 1.0 -v = 1.0 - -limiter = 2 diff --git a/advection_nonuniform/problems/smooth.py b/advection_nonuniform/problems/smooth.py deleted file mode 100755 index 21b149177..000000000 --- a/advection_nonuniform/problems/smooth.py +++ /dev/null @@ -1,41 +0,0 @@ -from __future__ import print_function - -import mesh.patch as patch -import numpy as np -from util import msg - - -def init_data(my_data, rp): - """ initialize the smooth advection problem """ - - msg.bold("initializing the smooth advection problem...") - - # make sure that we are passed a valid patch object - if not isinstance(my_data, patch.CellCenterData2d): - print(my_data.__class__) - msg.fail("ERROR: patch invalid in slotted.py") - - dens = my_data.get_var("density") - - xmin = my_data.grid.xmin - xmax = my_data.grid.xmax - - ymin = my_data.grid.ymin - ymax = my_data.grid.ymax - - xctr = 0.5*(xmin + xmax) - yctr = 0.5*(ymin + ymax) - - dens[:, :] = 1.0 + np.exp(-60.0*((my_data.grid.x2d-xctr)**2 + - (my_data.grid.y2d-yctr)**2)) - - u = my_data.get_var("x-velocity") - v = my_data.get_var("y-velocity") - - u[:, :] = rp.get_param("advection.u") - v[:, :] = rp.get_param("advection.v") - - -def finalize(): - """ print out any information to the user at the end of the run """ - pass diff --git a/advection_nonuniform/problems/tophat.py b/advection_nonuniform/problems/tophat.py deleted file mode 100755 index 6436543ea..000000000 --- a/advection_nonuniform/problems/tophat.py +++ /dev/null @@ -1,45 +0,0 @@ -from __future__ import print_function - -import mesh.patch as patch -from util import msg - - -def init_data(my_data, rp): - """ initialize the tophat advection problem """ - - msg.bold("initializing the tophat advection problem...") - - # make sure that we are passed a valid patch object - if not isinstance(my_data, patch.CellCenterData2d): - print(my_data.__class__) - msg.fail("ERROR: patch invalid in slotted.py") - - dens = my_data.get_var("density") - - xmin = my_data.grid.xmin - xmax = my_data.grid.xmax - - ymin = my_data.grid.ymin - ymax = my_data.grid.ymax - - xctr = 0.5*(xmin + xmax) - yctr = 0.5*(ymin + ymax) - - dens[:, :] = 0.0 - - R = 0.1 - - inside = (my_data.grid.x2d - xctr)**2 + (my_data.grid.y2d - yctr)**2 < R**2 - - dens[inside] = 1.0 - - u = my_data.get_var("x-velocity") - v = my_data.get_var("y-velocity") - - u[:, :] = rp.get_param("advection.u") - v[:, :] = rp.get_param("advection.v") - - -def finalize(): - """ print out any information to the user at the end of the run """ - pass diff --git a/docs/source/advection_nonuniform.problems.rst b/docs/source/advection_nonuniform.problems.rst index c67ef17f2..df30b77e4 100644 --- a/docs/source/advection_nonuniform.problems.rst +++ b/docs/source/advection_nonuniform.problems.rst @@ -15,28 +15,4 @@ advection\_nonuniform\.problems\.slotted module .. automodule:: advection_nonuniform.problems.slotted :members: :undoc-members: - :show-inheritance: - -advection\_nonuniform\.problems\.smooth module ----------------------------------------------- - -.. automodule:: advection_nonuniform.problems.smooth - :members: - :undoc-members: - :show-inheritance: - -advection\_nonuniform\.problems\.test module --------------------------------------------- - -.. automodule:: advection_nonuniform.problems.test - :members: - :undoc-members: - :show-inheritance: - -advection\_nonuniform\.problems\.tophat module ----------------------------------------------- - -.. automodule:: advection_nonuniform.problems.tophat - :members: - :undoc-members: - :show-inheritance: + :show-inheritance: \ No newline at end of file diff --git a/docs/source/advection_nonuniform_defaults.inc b/docs/source/advection_nonuniform_defaults.inc index 0c3f45025..fae8e84bf 100644 --- a/docs/source/advection_nonuniform_defaults.inc +++ b/docs/source/advection_nonuniform_defaults.inc @@ -28,3 +28,12 @@ | particle_generator | ``grid`` | | +----------------------------------+----------------+----------------------------------------------------+ +* section: [slotted] + + +----------------------------------+----------------+----------------------------------------------------+ + | option | value | description | + +==================================+================+====================================================+ + | omega | ``0.5`` | angular velocity | + +----------------------------------+----------------+----------------------------------------------------+ + | offset | ``0.25`` | offset of the slot's center from domain's center | + +----------------------------------+----------------+----------------------------------------------------+ diff --git a/paper/paper.md b/paper/paper.md index b54be8bb1..7e77f6a83 100644 --- a/paper/paper.md +++ b/paper/paper.md @@ -18,12 +18,16 @@ authors: - name: Ian Hawke orcid: 0000-0003-4805-0309 affiliation: 2 - +- name: Taher Chegini + orcid: 0000-0002-5430-6000 + affiliation: 3 affiliations: - name: Department of Physics and Astronomy, Stony Brook University index: 1 - name: University of Southampton index: 2 +- name: University of Houston + index: 3 date: 10 August 2018