Opm::SteadyStateUpscaler< Traits > Class Template Reference

A class for doing steady state upscaling. More...

#include <SteadyStateUpscaler.hpp>

Inheritance diagram for Opm::SteadyStateUpscaler< Traits >:
Inheritance graph

Public Types

enum  { Dimension = UpscalerBase<Traits>::Dimension }
 
typedef UpscalerBase< Traits > Super
 
typedef Super::permtensor_t permtensor_t
 
typedef UpscalerBase< Traits >::GridInterface GridInterface
 
enum  { Dimension = GridType::dimension }
 
enum  BoundaryConditionType { Fixed = 0 , Linear = 1 , Periodic = 2 }
 
typedef Dune::CpGrid GridType
 
typedef Traits::template ResProp< Dimension >::Type ResProp
 

Public Member Functions

 SteadyStateUpscaler ()
 Default constructor. More...
 
std::pair< permtensor_t, permtensor_tupscaleSteadyState (const int flow_direction, const std::vector< double > &initial_saturation, const double boundary_saturation, const double pressure_drop, const permtensor_t &upscaled_perm)
 
const std::vector< double > & lastSaturationState () const
 
double lastSaturationUpscaled () const
 
void init (const Opm::ParameterGroup &param)
 Initializes the upscaler from parameters. More...
 
void init (const Opm::Deck &deck, BoundaryConditionType bctype, double perm_threshold, double residual_tolerance=1e-8, int linsolver_verbosity=0, int linsolver_type=3, bool twodim_hack=false, int linsolver_maxit=0, double linsolver_prolongate_factor=1.0, int linsolver_smooth_steps=1, const double gravity=0.0)
 Initializes the upscaler from given arguments. More...
 
const GridTypegrid () const
 Access the grid. More...
 
void setBoundaryConditionType (BoundaryConditionType type)
 
void setPermeability (const int cell_index, const permtensor_t &k)
 
permtensor_t upscaleSinglePhase ()
 
double upscalePorosity () const
 
double upscaleNetPorosity () const
 
double upscaleNTG () const
 
double upscaleSWCR (const bool NTG) const
 
double upscaleSOWCR (const bool NTG) const
 

Protected Types

typedef Traits::template TransportSolver< GridInterface, typenameSuper::BCs >::Type TransportSolver
 
typedef GridInterface::CellIterator CellIter
 
typedef CellIter::FaceIterator FaceIter
 
typedef BasicBoundaryConditions< true, true > BCs
 
typedef Traits::template FlowSolver< GridInterface, BCs >::Type FlowSolver
 

Protected Member Functions

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
 
virtual void initImpl (const Opm::parameter::ParameterGroup &param)
 Override from superclass. More...
 
template<class FlowSol >
double computeAverageVelocity (const FlowSol &flow_solution, const int flow_dir, const int pdrop_dir) const
 
double computeDelta (const int flow_dir) const
 
template<class FluidInterface >
permtensor_t upscaleEffectivePerm (const FluidInterface &fluid)
 
virtual void initImpl (const Opm::ParameterGroup &param)
 
virtual void initFinal (const Opm::ParameterGroup &param)
 

Protected Attributes

std::vector< double > last_saturation_state_
 
bool use_gravity_
 
bool output_vtk_
 
bool print_inoutflows_
 
int simulation_steps_
 
double stepsize_
 
double relperm_threshold_
 
double maximum_mobility_contrast_
 
double sat_change_threshold_
 
TransportSolver transport_solver_
 
BoundaryConditionType bctype_
 
bool twodim_hack_
 
double residual_tolerance_
 
int linsolver_maxit_
 
double linsolver_prolongate_factor_
 
int linsolver_verbosity_
 
int linsolver_type_
 
int linsolver_smooth_steps_
 
double gravity_
 
GridType grid_
 
GridInterface ginterf_
 
ResProp res_prop_
 
BCs bcond_
 
FlowSolver flow_solver_
 

Detailed Description

template<class Traits>
class Opm::SteadyStateUpscaler< Traits >

A class for doing steady state upscaling.

Author
Atgeirr F. Rasmussen atgei.nosp@m.rr@s.nosp@m.intef.nosp@m..no

Member Typedef Documentation

◆ BCs

template<class Traits >
typedef BasicBoundaryConditions<true, true> Opm::UpscalerBase< Traits >::BCs
protectedinherited

◆ CellIter

template<class Traits >
typedef GridInterface::CellIterator Opm::UpscalerBase< Traits >::CellIter
protectedinherited

◆ FaceIter

template<class Traits >
typedef CellIter::FaceIterator Opm::UpscalerBase< Traits >::FaceIter
protectedinherited

◆ FlowSolver

template<class Traits >
typedef Traits::template FlowSolver<GridInterface,BCs>::Type Opm::UpscalerBase< Traits >::FlowSolver
protectedinherited

◆ GridInterface

template<class Traits >
typedef UpscalerBase<Traits>::GridInterface Opm::SteadyStateUpscaler< Traits >::GridInterface

◆ GridType

template<class Traits >
typedef Dune::CpGrid Opm::UpscalerBase< Traits >::GridType
inherited

◆ permtensor_t

template<class Traits >
typedef Super::permtensor_t Opm::SteadyStateUpscaler< Traits >::permtensor_t

◆ ResProp

template<class Traits >
typedef Traits::template ResProp<Dimension>::Type Opm::UpscalerBase< Traits >::ResProp
inherited

◆ Super

template<class Traits >
typedef UpscalerBase<Traits> Opm::SteadyStateUpscaler< Traits >::Super

◆ TransportSolver

template<class Traits >
typedef Traits::template TransportSolver<GridInterface,typenameSuper::BCs>::Type Opm::SteadyStateUpscaler< Traits >::TransportSolver
protected

Member Enumeration Documentation

◆ anonymous enum

template<class Traits >
anonymous enum
Enumerator
Dimension 

◆ anonymous enum

template<class Traits >
anonymous enum
inherited
Enumerator
Dimension 

◆ BoundaryConditionType

template<class Traits >
enum Opm::UpscalerBase::BoundaryConditionType
inherited
Enumerator
Fixed 
Linear 
Periodic 

Constructor & Destructor Documentation

◆ SteadyStateUpscaler()

template<class Traits >
Opm::SteadyStateUpscaler< Traits >::SteadyStateUpscaler
inline

Default constructor.

Member Function Documentation

◆ computeAverageVelocity()

template<class Traits >
template<class FlowSol >
double Opm::UpscalerBase< Traits >::computeAverageVelocity ( const FlowSol &  flow_solution,
const int  flow_dir,
const int  pdrop_dir 
) const
protectedinherited

◆ computeDelta()

template<class Traits >
double Opm::UpscalerBase< Traits >::computeDelta ( const int  flow_dir) const
inlineprotectedinherited

◆ computeInOutFlows()

template<class Traits >
template<class FlowSol >
void Opm::SteadyStateUpscaler< Traits >::computeInOutFlows ( std::pair< double, double > &  water_inout,
std::pair< double, double > &  oil_inout,
const FlowSol &  flow_solution,
const std::vector< double > &  saturations 
) const
protected

◆ grid()

template<class Traits >
const UpscalerBase< Traits >::GridType & Opm::UpscalerBase< Traits >::grid
inlineinherited

Access the grid.

◆ init() [1/2]

template<class Traits >
void Opm::UpscalerBase< Traits >::init ( const Opm::Deck &  deck,
BoundaryConditionType  bctype,
double  perm_threshold,
double  residual_tolerance = 1e-8,
int  linsolver_verbosity = 0,
int  linsolver_type = 3,
bool  twodim_hack = false,
int  linsolver_maxit = 0,
double  linsolver_prolongate_factor = 1.0,
int  linsolver_smooth_steps = 1,
const double  gravity = 0.0 
)
inlineinherited

Initializes the upscaler from given arguments.

◆ init() [2/2]

template<class Traits >
void Opm::UpscalerBase< Traits >::init ( const Opm::ParameterGroup &  param)
inlineinherited

Initializes the upscaler from parameters.

Referenced by Opm::SteadyStateUpscalerManager< Traits >::upscale().

◆ initFinal()

template<class Traits >
void Opm::UpscalerBase< Traits >::initFinal ( const Opm::ParameterGroup &  param)
inlineprotectedvirtualinherited

◆ initImpl() [1/2]

template<class Traits >
void Opm::SteadyStateUpscaler< Traits >::initImpl ( const Opm::parameter::ParameterGroup &  param)
inlineprotectedvirtual

Override from superclass.

◆ initImpl() [2/2]

template<class Traits >
void Opm::UpscalerBase< Traits >::initImpl ( const Opm::ParameterGroup &  param)
inlineprotectedvirtualinherited

◆ lastSaturationState()

template<class Traits >
const std::vector< double > & Opm::SteadyStateUpscaler< Traits >::lastSaturationState
inline

Accessor for the steady state saturation field. This is empty until upscaleSteadyState() is called, at which point it will contain the last computed (steady) saturation state.

◆ lastSaturationUpscaled()

template<class Traits >
double Opm::SteadyStateUpscaler< Traits >::lastSaturationUpscaled

Computes the upscaled saturation corresponding to the saturation field returned by lastSaturationState(). Does this by computing total saturated volume divided by total pore volume.

References Opm::GIE::Cell< GridInterface, EntityType >::volume().

◆ setBoundaryConditionType()

template<class Traits >
void Opm::UpscalerBase< Traits >::setBoundaryConditionType ( BoundaryConditionType  type)
inlineinherited

Set boundary condition type. This may not be used to swicth between Periodic and the other types, since the grid is modified for Periodic conditions.

◆ setPermeability()

template<class Traits >
void Opm::UpscalerBase< Traits >::setPermeability ( const int  cell_index,
const permtensor_t k 
)
inlineinherited

Set the permeability of a cell directly. This will override the permeability that was read from the eclipse file.

◆ upscaleEffectivePerm()

template<class Traits >
template<class FluidInterface >
UpscalerBase< Traits >::permtensor_t Opm::UpscalerBase< Traits >::upscaleEffectivePerm ( const FluidInterface &  fluid)
inlineprotectedinherited

◆ upscaleNetPorosity()

template<class Traits >
double Opm::UpscalerBase< Traits >::upscaleNetPorosity
inherited

Compute upscaled net porosity.

Returns
total pore volume (with NTG) of all cells divided by total volume.

◆ upscaleNTG()

template<class Traits >
double Opm::UpscalerBase< Traits >::upscaleNTG
inherited

Compute upscaled NTG.

Returns
total net of all cells divided by total volume.

◆ upscalePorosity()

template<class Traits >
double Opm::UpscalerBase< Traits >::upscalePorosity
inherited

Compute upscaled porosity.

Returns
total pore volume of all cells divided by total volume.

◆ upscaleSinglePhase()

template<class Traits >
UpscalerBase< Traits >::permtensor_t Opm::UpscalerBase< Traits >::upscaleSinglePhase
inlineinherited

Does a single-phase upscaling.

Returns
an upscaled permeability tensor.

◆ upscaleSOWCR()

template<class Traits >
double Opm::UpscalerBase< Traits >::upscaleSOWCR ( const bool  NTG) const
inherited

Compute upscaled SOWCR.

Returns
total irreducible oil volume divided by total pore volume

◆ upscaleSteadyState()

template<class Traits >
std::pair< typename SteadyStateUpscaler< Traits >::permtensor_t, typename SteadyStateUpscaler< Traits >::permtensor_t > Opm::SteadyStateUpscaler< Traits >::upscaleSteadyState ( const int  flow_direction,
const std::vector< double > &  initial_saturation,
const double  boundary_saturation,
const double  pressure_drop,
const permtensor_t upscaled_perm 
)
inline

Does a steady-state upscaling.

Parameters
flow_directionThe cardinal direction in which to impose a pressure gradient for the purpose of converging to steady state.
initial_saturationthe initial saturation profile for the steady-state computation. The vector must have size equal to the number of cells in the grid.
boundary_saturationthe saturation of fluid flowing in across the boundary, only needed for nonperiodic upscaling.
pressure_dropthe pressure drop in Pascal over the domain.
upscaled_permtypically the output of upscaleSinglePhase().
Returns
the upscaled relative permeability matrices of both phases. The relative permeability matrix, call it k, is such that if K_w is the phase permeability and K the absolute permeability, K_w = k*K.

References Opm::inverse3x3(), Opm::matprod(), Opm::setupUpscalingConditions(), Opm::ImplicitCapillarityDetails::thresholdMobility(), and Opm::writeVtkOutput().

◆ upscaleSWCR()

template<class Traits >
double Opm::UpscalerBase< Traits >::upscaleSWCR ( const bool  NTG) const
inherited

Compute upscaled SWCR.

Returns
total irreducible water volume divided by total pore volume

Member Data Documentation

◆ bcond_

template<class Traits >
BCs Opm::UpscalerBase< Traits >::bcond_
protectedinherited

◆ bctype_

template<class Traits >
BoundaryConditionType Opm::UpscalerBase< Traits >::bctype_
protectedinherited

◆ flow_solver_

template<class Traits >
FlowSolver Opm::UpscalerBase< Traits >::flow_solver_
protectedinherited

◆ ginterf_

template<class Traits >
GridInterface Opm::UpscalerBase< Traits >::ginterf_
protectedinherited

◆ gravity_

template<class Traits >
double Opm::UpscalerBase< Traits >::gravity_
protectedinherited

◆ grid_

template<class Traits >
GridType Opm::UpscalerBase< Traits >::grid_
protectedinherited

◆ last_saturation_state_

template<class Traits >
std::vector<double> Opm::SteadyStateUpscaler< Traits >::last_saturation_state_
protected

◆ linsolver_maxit_

template<class Traits >
int Opm::UpscalerBase< Traits >::linsolver_maxit_
protectedinherited

◆ linsolver_prolongate_factor_

template<class Traits >
double Opm::UpscalerBase< Traits >::linsolver_prolongate_factor_
protectedinherited

◆ linsolver_smooth_steps_

template<class Traits >
int Opm::UpscalerBase< Traits >::linsolver_smooth_steps_
protectedinherited

◆ linsolver_type_

template<class Traits >
int Opm::UpscalerBase< Traits >::linsolver_type_
protectedinherited

◆ linsolver_verbosity_

template<class Traits >
int Opm::UpscalerBase< Traits >::linsolver_verbosity_
protectedinherited

◆ maximum_mobility_contrast_

template<class Traits >
double Opm::SteadyStateUpscaler< Traits >::maximum_mobility_contrast_
protected

◆ output_vtk_

template<class Traits >
bool Opm::SteadyStateUpscaler< Traits >::output_vtk_
protected

◆ print_inoutflows_

template<class Traits >
bool Opm::SteadyStateUpscaler< Traits >::print_inoutflows_
protected

◆ relperm_threshold_

template<class Traits >
double Opm::SteadyStateUpscaler< Traits >::relperm_threshold_
protected

◆ res_prop_

template<class Traits >
ResProp Opm::UpscalerBase< Traits >::res_prop_
protectedinherited

◆ residual_tolerance_

template<class Traits >
double Opm::UpscalerBase< Traits >::residual_tolerance_
protectedinherited

◆ sat_change_threshold_

template<class Traits >
double Opm::SteadyStateUpscaler< Traits >::sat_change_threshold_
protected

◆ simulation_steps_

template<class Traits >
int Opm::SteadyStateUpscaler< Traits >::simulation_steps_
protected

◆ stepsize_

template<class Traits >
double Opm::SteadyStateUpscaler< Traits >::stepsize_
protected

◆ transport_solver_

template<class Traits >
TransportSolver Opm::SteadyStateUpscaler< Traits >::transport_solver_
protected

◆ twodim_hack_

template<class Traits >
bool Opm::UpscalerBase< Traits >::twodim_hack_
protectedinherited

◆ use_gravity_

template<class Traits >
bool Opm::SteadyStateUpscaler< Traits >::use_gravity_
protected

The documentation for this class was generated from the following files: