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
39,872 changes: 39,872 additions & 0 deletions test/salinity/Levee_contamination_Density/Case_D/stored_mesh/levee_case_d.edge

Large diffs are not rendered by default.

26,413 changes: 26,413 additions & 0 deletions test/salinity/Levee_contamination_Density/Case_D/stored_mesh/levee_case_d.ele

Large diffs are not rendered by default.

13,462 changes: 13,462 additions & 0 deletions test/salinity/Levee_contamination_Density/Case_D/stored_mesh/levee_case_d.node

Large diffs are not rendered by default.

20 changes: 16 additions & 4 deletions test/salinity/test_vdft_compatible.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"""
import importlib
import os
import shutil
import sys

import numpy as np
Expand Down Expand Up @@ -56,7 +57,7 @@ def _run(so, pList, nList, name):
p.name = p.__name__
# the decks inherit genMesh from proteus.default_p, which other test modules set to False
# at collection (test/post_processing/import_modules/bdm_tests_3Dtemplate.py)
p.genMesh = True
p.genMesh = not getattr(p, 'stored_mesh', False)
so.sList = [default_s for p in pList]
ns = NumericalSolution.NS_base(so, pList, nList, so.sList, opts)
ns.calculateSolution(name)
Expand Down Expand Up @@ -120,7 +121,15 @@ def _check_budgets(transport, flow_atol, transport_atol):
@pytest.fixture
def levee_deck(tmp_path, monkeypatch):
monkeypatch.chdir(tmp_path)
# The mesh is stored, not generated: the external `triangle` of each environment (conda-forge on the Mac, on
# Linux, the PETSc-built one the fleet nightly puts first on PATH) makes a different mesh from the same .poly
# and options (26411, 26366 and 26312 elements), and the first dt of the explicit transport follows the mesh
# (0.192 s on the first, 0.249 s on the last). The files are triangle's output on the Mac, .1. removed.
for ext in ('node', 'ele', 'edge'):
shutil.copy(os.path.join(CASE_D, 'stored_mesh', 'levee_case_d.' + ext), tmp_path)
modules = _load(CASE_D, CASE_D_MODULES)
domain, rp, rn, tp, tn, so = modules
rp.stored_mesh = tp.stored_mesh = True # read by _run
yield modules
_unload(CASE_D_MODULES)

Expand Down Expand Up @@ -439,9 +448,12 @@ def second_preStep(self, t, firstStep=False):
_run(so, [rp, tp], [rn, tn], 'vdft_levee_first_dt_long')
assert np.finfo(float).eps / rn.nl_atol_res < seen['dt'] < 1.0e3, seen['dt']
c = seen['c']
# the first step is not bound-preserving: it takes the wetting front's fluxes (c = 4.5 after 0.19 s) that the
# CFL of the initial state could not see
assert -10.0 <= c.min() and c.max() <= 10.0, (c.min(), c.max(), seen['dt'])
# the first step is not bound-preserving: it takes the wetting front's fluxes that the CFL of the initial state
# could not see. Measured on the stored mesh (26411 elements, first dt 0.192 s): c in [0, 4.49] (SSP11),
# [-2.31, 9.51] (SSP33). The first dt follows the mesh (0.249 s on the 26312-element mesh of the PETSc-built
# triangle: c in [-7.33, 16.07] for SSP33), so the bound is set above both; the failure it guards against, the
# interval as the first dt, is c ~ 1e8.
assert -20.0 <= c.min() and c.max() <= 20.0, (c.min(), c.max(), seen['dt'])


def test_first_step_old_time_mass_is_at_the_coupled_density(levee_deck, monkeypatch):
Expand Down
6 changes: 6 additions & 0 deletions test/salinity/vdft_reproduce/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,12 @@ the code it needs: run-time switches as `Coefficients` options (`EDGE_VELOCITY`,

- **Flags.** Every deck with Richards `FCT=True` passes `FCT_BND_DIFF=True, FCT_BND_KRW=True`; without them the runs
differ from the manuscript's.
- **`BC_CONS=True`.** Every flow deck also passes `BC_CONS=True`. The authors' builds had the boundary-conservative
velocity ON by default (`RICHARDS_BC_CONS` unset meant on); proteus makes it opt-in (`Coefficients(BC_CONS=False)`), and it
changes the boundary velocity that the velocity-based transport coupling sees. Without it the UHD coupling rows of
`tab:uhd_coupling` (velocity-based, eos, Co 0.5: total 4.30 % instead of 1.81 %) and the bioswale step count on 2 ranks
(442 instead of 443) differ from the manuscript's. Henry and the MMS N = 40 case are not sensitive to it (identical to every printed digit);
the compatible (edge-flux) coupling is not affected.
- **Parallel.** `main` is partition independent (C0 rounds 2-3). 1.9.x is not: TADR's FCT limiter ratios are not
ghost-exchanged there, so a run on N ranks differs from the serial one by the partition effect Barua measured on
Zalesak's disk (0.077 at 4 ranks; Henry on 2 ranks differed from serial by 2.4e-9 on 1.9.x). Pin the partition (`PETSC_OPTIONS="-mat_partitioning_type current"`) when comparing rank counts,
Expand Down
1 change: 1 addition & 0 deletions test/salinity/vdft_reproduce/bioswale/Raingarden_p.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ def getSeepageFace(flag):
ENTROPY_TYPE=1,
LUMPED_MASS_MATRIX= False ,
FCT=True, FCT_BND_DIFF=True, FCT_BND_KRW=True, # Barua edge-flux runs: his FCT boundary block (both off by default since #173)
BC_CONS=True, # the authors' builds ran with the boundary-conservative velocity ON (RICHARDS_BC_CONS unset meant on); the velocity-based coupling needs it for the manuscript's numbers
num_fct_iter=0,
# FOR ENTROPY VISCOSITY
cE=1.0,
Expand Down
1 change: 1 addition & 0 deletions test/salinity/vdft_reproduce/elder/flow_p.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
ENTROPY_TYPE=1,
LUMPED_MASS_MATRIX=False,
FCT=True, FCT_BND_DIFF=True, FCT_BND_KRW=True, # Barua edge-flux runs: his FCT boundary block (both off by default since #173)
BC_CONS=True, # the authors' builds ran with the boundary-conservative velocity ON (RICHARDS_BC_CONS unset meant on); the velocity-based coupling needs it for the manuscript's numbers
# Richards FCT on, as in the UHD L4 runs
num_fct_iter=0,
cE=1.0,
Expand Down
1 change: 1 addition & 0 deletions test/salinity/vdft_reproduce/henry/flow_p.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
ENTROPY_TYPE=1,
LUMPED_MASS_MATRIX= False ,
FCT=True, FCT_BND_DIFF=True, FCT_BND_KRW=True, # Barua edge-flux runs: his FCT boundary block (both off by default since #173)
BC_CONS=True, # the authors' builds ran with the boundary-conservative velocity ON (RICHARDS_BC_CONS unset meant on); the velocity-based coupling needs it for the manuscript's numbers
#True,
num_fct_iter=0,
# FOR ENTROPY VISCOSITY
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
ENTROPY_TYPE=1,
LUMPED_MASS_MATRIX=False,
FCT=True, FCT_BND_DIFF=True, FCT_BND_KRW=True, # Barua edge-flux runs: his FCT boundary block (both off by default since #173)
BC_CONS=True, # the authors' builds ran with the boundary-conservative velocity ON (RICHARDS_BC_CONS unset meant on); the velocity-based coupling needs it for the manuscript's numbers
num_fct_iter=0,
cE=1.0,
uL=0.0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
ENTROPY_TYPE=1,
LUMPED_MASS_MATRIX=False,
FCT=True, FCT_BND_DIFF=True, FCT_BND_KRW=True, # Barua edge-flux runs: his FCT boundary block (both off by default since #173)
BC_CONS=True, # the authors' builds ran with the boundary-conservative velocity ON (RICHARDS_BC_CONS unset meant on); the velocity-based coupling needs it for the manuscript's numbers
num_fct_iter=0,
cE=1.0,
uL=0.0,
Expand Down
1 change: 1 addition & 0 deletions test/salinity/vdft_reproduce/mms/flow_p.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
ENTROPY_TYPE=1,
LUMPED_MASS_MATRIX=False,
FCT=FCT, FCT_BND_DIFF=True, FCT_BND_KRW=True, # Barua edge-flux runs: his FCT boundary block (both off by default since #173)
BC_CONS=True, # the authors' builds ran with the boundary-conservative velocity ON (RICHARDS_BC_CONS unset meant on); the velocity-based coupling needs it for the manuscript's numbers

num_fct_iter=0,
cE=1.0,
Expand Down
1 change: 1 addition & 0 deletions test/salinity/vdft_reproduce/simmons_uhd/flow_p.py
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,7 @@ def _restrict_seepage_face(self, mesh):
ENTROPY_TYPE=1,
LUMPED_MASS_MATRIX=False,
FCT=RICHARDS_FCT, FCT_BND_DIFF=True, FCT_BND_KRW=True, # Barua edge-flux runs: his FCT boundary block (both off by default since #173)
BC_CONS=True, # the authors' builds ran with the boundary-conservative velocity ON (RICHARDS_BC_CONS unset meant on); the velocity-based coupling needs it for the manuscript's numbers

num_fct_iter=0,
cE=1.0,
Expand Down
Loading