opm-simulators/opm/simulators/wells/WellConvergence.hpp

72 lines
2.3 KiB
C++
Raw Normal View History

/*
Copyright 2017 SINTEF Digital, Mathematics and Cybernetics.
Copyright 2017 Statoil ASA.
Copyright 2016 - 2017 IRIS AS.
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OPM_WELL_CONVERGENCE_HEADER_INCLUDED
#define OPM_WELL_CONVERGENCE_HEADER_INCLUDED
#include <vector>
namespace Opm
{
class ConvergenceReport;
class DeferredLogger;
template<class Scalar> class WellInterfaceGeneric;
2024-02-17 11:13:46 -06:00
template<class Scalar> class WellState;
2024-02-20 04:14:54 -06:00
template<class Scalar>
class WellConvergence
{
public:
2024-02-20 04:14:54 -06:00
WellConvergence(const WellInterfaceGeneric<Scalar>& well)
: well_(well)
{}
struct Tolerances {
2024-02-20 04:14:54 -06:00
Scalar bhp; //!< Tolerance for bhp controlled well
Scalar thp; //!< Tolerance for thp controlled well
Scalar rates; //!< Tolerance for a rate controlled well
Scalar grup; //!< Tolerance for a grup controlled well
Scalar max_residual_allowed; //!< Max residual allowd
};
// checking the convergence of the well control equations
2024-02-20 04:14:54 -06:00
void checkConvergenceControlEq(const WellState<Scalar>& well_state,
const Tolerances& tolerances,
2024-02-20 04:14:54 -06:00
const Scalar well_control_residual,
const bool well_is_stopped,
ConvergenceReport& report,
DeferredLogger& deferred_logger) const;
2024-02-20 04:14:54 -06:00
void checkConvergencePolyMW(const std::vector<Scalar>& res,
const int Bhp,
2024-02-20 04:14:54 -06:00
const Scalar maxResidualAllowed,
ConvergenceReport& report) const;
private:
2024-02-20 04:14:54 -06:00
const WellInterfaceGeneric<Scalar>& well_;
};
}
#endif // OPM_WELL_CONVERGENCE_HEADER_INCLUDED