From 0f290e3f6ec43f383feae41a99267b72cafb27c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atgeirr=20Fl=C3=B8=20Rasmussen?= Date: Tue, 24 May 2016 11:54:17 +0200 Subject: [PATCH] Separate non-neighbour and non-cartesian connections. The non-cartesian connections are required by the output facilities, while the truly non-neighbour connections (meaning those not in the grid) should be used by all other code. --- opm/autodiff/FlowMain.hpp | 2 +- opm/autodiff/GeoProps.hpp | 19 ++++++++++++------- opm/autodiff/SimulatorBase_impl.hpp | 2 +- ...FullyImplicitBlackoilMultiSegment_impl.hpp | 2 +- .../SimulatorFullyImplicitBlackoilOutput.cpp | 4 ++-- .../SimulatorFullyImplicitBlackoilOutput.hpp | 6 +++--- 6 files changed, 20 insertions(+), 15 deletions(-) diff --git a/opm/autodiff/FlowMain.hpp b/opm/autodiff/FlowMain.hpp index 29ad684ca..e8aeec1e1 100644 --- a/opm/autodiff/FlowMain.hpp +++ b/opm/autodiff/FlowMain.hpp @@ -724,7 +724,7 @@ namespace Opm fullReport.reportParam(tot_os); } } else { - output_writer_->writeInit( simtimer, geoprops_->nnc() ); + output_writer_->writeInit( simtimer, geoprops_->nonCartesianConnections() ); if (output_cout_) { std::cout << "\n\n================ Simulation turned off ===============\n" << std::flush; } diff --git a/opm/autodiff/GeoProps.hpp b/opm/autodiff/GeoProps.hpp index a8047bc74..68b078f46 100644 --- a/opm/autodiff/GeoProps.hpp +++ b/opm/autodiff/GeoProps.hpp @@ -94,8 +94,6 @@ namespace Opm * cartDims[1] * cartDims[2]; - nnc_ = eclState->getInputNNC(); - // get the pore volume multipliers from the EclipseState std::vector multpv(numCartesianCells, 1.0); const auto& eclProps = eclState->get3DProperties(); @@ -128,6 +126,8 @@ namespace Opm } } + // Non-neighbour connections. + nnc_ = eclState->getInputNNC(); // Transmissibility Vector htrans(AutoDiffGrid::numCellFaces(grid)); @@ -143,8 +143,6 @@ namespace Opm std::vector mult; multiplyHalfIntersections_(grid, eclState, ntg, htrans, mult); - - // Use volume weighted arithmetic average of the NTG values for // the cells effected by the current OPM cpgrid process algorithm // for MINPV. Note that the change does not effect the pore volume calculations @@ -160,6 +158,7 @@ namespace Opm pinchProcess_(grid, *eclState, htrans, numCells); } + // combine the half-face transmissibilites into the final face // transmissibilites. tpfa_trans_compute(ug, htrans.data(), trans_.data()); @@ -170,6 +169,10 @@ namespace Opm trans_[faceIdx] *= mult[faceIdx]; } + // Create the set of noncartesian connections. + noncartesian_ = nnc_; + exportNncStructure(grid); + // Compute z coordinates for (int c = 0; c @@ -283,7 +286,7 @@ namespace Opm if (!cartesianAdjacent(grid, c1, c2)) { // suppose c1,c2 is specified in ECLIPSE input // we here overwrite its trans by grid's - nnc_.addNNC(c1, c2, trans_[i]); + noncartesian_.addNNC(c1, c2, trans_[i]); } } } @@ -295,8 +298,10 @@ namespace Opm double gravity_[3]; // Size 3 even if grid is 2-dim. bool use_local_perm_; - /// Non-neighboring connections + // Non-neighboring connections NNC nnc_; + // Non-cartesian connections + NNC noncartesian_; }; template diff --git a/opm/autodiff/SimulatorBase_impl.hpp b/opm/autodiff/SimulatorBase_impl.hpp index f6f7f9d6c..e143f1029 100644 --- a/opm/autodiff/SimulatorBase_impl.hpp +++ b/opm/autodiff/SimulatorBase_impl.hpp @@ -110,7 +110,7 @@ namespace Opm } // init output writer - output_writer_.writeInit( timer, geo_.nnc() ); + output_writer_.writeInit( timer, geo_.nonCartesianConnections() ); std::string restorefilename = param_.getDefault("restorefile", std::string("") ); if( ! restorefilename.empty() ) diff --git a/opm/autodiff/SimulatorFullyImplicitBlackoilMultiSegment_impl.hpp b/opm/autodiff/SimulatorFullyImplicitBlackoilMultiSegment_impl.hpp index 934d8e6e6..6db792873 100644 --- a/opm/autodiff/SimulatorFullyImplicitBlackoilMultiSegment_impl.hpp +++ b/opm/autodiff/SimulatorFullyImplicitBlackoilMultiSegment_impl.hpp @@ -73,7 +73,7 @@ namespace Opm } // init output writer - output_writer_.writeInit( timer, geo_.nnc()); + output_writer_.writeInit( timer, geo_.nonCartesianConnections()); std::string restorefilename = param_.getDefault("restorefile", std::string("") ); if( ! restorefilename.empty() ) diff --git a/opm/autodiff/SimulatorFullyImplicitBlackoilOutput.cpp b/opm/autodiff/SimulatorFullyImplicitBlackoilOutput.cpp index b54105923..a84daae05 100644 --- a/opm/autodiff/SimulatorFullyImplicitBlackoilOutput.cpp +++ b/opm/autodiff/SimulatorFullyImplicitBlackoilOutput.cpp @@ -246,10 +246,10 @@ namespace Opm void BlackoilOutputWriter:: - writeInit(const SimulatorTimerInterface& timer, const NNC& nnc) + writeInit(const SimulatorTimerInterface& timer, const NNC& non_cartesian_connections) { if( eclWriter_ ) { - eclWriter_->writeInit(timer, nnc); + eclWriter_->writeInit(timer, non_cartesian_connections); } } diff --git a/opm/autodiff/SimulatorFullyImplicitBlackoilOutput.hpp b/opm/autodiff/SimulatorFullyImplicitBlackoilOutput.hpp index 2458b68b0..e87aead5a 100644 --- a/opm/autodiff/SimulatorFullyImplicitBlackoilOutput.hpp +++ b/opm/autodiff/SimulatorFullyImplicitBlackoilOutput.hpp @@ -153,7 +153,7 @@ namespace Opm {} /** \copydoc Opm::OutputWriter::writeInit */ - void writeInit(const SimulatorTimerInterface& /* timer */, const NNC& nnc) + void writeInit(const SimulatorTimerInterface& /* timer */, const NNC& /* non_cartesian_connections */) {} /** \copydoc Opm::OutputWriter::writeTimeStep */ @@ -183,7 +183,7 @@ namespace Opm {} /** \copydoc Opm::OutputWriter::writeInit */ - void writeInit(const SimulatorTimerInterface& /* timer */, const NNC& nnc) + void writeInit(const SimulatorTimerInterface& /* timer */, const NNC& /* non_cartesian_connections */) {} /** \copydoc Opm::OutputWriter::writeTimeStep */ @@ -214,7 +214,7 @@ namespace Opm const double* permeability ); /** \copydoc Opm::OutputWriter::writeInit */ - void writeInit(const SimulatorTimerInterface &timer, const NNC& nnc); + void writeInit(const SimulatorTimerInterface &timer, const NNC& non_cartesian_connections); /** \copydoc Opm::OutputWriter::writeTimeStep */ void writeTimeStep(const SimulatorTimerInterface& timer,