pyopensn.math.AngularFluxTimeFunction

class pyopensn.math.AngularFluxTimeFunction

Time-dependent angular flux function.

Functions that accept a group index, a direction index, and time, and return the incoming angular flux value for that (group, direction, time) tuple.

Wrapper of opensn::AngularFluxTimeFunction.

Examples

>>> # Create from a Python function
>>> def incident_flux(group, direction, time):
...     return 1.0 if group == 0 and time <= 0.5 else 0.0
>>> f = AngularFluxTimeFunction(incident_flux)
>>>
>>> # Create from lambda
>>> g = AngularFluxTimeFunction(lambda group, direction, time: time)
>>>
>>> # Evaluate
>>> f(0, 3, 0.25)
1.0
>>> g(1, 2, 0.5)
0.5
__call__(self: pyopensn.math.AngularFluxTimeFunction, group: int, direction: int, time: float) float

Evaluate the associated time-dependent angular flux function.

Parameters:
  • group (int) – Energy group index.

  • direction (int) – Direction index in the angular quadrature.

  • time (float) – Evaluation time.

__init__(self: pyopensn.math.AngularFluxTimeFunction, func: Callable[[int, int, float], float]) None

Construct a time-dependent angular flux function from a Python function or lambda.

Parameters:

func (Callable[[int, int, float], float]) – Referenced angular flux function. The arguments are energy group index, direction index, and time.