mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-16 20:24:48 -06:00
add changes to fix the order
enabling reordering as default
This commit is contained in:
parent
02555ac504
commit
6c2e957df0
@ -17,6 +17,9 @@
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include <config.h>
|
||||
// The default in dune-ALUGrird is "DISABLE_ALUGRID_SFC_ORDERING is false"
|
||||
#undef DISABLE_ALUGRID_SFC_ORDERING
|
||||
#undef USE_ALUGRID_SFC_ORDERING
|
||||
|
||||
#include <dune/alugrid/grid.hh>
|
||||
#include <opm/simulators/flow/Main.hpp>
|
||||
|
@ -325,7 +325,8 @@ protected:
|
||||
|
||||
factory_ = std::make_unique<Factory>();
|
||||
grid_ = factory_->convert(*equilGrid_, cartesianCellId_, ordering_);
|
||||
OpmLog::warning("Space Filling Curve Ordering is not yet supported: DISABLE_ALUGRID_SFC_ORDERING is enabled");
|
||||
OpmLog::warning("Space Filling Curve Ordering (SFCO) is used");
|
||||
OpmLog::warning("Add '#define DISABLE_ALUGRID_SFC_ORDERING 1' to disable SFC reordering");
|
||||
equilGridToGrid_.resize(ordering_.size());
|
||||
for (std::size_t index = 0; index < ordering_.size(); ++index) {
|
||||
equilGridToGrid_[ordering_[index]] = index;
|
||||
|
@ -451,10 +451,11 @@ public:
|
||||
const auto& residual = this->model().linearizer().residual();
|
||||
|
||||
for (unsigned globalDofIdx = 0; globalDofIdx < residual.size(); globalDofIdx ++) {
|
||||
this->drift_[globalDofIdx] = residual[globalDofIdx] * simulator.timeStepSize();
|
||||
int sfcdofIdx = simulator.vanguard().gridEquilIdxToGridIdx(globalDofIdx);
|
||||
this->drift_[sfcdofIdx] = residual[sfcdofIdx] * simulator.timeStepSize();
|
||||
|
||||
if constexpr (getPropValue<TypeTag, Properties::UseVolumetricResidual>()) {
|
||||
this->drift_[globalDofIdx] *= this->model().dofTotalVolume(globalDofIdx);
|
||||
this->drift_[sfcdofIdx] *= this->model().dofTotalVolume(sfcdofIdx);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1375,14 +1376,15 @@ protected:
|
||||
const auto& fp = eclState.fieldProps();
|
||||
const std::vector<double> porvData = this -> fieldPropDoubleOnLeafAssigner_()(fp, "PORV");
|
||||
for (std::size_t dofIdx = 0; dofIdx < numDof; ++dofIdx) {
|
||||
int sfcdofIdx = simulator.vanguard().gridEquilIdxToGridIdx(dofIdx);
|
||||
Scalar poreVolume = porvData[dofIdx];
|
||||
|
||||
// we define the porosity as the accumulated pore volume divided by the
|
||||
// geometric volume of the element. Note that -- in pathetic cases -- it can
|
||||
// be larger than 1.0!
|
||||
Scalar dofVolume = simulator.model().dofTotalVolume(dofIdx);
|
||||
Scalar dofVolume = simulator.model().dofTotalVolume(sfcdofIdx);
|
||||
assert(dofVolume > 0.0);
|
||||
this->referencePorosity_[/*timeIdx=*/0][dofIdx] = poreVolume/dofVolume;
|
||||
this->referencePorosity_[/*timeIdx=*/0][sfcdofIdx] = poreVolume/dofVolume;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -134,7 +134,7 @@ namespace Opm {
|
||||
const auto& fs = intQuants.fluidState();
|
||||
// use pore volume weighted averages.
|
||||
const Scalar pv_cell =
|
||||
simulator.model().dofTotalVolume(cellIdx)
|
||||
simulator.model().dofTotalVolume(simulator.vanguard().gridEquilIdxToGridIdx(cellIdx))
|
||||
* intQuants.porosity().value();
|
||||
|
||||
// only count oil and gas filled parts of the domain
|
||||
|
Loading…
Reference in New Issue
Block a user