Loading...
Searching...
No Matches
N_solute_transport.h File Reference
`#include "N_pde.h"`
Include dependency graph for N_solute_transport.h:

Go to the source code of this file.

## Data Structures

struct | N_solute_transport_data3d
struct | N_solute_transport_data2d

## Functions

N_data_star * | N_callback_solute_transport_3d (void *solutedata, N_geom_data *geom, int col, int row, int depth)
| This is just a placeholder.
N_data_star * | N_callback_solute_transport_2d (void *solutedata, N_geom_data *geom, int col, int row)
| This callback function creates the mass balance of a 5 point star.
N_solute_transport_data3d * | N_alloc_solute_transport_data3d (int cols, int rows, int depths)
| Allocate memory for the solute transport data structure in three dimensions.
N_solute_transport_data2d * | N_alloc_solute_transport_data2d (int cols, int rows)
| Allocate memory for the solute transport data structure in two dimensions.
void | N_free_solute_transport_data3d (N_solute_transport_data3d *data)
| Release the memory of the solute transport data structure in three dimensions.
void | N_free_solute_transport_data2d (N_solute_transport_data2d *data)
| Release the memory of the solute transport data structure in two dimensions.
void | N_calc_solute_transport_disptensor_2d (N_solute_transport_data2d *data)
| Compute the dispersivity tensor based on the solute transport data in 2d.
void | N_calc_solute_transport_disptensor_3d (N_solute_transport_data3d *data)
| Compute the dispersivity tensor based on the solute transport data in 3d.
void | N_calc_solute_transport_transmission_2d (N_solute_transport_data2d *data)
| Compute the transmission boundary condition in 2d.
void | N_calc_solute_transport_transmission_3d (N_solute_transport_data3d *data)

## Function Documentation

## N_alloc_solute_transport_data2d()

N_solute_transport_data2d * N_alloc_solute_transport_data2d | ( | int | cols,
|  | int | rows )

extern

Allocate memory for the solute transport data structure in two dimensions.

The solute transport data structure will be allocated including all appendant 2d arrays. The offset for the 2d arrays is one to establish homogeneous Neumann boundary conditions at the calculation area border. This data structure is used to create a linear equation system based on the computation of solute transport in porous media with the finite volume method.

Parameters

  cols | int
  rows | int

Returns
  N_solute_transport_data2d *

Definition at line 442 of file n_solute_transport.c.

References N_alloc_array_2d(), N_alloc_gradient_field_2d(), N_UPWIND_EXP, and NULL.

## N_alloc_solute_transport_data3d()

N_solute_transport_data3d * N_alloc_solute_transport_data3d | ( | int | cols,
|  | int | rows,
|  | int | depths )

extern

Allocate memory for the solute transport data structure in three dimensions.

The solute transport data structure will be allocated including all appendant 3d arrays. The offset for the 3d arrays is one to establish homogeneous Neumann boundary conditions at the calculation area border. This data structure is used to create a linear equation system based on the computation of solute transport in porous media with the finite volume method.

Parameters

  cols | int
  rows | int
  depths | int

Returns
  N_solute_transport_data3d *

Definition at line 389 of file n_solute_transport.c.

References N_alloc_array_3d(), N_alloc_gradient_field_3d(), N_UPWIND_EXP, and NULL.

## N_calc_solute_transport_disptensor_2d()

void N_calc_solute_transport_disptensor_2d | ( | N_solute_transport_data2d * | data | ) |

extern

Compute the dispersivity tensor based on the solute transport data in 2d.

The dispersivity tensor is stored in the data structure. To compute the dispersivity tensor, the dispersivity lengths and the gradient field must be present.

This is just a simple tensor computation which should be extended.

Todo
  Change the tensor calculation to a more realistic algorithm

Parameters

  data | N_solute_transport_data2d *

Returns
  void *

Definition at line 637 of file n_solute_transport.c.

References N_gradient_2d::EC, G_debug(), N_get_gradient_2d(), N_put_array_2d_d_value(), N_gradient_2d::NC, N_gradient_2d::SC, and N_gradient_2d::WC.

## N_calc_solute_transport_disptensor_3d()

void N_calc_solute_transport_disptensor_3d | ( | N_solute_transport_data3d * | data | ) |

extern

Compute the dispersivity tensor based on the solute transport data in 3d.

The dispersivity tensor is stored in the data structure. To compute the dispersivity tensor, the dispersivity lengths and the gradient field must be present.

This is just a simple tensor computation which should be extended.

Todo
  Change the tensor calculation to a more realistic algorithm

Parameters

  data | N_solute_transport_data3d *

Returns
  void *

Definition at line 698 of file n_solute_transport.c.

References N_gradient_3d::BC, N_gradient_3d::EC, G_debug(), N_get_gradient_3d(), N_put_array_3d_d_value(), N_gradient_3d::NC, N_gradient_3d::SC, N_gradient_3d::TC, and N_gradient_3d::WC.

## N_calc_solute_transport_transmission_2d()

void N_calc_solute_transport_transmission_2d | ( | N_solute_transport_data2d * | data | ) |

extern

Compute the transmission boundary condition in 2d.

This function calculates the transmission boundary condition for each cell with status N_CELL_TRANSMISSION. The surrounding gradient field is used to verify the flow direction. If a flow goes into a cell, the concentration (data->c) from the neighbour cell is added to the transmission cell. If the flow from several neighbour cells goes into the cell, the concentration mean is calculated.

The new concentrations are written into the data->c_start array, so they can be handled by the matrix assembling function.

Parameters

  data | N_solute_transport_data2d *

Returns
  void *

Definition at line 563 of file n_solute_transport.c.

References count, N_gradient_2d::EC, G_debug(), N_CELL_TRANSMISSION, N_get_array_2d_d_value(), N_get_gradient_2d(), N_is_array_2d_value_null(), N_put_array_2d_d_value(), N_gradient_2d::NC, N_gradient_2d::SC, and N_gradient_2d::WC.

## N_calc_solute_transport_transmission_3d()

void N_calc_solute_transport_transmission_3d | ( | N_solute_transport_data3d * | data | ) |

extern

## N_callback_solute_transport_2d()

N_data_star * N_callback_solute_transport_2d | ( | void * | solutedata,
|  | N_geom_data * | geom,
|  | int | col,
|  | int | row )

extern

This callback function creates the mass balance of a 5 point star.

The mass balance is based on the common solute transport equation:

This equation is discretizised with the finite volume method in two dimensions.

Parameters

  solutedata | * N_solute_transport_data2d - a void pointer to the data structure
  geom | N_geom_data *
  col | int
  row | int

Returns
  N_data_star * - a five point data star

Definition at line 180 of file n_solute_transport.c.

References N_geom_data::dx, N_geom_data::dy, N_gradient_2d::EC, G_debug(), N_calc_geom_mean(), N_calc_harmonic_mean(), N_CELL_TRANSMISSION, N_create_9star(), N_exp_upwinding(), N_full_upwinding(), N_get_array_2d_d_value(), N_get_geom_data_area_of_cell(), N_get_gradient_2d(), N_UPWIND_EXP, N_UPWIND_FULL, N_gradient_2d::NC, NE, NULL, NW, N_gradient_2d::SC, SE, SW, and N_gradient_2d::WC.

## N_callback_solute_transport_3d()

N_data_star * N_callback_solute_transport_3d | ( | void * | solutedata,
|  | N_geom_data * | geom,
|  | int | col,
|  | int | row,
|  | int | depth )

extern

This is just a placeholder.

Definition at line 27 of file n_solute_transport.c.

References N_gradient_3d::BC, N_geom_data::dx, N_geom_data::dy, N_geom_data::dz, N_gradient_3d::EC, G_debug(), N_calc_harmonic_mean(), N_create_7star(), N_exp_upwinding(), N_get_array_3d_d_value(), N_get_geom_data_area_of_cell(), N_get_gradient_3d(), N_gradient_3d::NC, NULL, N_gradient_3d::SC, N_gradient_3d::TC, and N_gradient_3d::WC.

## N_free_solute_transport_data2d()

void N_free_solute_transport_data2d | ( | N_solute_transport_data2d * | data | ) |

extern

Release the memory of the solute transport data structure in two dimensions.

Parameters

  data | N_solute_transport_data2d *

Returns
  void *

Definition at line 521 of file n_solute_transport.c.

References G_free(), N_free_array_2d(), and NULL.

## N_free_solute_transport_data3d()

void N_free_solute_transport_data3d | ( | N_solute_transport_data3d * | data | ) |

extern

Release the memory of the solute transport data structure in three dimensions.

Parameters

  data | N_solute_transport_data2d *

Returns
  void *

Definition at line 483 of file n_solute_transport.c.

References G_free(), N_free_array_3d(), and NULL.