Skip to content

Commit 4688744

Browse files
committed
Added test for vertical profile computation in RBC
1 parent 271ca6a commit 4688744

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

pySDC/tests/test_problems/test_RayleighBenard3D.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,25 @@ def test_spectrum_computation(mpi_ranks):
398398
assert xp.allclose(spectrum[iu, :, 0], 0)
399399

400400

401+
@pytest.mark.mpi4py
402+
def test_vertical_profiles():
403+
from pySDC.implementations.problem_classes.RayleighBenard3D import RayleighBenard3D
404+
405+
N = 4
406+
prob = RayleighBenard3D(nx=N, ny=N, nz=4, dealiasing=1.0, spectral_space=False, Rayleigh=1.0)
407+
xp = prob.xp
408+
iu, iv = prob.index(['u', 'v'])
409+
X, Y, Z = prob.X, prob.Y, prob.Z
410+
z = Z[0, 0]
411+
412+
u = prob.u_init_physical
413+
u[iu] = (Z**2) * (1 + xp.sin(X * 2 * xp.pi / prob.Lx) + xp.sin(Y * 2 * xp.pi / prob.Ly))
414+
expect = z**2
415+
416+
profile = prob.get_vertical_profiles(u, 'u')
417+
assert xp.allclose(expect, profile['u'])
418+
419+
401420
if __name__ == '__main__':
402421
# test_eval_f(2**2, 2**1, 'x', False)
403422
# test_libraries()
@@ -406,5 +425,6 @@ def test_spectrum_computation(mpi_ranks):
406425
# test_solver_convergence('bicgstab+ilu', 32, False, True)
407426
# test_banded_matrix(False)
408427
# test_heterogeneous_implementation()
409-
test_Nusselt_number_computation(N=6, c=3)
428+
# test_Nusselt_number_computation(N=6, c=3)
429+
test_vertical_profiles()
410430
# test_spectrum_computation(None)

0 commit comments

Comments
 (0)