mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-16 20:24:48 -06:00
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:
parent
35cb155537
commit
3f0f0363c3
@ -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
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user