db.diffusion {RGeostats}R Documentation

Calculate the diffusion coefficient over coarse cells


Calculate the diffusion coefficient over coarse cells


db.diffusion(dbgin, dbgout, orient=0, niter=100, nseed=100, seed=43243,
             verbose=FALSE, radix = "Diffusion", modify.target = db.locmod())



The db-class structure of the Grid Db where the Input variable is read. Its dimension must lie between 1 and 3.


The db-class structure of the Grid Db where the Output variable is written. Its dimension must lie between 1 and 3 It must have the same space dimension as 'dbgin'.


Diffusion orientation: 0 for Euclidean distance, 1 for distance along X, 2 for distance along Y and 3 for distance along Z. Its value must be consistent with the Space Dimension of the Input Grid Db.


Number of time iterations for the random walk


Number of independent trajectories.


Seed used to initialze the random number generator. When 0, the seed is not initialized.


Verbose option


Radix of the name given to the upscaled variable.


Decides whether or not the newly created variables will have their locator defined or not. For more information, see db.locmod.


The principle is to calculate the average diffusion coefficient over a set of coarse cells (of the output Db Grid) starting from the information provided on small cells (of the input Db Grid). Each fine cell contains a real value which could be:

Each coarse cell is treated separately.

The idea is to perform a Monte-Carlo simulation in order to derive the upscaled diffusion coefficient. The principle is to launch a series of independent particles which follow a Brownian motion within the cell At each time iteration, we simply calculate the euclidean distance between the initial and the final locations for each particle. We finally establish the regression of the average of these squared distances as a function of the iteration rank. When this regression becomes linear, the slope of this linear regression (up to a scaling coefficient) provides the diffusion coefficient.

For each time lag, each particle may move to the neighboring location, according to the neighboring option, i.e. (for the 2-D case):

The user can choose this option by:


He may also specify that the particle MUST move (cannot stay at the same location) at each iteration:


If the user wishes to check the convergence used to calculate the diffusion coefficient from the Monte-Carlo simulation, he may examine the behavior of the regression on a target cell (starting from 1) by:


The estimation of the Slope and Intercept is determined based on a the values for a given range of iteration ranks. Note that the calculations are performed from the largest to the lowest ranks. Finally the Slope assigned to each output cell is calculated at a given iteration (defined by its percentage with respect to the total number of iterations), 75


The results (as a function of the iteration) are provided as a matrix (Nrow = niter; Ncol = 3) and can be loaded by using:


The first column corresponds to the mean squared distance, the second column to the diffusion coefficient and the third column to the origin of the linear regression (of squared distance versus iteration).

[Package RGeostats version 11.1.2 Index]