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:


He may also define the variable to be displayed as a function of the iteration rank:


The estimation of the Slope and Intercept is determined based on a the values for a given range of iteration ranks. The user may define the starting and ending ranks (as percentages of the total number of iterations). Note that the calculations are performed from the largest to the lowest ranks: the default values for the Starting percentage is 90 and 50 for the Ending percentage. These values can be modified using:

set.keypair("Diffusion.Converge.PStart",90) set.keypair("Diffusion.Converge.PEnd",50)

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 resulting array (as a function of the iteration) is provided as an array (Dimension = niter) and can be loaded by using:


[Package RGeostats version 11.0.6 Index]