Model

class phydrus.model.Model(exe_name, ws_name, name='model', description=None, length_unit='cm', time_unit='days', mass_units='mmol', print_screen=False)[source]

Basic Phydrus model container.

Parameters
  • exe_name (str) – String with the path to the Hydrus-1D executable.

  • ws_name (str) – String with the workspace name. Folder is created if it does not exist.

  • name (str, optional) – String with the name of the model.

  • description (str, optional) – String with the description of the model.

  • length_unit (str, optional) – length units to use in the simulation. Options are “mm”, “cm”, and “m”. Defaults to “cm”.

  • time_unit (str, optional) – time unit to use in the simulation, options are “seconds”, “minutes”, “hours”, “days, “years”. Defaults to “days”.

  • mass_units (str, optional) – Mass units to use in the simulation, Options are “mmol”. Defaults to “mmol”. Only used when transport process is added.

  • print_screen (bool, optional) – Print the results to the screen during code execution.

Examples

>>> import phydrus as ps
>>> ws = "example"
>>> exe = os.path.join(os.getcwd(), "hydrus")
>>> ml = ps.Model(exe_name=exe, ws_name=ws, mass_units="mmol",
>>>               time_unit="min", length_unit="cm")

Attributes

n_layers

n_materials

n_solutes

Methods

__init__

Initialize self.

add_atmospheric_bc

Method to add the atmospheric boundary condition to the model.

add_drains

Method to add a drain to the model.

add_heat_transport

Method to add heat transport to the model.

add_material

Method to add a material to the model.

add_obs_nodes

Method to add observation points.

add_profile

Method to add the soil profile to the model.

add_root_growth

Method to add root growth to the model.

add_root_uptake

Method to add rootwater update modeule to the model.

add_solute

Method to add a solute to the model.

add_solute_transport

Method to add solute transport to the model.

add_time_info

Method to produce time information.

add_waterflow

Method to add a water_flow module to the model.

get_empty_heat_df

Get an empty DataFrame to fill in the heat parameters.

get_empty_material_df

Get an empty DataFrame with the soil parameters as columns.

get_empty_solute_df

Get an empty DataFrame with the solute parameters as columns.

read_alevel

Method to read the A_LEVEL.OUT output file.

read_balance

Method to read the BALANCE.OUT output file.

read_i_check

Method to read the I_CHECK.OUT output file.

read_nod_inf

Method to read the NOD_INF.OUT output file.

read_obs_node

Method to read the OBS_NODE.OUT output file.

read_profile

Method to read the PROFILE.OUT output file.

read_run_inf

Method to read the RUN_INF.OUT output file.

read_solutes

Method to read the SOLUTE.OUT output file.

read_tlevel

Method to read the T_LEVEL.OUT output file.

set_executable

Method to set the path to the Hydrus-1D executable.

simulate

Method to call the Hydrus-1D executable.

write_atmosphere

Method to write the ATMOSPH.IN file

write_input

Method to write the input files for the HYDRUS-1D simulation.

write_profile

Method to write the PROFILE.DAT file.

write_selector

Write the SELECTOR.IN file.