METHOD
FVS Class Reference

#include <fluxVectorSplitting.h>

Inheritance diagram for FVS:
Collaboration diagram for FVS:

Public Member Functions

 FVS (Data *data, WenoBase *weno, Model *model)
 
virtual ~FVS ()
 
void fluxReconstruction (double *cons, double *prims, double *aux, double *f, double *frecon, int dir, int vars=-1)
 
void F (double *cons, double *prims, double *aux, double *f, double *fnet)
 
- Public Member Functions inherited from FluxMethod
 FluxMethod (Data *data, Model *model)
 
virtual ~FluxMethod ()
 

Public Attributes

WenoBaseweno
 
- Public Attributes inherited from FluxMethod
Datadata
 
Modelmodel
 

Detailed Description

Flux vector splitting method

The flux vector splitting method, initial proposed in Shu 1997. Here, we use a second order WENO spatial reconstruction.
Here we outline the method briefly, but for a detailed explanation see the above citation. Ignoring any contributions to the conserved vector due to source terms we can define the system of conservation equations in the following form,

\begin{align} \partial_t U + \partial_x f(U) = 0. \end{align}

In essence we desire some numerical flux function \(\mathcal{F}\) such that we can update the conserved vector in the following way,

\begin{align} \partial_t U = \mathcal{F}(U) \end{align}

such that

\begin{align} U^{n+1} =& U^n + \Delta t \mathcal{F}(U) \\ =& U^n + \Delta t \frac{f_{i+1/2} - f_{i-1/2}}{\Delta x} \end{align}

where we define \(f_{i+1/2}\) as the value of the flux vector at the righthand edge of the \(i^{th}\) cell, and each cell has width \(\Delta x\). To determine the value of the numerical flux function then, we need estimates of the values of the flux vector at the cell faces.
To get these, we consider the flux in cell \(i\) to be composed of entirely left moving and entirely right moving contributions, that is,

\begin{align} f_i = f_i^- + f_i^+. \end{align}

Using the Lax-Friedrichs approximation of the flux, we can ensure that these contributions are entirely poitive/negative by using the following,

\begin{align} f_i^{\pm} = \frac{1}{2}(f_i \pm \alpha U_i) \end{align}

where we have defined \(\alpha = max_p|\lambda_p|\) is the maximum wavespeed with \(\lambda_p\) as the \(p^th\) eigenvalue of the Jacobian of the system.
For simplicity, we note that in a system with electromagnetic perturbations, waves travel at the speed of light, and thus we set \(alpha=1\) throughout. To determine the flux vector at the cell faces, we reconstruct both upwind and downwind fluxes and compute the difference of the two at the face. We do this with a second order WENO reconstruction, thus,

\begin{align} f^+_{i, right} &= WENO(f_{i-2}, f_{i-1}, f_i) \\ f^-_{i, left} &= WENO(f_{i+1}, f_i, f_{i-1}) \end{align}

so that the reconstruction if \(f_{i+1/2} = f^+_{i, right} + f^-_{i, left}\). Note that this final equation is essentially a difference equation as the fluxes are moving in opposing directions.
Note
In the code, we have absorbed a minus into the definition of the numerical flux, and so where it says \(U^n + \Delta t \mathcal{F}(U^{(n)})\), the code actually implements \(cons - dt * flux\).

Definition at line 68 of file fluxVectorSplitting.h.

Constructor & Destructor Documentation

◆ FVS()

FVS::FVS ( Data data,
WenoBase weno,
Model model 
)
inline

Constructor.

Calls the base class constructor to store pointers to Data and Model classes.

Parameters
[in]*datapointer to Data class
[in]*modelpointer to Model class

Definition at line 82 of file fluxVectorSplitting.h.

◆ ~FVS()

virtual FVS::~FVS ( )
inlinevirtual

Destructor.

Definition at line 84 of file fluxVectorSplitting.h.

Member Function Documentation

◆ F()

void FVS::F ( double *  cons,
double *  prims,
double *  aux,
double *  f,
double *  fnet 
)
virtual

Numerical flux function.

For a given state described by cons prims and aux arrays, determines an approximation of the net flux of the conserved quantities through all cells by taking difference of the reconstructed values at the cell faces.

Parameters
[in]*conspointer to conserved vector
[in]*primspointer to primitive vector
[in]*auxpointer to auxiliary vector
[in]*fpointer to a flux work array to store the initial flux vector
[out]*fnetpointer to the array containing the net flux through every cell
See also
fluxReconstruction

Implements FluxMethod.

◆ fluxReconstruction()

void FVS::fluxReconstruction ( double *  cons,
double *  prims,
double *  aux,
double *  f,
double *  frecon,
int  dir,
int  vars = -1 
)
virtual

Flux reconstruction.

Reconstructs the fluxes at the center of the cells to the faces upwind and downwind and computes the difference, giving an approximation of the net flux (in the specified direction) at the cell faces. Method uses a second order WENO reconstruction.

Parameters
[in]*conspointer to conserved vector
[in]*primspointer to primitive vector
[in]*auxpointer to auxiliary vector
[in]*fpointer to a flux work array to store the initial flux vector
[out]*freconpointer to the array containing the reconstructed values of the fluxes at the cell faces
[in]dirthe direction in which to determine flux reconstruction with (0, 1, 2) = (x, y, z)
[in]varssize of the vector to reconstruct (saves time when using subgrid models). Default values is -1, which autos to Ncons.
Note
This is an approximation of the net flux at the cell faces, not the cell centers, and so the final approximation of the flux through a cell required differencing the values obtained here at either end of the cell. This is performed in F
See also
F

Implements FluxMethod.

Member Data Documentation

◆ weno

WenoBase* FVS::weno

Definition at line 72 of file fluxVectorSplitting.h.


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