mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
cleaning up.
no functional change.
This commit is contained in:
parent
93b7cceaf3
commit
86269e0de2
@ -98,7 +98,7 @@ namespace Opm {
|
|||||||
const RateConverterType& rate_converter,
|
const RateConverterType& rate_converter,
|
||||||
const bool terminal_output,
|
const bool terminal_output,
|
||||||
const int current_index,
|
const int current_index,
|
||||||
std::vector<int>& pvt_region_idx);
|
const std::vector<int>& pvt_region_idx);
|
||||||
|
|
||||||
void init(const PhaseUsage phase_usage_arg,
|
void init(const PhaseUsage phase_usage_arg,
|
||||||
const std::vector<bool>& active_arg,
|
const std::vector<bool>& active_arg,
|
||||||
@ -190,7 +190,7 @@ namespace Opm {
|
|||||||
PhaseUsage phase_usage_;
|
PhaseUsage phase_usage_;
|
||||||
std::vector<bool> active_;
|
std::vector<bool> active_;
|
||||||
const RateConverterType& rate_converter_;
|
const RateConverterType& rate_converter_;
|
||||||
std::vector<int> pvt_region_idx_;
|
const std::vector<int>& pvt_region_idx_;
|
||||||
|
|
||||||
// the number of the cells in the local grid
|
// the number of the cells in the local grid
|
||||||
int number_of_cells_;
|
int number_of_cells_;
|
||||||
|
@ -12,7 +12,7 @@ namespace Opm {
|
|||||||
const RateConverterType& rate_converter,
|
const RateConverterType& rate_converter,
|
||||||
const bool terminal_output,
|
const bool terminal_output,
|
||||||
const int current_timeIdx,
|
const int current_timeIdx,
|
||||||
std::vector<int>& pvt_region_idx)
|
const std::vector<int>& pvt_region_idx)
|
||||||
: wells_active_(wells_arg!=nullptr)
|
: wells_active_(wells_arg!=nullptr)
|
||||||
, wells_(wells_arg)
|
, wells_(wells_arg)
|
||||||
, wells_ecl_(wells_ecl)
|
, wells_ecl_(wells_ecl)
|
||||||
|
@ -261,7 +261,7 @@ namespace Opm
|
|||||||
case THP: {
|
case THP: {
|
||||||
well_state.thp()[index_of_well_] = target;
|
well_state.thp()[index_of_well_] = target;
|
||||||
|
|
||||||
const Opm::PhaseUsage& pu = phaseUsage();
|
/* const Opm::PhaseUsage& pu = phaseUsage();
|
||||||
std::vector<double> rates(3, 0.0);
|
std::vector<double> rates(3, 0.0);
|
||||||
if (active()[ Water ]) {
|
if (active()[ Water ]) {
|
||||||
rates[ Water ] = well_state.wellRates()[index_of_well_ * number_of_phases_ + pu.phase_pos[ Water ] ];
|
rates[ Water ] = well_state.wellRates()[index_of_well_ * number_of_phases_ + pu.phase_pos[ Water ] ];
|
||||||
@ -271,7 +271,7 @@ namespace Opm
|
|||||||
}
|
}
|
||||||
if (active()[ Gas ]) {
|
if (active()[ Gas ]) {
|
||||||
rates[ Gas ] = well_state.wellRates()[index_of_well_ * number_of_phases_ + pu.phase_pos[ Gas ] ];
|
rates[ Gas ] = well_state.wellRates()[index_of_well_ * number_of_phases_ + pu.phase_pos[ Gas ] ];
|
||||||
}
|
} */
|
||||||
|
|
||||||
// const int table_id = well_controls_iget_vfp(well_controls_, current);
|
// const int table_id = well_controls_iget_vfp(well_controls_, current);
|
||||||
// const double& thp = well_controls_iget_target(well_controls_, current);
|
// const double& thp = well_controls_iget_target(well_controls_, current);
|
||||||
@ -733,6 +733,8 @@ namespace Opm
|
|||||||
const BlackoilModelParameters& param,
|
const BlackoilModelParameters& param,
|
||||||
WellState& well_state) const
|
WellState& well_state) const
|
||||||
{
|
{
|
||||||
|
// TODO: we should probably distinguish the inner iteration or the final update
|
||||||
|
|
||||||
const bool use_inner_iterations = param.use_inner_iterations_ms_wells_;
|
const bool use_inner_iterations = param.use_inner_iterations_ms_wells_;
|
||||||
|
|
||||||
const double relaxation_factor = use_inner_iterations ? 0.2 : 1.0;
|
const double relaxation_factor = use_inner_iterations ? 0.2 : 1.0;
|
||||||
@ -1112,18 +1114,10 @@ namespace Opm
|
|||||||
// TODO: the concept of phases and components are rather confusing in this function.
|
// TODO: the concept of phases and components are rather confusing in this function.
|
||||||
// needs to be addressed sooner or later.
|
// needs to be addressed sooner or later.
|
||||||
|
|
||||||
|
|
||||||
// TODO: the phase location is so confusing, double check to make sure they are right
|
|
||||||
// do I need the gaspos, oilpos here?
|
|
||||||
|
|
||||||
// compute the segment density first
|
|
||||||
// TODO: the new understanding is that it might not need to know the grid block of the segments
|
|
||||||
// It is a try to calculate the fluid properties without assuming the segment is associated with
|
|
||||||
// any grid blocks
|
|
||||||
|
|
||||||
// get the temperature for later use. It is only useful when we are not handling
|
// get the temperature for later use. It is only useful when we are not handling
|
||||||
// thermal related simulation
|
// thermal related simulation
|
||||||
// basically, it is a single value for all the segments
|
// basically, it is a single value for all the segments
|
||||||
|
|
||||||
EvalWell temperature;
|
EvalWell temperature;
|
||||||
// not sure how to handle the pvt region related to segment
|
// not sure how to handle the pvt region related to segment
|
||||||
// for the current approach, we use the pvt region of the first perforated cell
|
// for the current approach, we use the pvt region of the first perforated cell
|
||||||
@ -1557,7 +1551,6 @@ namespace Opm
|
|||||||
const EvalWell density = segment_densities_[seg];
|
const EvalWell density = segment_densities_[seg];
|
||||||
const EvalWell out_velocity_head = mswellhelpers::velocityHead(area, mass_rate, density);
|
const EvalWell out_velocity_head = mswellhelpers::velocityHead(area, mass_rate, density);
|
||||||
|
|
||||||
// TODO: the sign is really hard and not sure
|
|
||||||
resWell_[seg][SPres] -= out_velocity_head.value();
|
resWell_[seg][SPres] -= out_velocity_head.value();
|
||||||
for (int pv_idx = 0; pv_idx < numWellEq; ++pv_idx) {
|
for (int pv_idx = 0; pv_idx < numWellEq; ++pv_idx) {
|
||||||
duneD_[seg][seg][SPres][pv_idx] -= out_velocity_head.derivative(pv_idx + numEq);
|
duneD_[seg][seg][SPres][pv_idx] -= out_velocity_head.derivative(pv_idx + numEq);
|
||||||
|
@ -298,17 +298,22 @@ public:
|
|||||||
|
|
||||||
const auto& wells_ecl = eclState().getSchedule().getWells(timer.currentStepNum());
|
const auto& wells_ecl = eclState().getSchedule().getWells(timer.currentStepNum());
|
||||||
extractLegacyCellPvtRegionIndex_();
|
extractLegacyCellPvtRegionIndex_();
|
||||||
// handling MS well related
|
WellModel well_model(wells, &(wells_manager.wellCollection()), wells_ecl, model_param_,
|
||||||
|
rateConverter_, terminal_output_, timer.currentStepNum(), legacyCellPvtRegionIdx_);
|
||||||
|
|
||||||
|
// handling MS well related
|
||||||
if (model_param_.use_multisegment_well_) { // if we use MultisegmentWell model
|
if (model_param_.use_multisegment_well_) { // if we use MultisegmentWell model
|
||||||
for (const auto& well : wells_ecl) {
|
for (const auto& well : wells_ecl) {
|
||||||
|
// TODO: this is acutally not very accurate, because sometimes a deck just claims a MS well
|
||||||
|
// while keep the well shut. More accurately, we should check if the well exisits in the Wells
|
||||||
|
// structure here
|
||||||
if (well->isMultiSegment(timer.currentStepNum()) ) { // there is one well is MS well
|
if (well->isMultiSegment(timer.currentStepNum()) ) { // there is one well is MS well
|
||||||
well_state.initWellStateMSWell(wells, wells_ecl, timer.currentStepNum(), phaseUsage_, prev_well_state);
|
well_state.initWellStateMSWell(wells, wells_ecl, timer.currentStepNum(), phaseUsage_, prev_well_state);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
WellModel well_model(wells, &(wells_manager.wellCollection()), wells_ecl, model_param_,
|
|
||||||
rateConverter_, terminal_output_, timer.currentStepNum(), legacyCellPvtRegionIdx_);
|
|
||||||
|
|
||||||
auto solver = createSolver(well_model);
|
auto solver = createSolver(well_model);
|
||||||
|
|
||||||
@ -775,9 +780,9 @@ protected:
|
|||||||
return totals;
|
return totals;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void outputTimestampFIP(SimulatorTimer& timer, const std::string version)
|
void outputTimestampFIP(SimulatorTimer& timer, const std::string version)
|
||||||
{
|
{
|
||||||
std::ostringstream ss;
|
std::ostringstream ss;
|
||||||
boost::posix_time::time_facet* facet = new boost::posix_time::time_facet("%d %b %Y");
|
boost::posix_time::time_facet* facet = new boost::posix_time::time_facet("%d %b %Y");
|
||||||
ss.imbue(std::locale(std::locale::classic(), facet));
|
ss.imbue(std::locale(std::locale::classic(), facet));
|
||||||
|
@ -379,7 +379,8 @@ namespace Opm
|
|||||||
// scale the phase rates for Gas to avoid too bad initial guess for gas fraction
|
// scale the phase rates for Gas to avoid too bad initial guess for gas fraction
|
||||||
// it will probably benefit the standard well too, while it needs to be justified
|
// it will probably benefit the standard well too, while it needs to be justified
|
||||||
// TODO: to see if this strategy can benefit StandardWell too
|
// TODO: to see if this strategy can benefit StandardWell too
|
||||||
// TODO: it might cause big problem for gas rate control or if there is gas rate limit
|
// TODO: it might cause big problem for gas rate control or if there is a gas rate limit
|
||||||
|
// maybe the best way is to initialize the fractions first then get the rates
|
||||||
for (int perf = 0; perf < nperf; perf++) {
|
for (int perf = 0; perf < nperf; perf++) {
|
||||||
const int perf_pos = start_perf + perf;
|
const int perf_pos = start_perf + perf;
|
||||||
perfPhaseRates()[np * perf_pos + gaspos] *= 100.;
|
perfPhaseRates()[np * perf_pos + gaspos] *= 100.;
|
||||||
|
Loading…
Reference in New Issue
Block a user