Skip to content

Add a apply_callbacks method to the Transient solver #2207

@jgostick

Description

@jgostick

This is to address #1766, for the application of fancy BCs like ramps and oscillations in time.

    def _build_rhs(self):

        def ode_func(t, y):
            # TODO: add a cache mechanism
            self[self.settings["quantity"]] = y
            # TransientReactiveTransport._update_A_and_b(self)
            self.apply_callbacks()
            A = self.A.tocsc()
            b = self.b
            V = self.network[self.settings["pore_volume"]]
            return (-A.dot(y) + b) / V  # much faster than A*y

        return ode_func

And this will require a set_callback function somewhere: like rxn.set_callback(<???>)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions