mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-01-27 21:36:26 -06:00
Print all well switching in parallel.
As for each well only one process is responsible, the output process does not see all wells. Ergo some well switching information was never printed in a parallel run. Therefore with this commit the well switching message is printed regardless on which process it appears.
This commit is contained in:
parent
ad01934670
commit
4c9d359638
@ -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