Data structures and support routines needed to represent explicit, compressible source terms. More...
Go to the source code of this file.
Classes | |
struct | compr_src |
Collection of explicit, compressible source terms. More... | |
Functions | |
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. More... | |
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(). More... | |
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. More... | |
void | clear_compr_source_term (struct compr_src *src) |
Empty source term collection while maintaining existing capacity. More... | |
Data structures and support routines needed to represent explicit, compressible source terms.
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.
[in] | c | Cell influenced by this source term. |
[in] | np | Number of fluid phases. Used for consistency checking only. |
[in] | v | Source term total reservoir volume Darcy flux. Positive if the source term is to be interpreted as an injection source and negative otherwise. |
[in] | sat | Injection 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] | src | On 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. |
void clear_compr_source_term | ( | struct compr_src * | src | ) |
Empty source term collection while maintaining existing capacity.
[in,out] | src | On 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.
[in] | np | Number of fluid phases. Must be positive to actually allocate any sources. |
[in] | nsrc | Initial management capacity. If positive, attempt to allocate that number of source terms. Otherwise, the initial capacity is treated as (and set to) zero. |
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().
[in,out] | src | On input - source term management structure obtained through a previous call to construction function compr_src_allocate(). On output - invalid pointer. |