ResSimpy.Nexus.DataModels.StructuredGrid.NexusGrid.NexusGrid

class ResSimpy.Nexus.DataModels.StructuredGrid.NexusGrid.NexusGrid(grid_nexus_file: 'Optional[NexusFile]' = None)[source]

Bases: Grid

Public Data Attributes:

Inherited from Grid

range_x

range_y

range_z

netgrs

porosity

sw

kx

ky

kz

Methods:

__init__([grid_nexus_file])

update_properties_from_dict(data)

Allows you to update properties on the class using the provided dict of values.

to_dict()

load_grid_properties_if_not_loaded()

load_structured_grid_file(structured_grid_file)

Loads in a structured grid file with all grid properties, and the array functions defined with 'FUNCTION'.

update_structured_grid_file(grid_dict, model)

Save values passed from the front end to the structured grid file and update the class.

load_array_functions()

get_array_functions_list()

Returns the grid array functions as a list of function lines.

get_array_functions_df()

Returns the grid array functions as a dataframe.

load_faults()

Function to read faults in Nexus grid file defined using MULT and FNAME keywords.

get_faults_df()

Returns the fault definition and transmissility multiplier information as a dataframe.

__repr__()

Return repr(self).

__eq__(other)

Return self==value.

Inherited from Grid

__init__()

load_structured_grid_file(...)

load_grid_properties_if_not_loaded()

to_dict()

update_properties_from_dict(data)

__repr__()

Return repr(self).

__eq__(other)

Return self==value.


__init__(grid_nexus_file: NexusFile | None = None) None[source]
update_properties_from_dict(data: dict[str, int | ResSimpy.Grid.VariableEntry]) None[source]

Allows you to update properties on the class using the provided dict of values.

Args:

data dict[str, int | VariableEntry]: the dictionary of values to update on the class

classmethod load_structured_grid_file(structured_grid_file: NexusFile, lazy_loading: bool = True) NexusGrid[source]

Loads in a structured grid file with all grid properties, and the array functions defined with ‘FUNCTION’. Other grid modifiers are currently not supported.

Args:

structured_grid_file (NexusFile): the NexusFile representation of a structured grid file for converting into a structured grid file class

raises AttributeError:

if no value is found for the structured grid file path

raises ValueError:

if when loading the grid no values can be found for the NX NY NZ line.

static update_structured_grid_file(grid_dict: dict[str, VariableEntry | int], model: NexusSimulator) None[source]

Save values passed from the front end to the structured grid file and update the class.

Args:

grid_dict (dict[str, Union[VariableEntry, int]]): dictionary containing grid properties to be replaced model (NexusSimulator): an instance of a NexusSimulator object

raises ValueError:

If no structured grid file is in the instance of the Simulator class

get_array_functions_list() list[list[str]] | None[source]

Returns the grid array functions as a list of function lines.

get_array_functions_df() pandas.DataFrame | None[source]

Returns the grid array functions as a dataframe.

load_faults() None[source]

Function to read faults in Nexus grid file defined using MULT and FNAME keywords.

get_faults_df() pandas.DataFrame | None[source]

Returns the fault definition and transmissility multiplier information as a dataframe.