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