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

Link compositional fluid model to static function implementation #2879

Merged
merged 57 commits into from
May 7, 2024

Conversation

dkachuma
Copy link
Contributor

@dkachuma dkachuma commented Dec 8, 2023

Finalises the compositional fluid model implementation by linking to static function implementation

  • Changes derivative calculations to use multifluid::DerivativeOffset layout instead of separate variables.
  • Implements fugacity coefficient analytical derivatives in CubicEOSPhaseModel. Adds unit test to numerically test derivatives in testCubicEOS.
  • Adds analytical derivative calculation to NegativeTwoPhaseFlash. This calculates the derivatives of the calculated vapour fraction and also the liquid and vapour compositions. The idea is that the iterative flash is performed without derivatives and once this converges implicit differentiation is used to calculate the analytical derivatives at the converged solution. Unit tests are added to testNegativeTwoPhaseFlash to numerically verify the derivatives.
  • Links the static calculation functions for negative two-phase flash to the fluid model
  • Adds a utility for the cubic eos model to convert non-dimensional volume shift parameters to their dimensional form.
  • Links the compositional density static calculation functions to the compositional fluid model object.
  • Adds unit test for compositional density.
  • Adds an option to PVTDriver to output the mass density of each phase.
  • Implements the LBC viscosity calculation. Taken from Add Lohrenz-Bray-Clark viscosity correlation #1726
  • Adds unit tests for the LBC viscosity model.
  • Adds a PVT driver test for compositional two phase models.
  • Adds a constantPhaseViscosity xml entry for the PVTPackage CompositionalMultiphaseFluid. This allows the user to change the constant viscosity value for each phase.

Tasks still outstanding (to be done in follow up PRs)

  • xml schema changes. Need to allow the user the capability to change some parameters including
    • Flash parameters such as tolerances and iteration limits
    • Flag to select the mixing rule for LBC viscosity
    • Value of viscosity for each phase for the constant viscosity model
  • More unit tests for phase appearance/disappearance
  • Extend BlasLapackLA::solveLinearSystem to GPU.

@dkachuma dkachuma self-assigned this Dec 11, 2023
@dkachuma dkachuma mentioned this pull request Dec 18, 2023
24 tasks
@dkachuma dkachuma changed the title EOS and flash derivatives Link compositional fluid model to static function implementaion Jan 5, 2024
@dkachuma dkachuma marked this pull request as ready for review April 15, 2024 15:15
@dkachuma
Copy link
Contributor Author

hey @dkachuma, what's the status of this PR?

Now ready for review. It's quite large but hopefully localised.

@dkachuma dkachuma requested a review from paveltomin April 15, 2024 15:59
Copy link

codecov bot commented Apr 15, 2024

Codecov Report

Attention: Patch coverage is 91.75340% with 103 lines in your changes are missing coverage. Please review.

Project coverage is 53.72%. Comparing base (ddf3e97) to head (fd53199).

Files Patch % Lines
...positional/CompositionalMultiphaseFluidUpdates.hpp 0.00% 37 Missing ⚠️
...ompositional/models/NegativeTwoPhaseFlashModel.hpp 0.00% 18 Missing ⚠️
...uid/compositional/CompositionalMultiphaseFluid.cpp 5.88% 16 Missing ⚠️
...d/compositional/functions/KValueInitialization.hpp 0.00% 10 Missing ⚠️
...sitional/functions/CompositionalPropertiesImpl.hpp 73.68% 5 Missing ⚠️
...onents/constitutive/fluid/multifluid/PVTDriver.cpp 63.63% 4 Missing ⚠️
...compositional/models/LohrenzBrayClarkViscosity.hpp 88.23% 4 Missing ⚠️
...ompositional/models/NegativeTwoPhaseFlashModel.cpp 0.00% 4 Missing ⚠️
...constitutive/fluid/multifluid/PVTDriverRunTest.hpp 88.23% 2 Missing ⚠️
.../compositional/functions/NegativeTwoPhaseFlash.hpp 98.60% 2 Missing ⚠️
... and 1 more
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2879      +/-   ##
===========================================
+ Coverage    53.19%   53.72%   +0.52%     
===========================================
  Files          989      994       +5     
  Lines        83647    84688    +1041     
===========================================
+ Hits         44498    45499    +1001     
- Misses       39149    39189      +40     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@joshua-white joshua-white left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. A few minor cleanups have already been noted, but it will be easy to do these in smaller PRs.

@dkachuma dkachuma added ci: run CUDA builds Allows to triggers (costly) CUDA jobs flag: no rebaseline Does not require rebaseline type: feature New feature or request labels May 1, 2024
@paveltomin paveltomin merged commit 04cda6c into develop May 7, 2024
24 of 25 checks passed
@paveltomin paveltomin deleted the feature/dkachuma/eos-flash-derivatives branch May 7, 2024 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci: run CUDA builds Allows to triggers (costly) CUDA jobs flag: no rebaseline Does not require rebaseline flag: ready for review type: feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants