Opm::VertEqUpscaler Struct Reference

#include <upscale.hpp>

Public Member Functions

 VertEqUpscaler (const TopSurf &topSurf)
 
void gather (int col, double *buf, const double *data, int stride, int offset) const
 
void wgt_dpt (int col, const double *val, rlw_double &res) const
 
double dpt_avg (int col, const double *val) const
 
double sum (int col, const double *val) const
 
int num_rows (int col) const
 
Elevation bottom (int col) const
 
double eval (int col, const rlw_double &dpt, const Elevation zeta) const
 
Elevation find (int col, const double *dpt, const double target) const
 

Protected Attributes

const TopSurfts
 

Detailed Description

Extension of the top surface that does integration across columns. The extension is done by aggregation since these methods really are orthogonal to how the grid is created.

Constructor & Destructor Documentation

Opm::VertEqUpscaler::VertEqUpscaler ( const TopSurf topSurf)
inline

Create a layer on top of a top surface that can upscale properties in columns.

Parameters
topSurfGrid that provides the weights in the integrations.

Member Function Documentation

Elevation Opm::VertEqUpscaler::bottom ( int  col) const

Get the elevation of the bottom of a column. This is usable when we want to get the depth-average for the entire column.

double Opm::VertEqUpscaler::dpt_avg ( int  col,
const double *  val 
) const

Depth-average of a property discretized for each block.

This is the same as the last item written in the column wih wgt_dpt, except this method returns the single result instead of all values down the column.

Parameters
colIndex of the column for which values should be averaged.
valValue for each block in the column.
Returns
Values weighted by the depth in each block, divided by the total depth of the column.
double Opm::VertEqUpscaler::eval ( int  col,
const rlw_double dpt,
const Elevation  zeta 
) const

Perform table lookup in an array of depth-averaged values.

Given a height in the form of a discretized elevation, quickly find the depth-averaged value at this point.

Parameters
colColumn that the elevation is specified for.
dptDepth fractions weighted with a certain property. This should be calculated with wgt_dpt().
zetaThe elevation to find. Use the interp() routine to get an elevation for an upscaled saturation.
Returns
Depth-weighted value of the property from the top down to the specified height.
Elevation Opm::VertEqUpscaler::find ( int  col,
const double *  dpt,
const double  target 
) const

Find the elevation where an integrated property has a certain value.

The method solves the equation

\int_{elevation}^{top} property dz = target

with respect to elevation, where the dpt argument contains precalculated values for the integral down to and including each block in the column.

Parameters
colIndex of the column to search, this is the coarse grid block number
dptDepth fractions weighted with a certain property. This should be calculated with wgt_dpt().
targetValue the integral from top down to the goal height should have.
Returns
Elevation where the integral specified in dpt down to this point becomes the target.
void Opm::VertEqUpscaler::gather ( int  col,
double *  buf,
const double *  data,
int  stride,
int  offset 
) const

Retrieve a property from the fine grid for a certain column of blocks.

The property is stored in records of 'stride' length, 'offset' elements from the start. (This is used to index into a permeability tensor).

Parameters
colIndex of the column to retrieve. This must be a valid cell number in the top surface.
bufArray that will receive the data. It is assumed that this is preallocated, and is large enough to hold the data for this column.
dataArray that contains the property for the entire fine grid. This is typically something that was retrieved from a fluid object associated with the fine grid.
strideNumber of values (not bytes!) between each entry for the property. Use one for simple arrays.
offsetNumber of values (not bytes!) before the first entry for this property. Use zero for simple arrays.
int Opm::VertEqUpscaler::num_rows ( int  col) const

Number of rows in a specified column. Use this method to get the expected length of arrays containing properties for it. (However, use ts.max_vert_res to preallocate space!)

double Opm::VertEqUpscaler::sum ( int  col,
const double *  val 
) const

Sum a property such as a source term down the column.

Use this method for upscaling things that are specified independent of the block size (source terms is specified as a volumetric flux (see computePorevolume in opm/core/utility/miscUtilities.cpp)).

Parameters
colIndex of the column for which values should be summed.
valValue for each block in the entire grid, same as the data argument to gather(). The reason for using this method is to avoid the extra copy.
Returns
Sum of values for this block, regardless of depth.
void Opm::VertEqUpscaler::wgt_dpt ( int  col,
const double *  val,
rlw_double res 
) const

Depth fraction weighted by an expression specified as piecewise values downwards a column from the top.

Returned for each block is the integral from the top down to and including each block, divided by the total height of the column. The last value will thus contain the average for the entire column.

Parameters
colIndex of the column for which the expression should be integrated.
valIntegrand values for each block in the column.
resArray that will receive the result. The caller must preallocate storage and pass it as input here. Only the column specified with col will be filled.

Member Data Documentation

const TopSurf& Opm::VertEqUpscaler::ts
protected

The documentation for this struct was generated from the following file: