mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-12-28 02:00:59 -06:00
MultisegmentWell: use CTAD
This commit is contained in:
parent
4e7b78c4ca
commit
9cc13977b0
@ -213,12 +213,12 @@ assembleAccelerationPressureLoss(const int seg,
|
||||
|
||||
const int seg_upwind = segments_.upwinding_segment(seg);
|
||||
// acceleration term is *subtracted* from pressure equation
|
||||
MultisegmentWellAssemble<FluidSystem,Indices,Scalar>(baseif_).
|
||||
MultisegmentWellAssemble(baseif_).
|
||||
assembleAccelerationTerm(seg, seg, seg_upwind, signed_velocity_head, linSys_);
|
||||
if (seg != seg_upwind) {// special treatment for reverse flow
|
||||
// extra derivatives are *added* to Jacobian (hence minus)
|
||||
const EvalWell extra_derivatives = -segments_.accelerationPressureLossContribution(seg, seg_area, /*extra_derivatives*/ true);
|
||||
MultisegmentWellAssemble<FluidSystem,Indices,Scalar>(baseif_).
|
||||
MultisegmentWellAssemble(baseif_).
|
||||
assemblePressureEqExtraDerivatives(seg, seg_upwind, extra_derivatives, linSys_);
|
||||
}
|
||||
|
||||
@ -230,13 +230,13 @@ assembleAccelerationPressureLoss(const int seg,
|
||||
segments.pressure_drop_accel[seg] -= signed_velocity_head_inlet.value();
|
||||
|
||||
const int inlet_upwind = segments_.upwinding_segment(inlet);
|
||||
MultisegmentWellAssemble<FluidSystem,Indices,Scalar>(baseif_).
|
||||
MultisegmentWellAssemble(baseif_).
|
||||
assembleAccelerationTerm(seg, inlet, inlet_upwind, -signed_velocity_head_inlet, linSys_);
|
||||
if (inlet != inlet_upwind) {// special treatment for reverse flow
|
||||
// extra derivatives are *added* to Jacobian (hence minus minus)
|
||||
const EvalWell extra_derivatives_inlet = segments_.accelerationPressureLossContribution(inlet, inlet_area, /*extra_derivatives*/ true);
|
||||
// in this case inlet_upwind = seg
|
||||
MultisegmentWellAssemble<FluidSystem,Indices,Scalar>(baseif_).
|
||||
MultisegmentWellAssemble(baseif_).
|
||||
assemblePressureEqExtraDerivatives(seg, inlet_upwind, extra_derivatives_inlet, linSys_);
|
||||
}
|
||||
}
|
||||
@ -271,7 +271,7 @@ assembleDefaultPressureEq(const int seg,
|
||||
if (reverseFlow){
|
||||
// call function once again to obtain/assemble remaining derivatives
|
||||
extra_derivatives = -segments_.getFrictionPressureLoss(seg, /*extra_reverse_flow_derivatives*/ true);
|
||||
MultisegmentWellAssemble<FluidSystem,Indices,Scalar>(baseif_).
|
||||
MultisegmentWellAssemble(baseif_).
|
||||
assemblePressureEqExtraDerivatives(seg, seg_upwind, extra_derivatives, linSys_);
|
||||
}
|
||||
pressure_equation -= friction_pressure_drop;
|
||||
@ -282,7 +282,7 @@ assembleDefaultPressureEq(const int seg,
|
||||
const int outlet_segment_index = this->segmentNumberToIndex(this->segmentSet()[seg].outletSegment());
|
||||
const EvalWell outlet_pressure = primary_variables_.getSegmentPressure(outlet_segment_index);
|
||||
|
||||
MultisegmentWellAssemble<FluidSystem,Indices,Scalar>(baseif_).
|
||||
MultisegmentWellAssemble(baseif_).
|
||||
assemblePressureEq(seg, seg_upwind, outlet_segment_index,
|
||||
pressure_equation, outlet_pressure, linSys_);
|
||||
|
||||
@ -306,7 +306,7 @@ assembleICDPressureEq(const int seg,
|
||||
if (const auto& segment = this->segmentSet()[seg];
|
||||
(segment.segmentType() == Segment::SegmentType::VALVE) &&
|
||||
(segment.valve().status() == Opm::ICDStatus::SHUT) ) { // we use a zero rate equation to handle SHUT valve
|
||||
MultisegmentWellAssemble<FluidSystem,Indices,Scalar>(baseif_).
|
||||
MultisegmentWellAssemble(baseif_).
|
||||
assembleTrivialEq(seg, this->primary_variables_.eval(seg)[WQTotal].value(), linSys_);
|
||||
|
||||
auto& ws = well_state.well(baseif_.indexOfWell());
|
||||
@ -352,9 +352,8 @@ assembleICDPressureEq(const int seg,
|
||||
}
|
||||
}
|
||||
if (reverseFlow){
|
||||
MultisegmentWellAssemble<FluidSystem,Indices,Scalar>(baseif_).
|
||||
MultisegmentWellAssemble(baseif_).
|
||||
assemblePressureEqExtraDerivatives(seg, seg_upwind, extra_derivatives, linSys_);
|
||||
|
||||
}
|
||||
|
||||
pressure_equation = pressure_equation - icd_pressure_drop;
|
||||
@ -365,7 +364,7 @@ assembleICDPressureEq(const int seg,
|
||||
const int outlet_segment_index = this->segmentNumberToIndex(this->segmentSet()[seg].outletSegment());
|
||||
const EvalWell outlet_pressure = primary_variables_.getSegmentPressure(outlet_segment_index);
|
||||
|
||||
MultisegmentWellAssemble<FluidSystem,Indices,Scalar>(baseif_).
|
||||
MultisegmentWellAssemble(baseif_).
|
||||
assemblePressureEq(seg, seg_upwind, outlet_segment_index,
|
||||
pressure_equation, outlet_pressure,
|
||||
linSys_,
|
||||
@ -392,15 +391,15 @@ assembleAccelerationAndHydroPressureLosses(const int seg,
|
||||
auto& ws = well_state.well(baseif_.indexOfWell());
|
||||
auto& segments = ws.segments;
|
||||
if (!use_average_density){
|
||||
MultisegmentWellAssemble<FluidSystem,Indices,Scalar>(baseif_).
|
||||
MultisegmentWellAssemble(baseif_).
|
||||
assembleHydroPressureLoss(seg, seg, hydro_pressure_drop_seg, linSys_);
|
||||
segments.pressure_drop_hydrostatic[seg] = hydro_pressure_drop_seg.value();
|
||||
} else {
|
||||
const int seg_outlet = this->segmentNumberToIndex(this->segmentSet()[seg].outletSegment());
|
||||
const auto hydro_pressure_drop_outlet = segments_.getHydroPressureLoss(seg, seg_outlet);
|
||||
MultisegmentWellAssemble<FluidSystem,Indices,Scalar>(baseif_).
|
||||
MultisegmentWellAssemble(baseif_).
|
||||
assembleHydroPressureLoss(seg, seg, 0.5*hydro_pressure_drop_seg, linSys_);
|
||||
MultisegmentWellAssemble<FluidSystem,Indices,Scalar>(baseif_).
|
||||
MultisegmentWellAssemble(baseif_).
|
||||
assembleHydroPressureLoss(seg, seg_outlet, 0.5*hydro_pressure_drop_outlet, linSys_);
|
||||
segments.pressure_drop_hydrostatic[seg] = 0.5*hydro_pressure_drop_seg.value() + 0.5*hydro_pressure_drop_outlet.value();
|
||||
}
|
||||
|
@ -1815,7 +1815,7 @@ namespace Opm
|
||||
for (int comp_idx = 0; comp_idx < this->num_components_; ++comp_idx) {
|
||||
const EvalWell accumulation_term = regularization_factor * (segment_surface_volume * this->primary_variables_.surfaceVolumeFraction(seg, comp_idx)
|
||||
- segment_fluid_initial_[seg][comp_idx]) / dt;
|
||||
MultisegmentWellAssemble<FluidSystem,Indices,Scalar>(*this).
|
||||
MultisegmentWellAssemble(*this).
|
||||
assembleAccumulationTerm(seg, comp_idx, accumulation_term, this->linSys_);
|
||||
}
|
||||
}
|
||||
@ -1828,7 +1828,7 @@ namespace Opm
|
||||
seg_upwind,
|
||||
comp_idx) *
|
||||
this->well_efficiency_factor_;
|
||||
MultisegmentWellAssemble<FluidSystem,Indices,Scalar>(*this).
|
||||
MultisegmentWellAssemble(*this).
|
||||
assembleOutflowTerm(seg, seg_upwind, comp_idx, segment_rate, this->linSys_);
|
||||
}
|
||||
}
|
||||
@ -1843,7 +1843,7 @@ namespace Opm
|
||||
inlet_upwind,
|
||||
comp_idx) *
|
||||
this->well_efficiency_factor_;
|
||||
MultisegmentWellAssemble<FluidSystem,Indices,Scalar>(*this).
|
||||
MultisegmentWellAssemble(*this).
|
||||
assembleInflowTerm(seg, inlet, inlet_upwind, comp_idx, inlet_rate, this->linSys_);
|
||||
}
|
||||
}
|
||||
@ -1888,7 +1888,7 @@ namespace Opm
|
||||
|
||||
this->connectionRates_[perf][comp_idx] = Base::restrictEval(cq_s_effective);
|
||||
|
||||
MultisegmentWellAssemble<FluidSystem,Indices,Scalar>(*this).
|
||||
MultisegmentWellAssemble(*this).
|
||||
assemblePerforationEq(seg, cell_idx, comp_idx, cq_s_effective, this->linSys_);
|
||||
}
|
||||
}
|
||||
@ -1897,7 +1897,7 @@ namespace Opm
|
||||
if (seg == 0) { // top segment, pressure equation is the control equation
|
||||
const auto& summaryState = ebosSimulator.vanguard().summaryState();
|
||||
const Schedule& schedule = ebosSimulator.vanguard().schedule();
|
||||
MultisegmentWellAssemble<FluidSystem,Indices,Scalar>(*this).
|
||||
MultisegmentWellAssemble(*this).
|
||||
assembleControlEq(well_state,
|
||||
group_state,
|
||||
schedule,
|
||||
|
Loading…
Reference in New Issue
Block a user