ReactiveTransport

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

Bases: openpnm.algorithms.GenericTransport.GenericTransport

A subclass for steady-state simulations with (optional) source terms.

Parameters
  • network ((OpenPNM Network object)) – The network object to which this algorithm will apply.

  • name ((string, optional)) – Name of the algorithm

  • project ((OpenPNM Project object, optional)) – Either a Network or a Project must be supplied

Notes

This subclass performs steady simulations of transport phenomena with reactions when source terms are added.

remove_source(propname, pores=None)[source]

Removes source terms from specified pores.

Parameters
  • propname (str) – The property name of the source term model to be removed.

  • pores (array_like) – The pore indices where the source term should be applied.

reset(source_terms=False, **kwargs)[source]

Resets the algorithm to enable re-use.

This allows the reuse of an algorithm inside a for-loop for parametric studies. The default behavior means that only alg.reset() and alg.run() must be called inside a loop. To reset the algorithm more completely requires overriding the default arguments.

Parameters
  • results (boolean) – If True (default) all previously calculated values pertaining to results of the algorithm are removed.

  • bcs (boolean (default = False)) – If True all previous boundary conditions are removed.

  • source_terms (boolean) – If True removes source terms. The default is False.

run(x0=None)[source]

Builds the A and b matrices, and calls the solver specified in the settings attribute.

Parameters

x0 (ND-array) – Initial guess of unknown variable

set_source(propname, pores, mode='overwrite')[source]

Applies a given source term to the specified pores.

Parameters
  • propname (string) – The property name of the source term model to be applied.

  • pores (array_like) – The pore indices where the source term should be applied.

  • mode (str) –

    Controls how the sources are applied. Options are:

    ’merge’ - Adds supplied source term to already existing ones. ‘overwrite’ - (default) Deletes all existing source terms of the given propname then adds the specified new ones

Notes

Source terms cannot be applied in pores where boundary conditions have already been set. Attempting to do so will result in an error being raised.