Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion advection_nonuniform/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
"""

__all__ = ['simulation']
from .simulation import *
from .simulation import Simulation
41 changes: 21 additions & 20 deletions advection_nonuniform/advective_fluxes.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,27 +78,27 @@ 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()
shift_y = my_data.get_var("y-shift").astype(int)

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
Expand All @@ -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

4 changes: 2 additions & 2 deletions advection_nonuniform/problems/_slotted.defaults
Original file line number Diff line number Diff line change
@@ -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
2 changes: 0 additions & 2 deletions advection_nonuniform/problems/_smooth.defaults

This file was deleted.

2 changes: 0 additions & 2 deletions advection_nonuniform/problems/_tophat.defaults

This file was deleted.

39 changes: 0 additions & 39 deletions advection_nonuniform/problems/inputs.smooth

This file was deleted.

34 changes: 0 additions & 34 deletions advection_nonuniform/problems/inputs.tophat

This file was deleted.

41 changes: 0 additions & 41 deletions advection_nonuniform/problems/smooth.py

This file was deleted.

45 changes: 0 additions & 45 deletions advection_nonuniform/problems/tophat.py

This file was deleted.

26 changes: 1 addition & 25 deletions docs/source/advection_nonuniform.problems.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:
9 changes: 9 additions & 0 deletions docs/source/advection_nonuniform_defaults.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
+----------------------------------+----------------+----------------------------------------------------+
6 changes: 5 additions & 1 deletion paper/paper.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down