ogstools.materiallib.core.medium module#

class ogstools.materiallib.core.medium.Medium[source]#

Bases: object

A Medium represents a full material definition for a given material_id, including its medium-level properties and all relevant phases.

It constructs its internal structure based on the selected process schema, automatically generating phases and components as required.

Parameters#

material_idint

The material ID assigned to this medium.

materialMaterial

The solid/medium material to use as property source.

fluidsdict[str, Material] | None

A mapping from phase type to fluid material (e.g. {“AqueousLiquid”: water, “Gas”: co2}).

processstr

The process type, e.g. “TH2M_PT”. Used to determine required structure.

__init__(material_id, material, name='NO_NAME_GIVEN', fluids=None, process='')[source]#
set_phase(phase)[source]#

Assigns a Phase to the correct slot based on its type.

get_phase(phase_type)[source]#
Return type:

Phase | None

validate_phase(phase)[source]#
Return type:

bool

get_phases()[source]#

Returns all defined phases in order.

Return type:

list[Phase]

add_property(prop)[source]#
validate()[source]#
Return type:

bool