Commit Graph
89 Commits
Author SHA1 Message Date
Bård Skaflestad 0225e6c9ee Ignore autosave files from Vim. 2013-05-14 17:45:20 +02:00
Bård Skaflestad b85c0dce88 Add test cases for density and water viscosity.
Currently, ViscosityAD fails due to missing pressure derivatives in
the viscosity primitives.
2013-05-14 17:29:49 +02:00
Bård Skaflestad cebb6fd5fa Add required fluid densities 2013-05-14 15:46:00 +02:00
Bård Skaflestad eb1836c977 Disable 'param' output for all test cases. 2013-05-14 15:45:31 +02:00
Bård Skaflestad 6583aca34c Default to using tables as-is. 2013-05-14 15:41:45 +02:00
Bård Skaflestad ac5350a598 All "parameter" values must be strings. 2013-05-14 15:41:34 +02:00
Bård Skaflestad 667cae6d84 Expose 'param' and 'deck' in TestFixture. 2013-05-14 15:31:41 +02:00
Bård Skaflestad a1ca968991 Merge remote-tracking branch 'atgeirr/master' 2013-05-14 15:19:13 +02:00
Bård Skaflestad 99c3ec2824 Start a test suite for class BlackoilPropsAd.
Relies on external data ("fluid.data") to describe the fluid model.
2013-05-14 14:59:31 +02:00
Bård Skaflestad 1069cfae6d Merge remote-tracking branch 'atgeirr/master' 2013-05-14 13:41:11 +02:00
Bård Skaflestad a13d78bb06 Start fleshing out overall structure of Newton loop
Specifically,
  - Extract method solveJacobianSystem() for solving a single,
    system of linear equations (i.e., the Newton step).
  - Extract method residualNorm() for computing the residual norm.
    Used in loop control.
  - Stub out a method for computing fluxes.

Compile and run-tested on a linear, gravity-driven flow problem.
2013-05-14 13:40:56 +02:00
Bård Skaflestad 55165bd68d Enforce row-major ordering of the pressure Jacobian
Otherwise, we will use the transposed Jacobian as a coefficient
matrix in the 'linsolver_'.  This is wrong when solving compressible
problems for which the Jacobian matrix is not symmetric.
2013-05-14 11:53:09 +02:00
Bård Skaflestad 3f0f0363c3 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)
2013-05-14 11:40:07 +02:00
Bård Skaflestad 35cb155537 Merge remote-tracking branch 'atgeirr/master' 2013-05-13 16:37:27 +02:00
Bård Skaflestad e31486e288 Add tentative implementation of gravity flux. 2013-05-13 16:31:26 +02:00
Bård Skaflestad a141e79ead Construct (and store) gravity operator on grid.
The gravity flux of phase 'i' across an (internal) interface is then
given by

    gflux = mob_i * (G * rho_i)

assuming 'rho_i' contains the phase density (at reservoir conditions)
of phase 'i' and 'mob_i' is the phase mobility of phase 'i' at the
interface.
2013-05-13 16:11:48 +02:00
Bård Skaflestad 4b737497d5 Implement static gravity potential in DerivedGeology.
This is a stepping stone towards implementing gravity support in
ImpesTPFAAD.
2013-05-13 13:30:00 +02:00
Bård Skaflestad 4721d402e4 Remove an instance of EOL whitespace. 2013-05-13 10:35:50 +02:00
Bård Skaflestad 61f184cdc9 Use constant intermediate quantities. 2013-05-12 22:48:15 +02:00
Bård Skaflestad a174d4eb51 Put spdiag() into an anonymous namespace.
This avoids warnings (GCC 4.6) about missing prior function declaration.
2013-05-08 19:21:09 +02:00
Bård Skaflestad 92592672fe Use upwind mobility flux. 2013-05-08 15:06:13 +02:00
Bård Skaflestad 093daa93d7 Implement first cut at pressure system assembly.
Compile-tested only.
2013-05-08 14:34:48 +02:00
Bård Skaflestad baab2cdf43 Implement simple constructor for sparse, diagonal matrix.
This is, effectively, the same as MATLAB's

    spdiags(d, 0)

constructor.
2013-05-08 14:32:48 +02:00
Bård Skaflestad 673c044a6c Rename 'phase' parameter p->phase to avoid confusion. 2013-05-08 13:13:57 +02:00
Bård Skaflestad dfd33d8973 Merge remote-tracking branch 'atgeirr/master' 2013-05-08 13:02:59 +02:00
Bård Skaflestad ea1cdcd478 Assert non-empty state quantities.
This avoids generating a null-pointer dereference for

   &s[0]

in case of s.empty().
2013-05-08 13:02:51 +02:00
Bård Skaflestad 3ff5347ac9 Distinguish fluid from geology properties.
Most of class ImpesTPFAAD deals (or will deal) with fluid properties
with only a token nod to the geology--mostly in the form of derived
quantities such as transmissibility and pore volumes.  There is no
need to conflate the roles of fluid interface and geology interface
for this purpose.
2013-05-08 09:39:48 +02:00
Bård Skaflestad 1b3e43068f Include proper file header. 2013-05-08 00:19:25 +02:00
Bård Skaflestad 146b1223d2 Don't check input values. Defaults are fine.
While here, also return zero, which although not strictly needed,
nevertheless indicates to the reader that we're exiting successfully.
2013-05-08 00:17:35 +02:00
Bård Skaflestad 843499e071 Include <cassert> for assert() macro. 2013-05-08 00:11:21 +02:00
Bård Skaflestad f3d8277d7a Ignore 'ImpesTPFAAD' test program. 2013-05-07 21:41:02 +02:00
Bård Skaflestad d0cb7d8a4c Move buildAllCells() to anon. namespace.
This avoids diagnostics like "no previous declaration for ...".
2013-05-07 21:40:17 +02:00
Bård Skaflestad cfb7c2916a Merge remote-tracking branch 'bska/master' 2013-05-07 21:25:30 +02:00
Bård Skaflestad 083fef3c69 Merge remote-tracking branch 'atgeirr/master' 2013-05-07 21:23:18 +02:00
Bård Skaflestad 72fdc41caa Add early foundations for compressible flow solver
This is highly incomplete and refactorings are likely.
2013-05-07 19:58:10 +02:00
Bård Skaflestad b4a49c5844 Merge remote-tracking branch 'atgeirr/master' 2013-05-07 13:28:08 +02:00
Bård Skaflestad 2fc7c65118 Ignore simulators 2013-05-07 10:51:05 +02:00
Bård Skaflestad 0058e34aec printSparseMatrix(): Use InnerIterator rather than index
This way, we're (slightly) more agnostic to the inner storage scheme.
2013-05-06 14:09:48 +02:00
Bård Skaflestad c9d65f8c28 Merge remote-tracking branch 'atgeirr/master' 2013-05-06 14:01:06 +02:00
Bård Skaflestad 7980f3f6cb Suppress output from assignment in MATLAB. 2013-05-06 13:37:04 +02:00
Bård Skaflestad e9a1aa2a99 Fix mismerge. 2013-05-06 12:31:13 +02:00
Bård Skaflestad bc547f82c6 Merge remote-tracking branch 'atgeirr/master'
Conflicts:
	sim_simple.cpp
2013-05-06 12:29:47 +02:00
Bård Skaflestad 60509ca960 Output solution as a MATLAB function.
This way, we can run the example as

    ./sim_simple | sed -n '/s1 *=/,$p' > solution.m

to obtain a MATLAB function containing the 'solution'.
2013-05-06 09:43:48 +02:00
Bård Skaflestad b06b0c99ca Decrease amount of output and count iterations in the process.
Specifically, output the solution only at the end (in MATLAB
compatible format, for easy comparison) and annotate the diagnostic
output (i.e., cpu time and residual norm) with the iteration number.
2013-05-05 22:57:42 +02:00
Bård Skaflestad 056b7ae292 Make Darcy flux actually constant.
The definition from commit 6f22d10 included a non-zero derivative
which interfered with the automatic differentiation solver.  Using a
fully constant Darcy flux enables using dt=150 while still computing
the correct solution.

While here, output the solution (s1) using more precision/digits for
comparison with 'sim_simple.m'.
2013-05-05 22:02:40 +02:00
Bård Skaflestad 6f22d10b06 Do real splitting based on total flux/fractional flow
We are now able to compute the correct solution with dt=0.5, but the
convergence rate is dismal.
2013-05-05 21:52:34 +02:00
Bård Skaflestad e31101e80f Incorporate transmissibility into water flux definition.
This means that we're computing the correct solution for dt=0.0005 (as
verified by 'sim_simple.m', but we're still failing larger time steps).
2013-05-05 16:44:51 +02:00
Bård Skaflestad 8b12d1506d Add MATLAB-compatible output of ADB::M values.
This is mostly intended as an interim aid in development.  Not enabled
if 'NDEBUG' is defined.
2013-05-03 23:45:13 +02:00
Bård Skaflestad fc5a3f181e Use S_o=1 as initial condition.
This is the case in 'sim_simple.cpp', too.
2013-05-03 20:28:36 +02:00
Bård Skaflestad 9b65338461 Add MRST function for 'sim_simple' development 2013-05-03 20:21:37 +02:00
Bård Skaflestad d0866c39b5 Implement first cut at upwind-mobility weighting for transport
Specifically,

  - Introduce a new class, UpwindSelector<Scalar> which provides a
    selection service (method select()) to pick out a quantity across
    an interface in the upwind direction.

    Method select() is implemented only for the case of no
    counter-current flow (i.e., no effects of gravity and/or capillary
    pressure).  The selector is affected through applying an explicit
    sparse matrix to each quantity.  This may be inefficient, but only
    measurements will tell.

  - Split function fluxFunc<ADB>() into two components,
    phaseMobility<ADB>() and fluxFunc<ADB>().  The former computes
    phase mobilities (per cell) for water and oil in a subset of the
    grid cells and the latter computes the flux function (for water,
    i.e., the first phase) based on a (2-) vector of phase
    mobilities--either per cell or per internal interface.

  - Compute explicit phase mobilities (per cell) in the non-linear
    loop before employing the upwind selector to pick out proper
    upwind mobilities per (internal) interface to define the quantity
    'fw_face' which was previously computed by an arithmetic average.
2013-05-03 17:48:33 +02:00
Bård Skaflestad bd240a31cb Declare operator?() as 'const'.
None of operator+(), operator-(), operator*() or operator/() modify
their object.  These methods are thus naturally declared as 'const'.
2013-05-03 16:24:20 +02:00
Bård Skaflestad 0a43fe68dd Complete Addition tests. 2013-05-03 12:53:51 +02:00
Bård Skaflestad d6cfe8ab6f Clarify diagnostic message in pressure solve.
Word missing in commit a95fbf0.
2013-05-03 12:39:24 +02:00
Bård Skaflestad a95fbf0e8e Terminate process in case of factorisation/solution failure.
Provide moderately informative diagnostic message in this case.
2013-05-03 12:33:48 +02:00
Bård Skaflestad dddb30b5a5 Use regularised Jacobian when solving pressure system. 2013-05-03 12:26:02 +02:00
Bård Skaflestad cd9c9d5cde Don't require initialiser lists.
These were introduced into GCC as recently as edition 4.7 .  Ubuntu
10.04 LTS features GCC 4.4 only.
2013-05-03 11:28:08 +02:00
Bård Skaflestad e4cbc2c7f2 Merge remote-tracking branch 'atgeirr/master' 2013-05-03 11:08:37 +02:00
Bård Skaflestad 4ffea931e3 Add test for addition of ADB::variable()s. 2013-05-03 11:08:06 +02:00
Bård Skaflestad 9e55006229 Implement a custom comparator for Eigen::SparseMatrix<double>
Use it to simplify the 'FunctionInitialisation' test.
2013-05-03 10:46:46 +02:00
Bård Skaflestad 6794577301 Add stub test for ADB::operator+()
Doesn't actually test anything at the moment.
2013-05-02 18:00:36 +02:00
Bård Skaflestad 49396b6079 Don't include <iostream> in tester.
It is not needed and was only added for convenience during test
development.
2013-05-02 15:40:59 +02:00
Bård Skaflestad b1b245ccab Don't include <iostream> in public header. 2013-05-02 15:16:48 +02:00
Bård Skaflestad b6834de662 Don't rely on header pollution to provide <iostream> 2013-05-02 15:16:21 +02:00
Bård Skaflestad 2b5d49bea9 Merge remote-tracking branch 'atgeirr/master' 2013-05-02 14:48:33 +02:00
Bård Skaflestad e15c389daf Rename typedef ADV -> ADB to reflect reality.
We're working with *Block*s here.
2013-05-02 13:57:05 +02:00
Bård Skaflestad 567d3a80b3 Add various initialisation tests using Boost.Test . 2013-05-02 13:39:33 +02:00
Bård Skaflestad 36f2dd6403 Merge remote-tracking branch 'atgeirr/master' 2013-05-02 11:28:32 +02:00
Bård Skaflestad a496c2d668 Merge remote-tracking branch 'atgeirr/master' 2013-05-02 10:52:36 +02:00
Bård Skaflestad 3c00b0528a Sort list of ignored executables for easy reference 2013-05-02 00:35:40 +02:00
Bård Skaflestad 633de102c2 Fix misprint in operator*() chain rule. 2013-04-30 22:51:29 +02:00
Bård Skaflestad 6ed2b129cb Implement constant() and variable() in terms of function()
Specifically,

  - A constant is a function with zero derivative
  - A variable is a function with unit derivative with respect to
    itself.
2013-04-30 13:41:13 +02:00
Bård Skaflestad 70996fb195 Remove two instances of EOL whitespace. 2013-04-30 13:35:34 +02:00
Bård Skaflestad 86eb29b4c3 variable(): Avoid memory overhead of identity constructor. 2013-04-30 12:48:02 +02:00
Bård Skaflestad c276592ca5 Don't #include <iostream>. It's not needed. 2013-04-30 12:37:08 +02:00
Bård Skaflestad 06d2c078fa Use documented include statements for Eigen 2013-04-30 12:36:43 +02:00
Bård Skaflestad 134b9b1a7f Readjust whitespace to original conventions. 2013-04-30 11:52:03 +02:00
Bård Skaflestad 6319c428a3 Don't return values from update operators.
Statements like

   a = b += c

make no sense
2013-04-30 10:47:00 +02:00
Bård Skaflestad 0ff3b721ee Rename members to better reflect purpose.
Specifically,

  - x_  -> val_
  - dx_ -> der_
2013-04-30 09:25:37 +02:00
Bård Skaflestad e17447d6cd Add further test cases
- Polynomials (including mixed mode arithmetic)
  - Cosines (including mixed mode arithmethic)
  - Square roots (including mixed mode arithmetic)
2013-04-30 00:08:02 +02:00
Bård Skaflestad 011ab5ee93 Operator *=(): Use correct derivative chain rule
Updating the derivative using '*=' is just plain wrong.
2013-04-29 23:53:31 +02:00
Bård Skaflestad 72d6d32095 Don't use updated values for computing derivatives
We must not overwrite the current evaluation point until all the
derivative values have been calculated.  Otherwise, the derivatives
will differ from that of the actual values.
2013-04-29 23:28:49 +02:00
Bård Skaflestad 72e2b1f5ca Ignore executables. 2013-04-29 15:01:03 +02:00
Bård Skaflestad a4cdbdc049 Add test cases for multiplication and division
Helped uncover syntax error (misprint) fixed in commit 8105166.
2013-04-29 14:52:38 +02:00
Bård Skaflestad 8105166c26 Fix misprint in Forward/Scalar case. 2013-04-29 14:51:28 +02:00
Bård Skaflestad 790f6a06b2 Add simple test cases
- Initialisation
  - Addition (including mixed mode)
  - Subtraction (including mixed mode)
2013-04-29 14:12:57 +02:00
Bård Skaflestad b05f65ae70 Add simple library for automatic differentiation
No build system or automatic test cases at this point.
2013-04-29 13:39:57 +02:00
Bård Skaflestad 33f2623257 Ignore Emacs autosave files. 2013-04-29 13:39:26 +02:00
Bård Skaflestad a3ae90635e Initial commit 2013-04-29 01:31:45 -07:00