TransientReactiveTransport

class TransientReactiveTransport(*args, **kwargs)[source]

Bases: openpnm.algorithms.ReactiveTransport.ReactiveTransport

A subclass of ReactiveTransport for transient/steady-state simulations

Parameters
  • network (OpenPNM Network object) – The Network with which this algorithm is associated.

  • project (OpenPNM Project object) – Either a Network or a Project must be specified.

Notes

This subclass performs steady and transient simulations of transport phenomena with reactions when source terms are added. It supports 3 time discretization schemes; ‘steady’ to perform a steady-state simulation, and ‘implicit’ (fast, 1st order accurate) and ‘cranknicolson’ (slow, 2nd order accurate) both for transient simulations.

results(times=None, **kwargs)[source]

Fetches the calculated quantity from the algorithm and returns it as an array.

Parameters
  • times (scalar, ND-array, list of scalars, None, or string) – Time steps to be returned. The default value is None which results in returning all time steps. If times is a scalar, only the corresponding time step is returned. If times is an ND-array or a list of scalars, time steps in the provided array or list are returned. If times is ‘final’ or ‘actual’, the current value of the quantity is returned.

  • t_precision (integer) – The time precision (number of decimal places). Default value is 12.

Notes

The keyword steps is interpreted in the same way as times.

run(t=None)[source]

Builds ‘A’ matrix of the steady system of equations to be used at each time step to build transient ‘A’ and ‘b’. Imposes the initial conditions and stores the initial field. Initialize transient ‘A’, ‘b’, and source term (if present) and finally calls the transient solver.

Parameters

t (scalar) – The time to start the simulation from. If no time is specified, the simulation starts from ‘t_initial’ defined in the settings.

set_IC(values)[source]

A method to set simulation initial conditions

Parameters

values (ND-array or scalar) – Set the initial conditions using an ‘Np’ long array. ‘Np’ being the number of pores. If a scalar is given, the same value is imposed to all pores.

setup(phase=None, quantity='', conductance='', t_initial=None, t_final=None, t_step=None, t_output=None, t_tolerance=None, t_precision=None, t_scheme='', **kwargs)[source]

This method takes several arguments that are essential to running the algorithm and adds them to the settings

Notes

More settings can be adjusted in the presence of a non-linear source term such as under-relaxation. See the ‘ReactiveTransport’ class documentation for details.