hyvr.geo package¶
Submodules¶
hyvr.geo.ae_realization module¶
Base class for AE realizations
-
class
hyvr.geo.ae_realization.
AERealization
¶ Bases:
object
AE realizations are the realization of a certain AE type in a HyVR simulation. For example, in the ‘made.ini’ test case, the lowest stratum consists of ‘clay_sheet’ architectural elements. While ‘clay_sheet’ is an AE type, each of these sheets is an AE realization.
This is the base class for AE realizations. Any instantiated object should be an instance of one of the (currently) three subtypes:
TroughAE
,ChannelAE
, andSheetAE
.Typically these objects should not be created directly, but via the
generate_realization
method of the respectiveAEType
object.An AE realization contains a list of geometrical objects that are typical for this AE. For example, a TroughAE contains a list of Trough objects. These objects should be implemented in separate files as cython cdef classes, similar to the Trough class.
AERealizations are designed to be used from Python and from Cython code. Therefore, after construction the object list is converted to multiple arrays of object properties.
For example, a TroughAE has a list of Trough objects, and each Trough object has a property
a
of type float (lenth of semi-major axis of ellipsoid). Therefore, the TroughAE object also has a float array calledobject_a
as property. This makes access from Cyton code faster, because we can then iterate over float arrays, instead of iterating over Python lists.The derived AERealization types must provide the methods
generate_object
,maybe_assign_points_to_objects
andmaybe_assign_points_to_object
.-
bg_azim
¶
-
bg_dip
¶
-
bg_facies
¶
-
bottom_surface
¶
-
create_object_arrays
()¶ This method is called after the object list has been created, so after all objects have been generated.
Its main purpose is to create fixed size arrays of object attributes as members of the AERealization subtype, so that they can be accessed without needing to access the python list of objects.
All subclasses of AERealization must override this method.
-
generate_objects
()¶ This is the method that should be used for generating geometrical objects of the right type. Override this in all of your subclasses.
It’s very important that the objects are stored in the order such that the object with the highest zmax is the first one, i.e. such that we can go from top to bottom by iterating over the list of objects.
To add the objects to the object list, use the _add_object function below
-
maybe_assign_points_to_object
()¶ This function checks whether the current grid cell with given coordinates is inside the trough and assigns facies, azimuth and dip by altering the passed arrays.
- Parameters
oi (int) – object index
geo_ids (np.int32 array of size 4) – This holds the geological indices, i.e. facies number, architectural element number, hydrofacies assemblage (ha) and hydrofacies assemblage type (hat).
angles (double array) – array of size 2 that holds the azimuth and dip of the cell. This will also be altered.
y, z (x,) – cell coordinates
y_idx (x_idx,) – indices of x and y position in grid.
grid (Grid object) –
-
n_objects
¶
-
num
¶
-
object_azim
¶
-
object_dip
¶
-
object_facies
¶
-
object_facies_array
¶
-
object_list
¶
-
object_num_facies
¶
-
object_num_ha
¶
-
object_zmax_list
¶
-
object_zmaxs
¶
-
object_zmin_list
¶
-
object_zmins
¶
-
top_surface
¶
-
type_id
¶
-
type_name
¶
-
type_params
¶
-
zmax
¶
-
zmin
¶
-
hyvr.geo.ae_types module¶
This module contains the architectural element types.
-
class
hyvr.geo.ae_types.
AEType
(ae_section, name)[source]¶ Bases:
object
Architectural element types are the kind of things that are read from the supplied ini-file. For example, in the
made.ini
testcase, there are the architectural element types “clay_sheet”, “sand_sheet”, “clay_lens”, “crossbedded_scour”, … In HyVR, these are instances of theAEType
class.The actual AEs that are realized in a HyVR simulation are instances of
AERealization
and are implemented in ‘ae_realization.py’.To generate a realization, you should normally call the
generate_realization
method of a type instance.-
generate_realization
(bottom_surface, top_surface, stratum, grid)[source]¶ Generates a realization of the AE type.
For example, if the AE geometry is ‘trunc_ellip’, this generates a
TruncEllip
object, i.e. a sub-layer containing trough features within a stratum.- Parameters
bottom_surface (ContactSurface object) – The bottom surface of the AE.
top_surface (ContactSurface object) – The top surface of the AE.
model (Model object) –
-
hyvr.geo.channel module¶
-
class
hyvr.geo.channel.
Channel
¶ Bases:
object
Channel implementation.
This is work in progress, as we currently lack a centerline construction method.
-
a
¶
-
azim
¶
-
cos_dip
¶
-
depth
¶
-
dip
¶
-
dipsets
¶
-
dont_check
¶
-
facies
¶
-
facies_array
¶
-
lag_facies
¶
-
lag_height
¶
-
layer_dist
¶
-
len_centerline
¶
-
min_dx_dy
¶
-
num_facies
¶
-
num_ha
¶
-
shift
¶
-
sin_dip
¶
-
vx
¶
-
vy
¶
-
width
¶
-
x_center
¶
-
y_center
¶
-
zmax
¶
-
zmin
¶
-
ztop
¶
-
hyvr.geo.channel_ae module¶
-
class
hyvr.geo.channel_ae.
ChannelAE
¶ Bases:
hyvr.geo.ae_realization.AERealization
-
create_object_arrays
()¶ This method is called after the object list has been created, so after all objects have been generated.
Its main purpose is to create fixed size arrays of object attributes as members of the AERealization subtype, so that they can be accessed without needing to access the python list of objects.
All subclasses of AERealization must override this method.
-
generate_objects
()¶ Generate channel objects and place them in the domain.
The following was just an idea I had, ignore it.
The channels follow a mean flow angle that is given in the parameter file. From this angle, a flow axis is constructed as the “center axis” in direction of the flow angle. (This means the flow axis is chosen such that the projection of the (x-y-)domain onto the axis perpendicular to the flow axis is cut in half by the flow axis.)
The channels are then created as random 1-d functions of the position on the flow axis, with random starting points (within the projection of the domain onto the axis perpendicular to the flow axis). This can then be rotated to get an approximation of the channel curve (a set of points which lie on the curve).
On every level, ‘channel_no’ channels are constructed. They share the same flow angle but are shifted w.r.t. the flow axis.
Its also possible to let the channels migrate in time, i.e. slightly change the flow angle and the distance between the channels (by changing their starting points).
-
maybe_assign_points_to_object
()¶ This function checks whether the current grid cell with given coordinates is inside the trough and assigns facies, azimuth and dip by altering the passed arrays.
- Parameters
oi (int) – object index
geo_ids (np.int32 array of size 4) – This holds the geological indices, i.e. facies number, architectural element number, hydrofacies assemblage (ha) and hydrofacies assemblage type (hat).
angles (double array) – array of size 2 that holds the azimuth and dip of the cell. This will also be altered.
y, z (x,) – cell coordinates
y_idx (x_idx,) – indices of x and y position in grid.
grid (Grid object) –
-
object_a
¶
-
object_cos_dip
¶
-
object_depth
¶
-
object_dipsets
¶
-
object_dont_check
¶
-
object_lag_facies
¶
-
object_lag_height
¶
-
object_layer_dist
¶
-
object_len_centerline
¶
-
object_min_dx_dy
¶
-
object_shift
¶
-
object_sin_dip
¶
-
object_vx
¶
-
object_vy
¶
-
object_width
¶
-
object_x_center
¶
-
object_y_center
¶
-
object_ztop
¶
-
hyvr.geo.channel_utils module¶
-
hyvr.geo.channel_utils.
ferguson_curve
(grid, h, k, ds, eps_factor, flow_angle, domain_length, xstart, ystart, width)[source]¶ Simulate extruded parabola centrelines using the Ferguson (1976) disturbed meander model Implementation of AR2 autoregressive model http://onlinelibrary.wiley.com/doi/10.1002/esp.3290010403/full
- Parameters
grid (Grid object) –
h (float) – Height (Ferguson model parameter)
k (float) – Wave number (Ferguson model parameter)
ds (float) – Curve distance for calculations (Ferguson model parameter)
eps_factor (float) – Random background noise (Ferguson model parameter)
flow_angle (float) – Angle of mean flow direction, in radians
domain_length (float) – Length of the domain in mean flow direction
ystart (xstart,) – Starting coordinates of the channel centerline
width (float) – Width of the channel
- Returns
outputs – Simulated extruded parabola centerlines: storage array containing values for x coordinate, y coordinate, vx and vy
- Return type
float matrix
-
hyvr.geo.channel_utils.
ferguson_theta
(s, eps_factor, k, h)[source]¶ Calculate curve direction angle
- Parameters
s – Steps within generated curve distance
eps_factor – Random background noise
k – Wave number
h – Height
- Returns
th_store (array) - Curve direction angle
-
hyvr.geo.channel_utils.
thetaAR2
(t1, t2, k, h, eps)[source]¶ Implementation of AR2 autoregressive model (Ferguson, 1976, Eq.15) http://onlinelibrary.wiley.com/doi/10.1002/esp.3290010403/full
- Parameters
t1 – theta(i-1)
t2 – theta(i-2)
k – Wavenumber
h – Height
eps – Random background noise
- Returns
2nd-order autoregression (AR2)
hyvr.geo.contact_surface module¶
hyvr.geo.contact_surface_utils module¶
hyvr.geo.grid module¶
hyvr.geo.model module¶
This class holds the abstraction of a HyVR model. It can be broadly structured in two parts:
Model description: This consists of all info about the model that is read from the ini-file.
- Model realization: This consists of several 3-d arrays which hold the
data for the different variables on the grid. This is what get’s put out in the end. The data is stored in a dictionary of arrays.
-
class
hyvr.geo.model.
Model
(model_dict, strata_dict, elements, flowtrans_section)[source]¶ Bases:
object
-
generate_hydraulic_parameters
(hydraulics)[source]¶ Generates (heterogeneous) hydraulic parameters
- Parameters
hydraulics (dictionary) – parsed hydraulics section of the ini-file
-
generate_model
()[source]¶ Generates the model.
This function generates the full model by creating all strata, the AEs within the strata and the geometrical objects within these.
The method starts from the domain top and calls the strata generation function for each stratum, which handles the generation of architectural elements.
-
hyvr.geo.sheet module¶
hyvr.geo.sheet_ae module¶
-
class
hyvr.geo.sheet_ae.
SheetAE
¶ Bases:
hyvr.geo.ae_realization.AERealization
-
create_object_arrays
()¶ This method is called after the object list has been created, so after all objects have been generated.
Its main purpose is to create fixed size arrays of object attributes as members of the AERealization subtype, so that they can be accessed without needing to access the python list of objects.
All subclasses of AERealization must override this method.
-
generate_objects
()¶ Generate sheet objects and place them in the domain.
-
maybe_assign_points_to_object
()¶ This function checks whether the current grid cell with given coordinates is inside the trough and assigns facies, azimuth and dip by altering the passed arrays.
- Parameters
oi (int) – object index
geo_ids (np.int32 array of size 4) – This holds the geological indices, i.e. facies number, architectural element number, hydrofacies assemblage (ha) and hydrofacies assemblage type (hat).
angles (double array) – array of size 2 that holds the azimuth and dip of the cell. This will also be altered.
y, z (x,) – cell coordinates
y_idx (x_idx,) – indices of x and y position in grid.
grid (Grid object) –
-
object_bottom_surface
¶
-
object_bottom_surface_zmean
¶
-
object_dipsets
¶
-
object_layer_dist
¶
-
object_normvec_x
¶
-
object_normvec_y
¶
-
object_normvec_z
¶
-
object_shift
¶
-
object_top_surface
¶
-
hyvr.geo.stratum module¶
hyvr.geo.trough module¶
-
class
hyvr.geo.trough.
Trough
¶ Bases:
object
This class holds all parameters of a geometrical trough object.
The only method of this class is __init__, as after creating all trough objects, the list of troughs in TroughAE will be converted to multiple lists containing of attribute values for easier access from Cython.
In principle this could also be implemented in pure Python, anyone interested in rewriting this class (and Channel and Sheet) can do so.
-
a
¶
-
alpha
¶
-
azim
¶
-
b
¶
-
c
¶
-
cosalpha
¶
-
cosdip
¶
-
dip
¶
-
facies
¶
-
facies_array
¶
-
lag
¶
-
lag_facies
¶
-
layer_dist
¶
-
max_ab
¶
-
normvec_x
¶
-
normvec_y
¶
-
normvec_z
¶
-
num_facies
¶
-
num_ha
¶
-
shift
¶
-
sinalpha
¶
-
structure
¶
-
x
¶
-
y
¶
-
z
¶
-
zmax
¶
-
zmin
¶
-
hyvr.geo.trough_ae module¶
-
class
hyvr.geo.trough_ae.
TroughAE
¶ Bases:
hyvr.geo.ae_realization.AERealization
-
create_object_arrays
()¶ This method is called after the object list has been created, so after all objects have been generated.
Its main purpose is to create fixed size arrays of object attributes as members of the AERealization subtype, so that they can be accessed without needing to access the python list of objects.
All subclasses of AERealization must override this method.
-
generate_objects
()¶ Generate trough objects and place them in the domain.
-
maybe_assign_points_to_object
()¶ This function checks whether the current grid cell with given coordinates is inside the trough and assigns facies, azimuth and dip by altering the passed arrays.
- Parameters
oi (int) – object index
geo_ids (np.int32 array of size 4) – This holds the geological indices, i.e. facies number, architectural element number, hydrofacies assemblage (ha) and hydrofacies assemblage type (hat).
angles (double array) – array of size 2 that holds the azimuth and dip of the cell. This will also be altered.
y, z (x,) – cell coordinates
y_idx (x_idx,) – indices of x and y position in grid.
grid (Grid object) –
-
object_a
¶
-
object_alpha
¶
-
object_b
¶
-
object_c
¶
-
object_cosalpha
¶
-
object_cosdip
¶
-
object_lag
¶
-
object_lag_facies
¶
-
object_layer_dist
¶
-
object_max_ab
¶
-
object_normvec_x
¶
-
object_normvec_y
¶
-
object_normvec_z
¶
-
object_shift
¶
-
object_sinalpha
¶
-
object_structure
¶
-
object_x
¶
-
object_y
¶
-
object_z
¶
-