mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Include well support in FIBOSolver interface.
Update callers accordingly.
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
#include <opm/autodiff/GeoProps.hpp>
|
||||
|
||||
#include <opm/core/simulator/BlackoilState.hpp>
|
||||
#include <opm/core/simulator/WellState.hpp>
|
||||
#include <opm/core/grid.h>
|
||||
#include <opm/core/utility/ErrorMacros.hpp>
|
||||
|
||||
@@ -133,12 +134,15 @@ namespace {
|
||||
namespace Opm {
|
||||
|
||||
|
||||
FullyImplicitBlackoilSolver::FullyImplicitBlackoilSolver(const UnstructuredGrid& grid ,
|
||||
const BlackoilPropsAdInterface& fluid,
|
||||
const DerivedGeology& geo )
|
||||
FullyImplicitBlackoilSolver::
|
||||
FullyImplicitBlackoilSolver(const UnstructuredGrid& grid ,
|
||||
const BlackoilPropsAdInterface& fluid,
|
||||
const DerivedGeology& geo ,
|
||||
const Wells& wells)
|
||||
: grid_ (grid)
|
||||
, fluid_ (fluid)
|
||||
, geo_ (geo)
|
||||
, wells_ (wells)
|
||||
, active_(activePhases(fluid.phaseUsage()))
|
||||
, canph_ (active2Canonical(fluid.phaseUsage()))
|
||||
, cells_ (buildAllCells(grid.number_of_cells))
|
||||
@@ -150,8 +154,10 @@ namespace Opm {
|
||||
}
|
||||
|
||||
void
|
||||
FullyImplicitBlackoilSolver::step(const double dt,
|
||||
BlackoilState& x)
|
||||
FullyImplicitBlackoilSolver::
|
||||
step(const double dt,
|
||||
BlackoilState& x ,
|
||||
WellState& xw)
|
||||
{
|
||||
const V dtpv = geo_.poreVolume() / dt;
|
||||
|
||||
@@ -166,7 +172,7 @@ namespace Opm {
|
||||
const int maxit = 15;
|
||||
#endif
|
||||
|
||||
assemble(dtpv, x);
|
||||
assemble(dtpv, x, xw);
|
||||
|
||||
#if 0
|
||||
const double r0 = residualNorm();
|
||||
@@ -175,7 +181,7 @@ namespace Opm {
|
||||
while (resTooLarge && (it < maxit)) {
|
||||
solveJacobianSystem(x);
|
||||
|
||||
assemble(dtpv, x);
|
||||
assemble(dtpv, x, xw);
|
||||
|
||||
const double r = residualNorm();
|
||||
|
||||
@@ -354,7 +360,10 @@ namespace Opm {
|
||||
}
|
||||
|
||||
void
|
||||
FullyImplicitBlackoilSolver::assemble(const V& dtpv, const BlackoilState& x)
|
||||
FullyImplicitBlackoilSolver::
|
||||
assemble(const V& dtpv,
|
||||
const BlackoilState& x ,
|
||||
const WellState& xw )
|
||||
{
|
||||
const V transi = subset(geo_.transmissibility(),
|
||||
ops_.internal_faces);
|
||||
|
||||
@@ -41,7 +41,8 @@ namespace Opm {
|
||||
public:
|
||||
FullyImplicitBlackoilSolver(const UnstructuredGrid& grid ,
|
||||
const BlackoilPropsAdInterface& fluid,
|
||||
const DerivedGeology& geo );
|
||||
const DerivedGeology& geo ,
|
||||
const Wells& wells);
|
||||
|
||||
/// Take a single forward step, modifiying
|
||||
/// state.pressure()
|
||||
@@ -49,8 +50,9 @@ namespace Opm {
|
||||
/// state.saturation()
|
||||
/// state.surfacevol()
|
||||
void
|
||||
step(const double dt,
|
||||
BlackoilState& state);
|
||||
step(const double dt ,
|
||||
BlackoilState& state ,
|
||||
WellState& wstate);
|
||||
|
||||
private:
|
||||
// Types and enums
|
||||
@@ -86,6 +88,7 @@ namespace Opm {
|
||||
const UnstructuredGrid& grid_;
|
||||
const BlackoilPropsAdInterface& fluid_;
|
||||
const DerivedGeology& geo_;
|
||||
const Wells& wells_;
|
||||
// For each canonical phase -> true if active
|
||||
const std::vector<bool> active_;
|
||||
// Size = # active faces. Maps active -> canonical phase indices.
|
||||
@@ -115,7 +118,9 @@ namespace Opm {
|
||||
const int aix );
|
||||
|
||||
void
|
||||
assemble(const V& dtpv, const BlackoilState& x);
|
||||
assemble(const V& dtpv,
|
||||
const BlackoilState& x ,
|
||||
const WellState& xw );
|
||||
|
||||
std::vector<ADB>
|
||||
computeRelPerm(const SolutionState& state);
|
||||
|
||||
@@ -252,7 +252,7 @@ namespace Opm
|
||||
gravity_(gravity),
|
||||
fluid_(props_),
|
||||
geo_(grid_, fluid_, gravity_),
|
||||
solver_(grid_, fluid_, geo_/*, *wells_manager.c_wells(), linsolver*/)
|
||||
solver_(grid_, fluid_, geo_, *wells_manager.c_wells()/*, linsolver*/)
|
||||
/* param.getDefault("nl_pressure_residual_tolerance", 0.0),
|
||||
param.getDefault("nl_pressure_change_tolerance", 1.0),
|
||||
param.getDefault("nl_pressure_maxiter", 10),
|
||||
@@ -361,7 +361,7 @@ namespace Opm
|
||||
// Run solver.
|
||||
solver_timer.start();
|
||||
std::vector<double> initial_pressure = state.pressure();
|
||||
solver_.step(timer.currentStepLength(), state/*, well_state*/);
|
||||
solver_.step(timer.currentStepLength(), state, well_state);
|
||||
|
||||
// Stop timer and report.
|
||||
solver_timer.stop();
|
||||
|
||||
Reference in New Issue
Block a user