mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Improve docs and give more info on error.
This commit is contained in:
parent
36721602b2
commit
76259dcd0f
@ -38,10 +38,12 @@ namespace Opm
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// Solve for time-of-flight at next timestep.
|
/// Solve for time-of-flight.
|
||||||
/// \param[in] darcyflux Array of signed face fluxes.
|
/// \param[in] darcyflux Array of signed face fluxes.
|
||||||
/// \param[in] porevolume Array of pore volumes.
|
/// \param[in] porevolume Array of pore volumes.
|
||||||
/// \param[in] source Transport source term.
|
/// \param[in] source Source term. Sign convention is:
|
||||||
|
/// (+) inflow flux,
|
||||||
|
/// (-) outflow flux.
|
||||||
/// \param[out] tof Array of time-of-flight values.
|
/// \param[out] tof Array of time-of-flight values.
|
||||||
void TransportModelTracerTof::solveTof(const double* darcyflux,
|
void TransportModelTracerTof::solveTof(const double* darcyflux,
|
||||||
const double* porevolume,
|
const double* porevolume,
|
||||||
|
@ -31,7 +31,13 @@ namespace Opm
|
|||||||
|
|
||||||
class IncompPropertiesInterface;
|
class IncompPropertiesInterface;
|
||||||
|
|
||||||
/// Implements a reordering transport solver for incompressible two-phase flow.
|
/// Implements a first-order finite volume solver for
|
||||||
|
/// (single-phase) time-of-flight using reordering.
|
||||||
|
/// The equation solved is:
|
||||||
|
/// v \cdot \grad\tau = \phi
|
||||||
|
/// where v is the fluid velocity, \tau is time-of-flight and
|
||||||
|
/// \phi is the porosity. This is a boundary value problem, where
|
||||||
|
/// \tau is specified to be zero on all inflow boundaries.
|
||||||
class TransportModelTracerTof : public TransportModelInterface
|
class TransportModelTracerTof : public TransportModelInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -39,10 +45,12 @@ namespace Opm
|
|||||||
/// \param[in] grid A 2d or 3d grid.
|
/// \param[in] grid A 2d or 3d grid.
|
||||||
TransportModelTracerTof(const UnstructuredGrid& grid);
|
TransportModelTracerTof(const UnstructuredGrid& grid);
|
||||||
|
|
||||||
/// Solve for time-of-flight at next timestep.
|
/// Solve for time-of-flight.
|
||||||
/// \param[in] darcyflux Array of signed face fluxes.
|
/// \param[in] darcyflux Array of signed face fluxes.
|
||||||
/// \param[in] porevolume Array of pore volumes.
|
/// \param[in] porevolume Array of pore volumes.
|
||||||
/// \param[in] source Transport source term.
|
/// \param[in] source Source term. Sign convention is:
|
||||||
|
/// (+) inflow flux,
|
||||||
|
/// (-) outflow flux.
|
||||||
/// \param[out] tof Array of time-of-flight values.
|
/// \param[out] tof Array of time-of-flight values.
|
||||||
void solveTof(const double* darcyflux,
|
void solveTof(const double* darcyflux,
|
||||||
const double* porevolume,
|
const double* porevolume,
|
||||||
|
@ -446,10 +446,12 @@ namespace Opm
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// Solve for time-of-flight at next timestep.
|
/// Solve for time-of-flight.
|
||||||
/// \param[in] darcyflux Array of signed face fluxes.
|
/// \param[in] darcyflux Array of signed face fluxes.
|
||||||
/// \param[in] porevolume Array of pore volumes.
|
/// \param[in] porevolume Array of pore volumes.
|
||||||
/// \param[in] source Transport source term.
|
/// \param[in] source Source term. Sign convention is:
|
||||||
|
/// (+) inflow flux,
|
||||||
|
/// (-) outflow flux.
|
||||||
/// \param[in] degree Polynomial degree of DG basis functions used.
|
/// \param[in] degree Polynomial degree of DG basis functions used.
|
||||||
/// \param[out] tof_coeff Array of time-of-flight solution coefficients.
|
/// \param[out] tof_coeff Array of time-of-flight solution coefficients.
|
||||||
/// The values are ordered by cell, meaning that
|
/// The values are ordered by cell, meaning that
|
||||||
@ -633,7 +635,20 @@ namespace Opm
|
|||||||
MAT_SIZE_T info = 0;
|
MAT_SIZE_T info = 0;
|
||||||
dgesv_(&n, &nrhs, &jac_[0], &lda, &piv[0], &rhs_[0], &ldb, &info);
|
dgesv_(&n, &nrhs, &jac_[0], &lda, &piv[0], &rhs_[0], &ldb, &info);
|
||||||
if (info != 0) {
|
if (info != 0) {
|
||||||
THROW("Lapack error: " << info);
|
// Print the local matrix and rhs.
|
||||||
|
std::cerr << "Failed solving single-cell system Ax = b in cell " << cell
|
||||||
|
<< " with A = \n";
|
||||||
|
for (int row = 0; row < n; ++row) {
|
||||||
|
for (int col = 0; col < n; ++col) {
|
||||||
|
std::cerr << " " << jac_[row + n*col];
|
||||||
|
}
|
||||||
|
std::cerr << '\n';
|
||||||
|
}
|
||||||
|
std::cerr << "and b = \n";
|
||||||
|
for (int row = 0; row < n; ++row) {
|
||||||
|
std::cerr << " " << rhs_[row] << '\n';
|
||||||
|
}
|
||||||
|
THROW("Lapack error: " << info << " encountered in cell " << cell);
|
||||||
}
|
}
|
||||||
// The solution ends up in rhs_, so we must copy it.
|
// The solution ends up in rhs_, so we must copy it.
|
||||||
std::copy(rhs_.begin(), rhs_.end(), tof_coeff_ + num_basis*cell);
|
std::copy(rhs_.begin(), rhs_.end(), tof_coeff_ + num_basis*cell);
|
||||||
|
@ -31,7 +31,15 @@ namespace Opm
|
|||||||
|
|
||||||
class IncompPropertiesInterface;
|
class IncompPropertiesInterface;
|
||||||
|
|
||||||
/// Implements a reordering transport solver for incompressible two-phase flow.
|
/// Implements a discontinuous Galerkin solver for
|
||||||
|
/// (single-phase) time-of-flight using reordering.
|
||||||
|
/// The equation solved is:
|
||||||
|
/// v \cdot \grad\tau = \phi
|
||||||
|
/// where v is the fluid velocity, \tau is time-of-flight and
|
||||||
|
/// \phi is the porosity. This is a boundary value problem, where
|
||||||
|
/// \tau is specified to be zero on all inflow boundaries.
|
||||||
|
/// The user may specify the polynomial degree of the basis function space
|
||||||
|
/// used, but only degrees 0 and 1 are supported so far.
|
||||||
class TransportModelTracerTofDiscGal : public TransportModelInterface
|
class TransportModelTracerTofDiscGal : public TransportModelInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -39,10 +47,13 @@ namespace Opm
|
|||||||
/// \param[in] grid A 2d or 3d grid.
|
/// \param[in] grid A 2d or 3d grid.
|
||||||
TransportModelTracerTofDiscGal(const UnstructuredGrid& grid);
|
TransportModelTracerTofDiscGal(const UnstructuredGrid& grid);
|
||||||
|
|
||||||
/// Solve for time-of-flight at next timestep.
|
|
||||||
|
/// Solve for time-of-flight.
|
||||||
/// \param[in] darcyflux Array of signed face fluxes.
|
/// \param[in] darcyflux Array of signed face fluxes.
|
||||||
/// \param[in] porevolume Array of pore volumes.
|
/// \param[in] porevolume Array of pore volumes.
|
||||||
/// \param[in] source Transport source term.
|
/// \param[in] source Source term. Sign convention is:
|
||||||
|
/// (+) inflow flux,
|
||||||
|
/// (-) outflow flux.
|
||||||
/// \param[in] degree Polynomial degree of DG basis functions used.
|
/// \param[in] degree Polynomial degree of DG basis functions used.
|
||||||
/// \param[out] tof_coeff Array of time-of-flight solution coefficients.
|
/// \param[out] tof_coeff Array of time-of-flight solution coefficients.
|
||||||
/// The values are ordered by cell, meaning that
|
/// The values are ordered by cell, meaning that
|
||||||
|
Loading…
Reference in New Issue
Block a user