Engines

Delft Advanced Research Terra Simulator

class darts.engines.conn_mesh

Bases: pybind11_object

Class for connection-based mesh and it`s properties

add_conn(self: darts.engines.conn_mesh, arg0: int, arg1: int, arg2: float, arg3: float) int
add_wells(self: darts.engines.conn_mesh, arg0: darts.engines.ms_well_vector) int
add_wells_mpfa(self: darts.engines.conn_mesh, arg0: darts.engines.ms_well_vector, arg1: int) int
connect_segments(self: darts.engines.conn_mesh, arg0: ms_well, arg1: ms_well, arg2: int, arg3: int, arg4: int) int
get_res_tran(self: darts.engines.conn_mesh, tran: darts.engines.value_vector, tranD: darts.engines.value_vector) int

Get reservoir transmissibilities

get_wells_tran(self: darts.engines.conn_mesh, tran: darts.engines.value_vector) int

Get well indexes

init(*args, **kwargs)

Overloaded function.

  1. init(self: darts.engines.conn_mesh, arg0: str) -> int

Initialize from TPFACONNS (TPFACONNSN) keyword file

  1. init(self: darts.engines.conn_mesh, block_m: darts.engines.index_vector, block_p: darts.engines.index_vector, tran: darts.engines.value_vector, tranD: darts.engines.value_vector = value_vector[]) -> int

Initialize by connection list defined by block_m, block_p, tran and tranD arrays

init_const_1d(self: darts.engines.conn_mesh, arg0: float, arg1: int) int
init_grav_coef(self: darts.engines.conn_mesh, grav_const: float = 9.80665e-05) int

Initialize gravity coefficients for every connection

init_mpfa(self: darts.engines.conn_mesh, arg0: darts.engines.index_vector, arg1: darts.engines.index_vector, arg2: darts.engines.index_vector, arg3: darts.engines.index_vector, arg4: darts.engines.value_vector, arg5: darts.engines.value_vector, arg6: darts.engines.value_vector, arg7: darts.engines.value_vector, arg8: int, arg9: int, arg10: int, arg11: int) int
init_mpsa(*args, **kwargs)

Overloaded function.

  1. init_mpsa(self: darts.engines.conn_mesh, arg0: darts.engines.index_vector, arg1: darts.engines.index_vector, arg2: darts.engines.index_vector, arg3: darts.engines.index_vector, arg4: darts.engines.value_vector, arg5: int, arg6: int, arg7: int, arg8: int) -> int

  2. init_mpsa(self: darts.engines.conn_mesh, arg0: darts.engines.index_vector, arg1: darts.engines.index_vector, arg2: darts.engines.index_vector, arg3: darts.engines.index_vector, arg4: darts.engines.value_vector, arg5: darts.engines.value_vector, arg6: int, arg7: int, arg8: int, arg9: int) -> int

init_pm(*args, **kwargs)

Overloaded function.

  1. init_pm(self: darts.engines.conn_mesh, arg0: darts.engines.index_vector, arg1: darts.engines.index_vector, arg2: darts.engines.index_vector, arg3: darts.engines.index_vector, arg4: darts.engines.value_vector, arg5: darts.engines.value_vector, arg6: int, arg7: int, arg8: int) -> int

  2. init_pm(self: darts.engines.conn_mesh, arg0: darts.engines.index_vector, arg1: darts.engines.index_vector, arg2: darts.engines.index_vector, arg3: darts.engines.index_vector, arg4: darts.engines.value_vector, arg5: darts.engines.value_vector, arg6: darts.engines.value_vector, arg7: darts.engines.value_vector, arg8: int, arg9: int, arg10: int) -> int

  3. init_pm(self: darts.engines.conn_mesh, arg0: darts.engines.index_vector, arg1: darts.engines.index_vector, arg2: darts.engines.index_vector, arg3: darts.engines.index_vector, arg4: darts.engines.value_vector, arg5: darts.engines.value_vector, arg6: darts.engines.value_vector, arg7: darts.engines.value_vector, arg8: darts.engines.value_vector, arg9: darts.engines.value_vector, arg10: int, arg11: int, arg12: int) -> int

init_pme(self: darts.engines.conn_mesh, arg0: darts.engines.index_vector, arg1: darts.engines.index_vector, arg2: darts.engines.index_vector, arg3: darts.engines.index_vector, arg4: darts.engines.value_vector, arg5: darts.engines.value_vector, arg6: darts.engines.value_vector, arg7: darts.engines.value_vector, arg8: darts.engines.value_vector, arg9: darts.engines.value_vector, arg10: int, arg11: int, arg12: int) int
init_poro(self: darts.engines.conn_mesh, arg0: str) int
reverse_and_sort(self: darts.engines.conn_mesh) int
reverse_and_sort_dvel(self: darts.engines.conn_mesh) int
reverse_and_sort_mpfa(self: darts.engines.conn_mesh) int
reverse_and_sort_mpsa(self: darts.engines.conn_mesh) int
reverse_and_sort_pm(self: darts.engines.conn_mesh) int
reverse_and_sort_pme(self: darts.engines.conn_mesh) int
save_enthalpy(self: darts.engines.conn_mesh, arg0: str) int
save_poro(self: darts.engines.conn_mesh, arg0: str) int
save_pressure(self: darts.engines.conn_mesh, arg0: str) int
save_temperature(self: darts.engines.conn_mesh, arg0: str) int
save_volume(self: darts.engines.conn_mesh, arg0: str) int
save_zmf(self: darts.engines.conn_mesh, arg0: str) int
set_res_tran(self: darts.engines.conn_mesh, tran: darts.engines.value_vector, tranD: darts.engines.value_vector) int

Set reservoir transmissibilities

set_wells_tran(*args, **kwargs)

Overloaded function.

  1. set_wells_tran(self: darts.engines.conn_mesh, tran: darts.engines.value_vector) -> int

Set well indexes

  1. set_wells_tran(self: darts.engines.conn_mesh, tran: darts.engines.value_vector) -> int

Set well indexes

class darts.engines.engine_base

Bases: pybind11_object

Base simulator engine class

add_value_to_Q(self: darts.engines.engine_base, arg0: darts.engines.value_vector) int
add_value_to_Q_inj_p(self: darts.engines.engine_base, arg0: darts.engines.value_vector) int
add_value_to_Q_p(self: darts.engines.engine_base, arg0: darts.engines.value_vector) int
add_value_to_cov_inj_p(self: darts.engines.engine_base, arg0: darts.engines.value_vector) int
add_value_to_cov_prod_p(self: darts.engines.engine_base, arg0: darts.engines.value_vector) int
add_value_to_inj_wei_p(self: darts.engines.engine_base, arg0: darts.engines.value_vector) int
add_value_to_prod_wei_p(self: darts.engines.engine_base, arg0: darts.engines.value_vector) int
apply_newton_update(self: darts.engines.engine_base, arg0: float) int
calc_adjoint_gradient_dirac_all(self: darts.engines.engine_base) int
calc_newton_residual(self: darts.engines.engine_base) float
calc_well_residual(self: darts.engines.engine_base) float
clear_Q(self: darts.engines.engine_base) int
clear_Q_inj_p(self: darts.engines.engine_base) int
clear_Q_p(self: darts.engines.engine_base) int
clear_cov_inj_p(self: darts.engines.engine_base) int
clear_cov_prod_p(self: darts.engines.engine_base) int
clear_inj_wei_p(self: darts.engines.engine_base) int
clear_previous_adjoint_assembly(self: darts.engines.engine_base) int
clear_prod_wei_p(self: darts.engines.engine_base) int
post_newtonloop(self: darts.engines.engine_base, arg0: float, arg1: float) int
print_stat(self: darts.engines.engine_base) int
push_back_to_BHP_all(self: darts.engines.engine_base, arg0: darts.engines.value_vector) int
push_back_to_BHP_wei_all(self: darts.engines.engine_base, arg0: darts.engines.value_vector) int
push_back_to_Q_all(self: darts.engines.engine_base) int
push_back_to_Q_inj_all(self: darts.engines.engine_base) int
push_back_to_binary_all(self: darts.engines.engine_base, arg0: darts.engines.value_vector) int
push_back_to_cov_BHP_all(self: darts.engines.engine_base, arg0: darts.engines.value_vector) int
push_back_to_cov_customized_op_all(self: darts.engines.engine_base, arg0: darts.engines.value_vector) int
push_back_to_cov_inj_all(self: darts.engines.engine_base) int
push_back_to_cov_prod_all(self: darts.engines.engine_base) int
push_back_to_cov_temperature_all(self: darts.engines.engine_base, arg0: darts.engines.value_vector) int
push_back_to_cov_well_tempr_all(self: darts.engines.engine_base, arg0: darts.engines.value_vector) int
push_back_to_customized_op_all(self: darts.engines.engine_base, arg0: darts.engines.value_vector) int
push_back_to_customized_op_wei_all(self: darts.engines.engine_base, arg0: darts.engines.value_vector) int
push_back_to_inj_wei_all(self: darts.engines.engine_base) int
push_back_to_prod_wei_all(self: darts.engines.engine_base) int
push_back_to_temperature_all(self: darts.engines.engine_base, arg0: darts.engines.value_vector) int
push_back_to_temperature_wei_all(self: darts.engines.engine_base, arg0: darts.engines.value_vector) int
push_back_to_well_tempr_all(self: darts.engines.engine_base, arg0: darts.engines.value_vector) int
push_back_to_well_tempr_wei_all(self: darts.engines.engine_base, arg0: darts.engines.value_vector) int
report(self: darts.engines.engine_base) int
run(self: darts.engines.engine_base, arg0: float) int
run_single_newton_iteration(self: darts.engines.engine_base, arg0: float) int
run_timestep(self: darts.engines.engine_base, arg0: float, arg1: float) int
solve_linear_equation(self: darts.engines.engine_base) int
test_assembly(self: darts.engines.engine_base, arg0: int, arg1: int, arg2: int) int
test_spmv(self: darts.engines.engine_base, arg0: int, arg1: int, arg2: int) int
class darts.engines.engine_super_cpu1_1_t

Bases: engine_base

Isothermal CPU simulator engine for 1 components and 1 phases with diffusion and kinetic reaction

init(self: darts.engines.engine_super_cpu1_1_t, arg0: darts.engines.conn_mesh, arg1: darts.engines.ms_well_vector, arg2: darts.engines.op_vector, arg3: darts.engines.sim_params, arg4: darts.engines.timer_node) int

Initialize simulator by mesh, tables and wells

class darts.engines.engine_super_cpu2_1

Bases: engine_base

Non-isothermal CPU simulator engine for 2 components and 1 phases with diffusion and kinetic reaction

init(self: darts.engines.engine_super_cpu2_1, arg0: darts.engines.conn_mesh, arg1: darts.engines.ms_well_vector, arg2: darts.engines.op_vector, arg3: darts.engines.sim_params, arg4: darts.engines.timer_node) int

Initialize simulator by mesh, tables and wells

class darts.engines.engine_super_elastic_cpu1_2

Bases: engine_base

Isothermal CPU simulator engine for 1 components and 2 phases with momentum balance, diffusion and kinetic reaction

apply_newton_update(self: darts.engines.engine_super_elastic_cpu1_2, arg0: float) int
calc_newton_residual(self: darts.engines.engine_super_elastic_cpu1_2) darts.engines.value_vector
init(self: darts.engines.engine_super_elastic_cpu1_2, arg0: darts.engines.conn_mesh, arg1: darts.engines.ms_well_vector, arg2: darts.engines.op_vector, arg3: darts.engines.sim_params, arg4: darts.engines.timer_node) int

Initialize simulator by mesh, tables and wells

post_newtonloop(self: darts.engines.engine_super_elastic_cpu1_2, arg0: float, arg1: float) int
class darts.engines.engine_super_mp_cpu2_1

Bases: engine_base

Non-isothermal CPU simulator engine for 2 components and 1 phases with diffusion and kinetic reaction

init(self: darts.engines.engine_super_mp_cpu2_1, arg0: darts.engines.conn_mesh, arg1: darts.engines.ms_well_vector, arg2: darts.engines.op_vector, arg3: darts.engines.sim_params, arg4: darts.engines.timer_node) int

Initialize simulator by mesh, tables and wells

run_single_newton_iteration(self: darts.engines.engine_super_mp_cpu2_1, arg0: float) int
class darts.engines.ms_well

Bases: pybind11_object

Multisegment well, modeled as an extension of the reservoir

init_mech_rate_parameters(self: darts.engines.ms_well, N_VARS: int, P_VAR: int, n_vars: int, phase_names: List[str], rate_ev: operator_set_gradient_evaluator_iface, thermal: int = 0) None

Init by NC and rate operators for poromechanics

init_rate_parameters(self: darts.engines.ms_well, n_vars: int, phase_names: List[str], rate_ev: operator_set_gradient_evaluator_iface, thermal: int = 0) None

Init by NC and rate operators

class darts.engines.multilinear_adaptive_cpu_interpolator_i_d_1_1

Bases: operator_set_gradient_evaluator_iface

Operator set interpolator with j index type and d value type for 1 operators in 1-dimensional parameter space

evaluate(self: darts.engines.multilinear_adaptive_cpu_interpolator_i_d_1_1, state: darts.engines.value_vector, values: darts.engines.value_vector) int

Evaluate operators

evaluate_with_derivatives(self: darts.engines.multilinear_adaptive_cpu_interpolator_i_d_1_1, state: darts.engines.value_vector, block_idx: darts.engines.index_vector, values: darts.engines.value_vector, derivatives: darts.engines.value_vector) int

Evaluate operators and derivatives (v)

init(self: darts.engines.multilinear_adaptive_cpu_interpolator_i_d_1_1) int

Initialize interpolator

init_timer_node(self: darts.engines.multilinear_adaptive_cpu_interpolator_i_d_1_1, timer_node: darts.engines.timer_node) None

Initialize timer

write_to_file(self: darts.engines.multilinear_adaptive_cpu_interpolator_i_d_1_1, arg0: str) int

Write interpolator data to file

class darts.engines.multilinear_adaptive_cpu_interpolator_l_d_1_1

Bases: operator_set_gradient_evaluator_iface

Operator set interpolator with m index type and d value type for 1 operators in 1-dimensional parameter space

evaluate(self: darts.engines.multilinear_adaptive_cpu_interpolator_l_d_1_1, state: darts.engines.value_vector, values: darts.engines.value_vector) int

Evaluate operators

evaluate_with_derivatives(self: darts.engines.multilinear_adaptive_cpu_interpolator_l_d_1_1, state: darts.engines.value_vector, block_idx: darts.engines.index_vector, values: darts.engines.value_vector, derivatives: darts.engines.value_vector) int

Evaluate operators and derivatives (v)

init(self: darts.engines.multilinear_adaptive_cpu_interpolator_l_d_1_1) int

Initialize interpolator

init_timer_node(self: darts.engines.multilinear_adaptive_cpu_interpolator_l_d_1_1, timer_node: darts.engines.timer_node) None

Initialize timer

write_to_file(self: darts.engines.multilinear_adaptive_cpu_interpolator_l_d_1_1, arg0: str) int

Write interpolator data to file

class darts.engines.pm_discretizer

Bases: pybind11_object

Multipoint discretizer for poromechanics

calc_all_fluxes_once(self: darts.engines.pm_discretizer, arg0: float) None
get_gradient(self: darts.engines.pm_discretizer, arg0: int) Tuple[darts.engines.index_vector, List[float]]
get_thermal_gradient(self: darts.engines.pm_discretizer, arg0: int) Tuple[darts.engines.index_vector, List[float]]
init(self: darts.engines.pm_discretizer, arg0: int, arg1: int, arg2: darts.engines.index_vector) None
reconstruct_gradients_per_cell(self: darts.engines.pm_discretizer, arg0: float) None
reconstruct_gradients_thermal_per_cell(self: darts.engines.pm_discretizer, arg0: float) None
class darts.engines.sim_params

Bases: pybind11_object

Class simulation parameters

property first_ts

Length of the first time step (days)

class linear_solver_t

Bases: pybind11_object

Available types of linear solvers

Members:

cpu_gmres_cpr_amg

cpu_gmres_ilu0

cpu_superlu

cpu_gmres_cpr_amg1r5

cpu_gmres_fs_cpr

cpu_samg

gpu_gmres_cpr_amg

gpu_gmres_ilu0

gpu_gmres_cpr_aips

gpu_gmres_cpr_amgx_ilu

gpu_gmres_cpr_amgx_ilu_sp

gpu_gmres_cpr_amgx_amgx

gpu_gmres_amgx

gpu_amgx

gpu_gmres_cpr_nf

gpu_bicgstab_cpr_amgx

gpu_cusolver

property name
class newton_solver_t

Bases: pybind11_object

Available types of newton solvers

Members:

newton_std

newton_global_chop

newton_local_chop

newton_inflection_point

property name
class nonlinear_norm_t

Bases: pybind11_object

Available types of nonlinear norm

Members:

L1

L2

LINF

property name
class darts.engines.timer_node

Bases: pybind11_object

Timers tree structure

get_timer(self: darts.engines.timer_node) float
print(self: darts.engines.timer_node, arg0: str, arg1: str) str
reset_recursive(self: darts.engines.timer_node) None
start(self: darts.engines.timer_node) None
stop(self: darts.engines.timer_node) None

Physics_sup

Properties

Properties Black Oil

Properties CCS Thermal

Basic Properties

Operators

Models

class darts.models.darts_model.DartsModel[source]

Bases: object

This is a base class for creating a model in DARTS. A model is composed of a darts.models.Reservoir object and a darts.physics.Physics object. Initialization and communication between these two objects takes place through the Model object

Variables:
  • reservoir – Reservoir object

  • physics – Physics object

__init__()[source]

” Initialize DartsModel class.

Variables:
  • timer – Timer object

  • params – Object to set simulation parameters

export_vtk(file_name: str = 'data', local_cell_data: dict = {}, global_cell_data: dict = {}, vars_data_dtype: type = <class 'numpy.float32'>, export_grid_data: bool = True)[source]

Function to export results at timestamp t into .vtk format.

Parameters:
  • file_name (str) – Name to save .vtk file

  • local_cell_data (dict) – Local cell data (active cells)

  • global_cell_data (dict) – Global cell data (all cells including actnum)

  • vars_data_dtype (type) –

  • export_grid_data (bool) –

init()[source]

Function to initialize the model, which includes: - initialize well (perforation) position - initialize well rate parameters - initialize reservoir initial conditions - initialize well control settings - define list of operator interpolators for accumulation-flux regions and wells - initialize engine

load_restart_data(filename: str = 'restart.pkl')[source]

Function to load data from previous simulation and uses them for following simulation. :param filename: restart_data filename :type filename: str

output_properties()[source]

Function to return array of properties. Primary variables (vars) are obtained from engine, secondary variables (props) are interpolated by property_itor.

Returns:

property_array

Return type:

np.ndarray

print_stat()[source]

Function to print the statistics information, including total timesteps, Newton iteration, linear iteration, etc..

print_timers()[source]

Function to print the time information, including total time elapsed, time consumption at different stages of the simulation, etc..

reset()[source]

Function to initialize the engine by calling ‘physics.engine.init()’ method.

run(days: float | None = None)[source]
run_python(days: float, restart_dt: float = 0, timestep_python: bool = False)[source]
run_timestep_python(dt, t)[source]
save_restart_data(filename: str = 'restart.pkl')[source]

Function to save the simulation data for restart usage. :param filename: Name of the file where restart_data stores. :type filename: str

set_boundary_conditions()[source]

Function to set boundary conditions. Passes boundary conditions to Physics object and wells.

This function is virtual in DartsModel, needs to be defined in child Model.

set_initial_conditions()[source]

Function to set initial conditions. Passes initial conditions to Physics object.

This function is virtual in DartsModel, needs to be defined in child Model.

set_op_list()[source]

Function to define list of operator interpolators for accumulation-flux regions and wells.

Operator list is in order [acc_flux_itor[0], …, acc_flux_itor[n-1], acc_flux_w_itor]

set_physics()[source]

Function to define properties and regions and initialize Physics object.

This function is virtual in DartsModel, needs to be defined in child Model.

set_sim_params(first_ts: float | None = None, mult_ts: float | None = None, max_ts: float | None = None, runtime: float = 1000, tol_newton: float | None = None, tol_linear: float | None = None, it_newton: int | None = None, it_linear: int | None = None, newton_type=None, newton_params=None)[source]

Function to set simulation parameters.

Parameters:
  • first_ts (float) – First timestep

  • mult_ts (float) – Timestep multiplier

  • max_ts (float) – Maximum timestep

  • runtime (float) – Total runtime in days, default is 1000

  • tol_newton (float) – Tolerance for Newton iterations

  • tol_linear (float) – Tolerance for linear iterations

  • it_newton (int) – Maximum number of Newton iterations

  • it_linear (int) – Maximum number of linear iterations

  • newton_type

  • newton_params

set_wells()[source]

Function to define wells and initialize Reservoir object.

This function is virtual in DartsModel, needs to be defined in child Model.

Reservoirs

class darts.models.reservoirs.struct_reservoir.StructReservoir(timer, nx: int, ny: int, nz: int, dx, dy, dz, permx, permy, permz, poro, depth, actnum=1, global_to_local=0, op_num=0, coord=0, zcorn=0, is_cpg=False)[source]

Bases: object

__init__(timer, nx: int, ny: int, nz: int, dx, dy, dz, permx, permy, permz, poro, depth, actnum=1, global_to_local=0, op_num=0, coord=0, zcorn=0, is_cpg=False)[source]

Class constructor method

Parameters:
  • timer – timer object to measure discretization time

  • nx – number of reservoir blocks in the x-direction

  • ny – number of reservoir blocks in the y-direction

  • nz – number of reservoir blocks in the z-direction

  • dx – size of the reservoir blocks in the x-direction (scalar or vector form) [m]

  • dy – size of the reservoir blocks in the y-direction (scalar or vector form) [m]

  • dz – size of the reservoir blocks in the z-direction (scalar or vector form) [m]

  • permx – permeability of the reservoir blocks in the x-direction (scalar or vector form) [mD]

  • permy – permeability of the reservoir blocks in the y-direction (scalar or vector form) [mD]

  • permz – permeability of the reservoir blocks in the z-direction (scalar or vector form) [mD]

  • poro – porosity of the reservoir blocks

  • actnum – attribute of activity of the reservoir blocks (all are active by default)

  • global_to_local – one can define arbitrary indexing (mapping from global to local) for local arrays. Default indexing is by X (fastest),then Y, and finally Z (slowest)

  • op_num – index of required operator set of the reservoir blocks (the first by default). Use to introduce PVTNUM, SCALNUM, etc.

  • coord – COORD keyword values for more accurate geometry during VTK export (no values by default)

  • zcron – ZCORN keyword values for more accurate geometry during VTK export (no values by default)

add_perforation(well, i, j, k, well_radius=0.1524, well_index=-1, well_indexD=-1, segment_direction='z_axis', skin=0, multi_segment=True, verbose=False)[source]

well_indexD - thermal well index (for heat loss through the wellbore) if -1, use computed value based on cell geometry; if 0 - no heat losses

add_well(name, wellbore_diameter=0.15)[source]
export_vtk(file_name, t, local_cell_data, global_cell_data, export_constant_data=True)[source]
generate_cpg_vtk_grid()[source]
generate_vtk_grid(strict_vertical_layers=True, compute_depth_by_dz_sum=True)[source]
get_cell_cpg_widths()[source]
get_cell_cpg_widths_new()[source]
get_well(well_name)[source]

find well by name :param well_name: :return: well object

init_wells()[source]
set_boundary_volume(xy_minus=-1, xy_plus=-1, yz_minus=-1, yz_plus=-1, xz_minus=-1, xz_plus=-1)[source]
class darts.models.reservoirs.unstruct_reservoir.UnstructReservoir[source]

Bases: object

add_perforation(well, res_block, well_index=-1, well_indexD=-1, well_radius=0.1524, skin=0.0, multi_segment=True, verbose=False)[source]

Class method which ads perforation to each (existing!) well

Parameters:
  • well – data object which contains data of the particular well

  • res_block – reservoir block in which the well has a perforation

  • well_index – well index (productivity index)

Returns:

add_well(name, depth)[source]

Class method which adds wells heads to the reservoir (Note: well head is not equal to a perforation!)

Parameters:
  • name

  • depth

Returns:

calc_boundary_cells(boundary_data)[source]

Class method which calculates constant boundary values at a specif constant x,y,z-coordinate

Parameters:

boundary_data – dictionary with the boundary location (X,Y,Z, and location)

Returns:

Discretizer

Structured Discretizer

class darts.mesh.struct_discretizer.StructDiscretizer(nx, ny, nz, dx, dy, dz, permx, permy, permz, global_to_local=0, coord=0, zcorn=0, is_cpg=False)[source]
__init__(nx, ny, nz, dx, dy, dz, permx, permy, permz, global_to_local=0, coord=0, zcorn=0, is_cpg=False)[source]

Class constructor method.

Parameters:
  • nx – number of reservoir blocks in the x-direction

  • ny – number of reservoir blocks in the y-direction

  • nz – number of reservoir blocks in the z-direction

  • dx – size of the reservoir blocks in the x-direction (scalar or vector form) [m]

  • dy – size of the reservoir blocks in the y-direction (scalar or vector form) [m]

  • dz – size of the reservoir blocks in the z-direction (scalar or vector form) [m]

  • permx – permeability of the reservoir blocks in the x-direction (scalar or vector form) [mD]

  • permy – permeability of the reservoir blocks in the y-direction (scalar or vector form) [mD]

  • permz – permeability of the reservoir blocks in the z-direction (scalar or vector form) [mD]

  • global_to_local – one can define arbitrary indexing (mapping from global to local) for local arrays. Default indexing is by X (fastest),then Y, and finally Z (slowest)

calc_cpg_discr()[source]

Class methods which performs the actual construction of the connection list

Return cell_m:

minus-side of the connection

Return cell_p:

plus-side of the connection

Return tran:

transmissibility value of connection

Return tran_thermal:

geometric coefficient of connection

calc_structured_discr()[source]

Class methods which performs the actual construction of the connection list

Return cell_m:

minus-side of the connection

Return cell_p:

plus-side of the connection

Return tran:

transmissibility value of connection

Return tran_thermal:

geometric coefficient of connection

calc_volumes()[source]

Class method which reshapes the volumes of all the cells to a flat array (Ntot x 1)

Returns:

flat volume array (Ntot x 1)

calc_well_index(i, j, k, well_radius=0.1524, segment_direction='z_axis', skin=0)[source]

Class method which construct the well index for each well segment/perforation

Parameters:
  • i – “human” counting of x-location coordinate of perforation

  • j – “human” counting of y-location coordinate of perforation

  • k – “human” counting of z-location coordinate of perforation

  • well_radius – radius of the well-bore

  • segment_direction – direction in which the segment perforates the reservoir block

  • skin – skin factor for pressure loss around well-bore due to formation damage

Return well_index:

well-index of particular perforation

convert_to_3d_array(data, data_name: str)[source]

Class method which converts the data object (scalar or vector) to a true 3D array (Nx,Ny,Nz)

Parameters:
  • data – any type of data, e.g. permeability of the cells (scalar, vector, or array form)

  • data_name – name of the data object (e.g. ‘permx’)

Return data:

true data 3D data array

convert_to_flat_array(data, data_name: str)[source]

Class methods which converts data object from any type to true flat array of size (Ntot x 1)

Parameters:
  • data – data object of any type (e.g. permeability of the cells) (scalar, vector, or 3D array form)

  • data_name – name of the data object (e.g. ‘permx’)

Return data:

true flat array (Ntot x 1)

static dump_connection_list(cell_m, cell_p, conn, filename)[source]

Static method which dumps the connection list to a file

Parameters:
  • cell_m – minus-side of the connection

  • cell_p – plus-side of the connection

  • conn – transmisibility value of connection

  • filename – name of the desired file

Returns:

Unstructured Discretizer

class darts.mesh.unstruct_discretizer.UnstructDiscretizer(permx, permy, permz, frac_aper, mesh_file: str, poro=0.2, num_matrix_cells=0, num_fracture_cells=0, num_well_cells=0, verbose=False)[source]
__init__(permx, permy, permz, frac_aper, mesh_file: str, poro=0.2, num_matrix_cells=0, num_fracture_cells=0, num_well_cells=0, verbose=False)[source]

Class constructor method

Parameters:
  • permx – permeability data object (either in scalar or vector form) in x-direction

  • permy – permeability data object (either in scalar or vector form) in y-direction

  • permz – permeability data object (either in scalar or vector form) in z-direction

  • frac_aper – fracture aperture data object (either in scalar or vector form)

  • mesh_file – name of the mesh file (in string form)

  • num_matrix_cells – number of matrix cells, if known before hand! (in scalar form)

  • num_fracture_cells – number of fracture cells, if known before hand! (in scalar form)

calc_boundary_cells(boundary_data)[source]

Class method which calculates constant boundary values at a specif constant x,y,z-coordinate

Parameters:

boundary_data – dictionary with the boundary location (X,Y,Z, and location)

Returns:

calc_boundary_cells_new(boundary_data)[source]

Class method which calculates constant boundary values at a specif constant x,y,z-coordinate

Parameters:

boundary_data – dictionary with the boundary direction (x,y, or z) and type (min or max)

Returns:

calc_cell_information(cache=0)[source]

Class method which calculates the geometrical properties of the grid

calc_cell_information_with_wells(well_locations, well_radii, cache=0)[source]

Class method which calculates the geometrical properties of the grid

calc_connections_all_cells(cache=0)[source]

Class methods which calculates the connection list for all cell types (matrix & fracture)

Return cell_m:

minus-side of the connection

Return cell_p:

plus-side of the connection

Return tran:

transmissibility value of connection

Return tran_thermal:

geometric coefficient of connection

calc_equivalent_well_index(res_block: int, well_radius: float = 0.1524, skin: float = 0.0) List[float][source]

works only for wedge 2.5D extruded cells approximate calculation: triangle -> square with the same area -> Peaceman formula :param res_block: cell block index :param well_radius: well radius, m. :param skin: skin :return: well_index, well_index_thermal

check_fracture_data_input(data, data_name: str)[source]

Class method which checks the input data for fracture cells

Parameters:
  • data – scalar or vector with data

  • data_name – string which represents the data

Returns:

correct data object size

check_matrix_data_input(data, data_name: str)[source]

Class method which checks the input data for matrix cells

Parameters:
  • data – scalar or vector with data

  • data_name – string which represents the data

Returns:

correct data object size

load_mesh(cache=0)[source]

Class method which loads the mesh data of a specified file, using the module meshio module (third party).

load_mesh_with_wells(well_centers, well_radii, cache=0)[source]

Class method which reads msh file with meshio or reads mesh_data from cache

store_centroid_all_cells()[source]

Class method which loops over all the cells and stores the volume in single array (first frac, then mat) :return:

store_depth_all_cells()[source]

Class method which loops over all the cells and stores the depth in single array (first frac, then mat) :return:

store_volume_all_cells()[source]

Class method which loops over all the cells and stores the volume in single array (first frac, then mat) :return:

static write_conn2p_therm_to_file(cell_m, cell_p, tran, tranD, file_name)[source]

Static method which write a connection list to the specified file (for thermal application)

Parameters:
  • cell_m – negative residual contribution of cell block connections of interface

  • cell_p – positive residual contribution of cell block connections of interface

  • tran – transmissibility value of the interface

  • tranD – geometric coefficient of interface

  • file_name – file name where to write connection list

Returns:

static write_conn2p_to_file(cell_m, cell_p, tran, file_name)[source]

Static method which write a connection list to the specified file (for non-thermal application)

Parameters:
  • cell_m – negative residual contribution of cell block connections of interface

  • cell_p – positive residual contribution of cell block connections of interface

  • tran – transmissibility value of the interface

  • file_name – file name where to write connection list

Returns:

write_depth_to_file(file_name)[source]

Class method which loops over all the cells and writes the volume into a file (first frac, then mat) :return:

static write_property_to_file(data, key_word: str, file_name: str, num_cells: int)[source]

Static method which writes any specified property (in data) to any specified file

Parameters:
  • data – data object required to write to a file

  • key_word – keyword (usually read by other simulator)

  • file_name – name of the file where to write

  • num_cells – number of reservoir blocks

Returns:

write_to_vtk(output_directory, property_array, cell_property, ith_step)[source]

Class method which writes output of unstructured grid to VTK format

Parameters:
  • output_directory – directory of output files

  • property_array – np.array containing all cell properties (N_cells x N_prop)

  • cell_property – list with property names (visible in ParaView (format strings)

  • ith_step – integer containing the output step

Returns:

write_volume_to_file(file_name)[source]

Class method which loops over all the cells and writes the volume into a file (first frac, then mat) :return: