Skip to content
Snippets Groups Projects
Commit b7debd04 authored by Sven Marcus's avatar Sven Marcus
Browse files

Finish Poiseuille Test

parent 633d6961
No related branches found
No related tags found
1 merge request!48Adds a convergence analysis test case that runs on Phoenix
......@@ -30,9 +30,14 @@ class TestPoiseuilleFlow(unittest.TestCase):
self.viscosities)
def test_poiseuille_flow(self):
self.skipTest("This test is not implemented correctly yet")
plt.ion()
channel_height = 10
number_of_nodes = [16, 32, 64]
number_of_timesteps = [40_000, 80_000, 160_000]
viscosities = [5e-3, 1e-2, 2e-2]
l2_norm_results = []
physical_params = PhysicalParameters()
runtime_params = RuntimeParameters()
......@@ -48,9 +53,8 @@ class TestPoiseuilleFlow(unittest.TestCase):
runtime_params.number_of_timesteps = timesteps
kernel.forcing_in_x1 = forcing
grid_params = create_grid_params_with_nodes_in_column(nodes, delta_x)
l2_error = get_l2_error_for_simulation(grid_params, physical_params, runtime_params, kernel)
normalized_l2_errors.append(l2_error)
self.assertLessEqual(l2_norm_results[1], l2_norm_results[0] / 2)
self.assertLessEqual(l2_norm_results[2], l2_norm_results[1] / 2)
nodes_as_log = [np.log10(node) for node in self.number_of_nodes]
l2_norms_as_log = [np.log10(l2) for l2 in normalized_l2_errors]
......@@ -72,7 +76,7 @@ def get_l2_error_for_simulation(grid_params, physical_params, runtime_params, ke
heights = get_heights(output_folder, runtime_params)
numerical_results = get_numerical_results(runtime_params, output_folder)
analytical_results = get_analytical_results(grid_params, physical_params, kernel, heights)
analytical_results = get_analytical_results(physical_params, heights, grid_params.number_of_nodes_per_direction[2])
plt.plot(heights, numerical_results)
plt.plot(heights, analytical_results)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment