the sign for the standard well equations might be wrong

This commit is contained in:
Kai Bao 2025-02-14 23:24:38 +01:00
parent ee6d34f4a4
commit 15bf02a06f
2 changed files with 5 additions and 5 deletions

View File

@ -216,17 +216,17 @@ assemblePerforationEq(const EvalWell& cq_s_effective,
StandardWellEquationAccess eqns(eqns1);
// subtract sum of phase fluxes in the well equations.
eqns.residual()[0][componentIdx] += cq_s_effective.value();
eqns.residual()[0][componentIdx] -= cq_s_effective.value();
// assemble the jacobians
for (int pvIdx = 0; pvIdx < numWellEq; ++pvIdx) {
// also need to consider the efficiency factor when manipulating the jacobians.
eqns.C()[0][cell_idx][pvIdx][componentIdx] -= cq_s_effective.derivative(pvIdx+Indices::numEq); // intput in transformed matrix
eqns.D()[0][0][componentIdx][pvIdx] += cq_s_effective.derivative(pvIdx+Indices::numEq);
eqns.C()[0][cell_idx][pvIdx][componentIdx] += cq_s_effective.derivative(pvIdx+Indices::numEq); // intput in transformed matrix
eqns.D()[0][0][componentIdx][pvIdx] -= cq_s_effective.derivative(pvIdx+Indices::numEq);
}
for (int pvIdx = 0; pvIdx < Indices::numEq; ++pvIdx) {
eqns.B()[0][cell_idx][componentIdx][pvIdx] += cq_s_effective.derivative(pvIdx);
eqns.B()[0][cell_idx][componentIdx][pvIdx] -= cq_s_effective.derivative(pvIdx);
}
}

View File

@ -464,7 +464,7 @@ namespace Opm
resWell_loc += (this->primary_variables_.surfaceVolumeFraction(componentIdx) -
this->F0_[componentIdx]) * volume / dt;
}
resWell_loc -= this->primary_variables_.getQs(componentIdx) * this->well_efficiency_factor_;
resWell_loc += this->primary_variables_.getQs(componentIdx) * this->well_efficiency_factor_;
StandardWellAssemble<FluidSystem,Indices>(*this).
assembleSourceEq(resWell_loc,
componentIdx,