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

Adding trapped mass as output from compositional statistics #2052

Merged
merged 25 commits into from
Sep 15, 2022

Conversation

jafranc
Copy link
Contributor

@jafranc jafranc commented Sep 7, 2022

This PR aims at adding trapped mass in the statistics output from CompositionalMultiphaseStatistics.

It involves

  • moving up m_phaseMinVolFraction to RelativePermeabilityBase with accessor
  • adding m_phaseTrapped an array2d<real64, compflow::LAYOUT_PHASE> to store per-element minimal critical saturation

This last step is needed as for hysteretic relperm minimal critical saturation is not global to the domain.

Rebaseline done in https://github.com/GEOSX/integratedTests/pull/260

@jafranc jafranc self-assigned this Sep 7, 2022
@jafranc jafranc added the type: feature New feature or request label Sep 8, 2022
Copy link
Contributor

@francoishamon francoishamon left a comment

Choose a reason for hiding this comment

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

Thanks very much @jafranc this is very useful! I just made the cosmetic comments about naming that we discussed today. Let me know when you need a rebaseline.

src/coreComponents/schema/docs/LinearSolverParameters.rst Outdated Show resolved Hide resolved
Comment on lines 630 to 645
void TableRelativePermeabilityHysteresis::updateTrappedPhaseVolFraction( arrayView2d< real64 const, compflow::USD_PHASE > const & phaseVolFraction ) const
{

arrayView2d< real64, compflow::USD_PHASE > phaseTrapped = m_phaseTrapped.toView();
arrayView2d< real64, compflow::USD_PHASE > phaseCrit = m_phaseCriticalVolFraction.toView();

localIndex const numElems = phaseVolFraction.size( 0 );
integer const numPhases = numFluidPhases();
forAll< parallelDevicePolicy<> >( numElems, [=] GEOSX_HOST_DEVICE ( localIndex const ei ) {
for( integer ip = 0; ip < numPhases; ++ip )
{
phaseTrapped[ei][ip] = LvArray::math::min( phaseVolFraction[ei][ip],
phaseCrit[ei][ip] );
}
} );
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I have a suggestion to save an array2d (but I may be wrong).

Currently:

  • You compute phaseCriticalVolFraction in the hysteretic kernels
  • At the end of the time step, you call updateTrappedPhaseVolFraction to take the min of phaseVolFraction and phaseCriticalVolFraction

Instead, would it be possible to do the following:

  • You remove phaseCriticalVolFraction from the classes
  • You pass phaseTrappedVolFraction to the hysteretic kernels
  • Inside them, you compute and use Scrt as before
  • At the end of the hysteretic kernels, you do: phaseTrappedVolFraction = min( S, Scrt )
  • You remove updateTrappedPhaseVolFraction

but I may be missing something.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great idea ! should be done in 8052c80.

It might not be ideal as it implies quite some code duplication over the compute() functions of all relperm classes.
I tried though to have compute() pure virtual in relativePermeabilityBase instead of update and use update to trigger compute() and updateTrappedVolFrac() but bump into the change of interface of compute() for TableRelativePermeabilityHysteresis. That would imply using some adaptation I guess.

We might save that for future refactoring if the idea was worth pursuing.

@jafranc jafranc marked this pull request as ready for review September 9, 2022 21:50
jacques and others added 3 commits September 14, 2022 15:30
# Conflicts:
#	src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseStatistics.cpp
#	src/coreComponents/physicsSolvers/fluidFlow/IsothermalCompositionalMultiphaseBaseKernels.hpp
@francoishamon francoishamon added flag: requires rebaseline Requires rebaseline branch in integratedTests ci: run CUDA builds Allows to triggers (costly) CUDA jobs and removed flag: ready for review labels Sep 15, 2022
@francoishamon francoishamon merged commit 15d221c into develop Sep 15, 2022
@francoishamon francoishamon deleted the jafranc/feat/add-mobile-comp-stat branch September 15, 2022 18:08
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: requires rebaseline Requires rebaseline branch in integratedTests type: feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants