Skip to content

Conversation

tjb-ltk
Copy link
Contributor

@tjb-ltk tjb-ltk commented Sep 23, 2025

Reservoir volume constraint needs region average quantities for computing fluid properties. The ave quantities are computed via tasks such as CompositionalMultiphaseStatistics (and SinglePhaseStatistics equivalent) that are triggered in event section
Previously validation attempted to check if compute statistics wrappers were present on region. This was incorrect. but maybe the region should own the statistics object.

New check looks at if region ave quantities are zero.

integrated tests are forthcoming..

Copy link
Contributor

@MelReyCG MelReyCG left a comment

Choose a reason for hiding this comment

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

Maybe, to not expose the statistics component to the user, you can add in the well solver's registerDataOnMesh():

if( !wellControls.referenceReservoirRegion().empty() )
{
  // we need a statistics component for reference region pressure
  m_referenceRegionStats = taskManager.registerGroup<SinglePhaseStatistics>( "internalStats" )
    .setRestartFlags(NO_WRITE);
  m_referenceRegionStats.registerDataOnMeshRecursive(meshBodies);
}

m_referenceRegionStats would be a pointer or an std::optional, then you can call its execute() before reading it in updateVolRateForConstraint()

}

void CompositionalMultiphaseWell::updateVolRatesForConstraint( WellElementSubRegion & subRegion )
void CompositionalMultiphaseWell::updateVolRatesForConstraint( ElementRegionManager const & elemManager, WellElementSubRegion & subRegion )
Copy link
Contributor

Choose a reason for hiding this comment

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

(same for SinglePhaseWell)

Suggested change
void CompositionalMultiphaseWell::updateVolRatesForConstraint( ElementRegionManager const & elemManager, WellElementSubRegion & subRegion )
void CompositionalMultiphaseWell::updateVolRatesForConstraint( ElementRegionManager const & elemManager,
WellElementSubRegion & subRegion )

* @param targetIndex the targetIndex of the subRegion
*/
void updateVolRatesForConstraint( WellElementSubRegion & subRegion );
void updateVolRatesForConstraint( ElementRegionManager const & elemManager, WellElementSubRegion & subRegion );
Copy link
Contributor

Choose a reason for hiding this comment

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

(same for SinglePhaseWell)

Suggested change
void updateVolRatesForConstraint( ElementRegionManager const & elemManager, WellElementSubRegion & subRegion );
void updateVolRatesForConstraint( ElementRegionManager const & elemManager,
WellElementSubRegion & subRegion );

@MelReyCG
Copy link
Contributor

We are testing the current state of the branch

@MelReyCG
Copy link
Contributor

No success. I'll create a branch / PR on top of this one to contribute on this issue

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.

2 participants