NcpFlash.hpp File Reference
#include <opm/material/fluidmatrixinteractions/NullMaterial.hpp>
#include <opm/material/fluidmatrixinteractions/MaterialTraits.hpp>
#include <opm/material/fluidstates/CompositionalFluidState.hpp>
#include <opm/material/densead/Evaluation.hpp>
#include <opm/material/densead/Math.hpp>
#include <opm/material/common/MathToolbox.hpp>
#include <opm/material/common/Valgrind.hpp>
#include <opm/material/common/Exceptions.hpp>
#include <dune/common/fvector.hh>
#include <dune/common/fmatrix.hh>
#include <dune/common/version.hh>
#include <limits>
#include <iostream>
Include dependency graph for NcpFlash.hpp:

Go to the source code of this file.

Classes

class  Opm::NcpFlash< Scalar, FluidSystem >
 Determines the phase compositions, pressures and saturations given the total mass of all components. More...
 

Namespaces

namespace  Opm
 

Detailed Description

Determines the phase compositions, pressures and saturations given the total mass of all components.

In a M-phase, N-component context, we have the following unknowns:

  • M pressures
  • M saturations
  • M*N mole fractions

This sums up to M*(N + 2). On the equations side of things, we have:

  • (M - 1)*N equations stemming from the fact that the fugacity of any component is the same in all phases: $\forall \alpha, \beta, \kappa: f_\alpha^\kappa = f_\beta^\kappa$
  • 1 equation from the closure condition of all saturations: $\sum_\alpha S_\alpha = 1$
  • M - 1 constraints from the capillary pressures: $p_\beta = p_\alpha + p_c\alpha,\beta$
  • N constraints from the fact that the total mass of each component is given: $sum_\alpha rhoMolar_\alpha x_\alpha^\kappa = const$
  • M model constraints. Here, we use the NCP constraints: $ 0 = \mathrm{min}{S_\alpha, 1 - \sum_\kappa x_\alpha^\kappa}$

This also sums up to M*(N + 2).

The following assumptions apply: Capillary pressures are taken into account explicitly, so only the pressure of the first phase is implicitly solved for. Also, the closure condition for the saturations is taken into account explicitly, i.e., we don't need to implicitly solve for the last saturation. These two assumptions reduce the number of unknowns to the following M*(N + 1):

  • 1 pressure
  • M - 1 saturations
  • M*N mole fractions