mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-12-22 15:33:29 -06:00
Add sub iterations for balancing the network
This commit is contained in:
parent
b4fe429b35
commit
93206349c8
@ -1392,7 +1392,7 @@ inferLocalShutWells()
|
||||
|
||||
template<class Scalar>
|
||||
Scalar BlackoilWellModelGeneric<Scalar>::
|
||||
updateNetworkPressures(const int reportStepIdx)
|
||||
updateNetworkPressures(const int reportStepIdx, const Scalar damping_factor)
|
||||
{
|
||||
// Get the network and return if inactive (no wells in network at this time)
|
||||
const auto& network = schedule()[reportStepIdx].network();
|
||||
@ -1432,7 +1432,6 @@ updateNetworkPressures(const int reportStepIdx)
|
||||
// TODO: the following parameters are subject to adjustment for optimization purpose
|
||||
constexpr Scalar upper_update_bound = 5.0 * unit::barsa;
|
||||
// relative dampening factor based on update value
|
||||
constexpr Scalar damping_factor = 0.1;
|
||||
const Scalar damped_change = std::min(damping_factor * std::abs(change), upper_update_bound);
|
||||
const Scalar sign = change > 0 ? 1. : -1.;
|
||||
node_pressures_[name] = pressure + sign * damped_change;
|
||||
|
@ -332,7 +332,8 @@ protected:
|
||||
|
||||
bool wasDynamicallyShutThisTimeStep(const int well_index) const;
|
||||
|
||||
Scalar updateNetworkPressures(const int reportStepIdx);
|
||||
Scalar updateNetworkPressures(const int reportStepIdx,
|
||||
const Scalar damping_factor);
|
||||
|
||||
void updateWsolvent(const Group& group,
|
||||
const int reportStepIdx,
|
||||
|
@ -2187,12 +2187,18 @@ namespace Opm {
|
||||
const double dt = this->simulator_.timeStepSize();
|
||||
// Calculate common THP for subsea manifold well group (item 3 of NODEPROP set to YES)
|
||||
computeWellGroupThp(dt, deferred_logger);
|
||||
const auto local_network_imbalance = this->updateNetworkPressures(episodeIdx);
|
||||
const Scalar network_imbalance = comm.max(local_network_imbalance);
|
||||
const auto& balance = this->schedule()[episodeIdx].network_balance();
|
||||
constexpr Scalar relaxation_factor = 10.0;
|
||||
const Scalar tolerance = relax_network_tolerance ? relaxation_factor * balance.pressure_tolerance() : balance.pressure_tolerance();
|
||||
more_network_update = this->networkActive() && network_imbalance > tolerance;
|
||||
const int number_of_sub_iterations = 10;
|
||||
const Scalar damping_factor = 1.0/number_of_sub_iterations;
|
||||
for (int i = 0; i < number_of_sub_iterations; i++) {
|
||||
const auto local_network_imbalance = this->updateNetworkPressures(episodeIdx, damping_factor);
|
||||
const Scalar network_imbalance = comm.max(local_network_imbalance);
|
||||
const auto& balance = this->schedule()[episodeIdx].network_balance();
|
||||
constexpr Scalar relaxation_factor = 10.0;
|
||||
const Scalar tolerance = relax_network_tolerance ? relaxation_factor * balance.pressure_tolerance() : balance.pressure_tolerance();
|
||||
more_network_update = this->networkActive() && network_imbalance > tolerance;
|
||||
if (!more_network_update)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool changed_well_group = false;
|
||||
|
Loading…
Reference in New Issue
Block a user