Merge pull request #1743 from GitPaean/testing_storage_term_stdwell

correcting the sign of the accumulation term of StandardWell
This commit is contained in:
Atgeirr Flø Rasmussen 2019-03-06 13:31:10 +01:00 committed by GitHub
commit f0f06225c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 8 deletions

View File

@ -546,17 +546,17 @@ namespace Opm
connectionRates_[perf][componentIdx] = Base::restrictEval(cq_s_effective); connectionRates_[perf][componentIdx] = Base::restrictEval(cq_s_effective);
// subtract sum of phase fluxes in the well equations. // subtract sum of phase fluxes in the well equations.
resWell_[0][componentIdx] -= cq_s_effective.value(); resWell_[0][componentIdx] += cq_s_effective.value();
// assemble the jacobians // assemble the jacobians
for (int pvIdx = 0; pvIdx < numWellEq_; ++pvIdx) { for (int pvIdx = 0; pvIdx < numWellEq_; ++pvIdx) {
// also need to consider the efficiency factor when manipulating the jacobians. // also need to consider the efficiency factor when manipulating the jacobians.
duneC_[0][cell_idx][pvIdx][componentIdx] -= cq_s_effective.derivative(pvIdx+numEq); // intput in transformed matrix duneC_[0][cell_idx][pvIdx][componentIdx] -= cq_s_effective.derivative(pvIdx+numEq); // intput in transformed matrix
invDuneD_[0][0][componentIdx][pvIdx] -= cq_s_effective.derivative(pvIdx+numEq); invDuneD_[0][0][componentIdx][pvIdx] += cq_s_effective.derivative(pvIdx+numEq);
} }
for (int pvIdx = 0; pvIdx < numEq; ++pvIdx) { for (int pvIdx = 0; pvIdx < numEq; ++pvIdx) {
duneB_[0][cell_idx][componentIdx][pvIdx] -= cq_s_effective.derivative(pvIdx); duneB_[0][cell_idx][componentIdx][pvIdx] += cq_s_effective.derivative(pvIdx);
} }
// Store the perforation phase flux for later usage. // Store the perforation phase flux for later usage.
@ -687,8 +687,10 @@ namespace Opm
// add vol * dF/dt + Q to the well equations; // add vol * dF/dt + Q to the well equations;
for (int componentIdx = 0; componentIdx < numWellConservationEq; ++componentIdx) { for (int componentIdx = 0; componentIdx < numWellConservationEq; ++componentIdx) {
// TODO: following the development in MSW, we need to convert the volume of the wellbore to be surface volume
// since all the rates are under surface condition
EvalWell resWell_loc = (wellSurfaceVolumeFraction(componentIdx) - F0_[componentIdx]) * volume / dt; EvalWell resWell_loc = (wellSurfaceVolumeFraction(componentIdx) - F0_[componentIdx]) * volume / dt;
resWell_loc += getQs(componentIdx) * well_efficiency_factor_; resWell_loc -= getQs(componentIdx) * well_efficiency_factor_;
for (int pvIdx = 0; pvIdx < numWellEq_; ++pvIdx) { for (int pvIdx = 0; pvIdx < numWellEq_; ++pvIdx) {
invDuneD_[0][0][componentIdx][pvIdx] += resWell_loc.derivative(pvIdx+numEq); invDuneD_[0][0][componentIdx][pvIdx] += resWell_loc.derivative(pvIdx+numEq);
} }
@ -2168,6 +2170,8 @@ namespace Opm
calculateExplicitQuantities(const Simulator& ebosSimulator, calculateExplicitQuantities(const Simulator& ebosSimulator,
const WellState& well_state) const WellState& well_state)
{ {
updatePrimaryVariables(well_state);
initPrimaryVariablesEvaluation();
computeWellConnectionPressures(ebosSimulator, well_state); computeWellConnectionPressures(ebosSimulator, well_state);
computeAccumWell(); computeAccumWell();
} }

View File

@ -504,17 +504,17 @@ namespace Opm
connectionRates_[perf][componentIdx] = Base::restrictEval(cq_s_effective); connectionRates_[perf][componentIdx] = Base::restrictEval(cq_s_effective);
// subtract sum of phase fluxes in the well equations. // subtract sum of phase fluxes in the well equations.
resWell_[0][componentIdx] -= cq_s_effective.value(); resWell_[0][componentIdx] += cq_s_effective.value();
// assemble the jacobians // assemble the jacobians
for (int pvIdx = 0; pvIdx < numWellEq; ++pvIdx) { for (int pvIdx = 0; pvIdx < numWellEq; ++pvIdx) {
// also need to consider the efficiency factor when manipulating the jacobians. // also need to consider the efficiency factor when manipulating the jacobians.
duneC_[0][cell_idx][pvIdx][componentIdx] -= cq_s_effective.derivative(pvIdx+numEq); // intput in transformed matrix duneC_[0][cell_idx][pvIdx][componentIdx] -= cq_s_effective.derivative(pvIdx+numEq); // intput in transformed matrix
invDuneD_[0][0][componentIdx][pvIdx] -= cq_s_effective.derivative(pvIdx+numEq); invDuneD_[0][0][componentIdx][pvIdx] += cq_s_effective.derivative(pvIdx+numEq);
} }
for (int pvIdx = 0; pvIdx < numEq; ++pvIdx) { for (int pvIdx = 0; pvIdx < numEq; ++pvIdx) {
duneB_[0][cell_idx][componentIdx][pvIdx] -= cq_s_effective.derivative(pvIdx); duneB_[0][cell_idx][componentIdx][pvIdx] += cq_s_effective.derivative(pvIdx);
} }
// Store the perforation phase flux for later usage. // Store the perforation phase flux for later usage.
@ -632,8 +632,10 @@ namespace Opm
// add vol * dF/dt + Q to the well equations; // add vol * dF/dt + Q to the well equations;
for (int componentIdx = 0; componentIdx < numWellConservationEq; ++componentIdx) { for (int componentIdx = 0; componentIdx < numWellConservationEq; ++componentIdx) {
// TODO: following the development in MSW, we need to convert the volume of the wellbore to be surface volume
// since all the rates are under surface condition
EvalWell resWell_loc = (wellSurfaceVolumeFraction(componentIdx) - F0_[componentIdx]) * volume / dt; EvalWell resWell_loc = (wellSurfaceVolumeFraction(componentIdx) - F0_[componentIdx]) * volume / dt;
resWell_loc += getQs(componentIdx) * well_efficiency_factor_; resWell_loc -= getQs(componentIdx) * well_efficiency_factor_;
for (int pvIdx = 0; pvIdx < numWellEq; ++pvIdx) { for (int pvIdx = 0; pvIdx < numWellEq; ++pvIdx) {
invDuneD_[0][0][componentIdx][pvIdx] += resWell_loc.derivative(pvIdx+numEq); invDuneD_[0][0][componentIdx][pvIdx] += resWell_loc.derivative(pvIdx+numEq);
} }
@ -2062,6 +2064,8 @@ namespace Opm
calculateExplicitQuantities(const Simulator& ebosSimulator, calculateExplicitQuantities(const Simulator& ebosSimulator,
const WellState& well_state) const WellState& well_state)
{ {
updatePrimaryVariables(well_state);
initPrimaryVariablesEvaluation();
computeWellConnectionPressures(ebosSimulator, well_state); computeWellConnectionPressures(ebosSimulator, well_state);
computeAccumWell(); computeAccumWell();
} }