Skip to content

Commit 976e869

Browse files
authored
Merge pull request #71 from taataam/master
Cleaned up and added some new information
2 parents 2b85600 + ccfd7a4 commit 976e869

11 files changed

Lines changed: 38 additions & 211 deletions

File tree

advection_nonuniform/advective_fluxes.py

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -78,27 +78,27 @@ def unsplit_fluxes(my_data, rp, dt, scalar_name):
7878

7979
for index, vel in np.ndenumerate(u.v(buf=1)):
8080
if vel < 0:
81-
a_x.v(buf=1)[index] = a.ip(shift_x.v(buf=1)[index], buf=1)[index] - \
82-
0.5 * (1.0 + cx.v(buf=1)[index]) * \
83-
ldelta_ax.ip(shift_x.v(buf=1)[index], buf=1)[index]
81+
a_x.v(buf=1)[index] = a.ip(shift_x.v(buf=1)[index], buf=1)[index] \
82+
- 0.5*(1.0 + cx.v(buf=1)[index]) \
83+
* ldelta_ax.ip(shift_x.v(buf=1)[index], buf=1)[index]
8484
else:
85-
a_x.v(buf=1)[index] = a.ip(shift_x.v(buf=1)[index], buf=1)[index] + \
86-
0.5 * (1.0 - cx.v(buf=1)[index]) * \
87-
ldelta_ax.ip(shift_x.v(buf=1)[index], buf=1)[index]
85+
a_x.v(buf=1)[index] = a.ip(shift_x.v(buf=1)[index], buf=1)[index] \
86+
+ 0.5*(1.0 - cx.v(buf=1)[index]) \
87+
* ldelta_ax.ip(shift_x.v(buf=1)[index], buf=1)[index]
8888

8989
# upwind in y-direction
9090
a_y = myg.scratch_array()
9191
shift_y = my_data.get_var("y-shift").astype(int)
9292

9393
for index, vel in np.ndenumerate(v.v(buf=1)):
9494
if vel < 0:
95-
a_y.v(buf=1)[index] = a.jp(shift_y.v(buf=1)[index], buf=1)[index] - \
96-
0.5 * (1.0 + cy.v(buf=1)[index]) * \
97-
ldelta_ay.jp(shift_y.v(buf=1)[index], buf=1)[index]
95+
a_y.v(buf=1)[index] = a.jp(shift_y.v(buf=1)[index], buf=1)[index] \
96+
- 0.5*(1.0 + cy.v(buf=1)[index]) \
97+
* ldelta_ay.jp(shift_y.v(buf=1)[index], buf=1)[index]
9898
else:
99-
a_y.v(buf=1)[index] = a.jp(shift_y.v(buf=1)[index], buf=1)[index] + \
100-
0.5 * (1.0 - cy.v(buf=1)[index]) * \
101-
ldelta_ay.jp(shift_y.v(buf=1)[index], buf=1)[index]
99+
a_y.v(buf=1)[index] = a.jp(shift_y.v(buf=1)[index], buf=1)[index] \
100+
+ 0.5*(1.0 - cy.v(buf=1)[index]) \
101+
* ldelta_ay.jp(shift_y.v(buf=1)[index], buf=1)[index]
102102

103103
# compute the transverse flux differences. The flux is just (u a)
104104
# HOTF
@@ -110,17 +110,18 @@ def unsplit_fluxes(my_data, rp, dt, scalar_name):
110110

111111
# the zone where we grab the transverse flux derivative from
112112
# depends on the sign of the advective velocity
113-
dtdx2 = 0.5 * dt / myg.dx
114-
dtdy2 = 0.5 * dt / myg.dy
113+
dtdx2 = 0.5*dt/myg.dx
114+
dtdy2 = 0.5*dt/myg.dy
115115

116116
for index, vel in np.ndenumerate(u.v(buf=1)):
117-
F_x.v(buf=1)[index] = vel * (a_x.v(buf=1)[index] -
118-
dtdy2 * (F_yt.ip_jp(shift_x.v(buf=1)[index], 1, buf=1)[index] -
119-
F_yt.ip(shift_x.v(buf=1)[index], buf=1)[index]))
117+
F_x.v(buf=1)[index] = vel * (a_x.v(buf=1)[index] - dtdy2
118+
* (F_yt.ip_jp(shift_x.v(buf=1)[index], 1, buf=1)[index]
119+
- F_yt.ip(shift_x.v(buf=1)[index], buf=1)[index]))
120120

121121
for index, vel in np.ndenumerate(v.v(buf=1)):
122-
F_y.v(buf=1)[index] = vel * (a_y.v(buf=1)[index] -
123-
dtdx2 * (F_xt.ip_jp(1, shift_y.v(buf=1)[index], buf=1)[index] -
124-
F_xt.jp(shift_y.v(buf=1)[index], buf=1)[index]))
122+
F_y.v(buf=1)[index] = vel * (a_y.v(buf=1)[index] - dtdx2
123+
* (F_xt.ip_jp(1, shift_y.v(buf=1)[index], buf=1)[index]
124+
- F_xt.jp(shift_y.v(buf=1)[index], buf=1)[index]))
125125

126126
return F_x, F_y
127+
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[slotted]
2-
omega = 0.5 ;angular velocity
3-
offset = 0.25 ;offset of the slot center from domain center
2+
omega = 0.5 ;angular velocity
3+
offset = 0.25 ;offset of the slot center from domain center

advection_nonuniform/problems/_smooth.defaults

Lines changed: 0 additions & 2 deletions
This file was deleted.

advection_nonuniform/problems/_tophat.defaults

Lines changed: 0 additions & 2 deletions
This file was deleted.

advection_nonuniform/problems/inputs.smooth

Lines changed: 0 additions & 39 deletions
This file was deleted.

advection_nonuniform/problems/inputs.tophat

Lines changed: 0 additions & 34 deletions
This file was deleted.

advection_nonuniform/problems/smooth.py

Lines changed: 0 additions & 41 deletions
This file was deleted.

advection_nonuniform/problems/tophat.py

Lines changed: 0 additions & 45 deletions
This file was deleted.

docs/source/advection_nonuniform.problems.rst

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -15,28 +15,4 @@ advection\_nonuniform\.problems\.slotted module
1515
.. automodule:: advection_nonuniform.problems.slotted
1616
:members:
1717
:undoc-members:
18-
:show-inheritance:
19-
20-
advection\_nonuniform\.problems\.smooth module
21-
----------------------------------------------
22-
23-
.. automodule:: advection_nonuniform.problems.smooth
24-
:members:
25-
:undoc-members:
26-
:show-inheritance:
27-
28-
advection\_nonuniform\.problems\.test module
29-
--------------------------------------------
30-
31-
.. automodule:: advection_nonuniform.problems.test
32-
:members:
33-
:undoc-members:
34-
:show-inheritance:
35-
36-
advection\_nonuniform\.problems\.tophat module
37-
----------------------------------------------
38-
39-
.. automodule:: advection_nonuniform.problems.tophat
40-
:members:
41-
:undoc-members:
42-
:show-inheritance:
18+
:show-inheritance:

docs/source/advection_nonuniform_defaults.inc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,12 @@
2828
| particle_generator | ``grid`` | |
2929
+----------------------------------+----------------+----------------------------------------------------+
3030

31+
* section: [slotted]
32+
33+
+----------------------------------+----------------+----------------------------------------------------+
34+
| option | value | description |
35+
+==================================+================+====================================================+
36+
| omega | ``0.5`` | angular velocity |
37+
+----------------------------------+----------------+----------------------------------------------------+
38+
| offset | ``0.25`` | offset of the slot's center from domain's center |
39+
+----------------------------------+----------------+----------------------------------------------------+

0 commit comments

Comments
 (0)