compr_source.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  compr_src
 

Functions

struct compr_srccompr_src_allocate (int np, int nsrc)
 
void compr_src_deallocate (struct compr_src *src)
 
int append_compr_source_term (int c, int np, double v, const double *sat, struct compr_src *src)
 
void clear_compr_source_term (struct compr_src *src)
 

Detailed Description

Data structures and support routines needed to represent explicit, compressible source terms.

Function Documentation

int append_compr_source_term ( int  c,
int  np,
double  v,
const double *  sat,
struct compr_src src 
)

Insert a new explicit source term into an existing collection.

Parameters
[in]cCell influenced by this source term.
[in]npNumber of fluid phases. Used for consistency checking only.
[in]vSource term total reservoir volume Darcy flux. Positive if the source term is to be interpreted as an injection source and negative otherwise.
[in]satInjection composition for this source term. Array of size np. Copied to internal storage, but the actual numbers are not inspected unless v > 0.0.
[in,out]srcOn input - source term management structure obtained through a previous call to construction function compr_src_allocate() and, possibly, another call to function append_compr_source_term(). On output - source term collection that includes the new source term if successful and unchanged if not.
Returns
One (1, true) if successful (i.e., if the new source term could be included in the existing collection) and zero (0, false) if not.
void clear_compr_source_term ( struct compr_src src)

Empty source term collection while maintaining existing capacity.

Parameters
[in,out]srcOn input - an existing source term collection with a given number of sources and source capacity. On output - an empty source term collection (i.e., src->nsrc == 0) with an unchanged capacity.
struct compr_src* compr_src_allocate ( int  np,
int  nsrc 
)

Create a management structure that is, initially, capable of storing a specified number of sources defined by a particular number a fluid phases.

Parameters
[in]npNumber of fluid phases. Must be positive to actually allocate any sources.
[in]nsrcInitial management capacity. If positive, attempt to allocate that number of source terms. Otherwise, the initial capacity is treated as (and set to) zero.
Returns
Fully formed management structure if np > 0 and allocation success. NULL otherwise. The resources must be released using destructor function compr_src_deallocate().
void compr_src_deallocate ( struct compr_src src)

Release memory resources acquired in a previous call to constructor function compr_src_allocate() and, possibly, source term insertion function append_compr_source_term().

Parameters
[in,out]srcOn input - source term management structure obtained through a previous call to construction function compr_src_allocate(). On output - invalid pointer.