-
Notifications
You must be signed in to change notification settings - Fork 80
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
Conversation
…ies' into jafranc/feat/add-mobile-comp-stat
There was a problem hiding this 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/constitutive/relativePermeability/BrooksCoreyBakerRelativePermeability.cpp
Outdated
Show resolved
Hide resolved
src/coreComponents/constitutive/relativePermeability/BrooksCoreyBakerRelativePermeability.hpp
Outdated
Show resolved
Hide resolved
src/coreComponents/constitutive/relativePermeability/BrooksCoreyBakerRelativePermeability.hpp
Outdated
Show resolved
Hide resolved
src/coreComponents/constitutive/relativePermeability/RelativePermeabilityBase.cpp
Outdated
Show resolved
Hide resolved
src/coreComponents/constitutive/relativePermeability/RelativePermeabilityBase.cpp
Outdated
Show resolved
Hide resolved
src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseStatistics.cpp
Outdated
Show resolved
Hide resolved
src/coreComponents/physicsSolvers/fluidFlow/IsothermalCompositionalMultiphaseBaseKernels.hpp
Outdated
Show resolved
Hide resolved
src/coreComponents/physicsSolvers/fluidFlow/IsothermalCompositionalMultiphaseBaseKernels.hpp
Outdated
Show resolved
Hide resolved
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] ); | ||
} | ||
} ); | ||
} |
There was a problem hiding this comment.
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 ofphaseVolFraction
andphaseCriticalVolFraction
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.
There was a problem hiding this comment.
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.
…t' into jafranc/feat/add-mobile-comp-stat
…t' into jafranc/feat/add-mobile-comp-stat
# Conflicts: # src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseStatistics.cpp # src/coreComponents/physicsSolvers/fluidFlow/IsothermalCompositionalMultiphaseBaseKernels.hpp
This PR aims at adding trapped mass in the statistics output from
CompositionalMultiphaseStatistics
.It involves
m_phaseMinVolFraction
toRelativePermeabilityBase
with accessorm_phaseTrapped
anarray2d<real64, compflow::LAYOUT_PHASE>
to store per-element minimal critical saturationThis 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