METHOD
SRRMHD Class Reference

#include <srrmhd.h>

Inheritance diagram for SRRMHD:
Collaboration diagram for SRRMHD:

Public Member Functions

 SRRMHD ()
 
 SRRMHD (Data *data)
 
virtual ~SRRMHD ()
 
void sourceTermSingleCell (double *cons, double *prims, double *aux, double *source, int i=-1, int j=-1, int k=-1)
 
void sourceTerm (double *cons, double *prims, double *aux, double *source)
 
void getPrimitiveVarsSingleCell (double *cons, double *prims, double *aux, int i=-1, int j=-1, int k=-1)
 
void getPrimitiveVars (double *cons, double *prims, double *aux)
 
void primsToAll (double *cons, double *prims, double *aux)
 
void fluxVector (double *cons, double *prims, double *aux, double *f, const int dir)
 
void finalise (double *cons, double *prims, double *aux)
 
- Public Member Functions inherited from Model
 Model ()
 
 Model (Data *data)
 
virtual ~Model ()
 

Additional Inherited Members

- Public Attributes inherited from Model
Datadata
 
int Ncons
 
int Nprims
 
int Naux
 

Detailed Description

Special Relativistic Resistive MagnetHydroDynamics

The single fluid, special relativistic, resistive limit of the MHD equations.
Note
Model has 14 conserved variables:
\(\ \ \ D\), \(S_x\), \(S_y\), \(S_z\), \(\tau\), \(B_x\), \(B_y\), \(B_z\), \(E_x\), \(E_y\), \(E_z\), \(\psi\), \(\phi\), \(\varrho\)
11 primitive variables:
\(\ \ \ \rho\), \(v_x\), \(v_y\), \(v_z\), \(p\), \(B_x\), \(B_y\), \(B_z\), \(E_x\), \(E_y\), \(E_z\)
17 auxiliary variables:
\(\ \ \ h\), \(W\), \(e\), \(c\), \(J_x\), \(J_y\), \(J_z\), \(B^2\), \(E^2\), \(v^2\), \(\rho h W^2\), \(v \cdot E\), \(\overline{S}_x\), \(\overline{S}_y\), \(\overline{S}_z\), \(\overline{S}^2\), \(\overline{\tau}\)

The equations of motion are:

\begin{align} \partial_t \begin{pmatrix} D \\ S^i \\ \tau \\ B^i \\ E^i \\ \psi \\ \phi \\ \varrho \end{pmatrix} + \partial_k \begin{pmatrix} Dv^k \\ S^k_i\\ S^k - D v^k \\ - \epsilon^{ijk} E^j + \delta^k_i \phi \\ \epsilon^{ijk} B^j + \delta^k_i \psi \\ E^k \\ B^k \\ J^k \end{pmatrix} = \begin{pmatrix} 0 \\ 0 \\ 0 \\ 0 \\ -J^i \\ \varrho -\psi / c_p^2 \\ -\phi / c_p^2 \\ 0 \end{pmatrix}. \end{align}

Here, we sum over the \(k\) coordinate directions, and note the following relations:

\begin{align} D &= \rho W \\ S^i &= \rho h^* W^2 v^i + \epsilon^{ijk}E^j B^k \\ \tau &= \rho h^* W^2 - p^* + \frac{E^2 + B^2}{2} - D \\ W &= 1 / \sqrt(1 - v_i v^i) \\ J^i &= \varrho v^i + W \sigma \bigg[E^i + \epsilon^{ijk} v^j B^k - (v^kE^k)v^i\bigg] \\ S^{ij} &= \rho h W^2 v^i v^j + \delta^{ij}\bigg(P + \frac{E^2 + B^2}{2}\bigg) - E^i E^j - B^i B^j \\ c_p &= const. \end{align}

We have also included the additional scalar fields \(\psi\) and \(\phi\) such that any errors in the evolution of the magnetic/electric fields that break the divergence constraint set by Maxwell's equations are driven to zero on a timescale set by the constant parameter \(c_p\). See Dedner et al. 2002.
See also
Model

Definition at line 77 of file srrmhd.h.

Constructor & Destructor Documentation

◆ SRRMHD() [1/2]

SRRMHD::SRRMHD ( )

Default constructor.

◆ SRRMHD() [2/2]

SRRMHD::SRRMHD ( Data data)

Parameterized constructor.

Stores a pointer to the Data class for reference in its members
Parameters
*datapointer to Data class containing global simulation data

◆ ~SRRMHD()

virtual SRRMHD::~SRRMHD ( )
inlinevirtual

Definition at line 93 of file srrmhd.h.

Member Function Documentation

◆ finalise()

void SRRMHD::finalise ( double *  cons,
double *  prims,
double *  aux 
)
inlinevirtual

Finalise the simulation variables.

Mostly, this probably wont be needed, but if there is any final steps to finish off a timestep, this can be done here.

Reimplemented from Model.

Definition at line 201 of file srrmhd.h.

◆ fluxVector()

void SRRMHD::fluxVector ( double *  cons,
double *  prims,
double *  aux,
double *  f,
const int  dir 
)
virtual

Flux vector.

Method determines the value of the conserved vector in the specified direction. For the form of the fluxes see Dionysopoulou 2016 with the inclusion of divergence cleaning from Muddle 2015.

Note
We are assuming that all primitive and auxiliary variables are up-to-date at the time of this function execution.
Parameters
*conspointer to conserved vector work array. Size is Ncons*Nx*Ny*Nz
*primspointer to primitive vector work array. Size is Nprims*Nx*Ny*Nz
*auxpointer to auxiliary vector work array. Size is Naux*Nx*Ny*Nz
*fpointer to flux vector work array. Size is Ncons*Nx*Ny*Nz
dirdirection in which to generate flux vector. (x, y, z) = (0, 1, 2)
See also
Model::fluxVector

Implements Model.

◆ getPrimitiveVars()

void SRRMHD::getPrimitiveVars ( double *  cons,
double *  prims,
double *  aux 
)
virtual

Spectral decomposition.

Generates the values of the primitive and auxiliary variables consistent with the conservative vector given. Method first subtracts the EM fields from the conserved quantities, reducing the problem to the hydrodynamic properties only before determining their values via a newton method. Function calls single celled version (below) for each compute cell.

Parameters
*conspointer to conserved vector work array. Size is Ncons*Nx*Ny*Nz
*primspointer to primitive vector work array. Size is Nprims*Nx*Ny*Nz
*auxpointer to auxiliary vector work array. Size is Naux*Nx*Ny*Nz
See also
Model::getPrimitiveVars

Implements Model.

◆ getPrimitiveVarsSingleCell()

void SRRMHD::getPrimitiveVarsSingleCell ( double *  cons,
double *  prims,
double *  aux,
int  i = -1,
int  j = -1,
int  k = -1 
)
virtual

Single cell spectral decomposition.

Generates the values for aux and prims for the given cons vector for only a single cell (i, j, k). Note : pointers to arrays are the (Ncons,) conservative array, (Nprims,) prim array and (Naux,) aux array, NOT the (Ncons, Nx, Ny, Nz) arrays as in most other functions. Single celled version required for the inside of the residual functions for the (semi) implicit time integrators.

Parameters
*conspointer to conserved vector work array. Size is Ncons
*primspointer to primitive vector work array. Size is Nprims
*auxpointer to auxiliary vector work array. Size is Naux
icell number in x-direction (optional)
jcell number in y-direction (optional)
kcell number in z-direction (optional)
See also
Model::getPrimitiveVarsSingleCell

Implements Model.

◆ primsToAll()

void SRRMHD::primsToAll ( double *  cons,
double *  prims,
double *  aux 
)
virtual

Primitive-to-all transformation.

Transforms the initial state given in primitive form in to the conserved vector state. Relations have been taken from Dionysopoulou 2016.

Parameters
*conspointer to conserved vector work array. Size is Ncons*Nx*Ny*Nz
*primspointer to primitive vector work array. Size is Nprims*Nx*Ny*Nz
*auxpointer to auxiliary vector work array. Size is Naux*Nx*Ny*Nz
See also
Model::primsToAll

Implements Model.

◆ sourceTerm()

void SRRMHD::sourceTerm ( double *  cons,
double *  prims,
double *  aux,
double *  source 
)
virtual

Source term contribution.

Source terms arise from the evolution of the electric fields and from implementing the divergence cleaning method. This function determines the source contribution to the change in the conserved vector for all cells. This function calls sourceTermSingleCell for every compute cell.

Parameters
*conspointer to conserved vector work array. Size is Ncons*Nx*Ny*Nz
*primspointer to primitive vector work array. Size is Nprims*Nx*Ny*Nz
*auxpointer to auxiliary vector work array. Size is Naux*Nx*Ny*Nz
*sourcepointer to source vector work array. Size is Ncons*Nx*Ny*Nz
See also
Model::sourceTerm

Implements Model.

◆ sourceTermSingleCell()

void SRRMHD::sourceTermSingleCell ( double *  cons,
double *  prims,
double *  aux,
double *  source,
int  i = -1,
int  j = -1,
int  k = -1 
)
virtual

Destructor.

Single cell source term contribution

Determines the source vector due the the cond prims and aux vector of a single compute cell. Note : pointers to arrays are the (Ncons,) conservative array, (Nprims,) prim array and (Naux,) aux array, NOT the (Ncons, Nx, Ny, Nz) arrays as in most other functions.

Parameters
*conspointer to conserved vector work array. Size is Ncons
*primspointer to primitive vector work array. Size is Nprims
*auxpointer to auxiliary vector work array. Size is Naux
*sourcepointer to source vector work array. Size is Ncons
icell number in x-direction (optional)
jcell number in y-direction (optional)
kcell number in z-direction (optional)
See also
Model::sourceTermSingleCell

Implements Model.


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