Merge pull request #6235 from aritorto/smootherJumpsSerial

Reduce discontinuities in serial simulation for CpGrid with LGRs
This commit is contained in:
Markus Blatt authored and GitHub committed 2025-05-08 07:53:13 +02:00
commit cb3d29ef79
3 files changed
+22 -15

No files matched your search

+11 -11
View File
@@ -129,17 +129,6 @@ public:
OPM_END_PARALLEL_TRY_CATCH("Allocating the simulation vanguard failed: ", comm);
}
// Only relevant for CpGrid
if (verbose_) {
std::cout << "Adding LGRs, if any\n" << std::flush;
}
{
OPM_BEGIN_PARALLEL_TRY_CATCH();
vanguard_->addLgrs();
OPM_END_PARALLEL_TRY_CATCH("Adding LGRs to the simulation vanguard failed: ", comm);
}
if (verbose_) {
std::cout << "Distributing the vanguard's data\n" << std::flush;
}
@@ -150,6 +139,17 @@ public:
OPM_END_PARALLEL_TRY_CATCH("Could not distribute the vanguard data: ", comm);
}
// Only relevant for CpGrid and serial runs.
if (verbose_) {
std::cout << "Adding LGRs, if any, in serial run\n" << std::flush;
}
{
OPM_BEGIN_PARALLEL_TRY_CATCH();
vanguard_->addLgrs();
OPM_END_PARALLEL_TRY_CATCH("Adding LGRs to the simulation vanguard in serial run failed: ", comm);
}
if (verbose_) {
std::cout << "Allocating the model\n" << std::flush;
}
+8 -1
View File
@@ -255,9 +255,16 @@ public:
// Check if input file contains Lgrs.
//
// If there are lgrs, create the grid with them, and update the leaf grid view.
if (const auto& lgrs = this->eclState().getLgrs(); lgrs.size() > 0) {
if (const auto& lgrs = this->eclState().getLgrs(); (lgrs.size() > 0) && (this->grid_->comm().size() == 1)) {
OpmLog::info("\nAdding LGRs to the grid and updating its leaf grid view");
this->addLgrsUpdateLeafView(lgrs, lgrs.size(), *this->grid_);
this->updateGridView_();
this->updateCellDepths_();
this->updateCellThickness_();
}
else {
Opm::OpmLog::warning("Adding LGRs in parallel run is not supported yet.\n");
}
}
+3 -3
View File
@@ -362,9 +362,9 @@ protected:
cellCenterDepth_[elemIdx] = cellCenterDepth(element);
if (!num_aqu_cells.empty()) {
const unsigned int global_index = cartesianIndex(elemIdx);
const auto search = num_aqu_cells.find(global_index);
if (search != num_aqu_cells.end()) {
const unsigned int global_index = cartesianIndex(elemIdx);
const auto search = num_aqu_cells.find(global_index);
if (search != num_aqu_cells.end()) {
// updating the cell depth using aquifer cell depth
cellCenterDepth_[elemIdx] = search->second->depth;
}