effluent.model ============== .. py:module:: effluent.model .. autoapi-nested-parse:: The package contains the :class:`Model ` class and helper functions. Classes ------- .. autoapisummary:: effluent.model.Model Functions --------- .. autoapisummary:: effluent.model.load_config Module Contents --------------- .. py:class:: Model(pipe = None, ambient = None, output = None, solver = None, start='1970-01-01', stop='1970-01-01', step=86400) A complete model of an effluent discharge. The class contains all parameters necessary to execute a simulation, including information about the pipe discharge itself, the ambient ocean, parameters for the mixing process, the desired output format and numerical solver parameters. :param pipe: Pipe and effluent discharge parameters :param ambient: Ambient ocean hydrography and currents :param output: Output target and output format :param solver: Physical parametrization and numerical solver :param start: First simulated discharge time :param stop: Last simulated discharge time :param step: Seconds between each simulated discharge time .. py:method:: from_config(fname_or_dict) :staticmethod: Initialize a model object using the :doc:`configuration format `. :param fname_or_dict: Config dict or name of config file :return: An initialized object. .. py:method:: irun() Execute the simulation iteratively. For each iteration, a new discharge time is simulated using the following algorithm: 1. Initial conditions are specified using :func:`self.solver.set_init() ` 2. Ambient conditions are specified using :func:`self.solver.set_ambient() ` 3. The numerical solution is computed using :func:`self.solver.solve() `. 4. The result is written to the output file using :func:`self.output.write() ` 5. The iterator yields the result :return: An iterator for simulating the discharge times sequentially. .. py:method:: run() Execute the simulation using repeated calls to :func:`self.irun() `. The result is written to the output file. .. py:function:: load_config(fname_or_dict) Convert from external to internal config format. The :doc:`external config format ` is designed to be easy for the user, while the internal config format is structured as strictly one entry for each of the model subcomponent classes. The two formats are similar, but slightly reorganized. :param fname_or_dict: Either a dict, or the name of a file :return: A dict of config options, in internal config format