Skip to content

AxiGrid API Reference

geoloop.axisym.AxisymetricEL.AxiGrid

Bases: SimGridRegular

Axisymmetric grid following Langevin (2009).

The grid has nx cells along the axis, ny=nr radial cells, and nz=1 in tangential direction. Radial direction corresponds to the y-axis, axial direction to x, and tangential to z.

x[0] = rmin is first cell wall // rmax midpoint of last cell x[1]

__init__

__init__(
    nx: int,
    nr: int,
    xmin: float,
    xmax: float,
    rmin: float | ndarray,
    rmax: float,
    k: float | ndarray,
    rcf: float | ndarray,
    rcr: float | ndarray,
    por: float | ndarray,
    firstwellcell: bool = True,
    kwf: float = 0.6,
    rcwf: float = 4200000.0,
    drmin: float = 0,
    endcellbound: bool = False,
)

Constructor for the AxiGrid class.

Parameters:

Name Type Description Default
nx int

Number of grid cells along the axis.

required
nr int

Number of radial cells.

required
xmin float

Location of the first cell along the axis.

required
xmax float

Location of the last cell along the axis.

required
rmin float or ndarray

Radius of the first cell face near the radial axis (>0).

required
rmax float

Radius at the midpoint of the last cell.

required
k float or ndarray

Bulk conductivity in the radial direction (dimension nx).

required
rcf float or ndarray

Volumetric heat capacity of fluid [J m^-3 K^-1] (dimension nx).

required
rcr float or ndarray

Volumetric heat capacity of rock [J m^-3 K^-1] (dimension nx).

required
por float or ndarray

Porosity of cells (dimension nx).

required
firstwellcell bool

Whether the first cell is a well cell with modified properties (default: True).

True
kwf float

Well fluid thermal conductivity (used if firstwellcell is True, default: 0.6).

0.6
rcwf float

Well fluid volumetric heat capacity [J m^-3 K^-1] (used if firstwellcell is True, default: 4.2e6).

4200000.0
drmin float

Minimum radial increase for cells (default: 0).

0
endcellbound bool

Apply end cell boundary condition (default: False).

False

initfrom_xarray

initfrom_xarray(
    x_array: ndarray,
    nr: int,
    rmin: float | ndarray,
    rmax: float,
    k: ndarray,
    rcf: ndarray,
    rcr: ndarray,
    por: ndarray,
    firstwellcell: bool = True,
    kwf: float = 0.6,
    rcwf: float = 4200000.0,
    drmin: float = 0,
    endcellbound: bool = False,
) -> None

Initialize the grid using specified x-array positions.

Parameters:

Name Type Description Default
x_array ndarray

Cell midpoint positions along the x-axis.

required
nr int

Number of cells in radial direction.

required
rmin float or ndarray

Minimum cell face radius closest to the radial axis (>0). Can be an array of size nx.

required
rmax float

Maximum cell midpoint radius (furthest from radial axis). Constant.

required
k ndarray

Bulk conductivity in radial direction (dimension nx).

required
rcf ndarray

Volumetric heat capacity of fluid [J m^-3 K^-1] (dimension nx).

required
rcr ndarray

Volumetric heat capacity of rock [J m^-3 K^-1] (dimension nx).

required
por ndarray

Porosity of cells (dimension nx).

required
firstwellcell bool

Whether the first cell is a well cell with modified properties (default: True).

True
kwf float

Well fluid thermal conductivity (default: 0.6).

0.6
rcwf float

Well fluid volumetric heat capacity [J m^-3 K^-1] (default: 4.2e6).

4200000.0
drmin float

Minimum radial increase for cells (default: 0).

0
endcellbound bool

Apply end cell boundary condition (default: False).

False

initGrid

initGrid(
    rmin: float | ndarray,
    rmax: float | ndarray,
    k: ndarray,
    rcf: ndarray,
    rcr: ndarray,
    por: ndarray,
    firstwellcell: bool,
    kwf: float,
    rcwf: float,
    drmin: float,
    endcellbound: bool,
) -> None

Initialize the grid with radial and axial properties.

Parameters:

Name Type Description Default
rmin float or ndarray

Radius of first cell face closest to radial axis (>0). Can be array of size nx.

required
rmax float or ndarray

Radius of midpoint of last cell. Used to calculate cell sizes along axis.

required
k ndarray

Bulk conductivity in radial direction (dimension nx).

required
rcf ndarray

Volumetric heat capacity of fluid [J m^-3 K^-1] (dimension nx).

required
rcr ndarray

Volumetric heat capacity of rock [J m^-3 K^-1] (dimension nx).

required
por ndarray

Porosity of cells (dimension nx).

required
firstwellcell bool

Whether the first cell is a well cell with modified properties.

required
kwf float

Well fluid thermal conductivity (used if firstwellcell is True).

required
rcwf float

Well fluid volumetric heat capacity [J m^-3 K^-1] (used if firstwellcell is True).

required
drmin float

Minimum radius increase for cells (optional).

required
endcellbound bool

Apply end cell boundary condition (optional) in radial direction as Dirichlet.

required

initTempX

initTempX(tempx: ndarray) -> None

Set the initial temperature values along the x-axis.

Parameters:

Name Type Description Default
tempx ndarray

Initial temperatures along the x-axis.

required

setWellFlow

setWellFlow(q: ndarray) -> None

Set the flow along the well cells in x-direction (fxyz[0][i][:] to q[i]) defined along the well path (nx).

If there are laterals along the well path these can be incorporated by reducing the flow to q=q/nlateral at the along hole position of the laterals.

Parameters:

Name Type Description Default
q ndarray

Flow along the well bore [m³/s] for each cell along the well path (dimension nx).

required

setWellA

setWellA(a: ndarray) -> None

Set the heat production along the well cells (a[i,0,:] to a[i]) defined along the well path (nx).

Parameters:

Name Type Description Default
a ndarray

Heat production [W] for each cell along the well path (dimension nx).

required

plot_result

plot_result(
    result: ndarray,
    itime: int,
    rmax: float | None = None,
    fname: str | None = None,
    dif: bool = False,
) -> None

Plot the simulation result at a specific time step.

Parameters:

Name Type Description Default
result ndarray

Result array from ODE integration.

required
itime int

Time index to plot.

required
rmax float

Maximum radius to plot (default is None).

None
fname str

File name to save the figure (default is None, shows plot).

None
dif bool

Plot the difference with the first timestep if True (default: False).

False