Loading...
Searching...
No Matches
SteadyStateUpscalerImplicit.hpp
//===========================================================================
//
// File: SteadyStateUpscaler.hpp
//
// Created: Fri Aug 28 14:01:19 2009
//
// Author(s): Atgeirr F Rasmussen <atgeirr@sintef.no>
// B�rd Skaflestad <bard.skaflestad@sintef.no>
//
// $Date$
//
// $Revision$
//
//===========================================================================
/*
Copyright 2009, 2010 SINTEF ICT, Applied Mathematics.
Copyright 2009, 2010 Statoil ASA.
This file is part of The Open Reservoir Simulator Project (OpenRS).
OpenRS 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.
OpenRS 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 OpenRS. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OPM_STEADYSTATEUPSCALERIMPLICIT_HEADER
#define OPM_STEADYSTATEUPSCALERIMPLICIT_HEADER
#include <opm/upscaling/UpscalerBase.hpp>
#include <opm/porsol/euler/EulerUpstream.hpp>
#include <opm/porsol/euler/ImplicitCapillarity.hpp>
#include <opm/grid/common/GridAdapter.hpp>
namespace Opm
{
template <class Traits>
class SteadyStateUpscalerImplicit : public UpscalerBase<Traits>
{
public:
// ------- Typedefs and enums -------
typedef UpscalerBase<Traits> Super;
typedef typename Super::permtensor_t permtensor_t;
typedef typename UpscalerBase<Traits>::GridInterface GridInterface;
typedef typename UpscalerBase<Traits>::GridType GridType;
enum { Dimension = UpscalerBase<Traits>::Dimension };
// ------- Methods -------
SteadyStateUpscalerImplicit();
std::pair<permtensor_t, permtensor_t> upscaleSteadyState(const int flow_direction,
const std::vector<double>& initial_saturation,
const double boundary_saturation,
const double pressure_drop,
const permtensor_t& upscaled_perm,bool& success);
const std::vector<double>& lastSaturationState() const;
double lastSaturationUpscaled() const;
void initSatLimits(std::vector<double>& s) const;
void setToCapillaryLimit(double average_s, std::vector<double>& s) const;
protected:
// ------- Typedefs -------
typedef typename Traits::template TransportSolver<GridInterface, typename Super::BCs>::Type TransportSolver;
// ------- Methods -------
template <class FlowSol>
void computeInOutFlows(std::pair<double, double>& water_inout,
std::pair<double, double>& oil_inout,
const FlowSol& flow_solution,
const std::vector<double>& saturations) const;
void initImpl(const Opm::ParameterGroup& param) override;
// ------- Data members -------
std::vector<double> last_saturation_state_;
bool use_gravity_;
bool output_vtk_;
bool output_ecl_;
bool print_inoutflows_;
int simulation_steps_;
double init_stepsize_;
double relperm_threshold_;
double maximum_mobility_contrast_;
double sat_change_year_;
int max_it_;
double max_stepsize_;
double dt_sat_tol_;
bool use_maxdiff_;
TransportSolver transport_solver_;
GridAdapter grid_adapter_;
};
} // namespace Opm
#include "SteadyStateUpscalerImplicit_impl.hpp"
#endif // OPM_STEADYSTATEUPSCALERIMPLICIT_HEADER
Opm::SteadyStateUpscalerImplicit::initImpl
void initImpl(const Opm::ParameterGroup &param) override
Override from superclass.
Definition SteadyStateUpscalerImplicit_impl.hpp:78
Opm::SteadyStateUpscalerImplicit::initSatLimits
void initSatLimits(std::vector< double > &s) const
Ensure saturations are not outside table.
Definition SteadyStateUpscalerImplicit_impl.hpp:416
Opm::SteadyStateUpscalerImplicit::lastSaturationUpscaled
double lastSaturationUpscaled() const
Computes the upscaled saturation corresponding to the saturation field returned by lastSaturationStat...
Definition SteadyStateUpscalerImplicit_impl.hpp:400
Opm::SteadyStateUpscalerImplicit::upscaleSteadyState
std::pair< permtensor_t, permtensor_t > upscaleSteadyState(const int flow_direction, const std::vector< double > &initial_saturation, const double boundary_saturation, const double pressure_drop, const permtensor_t &upscaled_perm, bool &success)
Does a steady-state upscaling.
Definition SteadyStateUpscalerImplicit_impl.hpp:175
Opm::SteadyStateUpscalerImplicit::SteadyStateUpscalerImplicit
SteadyStateUpscalerImplicit()
Default constructor.
Definition SteadyStateUpscalerImplicit_impl.hpp:56
Opm::SteadyStateUpscalerImplicit::lastSaturationState
const std::vector< double > & lastSaturationState() const
Accessor for the steady state saturation field.
Definition SteadyStateUpscalerImplicit_impl.hpp:391
Opm::UpscalerBase::permtensor_t
ResProp::MutablePermTensor permtensor_t
A type for the upscaled permeability.
Definition UpscalerBase.hpp:66
Opm::UpscalerBase::UpscalerBase
UpscalerBase()
Default constructor.
Definition UpscalerBase_impl.hpp:48
Opm
Inverting small matrices.
Definition ImplicitAssembly.hpp:43