iFluidSolver
The purpose of the iFluidSolver class is to propagate the filling function in time following the hydrodynamic equation
This is achieved by approximating the propagation for a single time-step dt.
Note, the iFluidSolver class is abstract and must be extended by classes encoding algorithms for performing the time-step. Click here to see how to implement your own algorithm.
Constructor
obj = iFluidSolver(coreObj, Options)
Construct an iFluidSolver object for solving the hydrodynamical propagation equation.
Inputs:
coreObj:iFluidCoreobject specifying the model and problem at hand.Options: Struct of settings.
Returns:
obj:iFluidSolverobject.
Abstract (algorithm specific) methods
[theta, u, w] = initialize(obj, theta_init, u_init, w_init, t_array )
Calculates and stores all the required quantities used by the algorithm implemented in step().
Inputs:
theta_init: Initial filling function (t = 0), asfluidcell.u_init: Initial position characteristic (t = 0), asfluidcell.w_init: Initial rapidity characteristic (t = 0), asfluidcell.t_array: Vector of timesteps.
Returns:
theta: Filling passed to first call ofstep(). Typically equal totheta_init.u: Position characteristic passed to first call ofstep(). Typically equal tou_init.w: Rapidity characteristic passed to first call ofstep(). Typically equal tow_init.
[theta_next, u_next, w_next] = step(obj, theta_prev, u_prev, w_prev, t, dt)
Propagates the filling function one timestep dt.
Inputs:
theta_prev: Filling function at timet, asfluidcell.u_prev: Position characteristic at timet, asfluidcell.w_prev: Rapidity characteristic at timet, asfluidcell.t: Time at the start of the step.dt: Length of step.
Returns:
theta_next: Filling function at timet + dt, asfluidcell.u_next: Position characteristic at timet + dt, asfluidcell.w_next: Rapidity characteristic at timet + dt, asfluidcell.
Time propagation methods
[theta_t, u_t, w_t] = propagateTheta(obj, theta_init, t_array)
Propagates the filling function according to the hydrodynamical equation using the user-implemented step() method.
Inputs:
theta_init: Initial filling function (t = 0), asfluidcell.t_array: Vector of starting times of each step.
Returns:
theta_t: Cell array of filling functions for each time int_array.u_t: Cell array of position characteristics for each time int_array.w_t: Cell array of rapidity characteristics for each time int_array.
Additional methods
[theta_next, u_next, w_next] = performFirstOrderStep(obj, theta_prev, u_prev, w_prev, t, dt)
Propagates the filling function one timestep dt using a first-order approximation. This method is helpful for calculating the required quantities for more sophisticated step() algorithms.
Inputs:
theta_prev: Filling function at timet, asfluidcell.u_prev: Position characteristic at timet, asfluidcell.w_prev: Rapidity characteristic at timet, asfluidcell.t: Time at the start of the step.dt: Length of step.
Returns:
theta_next: Filling function at timet + dt, asfluidcell.u_next: Position characteristic at timet + dt, asfluidcell.w_next: Rapidity characteristic at timet + dt, asfluidcell.
tensor_int = interpPhaseSpace(obj, tensor_grid, rapid_int, x_int, extrapFlag)
Interpolates a quantity defined on the grids x_grid and rapid_grid from the stored iFluidCore object.
Inputs:
tensor_grid: Quantity to interpolate. Must befluidcell.rapid_int: Matrix of rapidities to interpolate to.x_int: Matrix of positions to interpolate to.extrapFlag: Flag for extrapolation. Iftrue, extrapolation is allowed. Iffalse, all extrapolated values are 0.
Returns:
tensor_int:tensor_gridinterpolate torapid_intandx_int.
Options
The iFluidSolver class takes an Options struct as argument in its constructor. The Options struct can hold the following (case sensitive!) parameters, which are transferred to the iFluidSolver object upon construction.
The possible options are:
extrapFlag(defaultfalse): Indicates if extrapolation is allowed.periodRapid(defaultfalse): Indicates if rapidity is periodic.