6.1.1.5.1.1. thyrsis.simulation.compute module¶
This module is a new python version of mhynos
- USAGE
python -m thyrsis.simulation.compute [-init, -run, -verbose, -mpi] dbname.sqlite
calcul mhynos in the spatial database dbname.sqlite
OPTIONS
-init : initialize -run : compute -verbose : verbose -mpi : MPI
- thyrsis.simulation.compute.calcul_flux(injection_data, simulation_data, param)¶
Compute the flux
- Paramètres
injection_data (dict) – data for a injection
simulation_data (dict) – dictionnary of simulation data
param (dict) – parameters dictionnary
- Return t0
begin date
- Rtype t0
date
- Return t1
end date
- Rtype t1
date
- Return flux
flux value (as input or calculated)
- Rtype flux
float
- thyrsis.simulation.compute.check_before_compute(dbname)¶
Return an error if database is not ready for computation
- Paramètres
dbname (string) – path to database
- Renvoie
success state
- Type renvoyé
string
- thyrsis.simulation.compute.check_injection_zones(dbname)¶
Checks if injection zones must be created and creates them »
- Paramètres
dbname (string) – path to database
- thyrsis.simulation.compute.compute(dbname, init=False, run=False, MPI=None, verbose=False)¶
Launch MHYNOS process
- Paramètres
dbname (string) – path to database
init (bool) – init flag
run (bool) – run flag
MPI (MPI) – MPI parameter
verbose (bool) – verbose flag
- Renvoie
success state
- Type renvoyé
bool
- thyrsis.simulation.compute.compute_mpi(dbname, init=True, run=True)¶
Launch parrallel process as configured
- Paramètres
dbname (string) – path to database
init (bool) – init flag
run (bool) – run flag
- thyrsis.simulation.compute.create_dates_simulation(conn, tmpdir)¶
Create the dates simulation file
- Paramètres
conn (sqlite3.Connection) – connection on a sqlite database
tmpdir (string) – temporary folder path
- Renvoie
nbDates number of dates
- Type renvoyé
int
- thyrsis.simulation.compute.create_debit_sat(code, sat_dir, injections_data, simulation_data, param)¶
Builds the input file in cas of no unsaturated calculation
- thyrsis.simulation.compute.create_insat_files(code, insat_dir, injection_data, simulation_data, param, settings, znodes)¶
Construct the input files for insaturated calculations
- Paramètres
insat_dir (string) – saturation path
injections_data (list) – list, containing a dictionnary for each injection
simulation_data (dict) – dictionnary of simulation data
param (dict) – parameters dictionnary
settings (Settings) – Thyrsis settings
znodes (list) – znodes (list of z coordinate)
- Return t0
begin date
- Rtype t0
date
- Return t1
end date
- Rtype t1
date
- Return flux
flux value (as input or calculated)
- Rtype flux
float
- thyrsis.simulation.compute.create_mesh_zns(conn, settings, vgamax)¶
Create the Zns mesh
- Paramètres
conn (sqlite3.Connection) – connection on a sqlite database
settings (Settings) – Thyrsis settings
vgamax – max value of Van Genuchten alpha parameter
- Renvoie
znodes (list of z coordinate)
- Type renvoyé
list
- thyrsis.simulation.compute.mhynos_init(code, settings, MPI=None)¶
Initialize calculation and data files
- thyrsis.simulation.compute.readfile(filename)¶
Read sat file
- Paramètres
filename (string) – path of the file to read
- Renvoie
data (file lines)
- Type renvoyé
list
- thyrsis.simulation.compute.update_injections(conn)¶
Update injections data in database
- Paramètres
conn (sqlite3.Connection) – connection on a sqlite database
- thyrsis.simulation.compute.utilisateurs(dbname)¶
Update db with users files
- Paramètres
dbname (string) – path to database