Add first, working gravity solution

When run as

    ./test_impestfpa_ad permeability=1.01325e15 ref_pressure=1.0e-5 \
    mu1=1000 mu2=1000 rho1=1 rho2=1

this example reproduces the expected solution (a one-Pascal pressure
increase per cell).

Note that this is an incompressible case, so 'test_impestpfa_ad' must
be compiled with the pre-processor symbol

    HACK_INCOMPRESSIBLE_GRAVITY

defined to a true value (e.g., -DHACK_INCOMPRESSIBLE_GRAVITY=1)
This commit is contained in:
Bård Skaflestad 2013-05-14 11:40:07 +02:00
parent 35cb155537
commit 3f0f0363c3
2 changed files with 8 additions and 2 deletions

View File

@ -279,6 +279,11 @@ namespace Opm {
const int nc = grid_.number_of_cells;
M matr = cell_residual_.derivative()[0];
#if HACK_INCOMPRESSIBLE_GRAVITY
matr.coeffRef(0, 0) *= 2;
#endif
V dp(nc);
const V p0 = Eigen::Map<const V>(&state.pressure()[0], nc, 1);
Opm::LinearSolverInterface::LinearSolverReport rep

View File

@ -99,7 +99,7 @@ int
main(int argc, char* argv[])
{
const Opm::parameter::ParameterGroup param(argc, argv, false);
const Opm::GridManager gm(3, 3);
const Opm::GridManager gm(20, 1);
const UnstructuredGrid* g = gm.c_grid();
const int nc = g->number_of_cells;
@ -125,7 +125,8 @@ main(int argc, char* argv[])
THROW("Something went wrong with well init.");
}
GeoProps geo(*g, props);
double grav[] = { 1.0, 0.0 };
GeoProps geo(*g, props, grav);
Opm::LinearSolverFactory linsolver(param);
PSolver ps (*g, props, geo, *wells, linsolver);