METHOD
RKSplit2 Class Reference

#include <rkSplit2ndOrder.h>

Inheritance diagram for RKSplit2:
Collaboration diagram for RKSplit2:

Public Member Functions

 RKSplit2 (Data *data, Model *model, Bcs *bcs, FluxMethod *fluxMethod, ModelExtension *modelExtension=NULL)
 
virtual ~RKSplit2 ()
 
void setSource (double *cons, double *prims, double *aux)
 
void step (double *cons, double *prims, double *aux, double dt=0)
 
- Public Member Functions inherited from RK2
 RK2 (Data *data, Model *model, Bcs *bcs, FluxMethod *fluxMethod, ModelExtension *modelExtension=NULL)
 
virtual ~RK2 ()
 
void predictorStep (double *cons, double *prims, double *aux, double dt)
 
void correctorStep (double *cons, double *prims, double *aux, double dt)
 
- Public Member Functions inherited from TimeIntegrator
 TimeIntegrator (Data *data, Model *model, Bcs *bcs, FluxMethod *fluxMethod, ModelExtension *modelExtension=NULL)
 
virtual ~TimeIntegrator ()
 
void finalise (double *cons, double *prims, double *aux)
 
- Public Member Functions inherited from TimeIntegratorBase
 TimeIntegratorBase (Data *data, Model *model, Bcs *bcs, FluxMethod *fluxMethod, ModelExtension *modelExtension=NULL)
 
virtual ~TimeIntegratorBase ()
 

Additional Inherited Members

- Public Attributes inherited from RK2
double * p1cons
 
double * p1prims
 
double * p1aux
 
double * args1
 
double * args2
 
- Public Attributes inherited from TimeIntegratorBase
Datadata
 
Modelmodel
 
Bcsbcs
 
FluxMethodfluxMethod
 
ModelExtensionmodelExtension
 

Detailed Description

Operator splitting RK2 integrator, second order accurate in time

Integrator deals with the flux and source using Strang splitting, first adding have a source term, then performing the two stages as a result of the flux integration, and the finally adding the dsecond half of the contribution of the source. See Font 2008 Section 4.1
Note
This is a fully explicit method at dealing with the source contributions, do not expect this integrator to converge for large source contributions, i.e. for sources that act on a fast timescale compared to the flux terms. For stiff hyperbolic systems, we need to solve the sources implicitly to ensure stability.
First, add half a source,

\begin{align} U^{*} = U^n + \frac{1}{2} \Delta t \Psi(U^n) \end{align}

then perform the RK2 step,

\begin{align} U^{**} = \frac{1}{2} U^* + \frac{1}{2} U^{(1)} + \frac{1}{2} \Delta t \mathcal{F}(U^{(1)}) \end{align}

where the first stage result is

\begin{align} U^{(1)} = U^* + \Delta t \mathcal{F}(U^*), \end{align}

and then adds the source due to this stage,

\begin{align} U^{n+1} = U^** + \Delta t \Psi(U^**), \end{align}

where \(\Psi(U)\) is the source vector due to the state \(U\).
See also
RKSplit
RK2

Definition at line 42 of file rkSplit2ndOrder.h.

Constructor & Destructor Documentation

◆ RKSplit2()

RKSplit2::RKSplit2 ( Data data,
Model model,
Bcs bcs,
FluxMethod fluxMethod,
ModelExtension modelExtension = NULL 
)
inline

Constructor.

Constructor requires simulation data and the flux and source functions from the model class.

Parameters
[in]*datapointer to Data class containing global simulation data
[in]*modelpointer to Model object
[in]*bcspointer to Bcs object
[in]*fluxMethodpointer to FluxMethod object
[in]*modelExtensionpointer to the ModelExtension object
See also
TimeIntegrator::TimeIntegrator
RK2::RK2

Definition at line 59 of file rkSplit2ndOrder.h.

◆ ~RKSplit2()

virtual RKSplit2::~RKSplit2 ( )
inlinevirtual

Destructor.

Definition at line 63 of file rkSplit2ndOrder.h.

Member Function Documentation

◆ setSource()

void RKSplit2::setSource ( double *  cons,
double *  prims,
double *  aux 
)

Set the source vector.

Set the source vector from the physics model and any model extensions
Parameters
[in]conspointer to conserved vector work array. Size is \(N_{cons} \times N_x \times N_y \times N_z\)
[in]primspointer to primitive vector work array. Size is \(N_{prims} \times N_x \times N_y \times N_z\)
[in]auxpointer to auxilliary vector work array. Size is \(N_{aux} \times N_x \times N_y \times N_z\)
[out]sourcepointer to data->source vector work array. Size is \(N_{cons} \times N_x \times N_y \times N_z\)

◆ step()

void RKSplit2::step ( double *  cons,
double *  prims,
double *  aux,
double  dt = 0 
)
virtual

Performs a single time step.

The timestep will use the current values of the conserved, primitive and auxilliary variables at t=t0 and compute the values of all of them at time t=t0 + dt. I.e. the conserved vector is evolved forward, and the corresponding prims and aux vars are found.

Parameters
[in]*conspointer to conserved vector work array. Size is \(N_{cons} \times N_x \times N_y \times N_z\)
[in]*primspointer to primitive vector work array. Size is \(N_{prims} \times N_x \times N_y \times N_z\)
[in]*auxpointer to auxilliary vector work array. Size is \(N_{aux} \times N_x \times N_y \times N_z\)
dtthe step size desired to move by. Defaults to the value in the Data class
See also
TimeIntegrator::step
RK2::step

Reimplemented from RK2.


The documentation for this class was generated from the following file: