Merge pull request #694 from atgeirr/fix-nnc-vs-noncartesian

Separate non-neighbour and non-cartesian connections.
This commit is contained in:
Atgeirr Flø Rasmussen 2016-05-25 13:38:15 +02:00
commit 69469bf537
6 changed files with 20 additions and 15 deletions

View File

@ -724,7 +724,7 @@ namespace Opm
fullReport.reportParam(tot_os); fullReport.reportParam(tot_os);
} }
} else { } else {
output_writer_->writeInit( simtimer, geoprops_->nnc() ); output_writer_->writeInit( simtimer, geoprops_->nonCartesianConnections() );
if (output_cout_) { if (output_cout_) {
std::cout << "\n\n================ Simulation turned off ===============\n" << std::flush; std::cout << "\n\n================ Simulation turned off ===============\n" << std::flush;
} }

View File

@ -94,8 +94,6 @@ namespace Opm
* cartDims[1] * cartDims[1]
* cartDims[2]; * cartDims[2];
nnc_ = eclState->getInputNNC();
// get the pore volume multipliers from the EclipseState // get the pore volume multipliers from the EclipseState
std::vector<double> multpv(numCartesianCells, 1.0); std::vector<double> multpv(numCartesianCells, 1.0);
const auto& eclProps = eclState->get3DProperties(); const auto& eclProps = eclState->get3DProperties();
@ -128,6 +126,8 @@ namespace Opm
} }
} }
// Non-neighbour connections.
nnc_ = eclState->getInputNNC();
// Transmissibility // Transmissibility
Vector htrans(AutoDiffGrid::numCellFaces(grid)); Vector htrans(AutoDiffGrid::numCellFaces(grid));
@ -143,8 +143,6 @@ namespace Opm
std::vector<double> mult; std::vector<double> mult;
multiplyHalfIntersections_(grid, eclState, ntg, htrans, mult); multiplyHalfIntersections_(grid, eclState, ntg, htrans, mult);
// Use volume weighted arithmetic average of the NTG values for // Use volume weighted arithmetic average of the NTG values for
// the cells effected by the current OPM cpgrid process algorithm // the cells effected by the current OPM cpgrid process algorithm
// for MINPV. Note that the change does not effect the pore volume calculations // for MINPV. Note that the change does not effect the pore volume calculations
@ -160,6 +158,7 @@ namespace Opm
pinchProcess_(grid, *eclState, htrans, numCells); pinchProcess_(grid, *eclState, htrans, numCells);
} }
// combine the half-face transmissibilites into the final face // combine the half-face transmissibilites into the final face
// transmissibilites. // transmissibilites.
tpfa_trans_compute(ug, htrans.data(), trans_.data()); tpfa_trans_compute(ug, htrans.data(), trans_.data());
@ -170,6 +169,10 @@ namespace Opm
trans_[faceIdx] *= mult[faceIdx]; trans_[faceIdx] *= mult[faceIdx];
} }
// Create the set of noncartesian connections.
noncartesian_ = nnc_;
exportNncStructure(grid);
// Compute z coordinates // Compute z coordinates
for (int c = 0; c<numCells; ++c){ for (int c = 0; c<numCells; ++c){
z_[c] = Opm::UgGridHelpers::cellCenterDepth(grid, c); z_[c] = Opm::UgGridHelpers::cellCenterDepth(grid, c);
@ -200,7 +203,6 @@ namespace Opm
} }
std::copy(grav, grav + nd, gravity_); std::copy(grav, grav + nd, gravity_);
} }
exportNncStructure(grid);
} }
@ -214,6 +216,7 @@ namespace Opm
Vector& poreVolume() { return pvol_ ;} Vector& poreVolume() { return pvol_ ;}
Vector& transmissibility() { return trans_ ;} Vector& transmissibility() { return trans_ ;}
const NNC& nnc() const { return nnc_;} const NNC& nnc() const { return nnc_;}
const NNC& nonCartesianConnections() const { return noncartesian_;}
private: private:
template <class Grid> template <class Grid>
@ -283,7 +286,7 @@ namespace Opm
if (!cartesianAdjacent(grid, c1, c2)) { if (!cartesianAdjacent(grid, c1, c2)) {
// suppose c1,c2 is specified in ECLIPSE input // suppose c1,c2 is specified in ECLIPSE input
// we here overwrite its trans by grid's // 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. double gravity_[3]; // Size 3 even if grid is 2-dim.
bool use_local_perm_; bool use_local_perm_;
/// Non-neighboring connections // Non-neighboring connections
NNC nnc_; NNC nnc_;
// Non-cartesian connections
NNC noncartesian_;
}; };
template <class GridType> template <class GridType>

View File

@ -110,7 +110,7 @@ namespace Opm
} }
// init output writer // init output writer
output_writer_.writeInit( timer, geo_.nnc() ); output_writer_.writeInit( timer, geo_.nonCartesianConnections() );
std::string restorefilename = param_.getDefault("restorefile", std::string("") ); std::string restorefilename = param_.getDefault("restorefile", std::string("") );
if( ! restorefilename.empty() ) if( ! restorefilename.empty() )

View File

@ -73,7 +73,7 @@ namespace Opm
} }
// init output writer // init output writer
output_writer_.writeInit( timer, geo_.nnc()); output_writer_.writeInit( timer, geo_.nonCartesianConnections());
std::string restorefilename = param_.getDefault("restorefile", std::string("") ); std::string restorefilename = param_.getDefault("restorefile", std::string("") );
if( ! restorefilename.empty() ) if( ! restorefilename.empty() )

View File

@ -246,10 +246,10 @@ namespace Opm
void void
BlackoilOutputWriter:: BlackoilOutputWriter::
writeInit(const SimulatorTimerInterface& timer, const NNC& nnc) writeInit(const SimulatorTimerInterface& timer, const NNC& non_cartesian_connections)
{ {
if( eclWriter_ ) { if( eclWriter_ ) {
eclWriter_->writeInit(timer, nnc); eclWriter_->writeInit(timer, non_cartesian_connections);
} }
} }

View File

@ -153,7 +153,7 @@ namespace Opm
{} {}
/** \copydoc Opm::OutputWriter::writeInit */ /** \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 */ /** \copydoc Opm::OutputWriter::writeTimeStep */
@ -183,7 +183,7 @@ namespace Opm
{} {}
/** \copydoc Opm::OutputWriter::writeInit */ /** \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 */ /** \copydoc Opm::OutputWriter::writeTimeStep */
@ -214,7 +214,7 @@ namespace Opm
const double* permeability ); const double* permeability );
/** \copydoc Opm::OutputWriter::writeInit */ /** \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 */ /** \copydoc Opm::OutputWriter::writeTimeStep */
void writeTimeStep(const SimulatorTimerInterface& timer, void writeTimeStep(const SimulatorTimerInterface& timer,