-
Notifications
You must be signed in to change notification settings - Fork 0
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
hsaunders1904
merged 16 commits into
main
from
hsaunders1904/add_buoyantFoam_example_tests
Feb 9, 2024
Merged
Add buoyant foam example tests #10
hsaunders1904
merged 16 commits into
main
from
hsaunders1904/add_buoyantFoam_example_tests
Feb 9, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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 |
Stops MOOSE moaning at me every time I run hippo.
Use different reference meshes for the serial and parallel tests, as OpenFOAM gives different answers. Relax the tolerance on the parallel test. This is OK for now, as we are planning to move away from setting values by node anyway.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Adds the buoyantFoam examples to our automated test suite.
To run only the
buoyantFoam
tests:Also in this PR: I've added groups/tags to the test definitions, so it's easier to filter tests when running them.
Checklist