cleaning up and adding more comments for better understanding.
No functional change.
This commit is contained in:
parent
3e8b1bdb82
commit
b319e1a75d
@ -204,7 +204,7 @@ namespace Opm
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//TODO: later, it should be extended to update group targets
|
// TODO: later, it should be extended to update group targets
|
||||||
bool WellCollection::needUpdateWellTargets() const
|
bool WellCollection::needUpdateWellTargets() const
|
||||||
{
|
{
|
||||||
return needUpdateInjectionTargets() || needUpdateProductionTargets();
|
return needUpdateInjectionTargets() || needUpdateProductionTargets();
|
||||||
@ -213,6 +213,9 @@ namespace Opm
|
|||||||
|
|
||||||
bool WellCollection::needUpdateInjectionTargets() const
|
bool WellCollection::needUpdateInjectionTargets() const
|
||||||
{
|
{
|
||||||
|
// TODO: it should based on individual group
|
||||||
|
// With current approach, it will potentially result in more update,
|
||||||
|
// thus more iterations, while it will not cause result wrong.
|
||||||
bool any_group_control_node = false;
|
bool any_group_control_node = false;
|
||||||
bool any_should_update_node = false;
|
bool any_should_update_node = false;
|
||||||
|
|
||||||
@ -233,6 +236,9 @@ namespace Opm
|
|||||||
|
|
||||||
bool WellCollection::needUpdateProductionTargets() const
|
bool WellCollection::needUpdateProductionTargets() const
|
||||||
{
|
{
|
||||||
|
// TODO: it should based on individual group
|
||||||
|
// With current approach, it will potentially result in more update,
|
||||||
|
// thus more iterations, while it will not cause result wrong.
|
||||||
bool any_group_control_node = false;
|
bool any_group_control_node = false;
|
||||||
bool any_should_update_node = false;
|
bool any_should_update_node = false;
|
||||||
|
|
||||||
|
@ -111,33 +111,42 @@ namespace Opm
|
|||||||
const std::vector<double>& well_surfacerates_phase);
|
const std::vector<double>& well_surfacerates_phase);
|
||||||
|
|
||||||
|
|
||||||
// TODO: should have tried to use the above applyExplicitReinjectionControls
|
/// applying VREP group control based on calculated voidage rates
|
||||||
// For prototyping, make a new function here at the moment.
|
|
||||||
void applyVREPGroupControls(const std::vector<double>& well_voidage_rates,
|
void applyVREPGroupControls(const std::vector<double>& well_voidage_rates,
|
||||||
const std::vector<double>& conversion_coeffs);
|
const std::vector<double>& conversion_coeffs);
|
||||||
|
|
||||||
/// Checking whehter need to update the targets of the wells / or the groups later
|
/// Checking whether need to update the targets of the wells / or the groups later
|
||||||
/// True need to update well targets within this iteration, no switching control within this iteration.
|
/// True need to update well targets within this iteration, no switching control within this iteration.
|
||||||
/// False no need to update well targets within this iteration, continuing as usual.
|
/// False no need to update well targets within this iteration, continuing as usual.
|
||||||
/// TODO: currently return true whenever a wellNode needs to be updated. Later some more sophiscated
|
|
||||||
/// strategy might be required.
|
|
||||||
bool needUpdateWellTargets() const;
|
bool needUpdateWellTargets() const;
|
||||||
|
|
||||||
|
/// Checking whether need to update the targets for the injection wells.
|
||||||
bool needUpdateInjectionTargets() const;
|
bool needUpdateInjectionTargets() const;
|
||||||
|
|
||||||
|
/// Checking whehter need to update the targets for the production wells.
|
||||||
bool needUpdateProductionTargets() const;
|
bool needUpdateProductionTargets() const;
|
||||||
|
|
||||||
|
/// Number of the well nodes.
|
||||||
size_t numNode() const;
|
size_t numNode() const;
|
||||||
|
|
||||||
|
/// Getting the ith well node.
|
||||||
WellNode* getNode(size_t i) const;
|
WellNode* getNode(size_t i) const;
|
||||||
|
|
||||||
|
/// Updating the well targets based on the well rates.
|
||||||
void updateWellTargets(const std::vector<double> well_rates);
|
void updateWellTargets(const std::vector<double> well_rates);
|
||||||
|
|
||||||
|
/// True right after updating the well targets due to wells switching between individual control and group control.
|
||||||
|
/// It is used to force the simulation continue for another iteration in case that update the well targets are updated,
|
||||||
|
/// at the same time, the simulation is ended because of achieving the convergence with previous well targets.
|
||||||
bool justUpdateWellTargets() const;
|
bool justUpdateWellTargets() const;
|
||||||
|
|
||||||
|
/// Setting the value for just_update_well_targets_
|
||||||
void setJustUpdateWellTargets(const bool flag);
|
void setJustUpdateWellTargets(const bool flag);
|
||||||
|
|
||||||
|
/// When we have VREP group, we need to update the targets based on the updated production voidage rates for each iteration.
|
||||||
bool havingVREPGroups() const;
|
bool havingVREPGroups() const;
|
||||||
|
|
||||||
|
/// Setting the VREP group flag when creating the well collection.
|
||||||
void setHavingVREPGroups(const bool vrep);
|
void setHavingVREPGroups(const bool vrep);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -538,23 +538,14 @@ namespace Opm
|
|||||||
InjectionSpecification::InjectorType inj_type = injSpec().injector_type_;
|
InjectionSpecification::InjectorType inj_type = injSpec().injector_type_;
|
||||||
switch (inj_mode) {
|
switch (inj_mode) {
|
||||||
case InjectionSpecification::RATE:
|
case InjectionSpecification::RATE:
|
||||||
// need to be careful in the future.
|
|
||||||
// pay attention to the phase under control and the phase for the guide rate
|
|
||||||
// they can be different, and more delicate situatioin can happen here.
|
|
||||||
case InjectionSpecification::RESV:
|
case InjectionSpecification::RESV:
|
||||||
{
|
{
|
||||||
// very hacky way here.
|
// all the wells will be assinged a group control target.
|
||||||
// The logic of the code is that only a well is specified under GRUP control, it is under group control.
|
// TODO: when we consider WGRUPCON and well groups not responding to higher level group control
|
||||||
// Which is not the case observed from the result.
|
|
||||||
// From the result, if we specify group control with GCONPROD and WCONPROD for a well, it looks like
|
|
||||||
// the well will be under group control.
|
|
||||||
// TODO: make the logic correct here instead of using `false here`.
|
|
||||||
const double my_guide_rate = injectionGuideRate(false);
|
const double my_guide_rate = injectionGuideRate(false);
|
||||||
|
|
||||||
for (size_t i = 0; i < children_.size(); ++i) {
|
for (size_t i = 0; i < children_.size(); ++i) {
|
||||||
// Apply for all children.
|
// Apply group control to all children.
|
||||||
// Note, we do _not_ want to call the applyProdGroupControl in this object,
|
|
||||||
// as that would check if we're under group control, something we're not.
|
|
||||||
const double children_guide_rate = children_[i]->injectionGuideRate(false);
|
const double children_guide_rate = children_[i]->injectionGuideRate(false);
|
||||||
children_[i]->applyInjGroupControl(inj_mode, inj_type,
|
children_[i]->applyInjGroupControl(inj_mode, inj_type,
|
||||||
(children_guide_rate / my_guide_rate) * getTarget(inj_mode) / efficiencyFactor(),
|
(children_guide_rate / my_guide_rate) * getTarget(inj_mode) / efficiencyFactor(),
|
||||||
@ -563,18 +554,6 @@ namespace Opm
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
case InjectionSpecification::VREP:
|
case InjectionSpecification::VREP:
|
||||||
{
|
|
||||||
// really not sure whether to give a initialized target will be a good idea. It can cause the initial guess too far
|
|
||||||
// from the reasonable result and numerical convergence failure.
|
|
||||||
// Let us try to see what will happen. We begin with 100 / day, which is about 0.001.
|
|
||||||
// const double my_guide_rate = injectionGuideRate(false);
|
|
||||||
|
|
||||||
/* for (size_t i = 0; i < children_.size(); ++i) {
|
|
||||||
const double children_guide_rate = children_[i] -> injectionGuideRate(false);
|
|
||||||
children_[i]->applyInjGroupControl(, inj_type,
|
|
||||||
(children_guide_rate / my_guide_rate) * target / efficiencyFactor(), true);
|
|
||||||
} */
|
|
||||||
}
|
|
||||||
case InjectionSpecification::REIN:
|
case InjectionSpecification::REIN:
|
||||||
std::cout << "Replacement keywords found, remember to call applyExplicitReinjectionControls." << std::endl;
|
std::cout << "Replacement keywords found, remember to call applyExplicitReinjectionControls." << std::endl;
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user