Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add buoyant foam example tests #10

Merged
merged 16 commits into from
Feb 9, 2024

Conversation

hsaunders1904
Copy link
Contributor

@hsaunders1904 hsaunders1904 commented Oct 30, 2023

Summary

Adds the buoyantFoam examples to our automated test suite.

To run only the buoyantFoam tests:

./run_tests -C test/tests/buoyantFoam

Also in this PR: I've added groups/tags to the test definitions, so it's easier to filter tests when running them.

Checklist

  • Tests have been written for the new/changed behaviour.
  • Documentation/examples have been added/updated for the new changes.

This allows us to filter tests when we run them, e.g.,

  ./run_tests --group cube_slice --run test_3
The parallel test is currently failing, there seems to be some
difference between the serial and parallel version. Possibly just to do
with node ordering? The meshes look the same in paraview.
@hsaunders1904
Copy link
Contributor Author

hsaunders1904 commented Oct 30, 2023

Unfortunately, these tests fail. The serial and parallel versions give different results. We expect that the order of the nodes may not be preserved in the parallel version, but we are also seeing different temperatures.

import numpy as np
from netCDF4 import Dataset

ds_serial = Dataset("test/tests/buoyantFoam/buoyantFoam_serial/run_out.e")
ds_par = Dataset("test/tests/buoyantFoam/buoyantFoam_par/run_out.e")

print(ds_serial.variables["vals_nod_var3"][:].max())  # 303.13900450769205
print(ds_par.variables["vals_nod_var3"][:].max())  # 302.38041865733135

# x coordinates are the same, but in different orders
x_serial = ds_serial.variables["coordx"][:]
x_par =  ds_par.variables["coordx"][:]
print(x_serial[0:20])
# [0.         0.01085714 0.02171429 0.03257143 0.04342857 0.05428571
#  0.06514286 0.076      0.         0.01085714 0.02171429 0.03257143
#  0.04342857 0.05428571 0.06514286 0.076      0.         0.01085714
#  0.02171429 0.03257143]
print(x_par[0:20])
# [0.         0.01085714 0.02171429 0.03257143 0.         0.01085714
#  0.02171429 0.03257143 0.         0.01085714 0.02171429 0.03257143
#  0.         0.01085714 0.02171429 0.03257143 0.         0.01085714
#  0.02171429 0.03257143]
print(np.array_equal(np.sort(x_serial), np.sort(x_par)))  # True

@hsaunders1904 hsaunders1904 merged commit cfd430e into main Feb 9, 2024
1 check passed
@hsaunders1904 hsaunders1904 deleted the hsaunders1904/add_buoyantFoam_example_tests branch February 9, 2024 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant