Skip to content

Commit

Permalink
Fix mixing kernel test, as well as change runtime of mixing kernel test
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeldenes committed Dec 4, 2024
1 parent 3e31feb commit feedda0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/test_kernels.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ def test_Stokes():

start_lons = pset.lon.copy()
start_lats = pset.lat.copy()
print(pset[0].dt)
pset.execute(kernels, runtime=settings['simulation']['runtime'], dt=settings['simulation']['dt'])

# Assert that the particles move from their initial location
Expand Down Expand Up @@ -226,8 +225,11 @@ def test_mixing():
pset = make_standard_particleset(fieldset, settings)
pset_mixing = make_standard_particleset(fieldset, settings)

# Because vertical mixing can vertically push the particle large distances, let's set the simulation time to 1 hour
settings['simulation']['runtime'] = timedelta(hours=1)

pset.execute(kernels, runtime=settings['simulation']['runtime'], dt=settings['simulation']['dt'])
pset.execute(kernels_mixing, runtime=settings['simulation']['runtime'], dt=settings['simulation']['dt'])
pset_mixing.execute(kernels_mixing, runtime=settings['simulation']['runtime'], dt=settings['simulation']['dt'])

# Assert that the particles move from their initial location
assert (np.sum(np.abs(pset.lon - pset_mixing.lon)) > 0.) & (np.sum(np.abs(pset.lat - pset_mixing.lat)) > 0.)

0 comments on commit feedda0

Please sign in to comment.