Started adding necessary parameters to pressure solver. Work in progress.

This commit is contained in:
Atgeirr Flø Rasmussen 2012-05-16 14:38:55 +02:00
parent ac1e43b643
commit fd25a20b9d
2 changed files with 14 additions and 9 deletions

View File

@ -27,6 +27,7 @@
#include <opm/core/linalg/sparse_sys.h> #include <opm/core/linalg/sparse_sys.h>
#include <opm/core/utility/ErrorMacros.hpp> #include <opm/core/utility/ErrorMacros.hpp>
#include <opm/core/newwells.h> #include <opm/core/newwells.h>
#include <opm/core/BlackoilState.hpp>
#include <algorithm> #include <algorithm>
@ -83,13 +84,14 @@ namespace Opm
/// Solve pressure equation, by Newton iterations. /// Solve pressure equation, by Newton iterations.
void CompressibleTpfa::solve() void CompressibleTpfa::solve(const double dt,
BlackoilState& state)
{ {
// Set up dynamic data. // Set up dynamic data.
computeDynamicData(); computeDynamicData();
// Assemble J and F. // Assemble J and F.
assemble(); assemble(dt, state);
bool residual_ok = false; // Replace with tolerance check. bool residual_ok = false; // Replace with tolerance check.
while (!residual_ok) { while (!residual_ok) {
@ -104,7 +106,7 @@ namespace Opm
computeDynamicData(); computeDynamicData();
// Assemble J and F. // Assemble J and F.
assemble(); assemble(dt, state);
// Check for convergence. // Check for convergence.
// Include both tolerance check for residual // Include both tolerance check for residual
@ -127,12 +129,12 @@ namespace Opm
/// Compute the residual and Jacobian. /// Compute the residual and Jacobian.
void CompressibleTpfa::assemble() void CompressibleTpfa::assemble(const double dt,
const BlackoilState& state)
{ {
// Arguments or members? // Arguments or members?
const double dt = 0.0; const double* z = &state.surfacevol()[0];
const double* z = NULL; const double* cell_press = &state.pressure()[0];
const double* cell_press = NULL;
const double* well_bhp = NULL; const double* well_bhp = NULL;
const double* porevol = NULL; const double* porevol = NULL;

View File

@ -31,6 +31,7 @@ struct FlowBoundaryConditions;
namespace Opm namespace Opm
{ {
class BlackoilState;
class LinearSolverInterface; class LinearSolverInterface;
/// Encapsulating a tpfa pressure solver for the compressible-fluid case. /// Encapsulating a tpfa pressure solver for the compressible-fluid case.
@ -60,11 +61,13 @@ namespace Opm
/// Destructor. /// Destructor.
~CompressibleTpfa(); ~CompressibleTpfa();
void solve(); void solve(const double dt,
BlackoilState& state);
private: private:
void computeDynamicData(); void computeDynamicData();
void assemble(); void assemble(const double dt,
const BlackoilState& state);
void solveIncrement(); void solveIncrement();
void computeResults(std::vector<double>& pressure, void computeResults(std::vector<double>& pressure,