also switching B and C in StandardWell_impl

This commit is contained in:
Kai Bao
2017-07-21 11:59:28 +02:00
parent e7a2e52763
commit f1123acdf0
2 changed files with 10 additions and 11 deletions

View File

@@ -195,7 +195,7 @@ namespace Opm
Mat invDuneD_; Mat invDuneD_;
// several vector used in the matrix calculation // several vector used in the matrix calculation
mutable BVector Cx_; mutable BVector Bx_;
mutable BVector invDrw_; mutable BVector invDrw_;
mutable BVector scaleAddRes_; mutable BVector scaleAddRes_;

View File

@@ -53,20 +53,19 @@ namespace Opm
// setup sparsity pattern for the matrices // setup sparsity pattern for the matrices
// TODO: C and B are opposite compared with the notations used in the paper. //[A C^T [x = [ res
//[A B^T [x = [ res // B D] x_well] res_well]
// C D] x_well] res_well]
// set the size of the matrices // set the size of the matrices
invDuneD_.setSize(1, 1, 1); invDuneD_.setSize(1, 1, 1);
duneC_.setSize(1, num_cells, numberOfPerforations());
duneB_.setSize(1, num_cells, numberOfPerforations()); duneB_.setSize(1, num_cells, numberOfPerforations());
duneC_.setSize(1, num_cells, numberOfPerforations());
for (auto row=invDuneD_.createbegin(), end = invDuneD_.createend(); row!=end; ++row) { for (auto row=invDuneD_.createbegin(), end = invDuneD_.createend(); row!=end; ++row) {
// Add nonzeros for diagonal // Add nonzeros for diagonal
row.insert(row.index()); row.insert(row.index());
} }
for (auto row = duneC_.createbegin(), end = duneC_.createend(); row!=end; ++row) { for (auto row = duneB_.createbegin(), end = duneB_.createend(); row!=end; ++row) {
// Add nonzeros for diagonal // Add nonzeros for diagonal
for (int perf = 0 ; perf < numberOfPerforations(); ++perf) { for (int perf = 0 ; perf < numberOfPerforations(); ++perf) {
const int cell_idx = wellCells()[perf]; const int cell_idx = wellCells()[perf];
@@ -74,8 +73,8 @@ namespace Opm
} }
} }
// make the B^T matrix // make the C^T matrix
for (auto row = duneB_.createbegin(), end = duneB_.createend(); row!=end; ++row) { for (auto row = duneC_.createbegin(), end = duneC_.createend(); row!=end; ++row) {
for (int perf = 0; perf < numberOfPerforations(); ++perf) { for (int perf = 0; perf < numberOfPerforations(); ++perf) {
const int cell_idx = wellCells()[perf]; const int cell_idx = wellCells()[perf];
row.insert(cell_idx); row.insert(cell_idx);
@@ -85,7 +84,7 @@ namespace Opm
resWell_.resize(1); resWell_.resize(1);
// resize temporary class variables // resize temporary class variables
Cx_.resize( duneC_.N() ); Bx_.resize( duneB_.N() );
invDrw_.resize( invDuneD_.N() ); invDrw_.resize( invDuneD_.N() );
} }
@@ -646,7 +645,7 @@ namespace Opm
for (int pvIdx = 0; pvIdx < numWellEq; ++pvIdx) { for (int pvIdx = 0; pvIdx < numWellEq; ++pvIdx) {
if (!only_wells) { if (!only_wells) {
// also need to consider the efficiency factor when manipulating the jacobians. // also need to consider the efficiency factor when manipulating the jacobians.
duneB_[0][cell_idx][pvIdx][flowPhaseToEbosCompIdx(componentIdx)] -= cq_s_effective.derivative(pvIdx+numEq); // intput in transformed matrix duneC_[0][cell_idx][pvIdx][flowPhaseToEbosCompIdx(componentIdx)] -= cq_s_effective.derivative(pvIdx+numEq); // intput in transformed matrix
} }
invDuneD_[0][0][componentIdx][pvIdx] -= cq_s[componentIdx].derivative(pvIdx+numEq); invDuneD_[0][0][componentIdx][pvIdx] -= cq_s[componentIdx].derivative(pvIdx+numEq);
} }
@@ -655,7 +654,7 @@ namespace Opm
if (!only_wells) { if (!only_wells) {
// also need to consider the efficiency factor when manipulating the jacobians. // also need to consider the efficiency factor when manipulating the jacobians.
ebosJac[cell_idx][cell_idx][flowPhaseToEbosCompIdx(componentIdx)][flowToEbosPvIdx(pvIdx)] -= cq_s_effective.derivative(pvIdx); ebosJac[cell_idx][cell_idx][flowPhaseToEbosCompIdx(componentIdx)][flowToEbosPvIdx(pvIdx)] -= cq_s_effective.derivative(pvIdx);
duneC_[0][cell_idx][componentIdx][flowToEbosPvIdx(pvIdx)] -= cq_s_effective.derivative(pvIdx); duneB_[0][cell_idx][componentIdx][flowToEbosPvIdx(pvIdx)] -= cq_s_effective.derivative(pvIdx);
} }
} }