recovering the running of flow_ebos for 2p + dummy phase.

This commit is contained in:
Kai Bao
2017-08-04 10:06:37 +02:00
parent c43505d007
commit d4f26ad47a
2 changed files with 10 additions and 11 deletions

View File

@@ -66,13 +66,14 @@ namespace Opm
using typename Base::BVector; using typename Base::BVector;
using typename Base::Eval; using typename Base::Eval;
typedef Dune::FieldVector<Scalar, numWellEq> VectorBlockWellType;
typedef Dune::BlockVector<VectorBlockWellType> BVectorWell;
// sparsity pattern for the matrices // sparsity pattern for the matrices
//[A C^T [x = [ res //[A C^T [x = [ res
// B D ] x_well] res_well] // B D ] x_well] res_well]
// the vector type for the res_well and x_well
typedef Dune::FieldVector<Scalar, numWellEq> VectorBlockWellType;
typedef Dune::BlockVector<VectorBlockWellType> BVectorWell;
// the matrix type for the diagonal matrix D // the matrix type for the diagonal matrix D
typedef Dune::FieldMatrix<Scalar, numWellEq, numWellEq > DiagMatrixBlockWellType; typedef Dune::FieldMatrix<Scalar, numWellEq, numWellEq > DiagMatrixBlockWellType;
typedef Dune::BCRSMatrix <DiagMatrixBlockWellType> DiagMatWell; typedef Dune::BCRSMatrix <DiagMatrixBlockWellType> DiagMatWell;

View File

@@ -105,7 +105,10 @@ namespace Opm
setWellVariables(const WellState& well_state) setWellVariables(const WellState& well_state)
{ {
const int nw = well_state.bhp().size(); const int nw = well_state.bhp().size();
for (int eqIdx = 0; eqIdx < numWellEq; ++eqIdx) { // TODO: using numComp here is only to make the 2p + dummy phase work
// TODO: in theory, we should use numWellEq here.
// for (int eqIdx = 0; eqIdx < numWellEq; ++eqIdx) {
for (int eqIdx = 0; eqIdx < numComponents(); ++eqIdx) {
const unsigned int idx = nw * eqIdx + indexOfWell(); const unsigned int idx = nw * eqIdx + indexOfWell();
assert( eqIdx < well_variables_.size() ); assert( eqIdx < well_variables_.size() );
assert( idx < well_state.wellSolutions().size() ); assert( idx < well_state.wellSolutions().size() );
@@ -616,10 +619,10 @@ namespace Opm
} }
// add a trivial equation for the dummy phase for 2p cases (Only support water + oil) // add a trivial equation for the dummy phase for 2p cases (Only support water + oil)
/* if ( numComp < numWellEq ) { if ( numComp < numWellEq ) {
assert(!active()[ Gas ]); assert(!active()[ Gas ]);
invDuneD_[0][0][Gas][Gas] = 1.0; invDuneD_[0][0][Gas][Gas] = 1.0;
} */ }
// Store the perforation phase flux for later usage. // Store the perforation phase flux for later usage.
if (has_solvent && componentIdx == contiSolventEqIdx) {// if (flowPhaseToEbosCompIdx(componentIdx) == Solvent) if (has_solvent && componentIdx == contiSolventEqIdx) {// if (flowPhaseToEbosCompIdx(componentIdx) == Solvent)
@@ -656,11 +659,6 @@ namespace Opm
invDuneD_[0][0][componentIdx][pvIdx] += resWell_loc.derivative(pvIdx+numEq); invDuneD_[0][0][componentIdx][pvIdx] += resWell_loc.derivative(pvIdx+numEq);
} }
resWell_[0][componentIdx] += resWell_loc.value(); resWell_[0][componentIdx] += resWell_loc.value();
// add trivial equation for polymer
/* if (has_polymer) {
invDuneD_[0][0][contiPolymerEqIdx][polymerConcentrationIdx] = 1.0;
} */
} }
// do the local inversion of D. // do the local inversion of D.