mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3269 Compdat Export Performance : Use const access for fracture export
This commit is contained in:
parent
59b8d257cb
commit
bfcbb2132d
@ -63,7 +63,7 @@ std::vector<RigCompletionData> RicExportFractureCompletionsImpl::generateCompdat
|
|||||||
std::vector<RicWellPathFractureReportItem>* fractureDataForReport,
|
std::vector<RicWellPathFractureReportItem>* fractureDataForReport,
|
||||||
QTextStream* outputStreamForIntermediateResultsText)
|
QTextStream* outputStreamForIntermediateResultsText)
|
||||||
{
|
{
|
||||||
std::vector<RimFracture*> fracturesAlongWellPath;
|
std::vector<const RimFracture*> fracturesAlongWellPath;
|
||||||
|
|
||||||
if (wellPath->fractureCollection()->isChecked())
|
if (wellPath->fractureCollection()->isChecked())
|
||||||
{
|
{
|
||||||
@ -100,7 +100,7 @@ std::vector<RigCompletionData>
|
|||||||
|
|
||||||
for (size_t branchIndex = 0; branchIndex < branches.size(); ++branchIndex)
|
for (size_t branchIndex = 0; branchIndex < branches.size(); ++branchIndex)
|
||||||
{
|
{
|
||||||
std::vector<RimFracture*> fractures;
|
std::vector<const RimFracture*> fractures;
|
||||||
for (RimSimWellFracture* fracture : well->simwellFractureCollection->simwellFractures())
|
for (RimSimWellFracture* fracture : well->simwellFractureCollection->simwellFractures())
|
||||||
{
|
{
|
||||||
if (fracture->isChecked() && static_cast<size_t>(fracture->branchIndex()) == branchIndex)
|
if (fracture->isChecked() && static_cast<size_t>(fracture->branchIndex()) == branchIndex)
|
||||||
@ -125,7 +125,7 @@ std::vector<RigCompletionData>
|
|||||||
RicExportFractureCompletionsImpl::generateCompdatValues(RimEclipseCase* caseToApply,
|
RicExportFractureCompletionsImpl::generateCompdatValues(RimEclipseCase* caseToApply,
|
||||||
const QString& wellPathName,
|
const QString& wellPathName,
|
||||||
const RigWellPath* wellPathGeometry,
|
const RigWellPath* wellPathGeometry,
|
||||||
const std::vector<RimFracture*>& fractures,
|
const std::vector<const RimFracture*>& fractures,
|
||||||
std::vector<RicWellPathFractureReportItem>* fractureDataReportItems,
|
std::vector<RicWellPathFractureReportItem>* fractureDataReportItems,
|
||||||
QTextStream* outputStreamForIntermediateResultsText)
|
QTextStream* outputStreamForIntermediateResultsText)
|
||||||
{
|
{
|
||||||
@ -136,16 +136,6 @@ std::vector<RigCompletionData>
|
|||||||
return fractureCompletions;
|
return fractureCompletions;
|
||||||
}
|
}
|
||||||
|
|
||||||
double cDarcyInCorrectUnit = RiaEclipseUnitTools::darcysConstant(caseToApply->eclipseCaseData()->unitsType());
|
|
||||||
const RigMainGrid* mainGrid = caseToApply->eclipseCaseData()->mainGrid();
|
|
||||||
|
|
||||||
// To handle several fractures in the same eclipse cell we need to keep track of the transmissibility
|
|
||||||
// to the well from each fracture intersecting the cell and sum these transmissibilities at the end.
|
|
||||||
// std::map <eclipseCellIndex ,map< fracture, trans> >
|
|
||||||
// std::map<size_t, std::map<const RimFracture*, double>> eclCellIdxToTransPrFractureMap;
|
|
||||||
|
|
||||||
std::vector<std::vector<RigCompletionData>> sharedComplForFracture(fractures.size());
|
|
||||||
|
|
||||||
{
|
{
|
||||||
// Load the data required by computations to be able to use const access only inside OpenMP loop
|
// Load the data required by computations to be able to use const access only inside OpenMP loop
|
||||||
|
|
||||||
@ -182,12 +172,43 @@ std::vector<RigCompletionData>
|
|||||||
caseToApply->loadStaticResultsByName(resultNames);
|
caseToApply->loadStaticResultsByName(resultNames);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return generateCompdatValuesConst(caseToApply, wellPathName, wellPathGeometry, fractures, fractureDataReportItems, outputStreamForIntermediateResultsText);
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
std::vector<RigCompletionData> RicExportFractureCompletionsImpl::generateCompdatValuesConst(
|
||||||
|
const RimEclipseCase* caseToApply,
|
||||||
|
const QString& wellPathName,
|
||||||
|
const RigWellPath* wellPathGeometry,
|
||||||
|
const std::vector<const RimFracture*>& fractures,
|
||||||
|
std::vector<RicWellPathFractureReportItem>* fractureDataReportItems,
|
||||||
|
QTextStream* outputStreamForIntermediateResultsText)
|
||||||
|
{
|
||||||
|
std::vector<RigCompletionData> fractureCompletions;
|
||||||
|
|
||||||
|
if (!caseToApply || !caseToApply->eclipseCaseData())
|
||||||
|
{
|
||||||
|
return fractureCompletions;
|
||||||
|
}
|
||||||
|
|
||||||
|
double cDarcyInCorrectUnit = RiaEclipseUnitTools::darcysConstant(caseToApply->eclipseCaseData()->unitsType());
|
||||||
|
const RigMainGrid* mainGrid = caseToApply->eclipseCaseData()->mainGrid();
|
||||||
|
|
||||||
|
// To handle several fractures in the same eclipse cell we need to keep track of the transmissibility
|
||||||
|
// to the well from each fracture intersecting the cell and sum these transmissibilities at the end.
|
||||||
|
// std::map <eclipseCellIndex ,map< fracture, trans> >
|
||||||
|
// std::map<size_t, std::map<const RimFracture*, double>> eclCellIdxToTransPrFractureMap;
|
||||||
|
|
||||||
|
std::vector<std::vector<RigCompletionData>> sharedComplForFracture(fractures.size());
|
||||||
|
|
||||||
// Temporarily commented out due to sync problems. Needs more analysis
|
// Temporarily commented out due to sync problems. Needs more analysis
|
||||||
//#pragma omp parallel for
|
//#pragma omp parallel for
|
||||||
for (int i = 0; i < (int)fractures.size(); i++)
|
for (int i = 0; i < (int)fractures.size(); i++)
|
||||||
{
|
{
|
||||||
RimFracture* fracture = fractures[i];
|
const RimFracture* fracture = fractures[i];
|
||||||
RimFractureTemplate* fracTemplate = fracture->fractureTemplate();
|
const RimFractureTemplate* fracTemplate = fracture->fractureTemplate();
|
||||||
|
|
||||||
if (!fracTemplate) continue;
|
if (!fracTemplate) continue;
|
||||||
|
|
||||||
@ -199,9 +220,9 @@ std::vector<RigCompletionData>
|
|||||||
// If finite cond chosen and conductivity not present in stimplan file, do not calculate trans for this fracture
|
// If finite cond chosen and conductivity not present in stimplan file, do not calculate trans for this fracture
|
||||||
if (useFiniteConductivityInFracture)
|
if (useFiniteConductivityInFracture)
|
||||||
{
|
{
|
||||||
if (dynamic_cast<RimStimPlanFractureTemplate*>(fracTemplate))
|
auto fracTemplateStimPlan = dynamic_cast<const RimStimPlanFractureTemplate*>(fracTemplate);
|
||||||
|
if (fracTemplateStimPlan)
|
||||||
{
|
{
|
||||||
RimStimPlanFractureTemplate* fracTemplateStimPlan = dynamic_cast<RimStimPlanFractureTemplate*>(fracTemplate);
|
|
||||||
if (!fracTemplateStimPlan->hasConductivity())
|
if (!fracTemplateStimPlan->hasConductivity())
|
||||||
{
|
{
|
||||||
RiaLogging::error("Trying to export completion data for stimPlan fracture without conductivity data for " +
|
RiaLogging::error("Trying to export completion data for stimPlan fracture without conductivity data for " +
|
||||||
@ -428,7 +449,7 @@ std::vector<RigCompletionData>
|
|||||||
double height = 0.0;
|
double height = 0.0;
|
||||||
double halfLength = 0.0;
|
double halfLength = 0.0;
|
||||||
{
|
{
|
||||||
auto* ellipseTemplate = dynamic_cast<RimEllipseFractureTemplate*>(fracTemplate);
|
auto* ellipseTemplate = dynamic_cast<const RimEllipseFractureTemplate*>(fracTemplate);
|
||||||
if (ellipseTemplate)
|
if (ellipseTemplate)
|
||||||
{
|
{
|
||||||
conductivity = ellipseTemplate->conductivity();
|
conductivity = ellipseTemplate->conductivity();
|
||||||
@ -437,7 +458,7 @@ std::vector<RigCompletionData>
|
|||||||
halfLength = ellipseTemplate->halfLength();
|
halfLength = ellipseTemplate->halfLength();
|
||||||
}
|
}
|
||||||
|
|
||||||
auto* stimplanTemplate = dynamic_cast<RimStimPlanFractureTemplate*>(fracTemplate);
|
auto* stimplanTemplate = dynamic_cast<const RimStimPlanFractureTemplate*>(fracTemplate);
|
||||||
if (stimplanTemplate)
|
if (stimplanTemplate)
|
||||||
{
|
{
|
||||||
conductivity = stimplanTemplate->areaWeightedConductivity();
|
conductivity = stimplanTemplate->areaWeightedConductivity();
|
||||||
|
@ -47,10 +47,20 @@ public:
|
|||||||
const RimSimWellInView* well,
|
const RimSimWellInView* well,
|
||||||
QTextStream* outputStreamForIntermediateResultsText);
|
QTextStream* outputStreamForIntermediateResultsText);
|
||||||
|
|
||||||
static std::vector<RigCompletionData> generateCompdatValues(RimEclipseCase* caseToApply,
|
static std::vector<RigCompletionData>
|
||||||
|
generateCompdatValues(RimEclipseCase* caseToApply,
|
||||||
const QString& wellPathName,
|
const QString& wellPathName,
|
||||||
const RigWellPath* wellPathGeometry,
|
const RigWellPath* wellPathGeometry,
|
||||||
const std::vector<RimFracture*>& fractures,
|
const std::vector<const RimFracture*>& fractures,
|
||||||
std::vector<RicWellPathFractureReportItem>* fractureDataForReport,
|
std::vector<RicWellPathFractureReportItem>* fractureDataReportItems,
|
||||||
|
QTextStream* outputStreamForIntermediateResultsText);
|
||||||
|
|
||||||
|
private:
|
||||||
|
static std::vector<RigCompletionData>
|
||||||
|
generateCompdatValuesConst(const RimEclipseCase* caseToApply,
|
||||||
|
const QString& wellPathName,
|
||||||
|
const RigWellPath* wellPathGeometry,
|
||||||
|
const std::vector<const RimFracture*>& fractures,
|
||||||
|
std::vector<RicWellPathFractureReportItem>* fractureDataReportItems,
|
||||||
QTextStream* outputStreamForIntermediateResultsText);
|
QTextStream* outputStreamForIntermediateResultsText);
|
||||||
};
|
};
|
||||||
|
@ -484,8 +484,8 @@ void RicWellPathExportCompletionDataFeatureImpl::generateWelsegsTable(RifEclipse
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
generateWelsegsSegments(formatter, exportInfo, { RigCompletionData::ICD, RigCompletionData::FISHBONES});
|
generateWelsegsSegments(formatter, exportInfo, {RigCompletionData::ICD, RigCompletionData::FISHBONES});
|
||||||
generateWelsegsSegments(formatter, exportInfo, { RigCompletionData::FRACTURE });
|
generateWelsegsSegments(formatter, exportInfo, {RigCompletionData::FRACTURE});
|
||||||
}
|
}
|
||||||
|
|
||||||
formatter.tableCompleted();
|
formatter.tableCompleted();
|
||||||
@ -574,7 +574,9 @@ void RicWellPathExportCompletionDataFeatureImpl::generateWelsegsSegments(
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RicWellPathExportCompletionDataFeatureImpl::generateWelsegsCompletionCommentHeader(RifEclipseDataTableFormatter &formatter, RigCompletionData::CompletionType completionType)
|
void RicWellPathExportCompletionDataFeatureImpl::generateWelsegsCompletionCommentHeader(
|
||||||
|
RifEclipseDataTableFormatter& formatter,
|
||||||
|
RigCompletionData::CompletionType completionType)
|
||||||
{
|
{
|
||||||
if (completionType == RigCompletionData::CT_UNDEFINED)
|
if (completionType == RigCompletionData::CT_UNDEFINED)
|
||||||
{
|
{
|
||||||
@ -606,7 +608,7 @@ void RicWellPathExportCompletionDataFeatureImpl::generateCompsegTables(RifEclips
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
{
|
{
|
||||||
std::set<RigCompletionData::CompletionType> fishbonesTypes = { RigCompletionData::ICD, RigCompletionData::FISHBONES };
|
std::set<RigCompletionData::CompletionType> fishbonesTypes = {RigCompletionData::ICD, RigCompletionData::FISHBONES};
|
||||||
generateCompsegTable(formatter, exportInfo, false, fishbonesTypes);
|
generateCompsegTable(formatter, exportInfo, false, fishbonesTypes);
|
||||||
if (exportInfo.hasSubGridIntersections())
|
if (exportInfo.hasSubGridIntersections())
|
||||||
{
|
{
|
||||||
@ -615,7 +617,7 @@ void RicWellPathExportCompletionDataFeatureImpl::generateCompsegTables(RifEclips
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
std::set<RigCompletionData::CompletionType> fractureTypes = { RigCompletionData::FRACTURE };
|
std::set<RigCompletionData::CompletionType> fractureTypes = {RigCompletionData::FRACTURE};
|
||||||
generateCompsegTable(formatter, exportInfo, false, fractureTypes);
|
generateCompsegTable(formatter, exportInfo, false, fractureTypes);
|
||||||
if (exportInfo.hasSubGridIntersections())
|
if (exportInfo.hasSubGridIntersections())
|
||||||
{
|
{
|
||||||
@ -627,7 +629,8 @@ void RicWellPathExportCompletionDataFeatureImpl::generateCompsegTables(RifEclips
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RicWellPathExportCompletionDataFeatureImpl::generateCompsegTable(RifEclipseDataTableFormatter& formatter,
|
void RicWellPathExportCompletionDataFeatureImpl::generateCompsegTable(
|
||||||
|
RifEclipseDataTableFormatter& formatter,
|
||||||
const RicMswExportInfo& exportInfo,
|
const RicMswExportInfo& exportInfo,
|
||||||
bool exportSubGridIntersections,
|
bool exportSubGridIntersections,
|
||||||
const std::set<RigCompletionData::CompletionType>& exportCompletionTypes)
|
const std::set<RigCompletionData::CompletionType>& exportCompletionTypes)
|
||||||
@ -665,7 +668,8 @@ void RicWellPathExportCompletionDataFeatureImpl::generateCompsegTable(RifEclipse
|
|||||||
formatter.add(intersection.gridName());
|
formatter.add(intersection.gridName());
|
||||||
}
|
}
|
||||||
cvf::Vec3st ijk = intersection.gridLocalCellIJK();
|
cvf::Vec3st ijk = intersection.gridLocalCellIJK();
|
||||||
formatter.addZeroBasedCellIndex(ijk.x()).addZeroBasedCellIndex(ijk.y()).addZeroBasedCellIndex(ijk.z());
|
formatter.addZeroBasedCellIndex(ijk.x()).addZeroBasedCellIndex(ijk.y()).addZeroBasedCellIndex(
|
||||||
|
ijk.z());
|
||||||
formatter.add(completion.branchNumber());
|
formatter.add(completion.branchNumber());
|
||||||
|
|
||||||
double startLength = segment.startMD();
|
double startLength = segment.startMD();
|
||||||
@ -714,7 +718,7 @@ void RicWellPathExportCompletionDataFeatureImpl::generateCompsegHeader(RifEclips
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
std::vector<RifEclipseOutputTableColumn> header = { RifEclipseOutputTableColumn("Name") };
|
std::vector<RifEclipseOutputTableColumn> header = {RifEclipseOutputTableColumn("Name")};
|
||||||
formatter.header(header);
|
formatter.header(header);
|
||||||
formatter.add(exportInfo.wellPath()->name());
|
formatter.add(exportInfo.wellPath()->name());
|
||||||
formatter.rowCompleted();
|
formatter.rowCompleted();
|
||||||
@ -727,7 +731,7 @@ void RicWellPathExportCompletionDataFeatureImpl::generateCompsegHeader(RifEclips
|
|||||||
allHeaders.push_back(RifEclipseOutputTableColumn("Grid"));
|
allHeaders.push_back(RifEclipseOutputTableColumn("Grid"));
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<RifEclipseOutputTableColumn> commonHeaders = { RifEclipseOutputTableColumn("I"),
|
std::vector<RifEclipseOutputTableColumn> commonHeaders = {RifEclipseOutputTableColumn("I"),
|
||||||
RifEclipseOutputTableColumn("J"),
|
RifEclipseOutputTableColumn("J"),
|
||||||
RifEclipseOutputTableColumn("K"),
|
RifEclipseOutputTableColumn("K"),
|
||||||
RifEclipseOutputTableColumn("Branch no"),
|
RifEclipseOutputTableColumn("Branch no"),
|
||||||
@ -735,7 +739,7 @@ void RicWellPathExportCompletionDataFeatureImpl::generateCompsegHeader(RifEclips
|
|||||||
RifEclipseOutputTableColumn("End Length"),
|
RifEclipseOutputTableColumn("End Length"),
|
||||||
RifEclipseOutputTableColumn("Dir Pen"),
|
RifEclipseOutputTableColumn("Dir Pen"),
|
||||||
RifEclipseOutputTableColumn("End Range"),
|
RifEclipseOutputTableColumn("End Range"),
|
||||||
RifEclipseOutputTableColumn("Connection Depth") };
|
RifEclipseOutputTableColumn("Connection Depth")};
|
||||||
allHeaders.insert(allHeaders.end(), commonHeaders.begin(), commonHeaders.end());
|
allHeaders.insert(allHeaders.end(), commonHeaders.begin(), commonHeaders.end());
|
||||||
formatter.header(allHeaders);
|
formatter.header(allHeaders);
|
||||||
}
|
}
|
||||||
@ -1418,8 +1422,8 @@ RicMswExportInfo RicWellPathExportCompletionDataFeatureImpl::generateFracturesMs
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RicMswExportInfo RicWellPathExportCompletionDataFeatureImpl::generateFracturesMswExportInfo(
|
RicMswExportInfo
|
||||||
RimEclipseCase* caseToApply,
|
RicWellPathExportCompletionDataFeatureImpl::generateFracturesMswExportInfo(RimEclipseCase* caseToApply,
|
||||||
const RimWellPath* wellPath,
|
const RimWellPath* wellPath,
|
||||||
const std::vector<RimWellPathFracture*>& fractures)
|
const std::vector<RimWellPathFracture*>& fractures)
|
||||||
{
|
{
|
||||||
@ -1491,7 +1495,7 @@ RicMswExportInfo RicWellPathExportCompletionDataFeatureImpl::generateFracturesMs
|
|||||||
{
|
{
|
||||||
cvf::Vec3d position = wellPath->wellPathGeometry()->interpolatedPointAlongWellPath(fractureStartMD);
|
cvf::Vec3d position = wellPath->wellPathGeometry()->interpolatedPointAlongWellPath(fractureStartMD);
|
||||||
|
|
||||||
std::vector<RimFracture*> fractureVector(1, fracture);
|
std::vector<const RimFracture*> fractureVector(1, fracture);
|
||||||
std::vector<RigCompletionData> completionData =
|
std::vector<RigCompletionData> completionData =
|
||||||
RicExportFractureCompletionsImpl::generateCompdatValues(caseToApply,
|
RicExportFractureCompletionsImpl::generateCompdatValues(caseToApply,
|
||||||
wellPath->completions()->wellNameForExport(),
|
wellPath->completions()->wellNameForExport(),
|
||||||
|
Loading…
Reference in New Issue
Block a user