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 energy conservation test #30

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

hsaunders1904
Copy link
Contributor

Summary

Adds a test to check that energy is conserved in a simple conjugate heat transfer problem. See the README in the test's directory for a description of the problem.

Checklist

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

This, for now, also includes some debugging code that plots the change
in energy over time.

This also extends the time for which the simulation is run.
@hsaunders1904
Copy link
Contributor Author

This test currently fails, I'm not completely sure what is causing the difference in the energies yet.

Here's the test failure:

======================================================================
FAIL: test_moose_and_foam_energy_deltas_are_equal (test.TestEnergyConservedInSimpleConductionExample)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../hippo/test/tests/multiapps/energy_conserved_in_simple_conduction_example/test.py", line 36, in test_moose_and_foam_energy_deltas_are_equal
    self.assertAlmostEqual(foam_de, -moose_de)
AssertionError: 238.70727749797516 != 222524.174114801 within 7 places (222285.466837303 difference)
----------------------------------------------------------------------
Ran 1 test in 0.500s

FAILED (failures=1)

There's some debugging code in the Python test script that plots the change in energy over time for each domain, the plots look like this:

image

The shapes of the curves look promisingly similar, but the scales are pretty off.

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