Encapsulating a tpfa pressure solver for the incompressible-fluid case. More...
#include <IncompTpfa.hpp>
Public Member Functions | |
IncompTpfa (const UnstructuredGrid &grid, const IncompPropertiesInterface &props, LinearSolverInterface &linsolver, const double *gravity, const Wells *wells, const std::vector< double > &src, const FlowBoundaryConditions *bcs) | |
Construct solver for incompressible case. More... | |
IncompTpfa (const UnstructuredGrid &grid, const IncompPropertiesInterface &props, const RockCompressibility *rock_comp_props, LinearSolverInterface &linsolver, const double residual_tol, const double change_tol, const int maxiter, const double *gravity, const Wells *wells, const std::vector< double > &src, const FlowBoundaryConditions *bcs) | |
Construct solver, possibly with rock compressibility. More... | |
virtual | ~IncompTpfa () |
Destructor. | |
void | solve (const double dt, SimulationDataContainer &state, WellState &well_state) |
Solve the pressure equation. More... | |
const std::vector< double > & | getHalfTrans () const |
Expose read-only reference to internal half-transmissibility. | |
Protected Member Functions | |
void | solveIncomp (const double dt, SimulationDataContainer &state, WellState &well_state) |
void | solveRockComp (const double dt, SimulationDataContainer &state, WellState &well_state) |
Protected Attributes | |
const UnstructuredGrid & | grid_ |
const IncompPropertiesInterface & | props_ |
const RockCompressibility * | rock_comp_props_ |
const LinearSolverInterface & | linsolver_ |
const double | residual_tol_ |
const double | change_tol_ |
const int | maxiter_ |
const double * | gravity_ |
const Wells * | wells_ |
const std::vector< double > & | src_ |
const FlowBoundaryConditions * | bcs_ |
std::vector< double > | htrans_ |
std::vector< double > | gpress_ |
std::vector< int > | allcells_ |
std::vector< double > | trans_ |
std::vector< double > | wdp_ |
std::vector< double > | totmob_ |
std::vector< double > | omega_ |
std::vector< double > | gpress_omegaweighted_ |
std::vector< double > | initial_porevol_ |
struct ifs_tpfa_forces | forces_ |
std::vector< double > | porevol_ |
std::vector< double > | rock_comp_ |
std::vector< double > | pressures_ |
struct ifs_tpfa_data * | h_ |
Encapsulating a tpfa pressure solver for the incompressible-fluid case.
Supports gravity, wells controlled by bhp or reservoir rates, boundary conditions and simple sources as driving forces. Rock compressibility can be included, and necessary nonlinear iterations are handled. Below we use the shortcuts D for the number of dimensions, N for the number of cells and F for the number of faces.
Opm::IncompTpfa::IncompTpfa | ( | const UnstructuredGrid & | grid, |
const IncompPropertiesInterface & | props, | ||
LinearSolverInterface & | linsolver, | ||
const double * | gravity, | ||
const Wells * | wells, | ||
const std::vector< double > & | src, | ||
const FlowBoundaryConditions * | bcs | ||
) |
Construct solver for incompressible case.
[in] | grid | A 2d or 3d grid. |
[in] | props | Rock and fluid properties. |
[in] | linsolver | Linear solver to use. |
[in] | gravity | Gravity vector. If non-null, the array should have D elements. |
[in] | wells | The wells argument. Will be used in solution, is ignored if NULL. Note: this class observes the well object, and makes the assumption that the well topology and completions does not change during the run. However, controls (only) are allowed to change. |
[in] | src | Source terms. May be empty(). |
[in] | bcs | Boundary conditions, treat as all noflow if null. |
Opm::IncompTpfa::IncompTpfa | ( | const UnstructuredGrid & | grid, |
const IncompPropertiesInterface & | props, | ||
const RockCompressibility * | rock_comp_props, | ||
LinearSolverInterface & | linsolver, | ||
const double | residual_tol, | ||
const double | change_tol, | ||
const int | maxiter, | ||
const double * | gravity, | ||
const Wells * | wells, | ||
const std::vector< double > & | src, | ||
const FlowBoundaryConditions * | bcs | ||
) |
Construct solver, possibly with rock compressibility.
[in] | grid | A 2d or 3d grid. |
[in] | props | Rock and fluid properties. |
[in] | rock_comp_props | Rock compressibility properties. May be null. |
[in] | linsolver | Linear solver to use. |
[in] | residual_tol | Solution accepted if inf-norm of residual is smaller. |
[in] | change_tol | Solution accepted if inf-norm of change in pressure is smaller. |
[in] | maxiter | Maximum acceptable number of iterations. |
[in] | gravity | Gravity vector. If non-null, the array should have D elements. |
[in] | wells | The wells argument. Will be used in solution, is ignored if NULL. Note: this class observes the well object, and makes the assumption that the well topology and completions does not change during the run. However, controls (only) are allowed to change. |
[in] | src | Source terms. May be empty(). |
[in] | bcs | Boundary conditions, treat as all noflow if null. |
void Opm::IncompTpfa::solve | ( | const double | dt, |
SimulationDataContainer & | state, | ||
WellState & | well_state | ||
) |
Solve the pressure equation.
If there is no pressure dependency introduced by rock compressibility effects, the equation is linear, and it is solved directly. Otherwise, the nonlinear equations ares solved by a Newton-Raphson scheme. May throw an exception if the number of iterations exceed maxiter (set in constructor).