Skip to content

Fixed bug related to matching perforations to reservoir elements #1206

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

Merged
merged 3 commits into from
Jan 11, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/coreComponents/mesh/WellElementRegion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@ void WellElementRegion::GenerateWell( MeshLevel & mesh,

globalIndex const matchedPerforations = MpiWrapper::Sum( perforationData->size() );
GEOSX_ERROR_IF( matchedPerforations != numPerforationsGlobal,
"Invalid mapping perforation-to-element in well " << this->getName() );
"Invalid mapping perforation-to-element in well " << this->getName() << "." <<
" This happens when GEOSX cannot match a perforation with a reservoir element." <<
" The most common reason for this error is that a perforation is on a section of " <<
" the well polyline located outside the domain." );


// 2) classify well elements based on connectivity to local mesh partition
Expand Down
28 changes: 10 additions & 18 deletions src/coreComponents/mesh/WellElementSubRegion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,10 @@ void WellElementSubRegion::CheckPartitioningValidity( InternalWellGenerator cons
globalIndex const prevGlobal = prevElemIdsGlobal[iwelemGlobal][numBranches-1];

GEOSX_ERROR_IF( prevGlobal <= iwelemGlobal || prevGlobal < 0,
"Invalid partitioning in well " << getName() );
"The structure of well " << getName() << " is invalid. " <<
" The main reason for this error is that there may be no perforation" <<
" in the bottom well element of the well, which is required to have" <<
" a well-posed problem." );

if( elemStatusGlobal[prevGlobal] == WellElemStatus::LOCAL )
{
Expand Down Expand Up @@ -794,23 +797,12 @@ void WellElementSubRegion::ConnectPerforationsToMeshElements( MeshLevel & mesh,

// for each perforation, we have to find the reservoir element that contains the perforation

if( iperfLocal > 0 )
{
// get the info of the element matched with the previous perforation
// this will be used next to search around this reservoir element
erInit = m_perforationData.GetMeshElements().m_toElementRegion[iperfLocal-1];
esrInit = m_perforationData.GetMeshElements().m_toElementSubRegion[iperfLocal-1];
eiInit = m_perforationData.GetMeshElements().m_toElementIndex[iperfLocal-1];
}
else
{
// Step 1: first, we search for the reservoir element that is the *closest* from the center of well element
// note that this reservoir element does not necessarily contain the center of the well element
// this "init" reservoir element will be used in SearchLocalElements to find the reservoir element that
// contains the well element
InitializeLocalSearch( mesh, location,
erInit, esrInit, eiInit );
}
// Step 1: first, we search for the reservoir element that is the *closest* from the center of well element
// note that this reservoir element does not necessarily contain the center of the well element
// this "init" reservoir element will be used in SearchLocalElements to find the reservoir element that
// contains the well element
InitializeLocalSearch( mesh, location,
erInit, esrInit, eiInit );

// Step 2: then, search for the reservoir element that contains the well element
// to do that, we loop over the reservoir elements that are in the neighborhood of (erInit,esrInit,eiInit)
Expand Down