mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Implement static gravity potential in DerivedGeology.
This is a stepping stone towards implementing gravity support in ImpesTPFAAD.
This commit is contained in:
parent
4721d402e4
commit
4b737497d5
@ -46,9 +46,11 @@ namespace {
|
||||
typedef Vector V;
|
||||
|
||||
DerivedGeology(const UnstructuredGrid& grid,
|
||||
const Geology& geo)
|
||||
const Geology& geo ,
|
||||
const double* grav = 0)
|
||||
: pvol_ (grid.number_of_cells)
|
||||
, trans_(grid.number_of_faces)
|
||||
, gpot_ (grid.cell_facepos[ grid.number_of_cells ])
|
||||
{
|
||||
// Pore volume
|
||||
const typename Vector::Index nc = grid.number_of_cells;
|
||||
@ -61,14 +63,35 @@ namespace {
|
||||
UnstructuredGrid* ug = const_cast<UnstructuredGrid*>(& grid);
|
||||
tpfa_htrans_compute(ug, geo.permeability(), htrans.data());
|
||||
tpfa_trans_compute (ug, htrans.data() , trans_.data());
|
||||
|
||||
if (grav != 0) {
|
||||
const typename Vector::Index nd = grid.dimensions;
|
||||
|
||||
for (typename Vector::Index c = 0; c < nc; ++c) {
|
||||
const double* const cc = & grid.cell_centroids[c*nd + 0];
|
||||
|
||||
const int* const p = grid.cell_facepos;
|
||||
for (int i = p[c]; i < p[c + 1]; ++i) {
|
||||
const int f = grid.cell_faces[i];
|
||||
|
||||
const double* const fc = & grid.face_centroids[f*nd + 0];
|
||||
|
||||
for (typename Vector::Index d = 0; d < nd; ++d) {
|
||||
gpot_[i] += grav[d] * (fc[d] - cc[d]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const Vector& poreVolume() const { return pvol_ ; }
|
||||
const Vector& transmissibility() const { return trans_; }
|
||||
const Vector& gravityPotential() const { return gpot_ ; }
|
||||
|
||||
private:
|
||||
Vector pvol_ ;
|
||||
Vector trans_;
|
||||
Vector gpot_ ;
|
||||
};
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user