mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-15 15:53:29 -06:00
Merge pull request #1915 from GitPaean/fixing_warnings_
fixing warnings under opm-simulators
This commit is contained in:
commit
e731715924
@ -659,7 +659,6 @@ public:
|
||||
if (enableTuning_) {
|
||||
// if support for the TUNING keyword is enabled, we get the initial time
|
||||
// steping parameters from it instead of from command line parameters
|
||||
const auto& schedule = simulator.vanguard().schedule();
|
||||
const auto& tuning = schedule.getTuning();
|
||||
initialTimeStepSize_ = tuning.getTSINIT(0);
|
||||
maxTimeStepAfterWellEvent_ = tuning.getTMAXWC(0);
|
||||
@ -745,7 +744,7 @@ public:
|
||||
void deserialize(Restarter& res)
|
||||
{
|
||||
// reload the current episode/report step from the deck
|
||||
beginEpisode(/*isOnRestart=*/true);
|
||||
beginEpisode();
|
||||
|
||||
// deserialize the wells
|
||||
wellModel_.deserialize(res);
|
||||
@ -773,7 +772,7 @@ public:
|
||||
/*!
|
||||
* \brief Called by the simulator before an episode begins.
|
||||
*/
|
||||
void beginEpisode(bool isOnRestart = false)
|
||||
void beginEpisode()
|
||||
{
|
||||
// Proceed to the next report step
|
||||
auto& simulator = this->simulator();
|
||||
@ -1514,7 +1513,7 @@ public:
|
||||
|
||||
// convert the source term from the total mass rate of the
|
||||
// cell to the one per unit of volume as used by the model.
|
||||
unsigned globalDofIdx = context.globalSpaceIndex(spaceIdx, timeIdx);
|
||||
const unsigned globalDofIdx = context.globalSpaceIndex(spaceIdx, timeIdx);
|
||||
for (unsigned eqIdx = 0; eqIdx < numEq; ++ eqIdx) {
|
||||
rate[eqIdx] /= this->model().dofTotalVolume(globalDofIdx);
|
||||
|
||||
@ -1528,7 +1527,6 @@ public:
|
||||
// if requested, compensate systematic mass loss for cells which were "well
|
||||
// behaved" in the last time step
|
||||
if (enableDriftCompensation_) {
|
||||
unsigned globalDofIdx = context.globalSpaceIndex(spaceIdx, timeIdx);
|
||||
const auto& intQuants = context.intensiveQuantities(spaceIdx, timeIdx);
|
||||
const auto& simulator = this->simulator();
|
||||
const auto& model = this->model();
|
||||
@ -2651,10 +2649,10 @@ private:
|
||||
//////
|
||||
// set temperature
|
||||
//////
|
||||
Scalar temperature = tempiData[cartesianDofIdx];
|
||||
if (!std::isfinite(temperature) || temperature <= 0)
|
||||
temperature = FluidSystem::surfaceTemperature;
|
||||
dofFluidState.setTemperature(temperature);
|
||||
Scalar temperatureLoc = tempiData[cartesianDofIdx];
|
||||
if (!std::isfinite(temperatureLoc) || temperatureLoc <= 0)
|
||||
temperatureLoc = FluidSystem::surfaceTemperature;
|
||||
dofFluidState.setTemperature(temperatureLoc);
|
||||
|
||||
//////
|
||||
// set saturations
|
||||
|
@ -80,7 +80,7 @@ namespace Opm
|
||||
OPM_THROW(std::runtime_error, "Trying to add well " << wellChild.name() << " Step: " << boost::lexical_cast<std::string>(timeStep) << " to group named " << wellChild.groupName() << ", but this group does not exist in the WellCollection.");
|
||||
}
|
||||
|
||||
std::shared_ptr<WellsGroupInterface> child = createWellWellsGroup(wellChild, summaryState, timeStep, phaseUsage);
|
||||
std::shared_ptr<WellsGroupInterface> child = createWellWellsGroup(wellChild, summaryState, phaseUsage);
|
||||
|
||||
WellsGroup* parent_as_group = static_cast<WellsGroup*> (parent);
|
||||
if (!parent_as_group) {
|
||||
|
@ -1588,7 +1588,7 @@ namespace Opm
|
||||
'CMODE_UNDEFINED' - we do not carry that over the specification
|
||||
objects here.
|
||||
*/
|
||||
std::shared_ptr<WellsGroupInterface> createWellWellsGroup(const Well2& well, const SummaryState& summaryState, size_t timeStep, const PhaseUsage& phase_usage )
|
||||
std::shared_ptr<WellsGroupInterface> createWellWellsGroup(const Well2& well, const SummaryState& summaryState, const PhaseUsage& phase_usage )
|
||||
{
|
||||
InjectionSpecification injection_specification;
|
||||
ProductionSpecification production_specification;
|
||||
|
@ -543,7 +543,6 @@ namespace Opm
|
||||
/// \param[in] the phase usage
|
||||
std::shared_ptr<WellsGroupInterface> createWellWellsGroup(const Well2& well,
|
||||
const SummaryState& summaryState,
|
||||
size_t timeStep,
|
||||
const PhaseUsage& phase_usage );
|
||||
|
||||
/// Creates the WellsGroupInterface for the given Group
|
||||
|
@ -294,7 +294,6 @@ namespace Opm
|
||||
|
||||
void WellsManager::setupWellControls(const std::vector<Well2>& wells,
|
||||
const SummaryState& summaryState,
|
||||
size_t timeStep,
|
||||
std::vector<std::string>& well_names,
|
||||
const PhaseUsage& phaseUsage,
|
||||
const std::vector<int>& wells_on_proc) {
|
||||
@ -599,7 +598,7 @@ namespace Opm
|
||||
}
|
||||
|
||||
// only handle the guide rates from the keyword WGRUPCON
|
||||
void WellsManager::setupGuideRates(const std::vector<Well2>& wells, const size_t timeStep, std::vector<WellData>& well_data, std::map<std::string, int>& well_names_to_index)
|
||||
void WellsManager::setupGuideRates(const std::vector<Well2>& wells, std::vector<WellData>& well_data, std::map<std::string, int>& well_names_to_index)
|
||||
{
|
||||
for (auto wellIter = wells.begin(); wellIter != wells.end(); ++wellIter ) {
|
||||
const auto& well = *wellIter;
|
||||
|
@ -170,7 +170,7 @@ namespace Opm
|
||||
WellsManager(const WellsManager& other);
|
||||
WellsManager& operator=(const WellsManager& other);
|
||||
static void setupCompressedToCartesian(const int* global_cell, int number_of_cells, std::map<int,int>& cartesian_to_compressed );
|
||||
void setupWellControls(const std::vector<Well2>& wells, const SummaryState& summaryState, size_t timeStep,
|
||||
void setupWellControls(const std::vector<Well2>& wells, const SummaryState& summaryState,
|
||||
std::vector<std::string>& well_names, const PhaseUsage& phaseUsage,
|
||||
const std::vector<int>& wells_on_proc);
|
||||
|
||||
@ -191,7 +191,7 @@ namespace Opm
|
||||
std::vector<int>& wells_on_proc,
|
||||
const std::unordered_set<std::string>& deactivated_wells);
|
||||
|
||||
void setupGuideRates(const std::vector<Well2>& wells, const size_t timeStep, std::vector<WellData>& well_data, std::map<std::string, int>& well_names_to_index);
|
||||
void setupGuideRates(const std::vector<Well2>& wells, std::vector<WellData>& well_data, std::map<std::string, int>& well_names_to_index);
|
||||
|
||||
// Data
|
||||
Wells* w_;
|
||||
|
@ -226,16 +226,16 @@ void WellsManager::createWellsFromSpecs(const std::vector<Well2>& wells, size_t
|
||||
destroy_wells( w );
|
||||
|
||||
// Add wells.
|
||||
for (int w = 0; w < num_wells; ++w) {
|
||||
const int w_num_perf = wellperf_data[w].size();
|
||||
for (int iw = 0; iw < num_wells; ++iw) {
|
||||
const int w_num_perf = wellperf_data[iw].size();
|
||||
std::vector<int> perf_cells (w_num_perf);
|
||||
std::vector<double> perf_prodind(w_num_perf);
|
||||
std::vector<int> perf_satnumid(w_num_perf);
|
||||
|
||||
for (int perf = 0; perf < w_num_perf; ++perf) {
|
||||
perf_cells [perf] = wellperf_data[w][perf].cell;
|
||||
perf_prodind[perf] = wellperf_data[w][perf].well_index;
|
||||
perf_satnumid[perf] = wellperf_data[w][perf].satnumid;
|
||||
perf_cells [perf] = wellperf_data[iw][perf].cell;
|
||||
perf_prodind[perf] = wellperf_data[iw][perf].well_index;
|
||||
perf_satnumid[perf] = wellperf_data[iw][perf].satnumid;
|
||||
}
|
||||
|
||||
const double* comp_frac = NULL;
|
||||
@ -243,21 +243,21 @@ void WellsManager::createWellsFromSpecs(const std::vector<Well2>& wells, size_t
|
||||
// We initialize all wells with a null component fraction,
|
||||
// and must (for injection wells) overwrite it later.
|
||||
const int ok =
|
||||
add_well(well_data[w].type,
|
||||
well_data[w].reference_bhp_depth,
|
||||
add_well(well_data[iw].type,
|
||||
well_data[iw].reference_bhp_depth,
|
||||
w_num_perf,
|
||||
comp_frac,
|
||||
perf_cells.data(),
|
||||
perf_prodind.data(),
|
||||
perf_satnumid.data(),
|
||||
well_names[w].c_str(),
|
||||
well_data[w].allowCrossFlow,
|
||||
well_names[iw].c_str(),
|
||||
well_data[iw].allowCrossFlow,
|
||||
w_);
|
||||
|
||||
if (!ok) {
|
||||
OPM_THROW(std::runtime_error,
|
||||
"Failed adding well "
|
||||
<< well_names[w]
|
||||
<< well_names[iw]
|
||||
<< " to Wells data structure.");
|
||||
}
|
||||
}
|
||||
@ -368,7 +368,7 @@ WellsManager::init(const Opm::EclipseState& eclipseState,
|
||||
pu, cartesian_to_compressed, interleavedPerm.data(), ntg,
|
||||
wells_on_proc, deactivated_wells);
|
||||
|
||||
setupWellControls(wells, summaryState, timeStep, well_names, pu, wells_on_proc);
|
||||
setupWellControls(wells, summaryState, well_names, pu, wells_on_proc);
|
||||
|
||||
{
|
||||
const auto& fieldGroup = schedule.getGroup( "FIELD" );
|
||||
@ -401,7 +401,7 @@ WellsManager::init(const Opm::EclipseState& eclipseState,
|
||||
|
||||
if (well_collection_.groupControlActive()) {
|
||||
// here does not consider the well potentials related guide rate setting
|
||||
setupGuideRates(wells, timeStep, well_data, well_names_to_index);
|
||||
setupGuideRates(wells, well_data, well_names_to_index);
|
||||
}
|
||||
|
||||
// Debug output.
|
||||
|
@ -437,8 +437,8 @@ namespace Opm {
|
||||
resultDenom += pressureNew*pressureNew;
|
||||
|
||||
for (unsigned phaseIdx = 0; phaseIdx < FluidSystem::numPhases; ++ phaseIdx) {
|
||||
Scalar tmp = saturationsNew[phaseIdx] - saturationsOld[phaseIdx];
|
||||
resultDelta += tmp*tmp;
|
||||
const Scalar tmpSat = saturationsNew[phaseIdx] - saturationsOld[phaseIdx];
|
||||
resultDelta += tmpSat * tmpSat;
|
||||
resultDenom += saturationsNew[phaseIdx]*saturationsNew[phaseIdx];
|
||||
}
|
||||
}
|
||||
@ -882,9 +882,9 @@ namespace Opm {
|
||||
const BlackoilWellModel<TypeTag>&
|
||||
wellModel() const { return well_model_; }
|
||||
|
||||
void beginReportStep(bool isRestart)
|
||||
void beginReportStep()
|
||||
{
|
||||
ebosSimulator_.problem().beginEpisode(isRestart);
|
||||
ebosSimulator_.problem().beginEpisode();
|
||||
}
|
||||
|
||||
void endReportStep()
|
||||
|
@ -204,10 +204,6 @@ public:
|
||||
wellModel_().initFromRestartFile(*restartValues);
|
||||
}
|
||||
|
||||
// beginReportStep(...) wants to know when we are at the
|
||||
// beginning of a restart
|
||||
bool firstRestartStep = isRestart();
|
||||
|
||||
// Main simulation loop.
|
||||
while (!timer.done()) {
|
||||
// Report timestep.
|
||||
@ -252,9 +248,7 @@ public:
|
||||
ebosSimulator_.startNextEpisode(ebosSimulator_.startTime() + schedule().getTimeMap().getTimePassedUntil(timer.currentStepNum()),
|
||||
timer.currentStepLength());
|
||||
ebosSimulator_.setEpisodeIndex(timer.currentStepNum());
|
||||
solver->model().beginReportStep(firstRestartStep);
|
||||
firstRestartStep = false;
|
||||
|
||||
solver->model().beginReportStep();
|
||||
|
||||
// If sub stepping is enabled allow the solver to sub cycle
|
||||
// in case the report steps are too large for the solver to converge
|
||||
|
@ -335,7 +335,6 @@ protected:
|
||||
}
|
||||
else
|
||||
{
|
||||
const WellModel& wellModel = simulator_.problem().wellModel();
|
||||
typedef WellModelMatrixAdapter< Matrix, Vector, Vector, WellModel, false > Operator;
|
||||
Operator opA(*matrix_, *matrix_, wellModel);
|
||||
solve( opA, x, *rhs_ );
|
||||
|
@ -520,8 +520,8 @@ namespace Opm {
|
||||
failing_wells.insert(wf.wellName());
|
||||
}
|
||||
if (sr_size >= num_steps) {
|
||||
for (int step = 1; step < num_steps; ++step) {
|
||||
const auto& srep = sr[sr_size - 1 - step];
|
||||
for (int s = 1; s < num_steps; ++s) {
|
||||
const auto& srep = sr[sr_size - 1 - s];
|
||||
// Report must be from same report step and substep, otherwise we have
|
||||
// not chopped/retried enough times on this step.
|
||||
if (srep.report_step != rep_step || srep.current_step != sub_step) {
|
||||
|
@ -389,7 +389,7 @@ namespace Opm {
|
||||
|
||||
void prepareGroupControl(Opm::DeferredLogger& deferred_logger);
|
||||
|
||||
void computeRESV(const std::size_t step, Opm::DeferredLogger& deferred_logger);
|
||||
void computeRESV(Opm::DeferredLogger& deferred_logger);
|
||||
|
||||
void extractLegacyCellPvtRegionIndex_();
|
||||
|
||||
@ -414,11 +414,10 @@ namespace Opm {
|
||||
void wellsToState( const data::Wells& wells,
|
||||
const PhaseUsage& phases,
|
||||
const bool handle_ms_well,
|
||||
const int report_step,
|
||||
WellStateFullyImplicitBlackoil& state ) const;
|
||||
|
||||
// whether there exists any multisegment well open on this process
|
||||
bool anyMSWellOpenLocal(const Wells* wells, const int report_step) const;
|
||||
bool anyMSWellOpenLocal(const Wells* wells) const;
|
||||
|
||||
const Well2& getWellEcl(const std::string& well_name) const;
|
||||
};
|
||||
|
@ -169,23 +169,18 @@ namespace Opm {
|
||||
forceShutWellByNameIfPredictionMode(const std::string& wellname,
|
||||
const double simulation_time)
|
||||
{
|
||||
Opm::DeferredLogger local_deferredLogger;
|
||||
// Only add the well to the closed list on the
|
||||
// process that owns it.
|
||||
int well_was_shut = 0;
|
||||
for (const auto& well : well_container_) {
|
||||
if (well->name() == wellname) {
|
||||
if (well->underPredictionMode(local_deferredLogger)) {
|
||||
if (well->underPredictionMode()) {
|
||||
wellTestState_.closeWell(wellname, WellTestConfig::Reason::PHYSICAL, simulation_time);
|
||||
well_was_shut = 1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
Opm::DeferredLogger global_deferredLogger = gatherDeferredLogger(local_deferredLogger);
|
||||
if (terminal_output_) {
|
||||
global_deferredLogger.logMessages();
|
||||
}
|
||||
|
||||
// Communicate across processes if a well was shut.
|
||||
well_was_shut = ebosSimulator_.vanguard().grid().comm().max(well_was_shut);
|
||||
@ -263,8 +258,8 @@ namespace Opm {
|
||||
well_state_.init(wells(), cellPressures, schedule(), wells_ecl_, timeStepIdx, &previous_well_state_, phase_usage_);
|
||||
|
||||
// handling MS well related
|
||||
if (param_.use_multisegment_well_&& anyMSWellOpenLocal(wells(), timeStepIdx)) { // if we use MultisegmentWell model
|
||||
well_state_.initWellStateMSWell(wells(), wells_ecl_, timeStepIdx, phase_usage_, &previous_well_state_);
|
||||
if (param_.use_multisegment_well_&& anyMSWellOpenLocal(wells())) { // if we use MultisegmentWell model
|
||||
well_state_.initWellStateMSWell(wells(), wells_ecl_, phase_usage_, &previous_well_state_);
|
||||
}
|
||||
|
||||
// update the previous well state. This is used to restart failed steps.
|
||||
@ -276,7 +271,7 @@ namespace Opm {
|
||||
|
||||
int exception_thrown = 0;
|
||||
try {
|
||||
computeRESV(timeStepIdx, local_deferredLogger);
|
||||
computeRESV(local_deferredLogger);
|
||||
} catch (const std::exception& e){
|
||||
exception_thrown = 1;
|
||||
}
|
||||
@ -502,9 +497,9 @@ namespace Opm {
|
||||
if (nw > 0) {
|
||||
const auto phaseUsage = phaseUsageFromDeck(eclState());
|
||||
const size_t numCells = Opm::UgGridHelpers::numCells(grid());
|
||||
const bool handle_ms_well = (param_.use_multisegment_well_ && anyMSWellOpenLocal(wells, report_step));
|
||||
well_state_.resize(wells, wells_ecl_, schedule(), handle_ms_well, report_step, numCells, phaseUsage); // Resize for restart step
|
||||
wellsToState(restartValues.wells, phaseUsage, handle_ms_well, report_step, well_state_);
|
||||
const bool handle_ms_well = (param_.use_multisegment_well_ && anyMSWellOpenLocal(wells));
|
||||
well_state_.resize(wells, wells_ecl_, schedule(), handle_ms_well, numCells, phaseUsage); // Resize for restart step
|
||||
wellsToState(restartValues.wells, phaseUsage, handle_ms_well, well_state_);
|
||||
previous_well_state_ = well_state_;
|
||||
}
|
||||
initial_step_ = false;
|
||||
@ -1645,7 +1640,7 @@ namespace Opm {
|
||||
template<typename TypeTag>
|
||||
void
|
||||
BlackoilWellModel<TypeTag>::
|
||||
computeRESV(const std::size_t step, Opm::DeferredLogger& deferred_logger)
|
||||
computeRESV(Opm::DeferredLogger& deferred_logger)
|
||||
{
|
||||
|
||||
const std::vector<int>& resv_wells = SimFIBODetails::resvWells(wells());
|
||||
@ -1731,8 +1726,7 @@ namespace Opm {
|
||||
wellsToState( const data::Wells& wells,
|
||||
const PhaseUsage& phases,
|
||||
const bool handle_ms_well,
|
||||
const int report_step,
|
||||
WellStateFullyImplicitBlackoil& state ) const
|
||||
WellStateFullyImplicitBlackoil& state) const
|
||||
{
|
||||
|
||||
using rt = data::Rates::opt;
|
||||
@ -1825,7 +1819,7 @@ namespace Opm {
|
||||
template<typename TypeTag>
|
||||
bool
|
||||
BlackoilWellModel<TypeTag>::
|
||||
anyMSWellOpenLocal(const Wells* wells, const int report_step) const
|
||||
anyMSWellOpenLocal(const Wells* wells) const
|
||||
{
|
||||
bool any_ms_well_open = false;
|
||||
|
||||
|
@ -276,7 +276,6 @@ namespace Opm
|
||||
// updating the well_state based on well solution dwells
|
||||
void updateWellState(const BVectorWell& dwells,
|
||||
WellState& well_state,
|
||||
Opm::DeferredLogger& deferred_logger,
|
||||
const double relaxation_factor=1.0) const;
|
||||
|
||||
|
||||
|
@ -528,11 +528,11 @@ namespace Opm
|
||||
MultisegmentWell<TypeTag>::
|
||||
recoverWellSolutionAndUpdateWellState(const BVector& x,
|
||||
WellState& well_state,
|
||||
Opm::DeferredLogger& deferred_logger) const
|
||||
Opm::DeferredLogger& /* deferred_logger*/) const
|
||||
{
|
||||
BVectorWell xw(1);
|
||||
recoverSolutionWell(x, xw);
|
||||
updateWellState(xw, well_state, deferred_logger);
|
||||
updateWellState(xw, well_state);
|
||||
}
|
||||
|
||||
|
||||
@ -712,13 +712,13 @@ namespace Opm
|
||||
template <typename TypeTag>
|
||||
void
|
||||
MultisegmentWell<TypeTag>::
|
||||
solveEqAndUpdateWellState(WellState& well_state, Opm::DeferredLogger& deferred_logger)
|
||||
solveEqAndUpdateWellState(WellState& well_state, Opm::DeferredLogger& /* deferred_logger */)
|
||||
{
|
||||
// We assemble the well equations, then we check the convergence,
|
||||
// which is why we do not put the assembleWellEq here.
|
||||
const BVectorWell dx_well = mswellhelpers::invDXDirect(duneD_, resWell_);
|
||||
|
||||
updateWellState(dx_well, well_state, deferred_logger);
|
||||
updateWellState(dx_well, well_state);
|
||||
}
|
||||
|
||||
|
||||
@ -803,7 +803,6 @@ namespace Opm
|
||||
MultisegmentWell<TypeTag>::
|
||||
updateWellState(const BVectorWell& dwells,
|
||||
WellState& well_state,
|
||||
Opm::DeferredLogger& deferred_logger,
|
||||
const double relaxation_factor) const
|
||||
{
|
||||
const double dFLimit = param_.dwell_fraction_max_;
|
||||
@ -1686,9 +1685,9 @@ namespace Opm
|
||||
|
||||
// handling the velocity head of intlet segments
|
||||
for (const int inlet : segment_inlets_[seg]) {
|
||||
const EvalWell density = segment_densities_[inlet];
|
||||
const EvalWell mass_rate = segment_mass_rates_[inlet];
|
||||
const EvalWell inlet_velocity_head = mswellhelpers::velocityHead(area, mass_rate, density);
|
||||
const EvalWell inlet_density = segment_densities_[inlet];
|
||||
const EvalWell inlet_mass_rate = segment_mass_rates_[inlet];
|
||||
const EvalWell inlet_velocity_head = mswellhelpers::velocityHead(area, inlet_mass_rate, inlet_density);
|
||||
resWell_[seg][SPres] += inlet_velocity_head.value();
|
||||
for (int pv_idx = 0; pv_idx < numWellEq; ++pv_idx) {
|
||||
duneD_[seg][inlet][SPres][pv_idx] += inlet_velocity_head.derivative(pv_idx + numEq);
|
||||
@ -1927,7 +1926,7 @@ namespace Opm
|
||||
deferred_logger.debug(sstr.str());
|
||||
}
|
||||
|
||||
updateWellState(dx_well, well_state, deferred_logger, relaxation_factor);
|
||||
updateWellState(dx_well, well_state, relaxation_factor);
|
||||
|
||||
// TODO: should we do something more if a switching of control happens
|
||||
this->updateWellControl(ebosSimulator, well_state, deferred_logger);
|
||||
|
@ -485,8 +485,7 @@ namespace Opm
|
||||
|
||||
// checking convergence of extra equations, if there are any
|
||||
void checkConvergenceExtraEqs(const std::vector<double>& res,
|
||||
ConvergenceReport& report,
|
||||
DeferredLogger& deferred_logger) const;
|
||||
ConvergenceReport& report) const;
|
||||
|
||||
// updating the connectionRates_ related polymer molecular weight
|
||||
void updateConnectionRatePolyMW(const EvalWell& cq_s_poly,
|
||||
|
@ -1393,7 +1393,7 @@ namespace Opm
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this->underPredictionMode(deferred_logger) ) {
|
||||
if (!this->underPredictionMode() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -2016,7 +2016,7 @@ namespace Opm
|
||||
|
||||
checkConvergenceControlEq(report, deferred_logger);
|
||||
|
||||
checkConvergenceExtraEqs(res, report, deferred_logger);
|
||||
checkConvergenceExtraEqs(res, report);
|
||||
|
||||
return report;
|
||||
}
|
||||
@ -3148,8 +3148,7 @@ namespace Opm
|
||||
void
|
||||
StandardWell<TypeTag>::
|
||||
checkConvergenceExtraEqs(const std::vector<double>& res,
|
||||
ConvergenceReport& report,
|
||||
DeferredLogger& deferred_logger) const
|
||||
ConvergenceReport& report) const
|
||||
{
|
||||
// if different types of extra equations are involved, this function needs to be refactored further
|
||||
|
||||
|
@ -253,7 +253,7 @@ namespace Opm
|
||||
bool wellHasTHPConstraints() const;
|
||||
|
||||
/// Returns true if the well is currently in prediction mode (i.e. not history mode).
|
||||
bool underPredictionMode(Opm::DeferredLogger& deferred_logger) const;
|
||||
bool underPredictionMode() const;
|
||||
|
||||
// update perforation water throughput based on solved water rate
|
||||
virtual void updateWaterThroughput(const double dt, WellState& well_state) const = 0;
|
||||
@ -416,8 +416,8 @@ namespace Opm
|
||||
OperabilityStatus operability_status_;
|
||||
|
||||
void wellTestingEconomic(const Simulator& simulator, const std::vector<double>& B_avg,
|
||||
const double simulation_time, const int report_step,
|
||||
const WellState& well_state, WellTestState& welltest_state, Opm::DeferredLogger& deferred_logger);
|
||||
const double simulation_time, const WellState& well_state,
|
||||
WellTestState& welltest_state, Opm::DeferredLogger& deferred_logger);
|
||||
|
||||
virtual void wellTestingPhysical(const Simulator& simulator, const std::vector<double>& B_avg,
|
||||
const double simulation_time, const int report_step,
|
||||
|
@ -543,7 +543,7 @@ namespace Opm
|
||||
template<typename TypeTag>
|
||||
bool
|
||||
WellInterface<TypeTag>::
|
||||
underPredictionMode(Opm::DeferredLogger& deferred_logger) const
|
||||
underPredictionMode() const
|
||||
{
|
||||
return well_ecl_.predictionMode();
|
||||
}
|
||||
@ -799,7 +799,7 @@ namespace Opm
|
||||
|
||||
// Based on current understanding, only under prediction mode, we need to shut well due to various
|
||||
// reasons or limits. With more knowlage or testing cases later, this might need to be corrected.
|
||||
if (!underPredictionMode(deferred_logger) ) {
|
||||
if (!underPredictionMode() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -997,7 +997,7 @@ namespace Opm
|
||||
}
|
||||
|
||||
if (testing_reason == WellTestConfig::Reason::ECONOMIC) {
|
||||
wellTestingEconomic(simulator, B_avg, simulation_time, report_step,
|
||||
wellTestingEconomic(simulator, B_avg, simulation_time,
|
||||
well_state, well_test_state, deferred_logger);
|
||||
}
|
||||
}
|
||||
@ -1010,8 +1010,8 @@ namespace Opm
|
||||
void
|
||||
WellInterface<TypeTag>::
|
||||
wellTestingEconomic(const Simulator& simulator, const std::vector<double>& B_avg,
|
||||
const double simulation_time, const int report_step,
|
||||
const WellState& well_state, WellTestState& welltest_state, Opm::DeferredLogger& deferred_logger)
|
||||
const double simulation_time, const WellState& well_state,
|
||||
WellTestState& welltest_state, Opm::DeferredLogger& deferred_logger)
|
||||
{
|
||||
deferred_logger.info(" well " + name() + " is being tested for economic limits");
|
||||
|
||||
|
@ -297,14 +297,13 @@ namespace Opm
|
||||
|
||||
|
||||
void resize(const Wells* wells, const std::vector<Well2>& wells_ecl, const Schedule& schedule,
|
||||
const bool handle_ms_well, const int report_step, const size_t numCells,
|
||||
const PhaseUsage& pu)
|
||||
const bool handle_ms_well, const size_t numCells, const PhaseUsage& pu)
|
||||
{
|
||||
const std::vector<double> tmp(numCells, 0.0); // <- UGLY HACK to pass the size
|
||||
init(wells, tmp, schedule, wells_ecl, 0, nullptr, pu);
|
||||
|
||||
if (handle_ms_well) {
|
||||
initWellStateMSWell(wells, wells_ecl, report_step, pu, nullptr);
|
||||
initWellStateMSWell(wells, wells_ecl, pu, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
@ -609,7 +608,7 @@ namespace Opm
|
||||
|
||||
/// init the MS well related.
|
||||
void initWellStateMSWell(const Wells* wells, const std::vector<Well2>& wells_ecl,
|
||||
const int time_step, const PhaseUsage& pu, const WellStateFullyImplicitBlackoil* prev_well_state)
|
||||
const PhaseUsage& pu, const WellStateFullyImplicitBlackoil* prev_well_state)
|
||||
{
|
||||
// still using the order in wells
|
||||
const int nw = wells->number_of_wells;
|
||||
|
@ -67,24 +67,24 @@ BOOST_AUTO_TEST_CASE(deferredlogger)
|
||||
|
||||
std::ostringstream log_stream;
|
||||
initLogger(log_stream);
|
||||
auto deferredlogger = Opm::DeferredLogger();
|
||||
deferredlogger.info("info 1");
|
||||
deferredlogger.warning("warning 1");
|
||||
deferredlogger.error("error 1");
|
||||
deferredlogger.error("error 2");
|
||||
deferredlogger.problem("problem 1");
|
||||
deferredlogger.bug("bug 1");
|
||||
deferredlogger.debug("debug 1");
|
||||
deferredlogger.note("note 1");
|
||||
deferredlogger.note("tagme", "note 2");
|
||||
deferredlogger.note("tagme", "note 3");
|
||||
deferredlogger.note("tagme", "note 3");
|
||||
deferredlogger.note("tagme", "note 3");
|
||||
deferredlogger.note("tagme", "note 3");
|
||||
deferredlogger.note("tagme", "note 3");
|
||||
deferredlogger.note("tagme", "note 3");
|
||||
auto deferred_logger = Opm::DeferredLogger();
|
||||
deferred_logger.info("info 1");
|
||||
deferred_logger.warning("warning 1");
|
||||
deferred_logger.error("error 1");
|
||||
deferred_logger.error("error 2");
|
||||
deferred_logger.problem("problem 1");
|
||||
deferred_logger.bug("bug 1");
|
||||
deferred_logger.debug("debug 1");
|
||||
deferred_logger.note("note 1");
|
||||
deferred_logger.note("tagme", "note 2");
|
||||
deferred_logger.note("tagme", "note 3");
|
||||
deferred_logger.note("tagme", "note 3");
|
||||
deferred_logger.note("tagme", "note 3");
|
||||
deferred_logger.note("tagme", "note 3");
|
||||
deferred_logger.note("tagme", "note 3");
|
||||
deferred_logger.note("tagme", "note 3");
|
||||
|
||||
deferredlogger.logMessages();
|
||||
deferred_logger.logMessages();
|
||||
|
||||
auto counter = OpmLog::getBackend<CounterLog>("COUNTER");
|
||||
BOOST_CHECK_EQUAL( 1 , counter->numMessages(Log::MessageType::Warning) );
|
||||
|
@ -59,7 +59,7 @@ BOOST_AUTO_TEST_CASE(ConstructGroupFromWell) {
|
||||
|
||||
for (size_t i=0; i<wells.size(); i++) {
|
||||
const auto& well = wells[i];
|
||||
std::shared_ptr<WellsGroupInterface> wellsGroup = createWellWellsGroup(well, summaryState, 2, pu);
|
||||
std::shared_ptr<WellsGroupInterface> wellsGroup = createWellWellsGroup(well, summaryState, pu);
|
||||
BOOST_CHECK_EQUAL(well.name(), wellsGroup->name());
|
||||
if (well.isInjector()) {
|
||||
const auto controls = well.injectionControls(summaryState);
|
||||
|
@ -79,7 +79,7 @@ namespace {
|
||||
|
||||
state.initWellStateMSWell(wmgr.c_wells(),
|
||||
setup.sched.getWells2(timeStep),
|
||||
timeStep, setup.pu, nullptr);
|
||||
setup.pu, nullptr);
|
||||
|
||||
return state;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user