GEOS-DEV / GEOS

GEOS Simulation Framework
GNU Lesser General Public License v2.1
203 stars 80 forks source link

Break up multi fluid test #3140

Closed dkachuma closed 3 weeks ago

dkachuma commented 1 month ago

This PR breaks up the testMultiFluid unit test. This test does a full fluid update call and tests the obtained values of fluid properties against expected values. It also does numerical derivative checks at selected fluid conditions (pressure, temperature and composition).

This test was getting larger and taking longer to build especially with CUDA. Instead of having all the fluid types in one test, this is now broken up into different tests for the different multiphase fluid types. The common part is factored out into the MultiFluidTest test fixture.

The numerical derivative tests in this case were not active because a very large absolute tolerance was used (see #2876). These are now activated for most of the fluid types. As a consequence, a fix on the temperature derivative was required in EzrokhiBrineDensity.hpp. The tests are not activated for the CompositionalMultiphaseFluidPVTPackage because this already uses finite differences to calculate derivatives and for some of the test compositions, it is actually unable to give reliable values (the package itself needs updating).

The inclusion of testCompFlowUtils.hpp in constitutiveTestHelpers.hpp was pulling in too many include files into the compilation of thee tests. The methods required for the multiphase fluid tests have now been moved to a smaller include testFlowUtils.hpp.

This will likely require a rebaseline due to the change in the Ezrokhi density derivative.

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 53.74%. Comparing base (010fc34) to head (b952b80).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #3140 +/- ## =========================================== - Coverage 53.77% 53.74% -0.03% =========================================== Files 1011 1016 +5 Lines 85816 85756 -60 =========================================== - Hits 46146 46090 -56 + Misses 39670 39666 -4 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

dkachuma commented 3 weeks ago

The fix to the derivative in EzrokhiBrineDensity has changed the response in class09_pb3_smoke_3d. The change in pressure is slightly different and quite expected. I would say a rebaseline is OK.

Error: /Problem/domain/MeshBodies/mesh1/meshLevels/Level0/ElementRegions/elementRegionsGroup/reservoir/elementSubRegions/1_hexahedra/deltaPressure
    Arrays of types float64 and float64 have 125 values of which 8 fail both the relative and absolute tests.
        Max absolute difference is at index (107,): value = 15333.86215468496, base_value = 15333.859636742622
        Max relative difference is at index (56,): value = 43.7011882327497, base_value = 43.70022329688072