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

Improve Poiseuille Test Case

parent cd627480
No related branches found
No related tags found
1 merge request!48Adds a convergence analysis test case that runs on Phoenix
......@@ -35,14 +35,9 @@ 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()
......@@ -58,8 +53,9 @@ class TestPoiseuilleFlow(unittest.TestCase):
runtime_params.number_of_timesteps = timesteps
kernel.forcing_in_x1 = forcing
self.assertLessEqual(l2_norm_results[1], l2_norm_results[0] / 2)
self.assertLessEqual(l2_norm_results[2], l2_norm_results[1] / 2)
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)
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]
......@@ -81,7 +77,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(physical_params, heights, grid_params.number_of_nodes_per_direction[2])
analytical_results = get_analytical_results(grid_params, physical_params, kernel, heights)
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