Modify solve() interface, fix source term bug in implicit solver.
This commit is contained in:
parent
aee974ef77
commit
7019eb2c32
@ -550,12 +550,9 @@ namespace Opm
|
|||||||
double injected[2] = { 0.0 };
|
double injected[2] = { 0.0 };
|
||||||
double produced[2] = { 0.0 };
|
double produced[2] = { 0.0 };
|
||||||
for (int tr_substep = 0; tr_substep < num_transport_substeps_; ++tr_substep) {
|
for (int tr_substep = 0; tr_substep < num_transport_substeps_; ++tr_substep) {
|
||||||
//tsolver_.solve(&state.faceflux()[0], &initial_porevol[0], &transport_src[0],
|
|
||||||
// stepsize, state.saturation());
|
|
||||||
tsolver_->solve(&transport_src[0],
|
tsolver_->solve(&transport_src[0],
|
||||||
&porevol[0],
|
&porevol[0],
|
||||||
stepsize,
|
stepsize,
|
||||||
well_state,
|
|
||||||
state);
|
state);
|
||||||
|
|
||||||
double substep_injected[2] = { 0.0 };
|
double substep_injected[2] = { 0.0 };
|
||||||
|
@ -59,32 +59,27 @@ namespace Opm
|
|||||||
|
|
||||||
/// Solve for saturation at next timestep.
|
/// Solve for saturation at next timestep.
|
||||||
/// \param[in] porevolume Array of pore volumes.
|
/// \param[in] porevolume Array of pore volumes.
|
||||||
/// \param[in] source Transport source term.
|
/// \param[in] source Transport source term. For interpretation see Opm::computeTransportSource().
|
||||||
/// \param[in] dt Time step.
|
/// \param[in] dt Time step.
|
||||||
/// \param[in] wstate Well state.
|
/// \param[in, out] state Reservoir state. Calling solve() will read state.faceflux() and
|
||||||
/// \param[in, out] state Reservoir state. Saturation will be modified.
|
/// read and write state.saturation().
|
||||||
void TransportSolverTwophaseImplicit::solve(const double* porevolume,
|
void TransportSolverTwophaseImplicit::solve(const double* porevolume,
|
||||||
const double* source,
|
const double* source,
|
||||||
const double dt,
|
const double dt,
|
||||||
const WellState& well_state,
|
|
||||||
TwophaseState& state)
|
TwophaseState& state)
|
||||||
{
|
{
|
||||||
std::vector<double> porevol;
|
std::vector<double> porevol;
|
||||||
if (rock_comp_.isActive()) {
|
if (rock_comp_.isActive()) {
|
||||||
computePorevolume(grid_, props_.porosity(), rock_comp_, state.pressure(), porevol);
|
computePorevolume(grid_, props_.porosity(), rock_comp_, state.pressure(), porevol);
|
||||||
}
|
}
|
||||||
std::vector<double> src(grid_.number_of_cells, 0.0);
|
double ssrc[] = { 1.0, 0.0 };
|
||||||
Opm::computeTransportSource(grid_, src, state.faceflux(), 1.0,
|
double dummy[] = { 0.0, 0.0 };
|
||||||
wells_.c_wells(), well_state.perfRates(), src);
|
clear_transport_source(tsrc_);
|
||||||
double ssrc[] = { 1.0, 0.0 };
|
|
||||||
double ssink[] = { 0.0, 1.0 };
|
|
||||||
double zdummy[] = { 0.0, 0.0 };
|
|
||||||
for (int cell = 0; cell < grid_.number_of_cells; ++cell) {
|
for (int cell = 0; cell < grid_.number_of_cells; ++cell) {
|
||||||
clear_transport_source(tsrc_);
|
if (source[cell] > 0.0) {
|
||||||
if (src[cell] > 0.0) {
|
append_transport_source(cell, 2, 0, source[cell], ssrc, dummy, tsrc_);
|
||||||
append_transport_source(cell, 2, 0, src[cell], ssrc, zdummy, tsrc_);
|
} else if (source[cell] < 0.0) {
|
||||||
} else if (src[cell] < 0.0) {
|
append_transport_source(cell, 2, 0, source[cell], dummy, dummy, tsrc_);
|
||||||
append_transport_source(cell, 2, 0, src[cell], ssink, zdummy, tsrc_);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Opm::ImplicitTransportDetails::NRReport rpt;
|
Opm::ImplicitTransportDetails::NRReport rpt;
|
||||||
|
@ -72,15 +72,14 @@ namespace Opm
|
|||||||
|
|
||||||
/// Solve for saturation at next timestep.
|
/// Solve for saturation at next timestep.
|
||||||
/// \param[in] porevolume Array of pore volumes.
|
/// \param[in] porevolume Array of pore volumes.
|
||||||
/// \param[in] source Transport source term.
|
/// \param[in] source Transport source term. For interpretation see Opm::computeTransportSource().
|
||||||
/// \param[in] dt Time step.
|
/// \param[in] dt Time step.
|
||||||
/// \param[in] wstate Well state.
|
/// \param[in, out] state Reservoir state. Calling solve() will read state.faceflux() and
|
||||||
/// \param[in, out] state Reservoir state. Saturation will be modified.
|
/// read and write state.saturation().
|
||||||
virtual void solve(const double* porevolume,
|
virtual void solve(const double* porevolume,
|
||||||
const double* source,
|
const double* source,
|
||||||
const double dt,
|
const double dt,
|
||||||
const Opm::WellState& well_state,
|
TwophaseState& state);
|
||||||
Opm::TwophaseState& state);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Disallow copying and assignment.
|
// Disallow copying and assignment.
|
||||||
|
@ -35,14 +35,13 @@ namespace Opm
|
|||||||
|
|
||||||
/// Solve for saturation at next timestep.
|
/// Solve for saturation at next timestep.
|
||||||
/// \param[in] porevolume Array of pore volumes.
|
/// \param[in] porevolume Array of pore volumes.
|
||||||
/// \param[in] source Transport source term.
|
/// \param[in] source Transport source term. For interpretation see Opm::computeTransportSource().
|
||||||
/// \param[in] dt Time step.
|
/// \param[in] dt Time step.
|
||||||
/// \param[in] wstate Well state.
|
/// \param[in, out] state Reservoir state. Calling solve() will read state.faceflux() and
|
||||||
/// \param[in, out] state Reservoir state. Saturation will be modified.
|
/// read and write state.saturation().
|
||||||
virtual void solve(const double* porevolume,
|
virtual void solve(const double* porevolume,
|
||||||
const double* source,
|
const double* source,
|
||||||
const double dt,
|
const double dt,
|
||||||
const WellState& wstate,
|
|
||||||
TwophaseState& state) = 0;
|
TwophaseState& state) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user