Creates a finite difference grid over a rectangular two-dimensional model
domain starting from two separate one-dimensional grids (as created by
setup.grid.1D
).
setup.grid.2D(x.grid = NULL, y.grid = NULL)
list containing the one-dimensional grid in the vertical
direction - see setup.grid.1D
for the structure of the list
list containing the one-dimensional grid in the horizontal
direction - see setup.grid.1D
for the structure of the list
a list of type grid.2D
containing:
position of the upstream interface in x-direction (i.e. if x is vertical, the upper boundary); one value
position of the downstream interface in x-direction (i.e. if x is vertical, the lower boundary); one value
position of the middle of the grid cells in x-direction;
vector of length x.N
position of the interfaces of the grid cells in x-direction;
vector of length x.N+1
distance between adjacent cell interfaces in x-direction
(thickness of grid cells); vector of length x.N
auxiliary vector containing the distance between adjacent
cell centers; at the upstream and downstream boundary calculated as
(x[1]-x.up
) and (x.down-x[x.N]
) respectively;
vector of length x.N+1
total number of grid cells in the x direction; one value
position of the upstream interface in y-direction (i.e. if y us the horizontal, the left boundary); one value
position of the downstream interface in y-direction (i.e. if y us the horizontal, the right boundary); one value
position of the middle of the grid cells in y-direction;
vector of length y.N
position of the interfaces of the grid cells in y-direction;
vector of length y.N+1
distance between adjacent cell interfaces in y-direction
(thickness of grid cells); vector of length y.N
auxiliary vector containing the distance between adjacent
cell centers; at the upstream and downstream boundary calculated as
(y[1]-y.up
) and (y.down-y[y.N]
) respectively;
vector of length y.N+1
total number of grid cells in the y direction; one value
tran.2D
, for a discretisation of the general transport equation in 2-D
setup.grid.1D
, for the creation of grids in 1-D
setup.prop.2D
for defining properties on the 2-D grid.
# NOT RUN {
# test of the setup.grid.2D functionality
x.grid <- setup.grid.1D(x.up = 0, L = 10, N = 5)
y.grid <- setup.grid.1D(x.up = 0, L = 20, N = 10)
(grid2D <- setup.grid.2D(x.grid, y.grid))
# }
Run the code above in your browser using DataLab