6.1.1.5.1.7. thyrsis.simulation.metis module

METIS specific functions

class thyrsis.simulation.metis.Metis(database, command)

Bases : object

Metis process class

check_maillage(a, b, c)

Unused

compute(compute_dir, total_time, MPI=None)

computes saturated or unsaturated

Paramètres
  • compute_dir (string) – path of compute folder

  • total_time (float) – simulation time duration in second

compute_hynverse(compute_dir)

computes saturated for inversion

Paramètres

compute_dir (string) – path of compute folder

compute_probes(compute_dir)

modifies results file _probes.sat in order to obtain a gnuplot readable file _probes_plot.sat

Paramètres

compute_dir (string) – path of compute folder

convert_infiltration_transitoire_insature(compute_dir)

Copy transient infiltration file to compute_dir

Paramètres

compute_dir (string) – path of compute folder

convert_infiltration_transitoire_sature(compute_dir)

Copy transient infiltration file to compute_dir

Paramètres

compute_dir (string) – path of compute folder

create_debit_sat(sat_dir, flux)

builds the input file for METIS in case of no unsaturated calculation

Paramètres
  • sat_dir (string) – path of saturated folder

  • flux – flux value list

create_hydrostationary_files(sat_dir, with_permeabilies=True)

builds the input files for METIS saturated stationary flow and inversion

Paramètres
  • sat_dir (string) – path of saturated folder

  • with_permeabilies (boolean) – boolean used to create or not the permeability file

create_insat_files(insat_dir, simulation_data, injection_data, param, settings, znodes)

builds the input files for METIS unsaturated

Paramètres
  • insat_dir (string) – path of insaturated folder

  • simulation_data (dict) – dictionnary of simulation data

  • injections_data (list) – list, containing a dictionnary for each injection

  • param (dict) – parameters dictionnary

  • settings (Settings) – Thyrsis settings

  • znodes (list) – znodes (list of z coordinate)

create_maillage_insat(insat_dir, znodes)

creates the METIS mesh files for unsaturated computations

Paramètres
  • insat_dir (string) – path of insaturated folder

  • znodes (list) – znodes (list of z coordinate)

create_maillage_sat(sat_dir, cur)

builds the mesh saturated METIS file

Paramètres
  • sat_dir (string) – path of saturated folder

  • cur (sqlite3.Cursor) – cursor

create_mnt_sat(sat_dir, cur)

builds the mnt saturated METIS file

Paramètres
  • sat_dir (string) – path of saturated folder

  • cur (sqlite3.Cursor) – cursor

create_mur_sat(sat_dir, cur)

builds the mur saturated METIS file

Paramètres
  • sat_dir (string) – path of saturated folder

  • cur (sqlite3.Cursor) – cursor

create_permeabilities_sat(sat_dir, cur=None, liste_pm=None)

builds the permeabilities saturated METIS file

Paramètres
  • sat_dir (string) – path of saturated folder

  • cur (sqlite3.Cursor) – cursor

  • liste_pm (list) – permeabilities data per mesh element

create_sat_files(sat_dir, simulation_data, param, settings)

builds the input files for METIS saturated

Paramètres
  • sat_dir (string) – path of saturated folder

  • simulation_data (dict) – dictionnary of simulation data

  • param (dict) – parameters dictionnary

  • settings (Settings) – Thyrsis settings

create_velocities_sat(sat_dir, cur=None, liste_vm=None, init=False)

builds the velocities saturated METIS file (unused)

Paramètres
  • sat_dir (string) – path of saturated folder

  • cur (sqlite3.Cursor) – cursor

  • liste_vm (list) – velocities data per mesh element

  • init (boolean) – boolean, True if only initialisation to (0 0 0)

file_exists(result_file)

Returns True if the result file exists (useful for other codes than METIS)

Renvoie

path of result file

Type renvoyé

string

get_hynverse_options()

Specific options for inversion process METIS

Renvoie

Metis options

Type renvoyé

dict

get_options()

Specific options for METIS

Renvoie

Metis options

Type renvoyé

dict

get_second_milieu()

Return if second milieu is used

Renvoie

True/False

Type renvoyé

bool

modif_data(rep, tini=0.0)

modifies the METIS data file and corrects the initial time

Paramètres
  • rep (string) – file path

  • tini (float) – initial time

nok(log_file)

Returns False if the METIS computation is OK, by testing the “fin du job metis” string in the log file

Paramètres

log_file (string) – log file path

Renvoie

success state

Type renvoyé

bool

read_dates_binaire(result_file)

reads a METIS binary results file and returns the dates and the number of dates

Paramètres

result_file (string) – path of the result file

Return dates

list of dates

Rtype dates

list

Return nbVal

number of values

Rtype nbVal

integer

read_dates_formate(result_file)

reads a METIS results file and returns the dates and the number of dates

Paramètres

result_file (string) – path of the result file

Return dates

list of dates

Rtype dates

list

Return nbVal

number of values

Rtype nbVal

integer

read_file(result_file, dates, convert=False)

reads an METIS results file

Paramètres
  • result_file (string) – path of the result file

  • dates (list) – list of dates

  • convert (bool) – convert flag to get ZNS columns data

Renvoie

result

Type renvoyé

numpy.ndarray

read_file_binaire(result_file, metis_dates, dates, nbVal, convert=False)

reads an METIS binary results file, adding values in case of missing dates

Paramètres
  • result_file (string) – path of the result file

  • metis_dates (list) – list of metis dates

  • dates (list) – list of dates

  • nbVal (integer) – number of values

  • convert (bool) – convert flag to get ZNS columns data

Renvoie

result

Type renvoyé

numpy.ndarray

read_file_formate(result_file, metis_dates, dates, nbVal, convert=False)

reads an METIS results file, adding values in case of missing dates

Paramètres
  • result_file (string) – path of the result file

  • metis_dates (list) – list of metis dates

  • dates (list) – list of dates

  • nbVal (integer) – number of values

  • convert (bool) – convert flag to get ZNS columns data

Renvoie

result

Type renvoyé

numpy.ndarray

read_insat_flux(insat_dir, name='debit')

reads the outgoing flux from a ZNS column

Paramètres
  • insat_dir (string) – path of insaturated folder

  • name (string) – flux name

Return ldates

dates list

Rtype ldates

list

Return lflux

outgoing flux value list

Rtype lflux »

list

read_mesh_insat(insat_dir)

Reads the METIS mesh file and returns the nodes number and the nodes surfaces

Paramètres

insat_dir (string) – path of insaturated folder

Return nnodes

nodes number

Rtype nnodes

list

Return surfaces

nodes surfaces

Rtype surfaces

list

read_potential_at_nodes(sat_dir, dates)

Reads the potential at node for each dates

Paramètres
  • sat_dir (string) – path of insaturated folder

  • dates (list) – list of dates

Renvoie

result

Type renvoyé

numpy.ndarray

settings_to_dict(settings)

save settings in dictionnary

Paramètres

settings (Settings) – Thyrsis settings

update_database(conn, compute_dir)

update database after inversion

Paramètres
  • conn (sqlite3.Connection) – conn on a sqlite database

  • compute_dir (string) – path of compute folder

write_sat_flux(sat_dir, name, dates, nodes, meshes, ldates, lnodes, lmeshes, lflux)

creates the file giving the incoming flux into the groundwater

Paramètres
  • sat_dir (string) – path of saturated folder

  • name (string) – flux name

  • dates (list) – list of dates

  • nodes (list) – total injection nodes list

  • meshes (list) – total injection meshes list

  • ldates (list) – dates list

  • lnodes (list) – list of injection nodes lists per injection

  • lmeshes (list) – list of injection meshes lists per injection

  • lflux – list of time-dependant flux lists per injection