mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #711 from blattms/print-all-well-switching-in-parallel
Print all well switching in parallel.
This commit is contained in:
commit
bcf210c03e
@ -747,7 +747,7 @@ namespace detail {
|
|||||||
|
|
||||||
// Possibly switch well controls and updating well state to
|
// Possibly switch well controls and updating well state to
|
||||||
// get reasonable initial conditions for the wells
|
// get reasonable initial conditions for the wells
|
||||||
asImpl().wellModel().updateWellControls(terminal_output_, well_state);
|
asImpl().wellModel().updateWellControls(well_state);
|
||||||
|
|
||||||
// Create the primary variables.
|
// Create the primary variables.
|
||||||
SolutionState state = asImpl().variableState(reservoir_state, well_state);
|
SolutionState state = asImpl().variableState(reservoir_state, well_state);
|
||||||
@ -1036,7 +1036,7 @@ namespace detail {
|
|||||||
const Eigen::VectorXd& dx = solver.solve(total_residual_v.matrix());
|
const Eigen::VectorXd& dx = solver.solve(total_residual_v.matrix());
|
||||||
assert(dx.size() == total_residual_v.size());
|
assert(dx.size() == total_residual_v.size());
|
||||||
asImpl().wellModel().updateWellState(dx.array(), dpMaxRel(), well_state);
|
asImpl().wellModel().updateWellState(dx.array(), dpMaxRel(), well_state);
|
||||||
asImpl().wellModel().updateWellControls(terminal_output_, well_state);
|
asImpl().wellModel().updateWellControls(well_state);
|
||||||
}
|
}
|
||||||
} while (it < 15);
|
} while (it < 15);
|
||||||
|
|
||||||
|
@ -147,7 +147,7 @@ namespace Opm {
|
|||||||
|
|
||||||
// Possibly switch well controls and updating well state to
|
// Possibly switch well controls and updating well state to
|
||||||
// get reasonable initial conditions for the wells
|
// get reasonable initial conditions for the wells
|
||||||
wellModel().updateWellControls(terminal_output_, well_state);
|
wellModel().updateWellControls(well_state);
|
||||||
|
|
||||||
// Create the primary variables.
|
// Create the primary variables.
|
||||||
SolutionState state = asImpl().variableState(reservoir_state, well_state);
|
SolutionState state = asImpl().variableState(reservoir_state, well_state);
|
||||||
|
@ -193,8 +193,7 @@ namespace Opm {
|
|||||||
|
|
||||||
template <class WellState>
|
template <class WellState>
|
||||||
void
|
void
|
||||||
updateWellControls(const bool terminal_output,
|
updateWellControls(WellState& xw) const;
|
||||||
WellState& xw) const;
|
|
||||||
|
|
||||||
// TODO: these code are same with the StandardWells
|
// TODO: these code are same with the StandardWells
|
||||||
// to find a better solution later.
|
// to find a better solution later.
|
||||||
|
@ -822,8 +822,7 @@ namespace Opm
|
|||||||
template <class WellState>
|
template <class WellState>
|
||||||
void
|
void
|
||||||
MultisegmentWells::
|
MultisegmentWells::
|
||||||
updateWellControls(const bool terminal_output,
|
updateWellControls(WellState& xw) const
|
||||||
WellState& xw) const
|
|
||||||
{
|
{
|
||||||
if( msWells().empty() ) return ;
|
if( msWells().empty() ) return ;
|
||||||
|
|
||||||
@ -860,12 +859,10 @@ namespace Opm
|
|||||||
|
|
||||||
if (ctrl_index != nwc) {
|
if (ctrl_index != nwc) {
|
||||||
// Constraint number ctrl_index was broken, switch to it.
|
// Constraint number ctrl_index was broken, switch to it.
|
||||||
if (terminal_output)
|
// Each well is only active on one process. Therefore we always print the sitch info.
|
||||||
{
|
std::cout << "Switching control mode for well " << msWells()[w]->name()
|
||||||
std::cout << "Switching control mode for well " << msWells()[w]->name()
|
<< " from " << modestring[well_controls_iget_type(wc, current)]
|
||||||
<< " from " << modestring[well_controls_iget_type(wc, current)]
|
<< " to " << modestring[well_controls_iget_type(wc, ctrl_index)] << std::endl;
|
||||||
<< " to " << modestring[well_controls_iget_type(wc, ctrl_index)] << std::endl;
|
|
||||||
}
|
|
||||||
xw.currentControls()[w] = ctrl_index;
|
xw.currentControls()[w] = ctrl_index;
|
||||||
current = xw.currentControls()[w];
|
current = xw.currentControls()[w];
|
||||||
}
|
}
|
||||||
|
@ -114,8 +114,7 @@ namespace Opm {
|
|||||||
WellState& well_state);
|
WellState& well_state);
|
||||||
|
|
||||||
template <class WellState>
|
template <class WellState>
|
||||||
void updateWellControls(const bool terminal_output,
|
void updateWellControls(WellState& xw) const;
|
||||||
WellState& xw) const;
|
|
||||||
|
|
||||||
// TODO: should LinearisedBlackoilResidual also be a template class?
|
// TODO: should LinearisedBlackoilResidual also be a template class?
|
||||||
template <class SolutionState>
|
template <class SolutionState>
|
||||||
|
@ -694,8 +694,7 @@ namespace Opm
|
|||||||
template <class WellState>
|
template <class WellState>
|
||||||
void
|
void
|
||||||
StandardWells::
|
StandardWells::
|
||||||
updateWellControls(const bool terminal_output,
|
updateWellControls(WellState& xw) const
|
||||||
WellState& xw) const
|
|
||||||
{
|
{
|
||||||
if( !localWellsActive() ) return ;
|
if( !localWellsActive() ) return ;
|
||||||
|
|
||||||
@ -732,14 +731,13 @@ namespace Opm
|
|||||||
}
|
}
|
||||||
if (ctrl_index != nwc) {
|
if (ctrl_index != nwc) {
|
||||||
// Constraint number ctrl_index was broken, switch to it.
|
// Constraint number ctrl_index was broken, switch to it.
|
||||||
if (terminal_output)
|
// We disregard terminal_ouput here as with it only messages
|
||||||
{
|
// for wells on one process will be printed.
|
||||||
std::ostringstream ss;
|
std::ostringstream ss;
|
||||||
ss << "Switching control mode for well " << wells().name[w]
|
ss << "Switching control mode for well " << wells().name[w]
|
||||||
<< " from " << modestring[well_controls_iget_type(wc, current)]
|
<< " from " << modestring[well_controls_iget_type(wc, current)]
|
||||||
<< " to " << modestring[well_controls_iget_type(wc, ctrl_index)] << std::endl;
|
<< " to " << modestring[well_controls_iget_type(wc, ctrl_index)] << std::endl;
|
||||||
OpmLog::info(ss.str());
|
OpmLog::info(ss.str());
|
||||||
}
|
|
||||||
xw.currentControls()[w] = ctrl_index;
|
xw.currentControls()[w] = ctrl_index;
|
||||||
current = xw.currentControls()[w];
|
current = xw.currentControls()[w];
|
||||||
}
|
}
|
||||||
|
@ -499,7 +499,7 @@ namespace Opm {
|
|||||||
// Possibly switch well controls and updating well state to
|
// Possibly switch well controls and updating well state to
|
||||||
// get reasonable initial conditions for the wells
|
// get reasonable initial conditions for the wells
|
||||||
// updateWellControls(well_state);
|
// updateWellControls(well_state);
|
||||||
wellModel().updateWellControls(terminal_output_, well_state);
|
wellModel().updateWellControls(well_state);
|
||||||
|
|
||||||
// Create the primary variables.
|
// Create the primary variables.
|
||||||
SolutionState state = variableState(reservoir_state, well_state);
|
SolutionState state = variableState(reservoir_state, well_state);
|
||||||
|
Loading…
Reference in New Issue
Block a user