/*
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 .
*/
#ifndef OPM_STANDARDWELL_ASSEMBLE_HEADER_INCLUDED
#define OPM_STANDARDWELL_ASSEMBLE_HEADER_INCLUDED
#include
namespace Opm
{
class DeferredLogger;
class GroupState;
class Schedule;
template class StandardWellEquations;
template class StandardWellPrimaryVariables;
class SummaryState;
template class WellInterfaceFluidSystem;
class WellState;
//! \brief Class handling assemble of the equation system for StandardWell.
template
class StandardWellAssemble
{
public:
using PrimaryVariables = StandardWellPrimaryVariables;
using EvalWell = typename PrimaryVariables::EvalWell;
//! \brief Constructor initializes reference to well.
StandardWellAssemble(const WellInterfaceFluidSystem& well)
: well_(well)
{}
//! \brief Assemble control equation.
void assembleControlEq(const WellState& well_state,
const GroupState& group_state,
const Schedule& schedule,
const SummaryState& summaryState,
const Well::InjectionControls& inj_controls,
const Well::ProductionControls& prod_controls,
const PrimaryVariables& primary_variables,
const double rho,
StandardWellEquations& eqns,
DeferredLogger& deferred_logger) const;
//! \brief Assemble injectivity equation.
void assembleInjectivityEq(const EvalWell& eq_pskin,
const EvalWell& eq_wat_vel,
const int pskin_index,
const int wat_vel_index,
const int cell_idx,
const int numWellEq,
StandardWellEquations& eqns) const;
//! \brief Assemble equation for a perforation.
void assemblePerforationEq(const EvalWell& cq_s_effective,
const int componentIdx,
const int cell_idx,
const int numWellEq,
StandardWellEquations& eqns) const;
//! \brief Assemble equation for Z fraction.
void assembleZFracEq(const EvalWell& cq_s_zfrac_effective,
const int cell_idx,
const int numWellEq,
StandardWellEquations& eqns) const;
//! \brief Assemble a source term.
void assembleSourceEq(const EvalWell& resWell_loc,
const int componentIdx,
const int numWellEq,
StandardWellEquations& eqns) const;
private:
const WellInterfaceFluidSystem& well_; //!< Reference to well
};
}
#endif // OPM_STANDARDWELL_ASSEMBLE_HEADER_INCLUDED