DPFEHM.ForwardDiff_gradient
— MethodForwardDiff_gradient(x...)
Wrapper for ForwardDiff.gradient
DPFEHM.addboundaryconditions
— Methodaddboundaryconditions(hfree, dirichletnodes, dirichleths, isfreenode, nodei2freenodei)
Returns an array giving the pressures at all nodes, including the nodes with Dirichlet boundary conditions.
Arguments
hfree
: an array giving values of h at each cell that is not constrained by a Dirichlet boundary conditiondirichletnodes
: the indices of the cells that are constrained by a Dirichlet boundary conditiondirichleth
: the values of h at the cells with Dirichlet boundary conditionsisfreenode
: a boolean array such that isfreenode[i] is true if cell i does not have a Dirichlet boundary conditionnodei2freenodei
: a dictionary that maps a node index to a free node index
DPFEHM.amg_solver
— Methodamg_solver(A, b; kwargs...)
Return the solution to A
x=b
using an algebraic multigrid solver, which the kwargs
being passed to the AlgebraicMultigrid solver
DPFEHM.cholesky_solver
— Methodcholesky_solver(A, b; kwargs...)
Return the solution to A
x=b
using a Cholesky factorization solver
DPFEHM.darcy_velocity
— Methoddarcy_velocity(h, Ks, mins, maxs, ns)
Return a function that computes the Darcy velocity on a regular grid
Arguments
h
: pressureKs
: permeabilitymins
: the minimum x[/y/z] coordinates of the cubemaxs
: the maximum x[/y/z] coordinates of the cubens
: the number of grid points in the x, [y, and z] directions
DPFEHM.effective_saturation
— Methodeffective_saturation(alpha::Number, psi::Number, N::Number)
Return the effective saturation
Arguments
alpha
: van Genucthen's α parameterpsi
: pressure headN
: van Genuchten's N parameter
DPFEHM.getfreenodes
— Methodgetfreenodes(n, dirichletnodes)
Returns an array indicating whether or not a node is free, a dictionary that maps a global index into a free node index, and an array that maps a free node index into a global index. A free node is one that is not defined by a Dirichlet boundary coundition. That is, a free node, is one that is not listed in dirichletnodes
.
Arguments
n
: the number of cells on the meshdirichletnodes
: the indices of the cells that are constrained by a Dirichlet boundary condition
DPFEHM.getpoints
— Methodgetpoints(min, max, n)
Return a range from min
to max
with n
points
DPFEHM.getuIters
— MethodgetuIters(cval, f, nz, nx, nt, dz, dx, dt)
Return the wave amplitude at the next nt
time steps starting from a zero initial condition
Arguments
cval
: velocity fieldf
: forcingnz
: number of grid cells in the z directionnx
: number of grid cells in the x directionnt
: number of time stepsdz
: distance between grid cells in the z directiondx
: distance between grid cells in the x directiondt
: time step
DPFEHM.groundwater_residuals
— Functiongroundwater_residuals(h, Ks, neighbors, areasoverlengths, dirichletnodes, dirichleths, Qs, specificstorage, volumes; linear_solver::Function=amg_solver, kwargs...)
Return the residuals at the free nodes of a finite volume discretization of the groundwater flow equation.
Arguments
h
: pressureKs
: permeabilityneighbors
: array of pairs indicating which cells share an interfaceareasoverlengths
: array with the same length asneighbors
that gives the interfacial area divided by the length between the two cell centersdirichletnodes
: array of indices indicating which nodes have Dirichlet boundary conditionsdirichleths
: array of pressures at the Dirichlet boundary (length is equal to the number of cells on the grid)Qs
: array of fluxes (length is equal to the number of cells on the grid)specificstorage
: array of the specific storage associated with each cell (length is equal to the number of cells on the grid)volumes
: array of the volume of each each cell (length is equal to the number of cells on the grid)
DPFEHM.groundwater_steadystate
— Methodgroundwater_steadystate(Ks, neighbors, areasoverlengths, dirichletnodes, dirichleths, Qs; linear_solver::Function=amg_solver, kwargs...)
Return the solution to a steady state groundwater flow problem
Arguments
Ks
: permeabilityneighbors
: array of pairs indicating which cells share an interfaceareasoverlengths
: array with the same length asneighbors
that gives the interfacial area divided by the length between the two cell centersdirichletnodes
: array of indices indicating which nodes have Dirichlet boundary conditionsdirichleths
: array of pressures at the Dirichlet boundary (length is equal to the number of cells on the grid)Qs
: array of fluxes (length is equal to the number of cells on the grid)
DPFEHM.hm
— Methodhm(x)
Returns the harmonic mean of x[1]
and x[2]
DPFEHM.hm
— Methodhm(x, y)
Returns the harmonic mean of x
and y
DPFEHM.kr
— Methodkr(x)
Returns kr(x[1], x[2], x[3])
DPFEHM.kr
— Methodkr(psi, alpha, N)
Return the van Genuchten relative permeability
Arguments
psi
: pressure headalpha
: van Genucthen's α parameterN
: van Genuchten's N parameter
DPFEHM.linearIndex
— MethodlinearIndex(nz, iz, ix)
Return the 1-d index of (iz, ix).
DPFEHM.load_uge
— Methodload_uge(filename)
Return mesh information (cell coordinates, cell volumes, cell neighbors, interfacial areas, and distances between neighboring nodes) from the ASCII .uge filename
For more information on the format, see: https://documentation.pflotran.org/userguide/cards/subsurface/grids/unstructuredexplicit_grid.html
DPFEHM.make_wave2diter_pullback
— Methodmake_wave2diter_pullback(args...)
Return a pullback function for wave2diter_residuals
. The arguments are the same as for wave2diter_residuals
DPFEHM.regulargrid1d
— Methodregulargrid1d(mins, maxs, ns, dy, dz)
Return mesh information (cell coordinates, cell volumes, cell neighbors, interfacial areas divided by the length between cell centers)
Arguments
mins
: the minimum x coordinates of the cubemaxs
: the maximum x coordinates of the cubens
: the number of grid points in the x directionsdy
: the size of the cells in the y dimensiondz
: the size of the cells in the z dimension
DPFEHM.regulargrid2d
— Methodregulargrid2d(mins, maxs, ns, dz)
Return mesh information (cell coordinates, cell volumes, cell neighbors, interfacial areas divided by the length between cell centers)
Arguments
mins
: the minimum x and y coordinates of the cubemaxs
: the maximum x and y coordinates of the cubens
: the number of grid points in the x and y directionsdz
: the size of the cells in the z dimension
DPFEHM.regulargrid3d
— Methodregulargrid3d(mins, maxs, ns)
Return mesh information (cell coordinates, cell volumes, cell neighbors, interfacial areas divided by the length between cell centers)
Arguments
mins
: the minimum x, y, and z coordinates of the cubemaxs
: the maximum x, y, and z coordinates of the cubens
: the number of grid points in the x, y, and z directions
DPFEHM.richards_residuals
— Functionwave2diter(c, f, u, uim1, uim2, nz, nx, nt, dz, dx, dt)
Return the residuals at the free nodes of a 2D finite difference discretization of the wave equation
Arguments
c
: velocity fieldf
: forcingu
: waveuim1
: wave at the previous time stepuim2
: wave two time steps agonz
: number of grid cells in the z directionnx
: number of grid cells in the x directionnt
: number of time stepsdz
: distance between grid cells in the z directiondx
: distance between grid cells in the x directiondt
: time step
DPFEHM.richards_steadystate
— Methodrichards_steadystate(Ks, neighbors, areasoverlengths, dirichletnodes, dirichletpsis, coords, alphas, Ns, Qs; callback=soln->nothing, kwargs...)
Return the solution to a steady state unsaturated groundwater problem
Arguments
psi0
: initial guess for the pressureKs
: permeabilityneighbors
: array of pairs indicating which cells share an interfaceareasoverlengths
: array with the same length asneighbors
that gives the interfacial area divided by the length between the two cell centersdirichletnodes
: array of indices indicating which nodes have Dirichlet boundary conditionsdirichletpsis
: array of pressures at the Dirichlet boundary (length is equal to the number of cells on the grid)coords
: the coordinates of the cell centersalphas
: van Genuchten α parameters for each cellNs
: van Genuchten N parameters for each cellQs
: array of fluxes (length is equal to the number of cells on the grid)
DPFEHM.transport_residuals
— Functiontransport_residuals(u, vxs, vys, vzs, Ds, neighbors, areasoverlengths, dirichletnodes, dirichletus, Qs, volumes, coords; use_upwind=true)
Return the residuals of a finite volume discretization of the advection-dispersion equation.
#Arguments
u
: the concentration of the species undergoing transportvxs
: the x components of the velocity at each cellvys
: the y components of the velocity at each cellvzs
: the z components of the velocity at each cellDs
: the dispersion coefficient at each cellneighbors
: array of pairs indicating which cells share an interfaceareasoverlengths
: array with the same length asneighbors
that gives the interfacial area divided by the length between the two cell centersdirichletnodes
: array of indices indicating which nodes have Dirichlet boundary conditionsdirichletus
: array of concentrations at the Dirichlet boundary (length is equal to the number of cells on the grid)Qs
: array of fluxes (length is equal to the number of cells on the grid)volumes
: array of the volume of each each cell (length is equal to the number of cells on the grid)
DPFEHM.uoneiter
— Methoduoneiter(ui, uim1, uim2, c, f, nz, nx, nt, dz, dx, dt)
Return the wave amplitude at the next time step
Arguments
ui
: wave at the current time stepuim1
: wave at the previous time stepuim2
: wave two time steps agoc
: velocity fieldf
: forcingnz
: number of grid cells in the z directionnx
: number of grid cells in the x directiondz
: distance between grid cells in the z directiondx
: distance between grid cells in the x directiondt
: time step