Skip to content

Commit a143519

Browse files
authored
update the advection_fv4 solver to properly average initial conditions (#230)
this hooks the averaging into preevolve, just like we do with compressible_fv4
1 parent 92605af commit a143519

File tree

10 files changed

+364
-684
lines changed

10 files changed

+364
-684
lines changed

docs/source/advection-error.ipynb

Lines changed: 216 additions & 0 deletions
Large diffs are not rendered by default.

docs/source/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ new ideas.
6262
:caption: Examples
6363
:hidden:
6464

65+
advection-error.ipynb
6566
compressible-convergence.ipynb
6667

6768
.. toctree::

pyro/advection_fv4/problems

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../advection/problems

pyro/advection_fv4/problems/__init__.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

pyro/advection_fv4/problems/_smooth.defaults

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

pyro/advection_fv4/problems/inputs.smooth

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

pyro/advection_fv4/problems/smooth.py

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

pyro/advection_fv4/simulation.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,13 @@ def substep(self, myd):
5858
(F_y.v() - F_y.jp(1))/myg.dy
5959

6060
return k
61+
62+
def preevolve(self):
63+
"""Since we are 4th order accurate we need to make sure that we
64+
initialized with accurate zone-averages, so the preevolve for
65+
this solver assumes that the initialization was done to
66+
cell-centers and converts it to cell-averages."""
67+
68+
# we just initialized cell-centers, but we need to store averages
69+
for var in self.cc_data.names:
70+
self.cc_data.from_centers(var)
4.92 KB
Binary file not shown.

pyro/solver-test.ipynb

Lines changed: 136 additions & 595 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)