Loading...
Searching...
No Matches
MultisegmentWellAssemble.hpp
/*
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_MULTISEGMENTWELL_ASSEMBLE_HEADER_INCLUDED
#define OPM_MULTISEGMENTWELL_ASSEMBLE_HEADER_INCLUDED
#include <opm/input/eclipse/Schedule/Well/Well.hpp>
#include <opm/material/densead/Evaluation.hpp>
namespace Opm
{
class DeferredLogger;
template<class Scalar> class GroupState;
template<class Scalar, typename IndexTraits, int numWellEq, int numEq> class MultisegmentWellEquations;
template<class FluidSystem, class Indices> class MultisegmentWellPrimaryVariables;
class Schedule;
class SummaryState;
template<class FluidSystem, class Indices> class WellInterfaceIndices;
template<typename Scalar, typename IndexTraits> class WellState;
template<class FluidSystem, class Indices>
class MultisegmentWellAssemble
{
using PrimaryVariables = MultisegmentWellPrimaryVariables<FluidSystem,Indices>;
static constexpr int WQTotal = PrimaryVariables::WQTotal;
static constexpr bool has_wfrac_variable = PrimaryVariables::has_wfrac_variable;
static constexpr bool has_gfrac_variable = PrimaryVariables::has_gfrac_variable;
static constexpr int WFrac = PrimaryVariables::WFrac;
static constexpr int GFrac = PrimaryVariables::GFrac;
static constexpr int SPres = PrimaryVariables::SPres;
public:
static constexpr int numWellEq = Indices::numPhases+1;
using Scalar = typename FluidSystem::Scalar;
using IndexTraits = typename FluidSystem::IndexTraitsType;
using Equations = MultisegmentWellEquations<Scalar, IndexTraits, numWellEq,Indices::numEq>;
using EvalWell = DenseAd::Evaluation<Scalar, numWellEq+Indices::numEq>;
explicit MultisegmentWellAssemble(const WellInterfaceIndices<FluidSystem,Indices>& well)
: well_(well)
{}
void assembleControlEq(const WellState<Scalar, IndexTraits>& well_state,
const GroupState<Scalar>& group_state,
const Schedule& schedule,
const SummaryState& summaryState,
const Well::InjectionControls& inj_controls,
const Well::ProductionControls& prod_controls,
const Scalar rho,
const PrimaryVariables& primary_variables,
Equations& eqns,
const bool stopped_or_zero_target,
DeferredLogger& deferred_logger) const;
void assembleAccelerationTerm(const int seg_target,
const int seg,
const int seg_upwing,
const EvalWell& accelerationTerm,
Equations& eqns1) const;
void assembleHydroPressureLoss(const int seg,
const int seg_density,
const EvalWell& hydro_pressure_drop_seg,
Equations& eqns1) const;
void assemblePressureEqExtraDerivatives(const int seg,
const int seg_upwind,
const EvalWell& extra_derivatives,
Equations& eqns1) const;
void assemblePressureEq(const int seg,
const int seg_upwind,
const int outlet_segment_index,
const EvalWell& pressure_equation,
const EvalWell& outlet_pressure,
Equations& eqns) const;
void assembleTrivialEq(const int seg,
const Scalar value,
Equations& eqns) const;
void assembleAccumulationTerm(const int seg,
const int comp_idx,
const EvalWell& accumulation_term,
Equations& eqns1) const;
void assembleOutflowTerm(const int seg,
const int seg_upwind,
const int comp_idx,
const EvalWell& segment_rate,
Equations& eqns1) const;
void assembleInflowTerm(const int seg,
const int inlet,
const int inlet_upwind,
const int comp_idx,
const EvalWell& inlet_rate,
Equations& eqns) const;
void assemblePerforationEq(const int seg,
const int local_perf_index,
const int comp_idx,
const EvalWell& cq_s_effective,
Equations& eqns) const;
private:
const WellInterfaceIndices<FluidSystem,Indices>& well_;
};
}
#endif // OPM_STANDARDWELL_ASSEMBLE_HEADER_INCLUDED
Opm::DeferredLogger
Definition DeferredLogger.hpp:57
Opm::GroupState
Definition GroupState.hpp:41
Opm::MultisegmentWellAssemble::assembleOutflowTerm
void assembleOutflowTerm(const int seg, const int seg_upwind, const int comp_idx, const EvalWell &segment_rate, Equations &eqns1) const
Assemble outflow term.
Definition MultisegmentWellAssemble.cpp:343
Opm::MultisegmentWellAssemble::assembleControlEq
void assembleControlEq(const WellState< Scalar, IndexTraits > &well_state, const GroupState< Scalar > &group_state, const Schedule &schedule, const SummaryState &summaryState, const Well::InjectionControls &inj_controls, const Well::ProductionControls &prod_controls, const Scalar rho, const PrimaryVariables &primary_variables, Equations &eqns, const bool stopped_or_zero_target, DeferredLogger &deferred_logger) const
Assemble control equation.
Definition MultisegmentWellAssemble.cpp:85
Opm::MultisegmentWellAssemble::MultisegmentWellAssemble
MultisegmentWellAssemble(const WellInterfaceIndices< FluidSystem, Indices > &well)
Constructor initializes reference to well.
Definition MultisegmentWellAssemble.hpp:61
Opm::MultisegmentWellAssemble::assemblePressureEqExtraDerivatives
void assemblePressureEqExtraDerivatives(const int seg, const int seg_upwind, const EvalWell &extra_derivatives, Equations &eqns1) const
Assemble additional derivatives due to reverse flow.
Definition MultisegmentWellAssemble.cpp:259
Opm::MultisegmentWellAssemble::assembleAccelerationTerm
void assembleAccelerationTerm(const int seg_target, const int seg, const int seg_upwing, const EvalWell &accelerationTerm, Equations &eqns1) const
Assemble piece of the acceleration term.
Definition MultisegmentWellAssemble.cpp:208
Opm::MultisegmentWellAssemble::assemblePerforationEq
void assemblePerforationEq(const int seg, const int local_perf_index, const int comp_idx, const EvalWell &cq_s_effective, Equations &eqns) const
Assemble equation for a perforation.
Definition MultisegmentWellAssemble.cpp:392
Opm::MultisegmentWellAssemble::assemblePressureEq
void assemblePressureEq(const int seg, const int seg_upwind, const int outlet_segment_index, const EvalWell &pressure_equation, const EvalWell &outlet_pressure, Equations &eqns) const
Assemble pressure terms.
Definition MultisegmentWellAssemble.cpp:277
Opm::MultisegmentWellAssemble::assembleTrivialEq
void assembleTrivialEq(const int seg, const Scalar value, Equations &eqns) const
Assembles a trivial equation.
Definition MultisegmentWellAssemble.cpp:307
Opm::MultisegmentWellAssemble::assembleInflowTerm
void assembleInflowTerm(const int seg, const int inlet, const int inlet_upwind, const int comp_idx, const EvalWell &inlet_rate, Equations &eqns) const
Assemble inflow term.
Definition MultisegmentWellAssemble.cpp:367
Opm::MultisegmentWellAssemble::assembleAccumulationTerm
void assembleAccumulationTerm(const int seg, const int comp_idx, const EvalWell &accumulation_term, Equations &eqns1) const
Assemble accumulation term.
Definition MultisegmentWellAssemble.cpp:325
Opm::MultisegmentWellAssemble::assembleHydroPressureLoss
void assembleHydroPressureLoss(const int seg, const int seg_density, const EvalWell &hydro_pressure_drop_seg, Equations &eqns1) const
Assemble hydraulic pressure term.
Definition MultisegmentWellAssemble.cpp:239
Opm::MultisegmentWellEquations
Definition MultisegmentWellEquations.hpp:52
Opm::MultisegmentWellPrimaryVariables
Definition MultisegmentWellPrimaryVariables.hpp:45
Opm::WellInterfaceIndices
Definition WellInterfaceIndices.hpp:34
Opm::WellState
The state of a set of wells, tailored for use by the fully implicit blackoil simulator.
Definition WellState.hpp:66
Opm
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition blackoilbioeffectsmodules.hh:43