METHOD
TwoFluidEMHD Class Reference

#include <twoFluidEMHD.h>

Inheritance diagram for TwoFluidEMHD:
Collaboration diagram for TwoFluidEMHD:

Public Member Functions

 TwoFluidEMHD ()
 
 TwoFluidEMHD (Data *data)
 
virtual ~TwoFluidEMHD ()
 
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

Two-Fluid ElectroMagnetoHydroDynamics

The special relativistic, two fluid model of EMHD. Governing equations have been taken and adapted from Amano 2016.
We label the species 1 and 2, so the density of electrons may be rho1 and of positrons may be rho2 for example.
Note
The model has eighteen conserved variables:
\( \ \ \ D, S_x, S_y, S_z, \tau \\ \ \ \ \bar{D}, \bar{S}_x, \bar{S}_y, \bar{S}_z, \bar{\tau}, \\ \ \ \ B_x, B_y, B_z, \\ \ \ \ E_x, E_y, E_z, \\ \ \ \ \psi, \phi \)
Sixteen primitive variables:
\( \ \ \ \rho_1, v_{x1}, v_{y1}, v_{z1}, p_1, \\ \ \ \ \rho_2, v_{x2}, v_{y2}, v_{z2}, p_2, \\ \ \ \ B_x, B_y, B_z, \\ \ \ \ E_x, E_y, E_z \)
Thirty-five auxiliary variables:
\( \ \ \ h_1, W_1, e_1, v^2_1, Z_1, D_1, \tilde{S}_{x1}, \tilde{S}_{y1}, \tilde{S}_{z1}, \tilde{\tau}_1, \\ \ \ \ h_2, W_2, e_2, v^2_2, Z_2, D_2, \tilde{S}_{x2}, \tilde{S}_{y2}, \tilde{S}_{z2}, \tilde{\tau}_2, \\ \ \ \ J_x, J_y, J_z, \\ \ \ \ \tilde{S}_x, \tilde{S}_y, \tilde{S}_z, \tilde{\tau}, \\ \ \ \ B^2, E^2 \\ \ \ \ \mathcal{\varrho}_0, \mathcal{\varrho}, \\ \ \ \ u_x, u_y, u_z, W \)
The two fluid EMHD equations describe a plasma composed of two oppositely charged species, electrons and positrons. We evolve the species by summing and differencing their standard hydrodynamical properties, and thus consider the following system of conservation equations:

\begin{align} \partial_t \renewcommand\arraystretch{5.0} \begin{pmatrix} D \\ S^x \\ S^y \\ S^z \\ \tau \\ \bar{D} \\ \bar{S}^x \\ \bar{S}^y \\ \bar{S}^z \\ \bar{\tau} \\ B^x \\ B^y \\ B^z \\ E^x \\ E^y \\ E^z \\ \psi \\ \phi \end{pmatrix} + \partial_j \begin{pmatrix} \rho_s W_s v_s^j \\ \rho_s h_s W_s^2 v_{s,x} v_s^j - (E_x E^j + B_x B^j) + \delta_x^j [(E^2 + B^2) / 2+ p_s ] \\ \rho_s h_s W_s^2 v_{s,y} v_s^j - (E_y E^j + B_y B^j) + \delta_y^j [(E^2 + B^2) / 2+ p_s ] \\ \rho_s h_s W_s^2 v_{s,z} v_s^j - (E_z E^j + B_z B^j) + \delta_z^j [(E^2 + B^2) / 2+ p_s ] \\ \rho_s h_s W_s^2 v_s^i + \epsilon^{jkl} E_k B_l - \rho_s W_s v_s^j \\ \mu_s \rho_s W_s v_s^j \\ \mu_s \rho_s h_s W_s^2 v_{s, x} v_s^j + \delta_x^j \mu_s p_s \\ \mu_s \rho_s h_s W_s^2 v_{s, y} v_s^j + \delta_y^j \mu_s p_s \\ \mu_s \rho_s h_s W_s^2 v_{s, z} v_s^j + \delta_z^j \mu_s p_s \\ \mu_s \rho_s h_s W_s^2 v_s^i - \mu_s \rho_s W_s v_s^i \\ \epsilon^{ixj} E_i + \delta_x^j \phi \\ \epsilon^{iyj} E_i + \delta_y^j \phi \\ \epsilon^{izj} E_i + \delta_z^j \phi \\ -\epsilon^{ixj} B_i + \delta_x^j \psi \\ -\epsilon^{iyj} B_i + \delta_y^j \psi \\-\epsilon^{izj} B_i + \delta_z^j \psi \\ E^j \\ B^j \end{pmatrix} = \begin{pmatrix} 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ \omega_p^2 \big[ W E^x + (u^y B^z - u^z B^y) - (J^x - \varrho_0 u^x) / \sigma) \\ \omega_p^2 \big[ W E^y + (u^z B^x - u^x B^z) - (J^y - \varrho_0 u^y) / \sigma) \\ \omega_p^2 \big[ W E^z + (u^x B^y - u^y B^x) - (J^z - \varrho_0 u^z) / \sigma) \\ \omega_p^2 \big[u_i E^i - (\varrho - \varrho_0 W) / \sigma\big] \\ 0 \\ 0 \\ 0 \\ -J_x \\ -J_y \\ -J_z \\ \varrho - \psi / c_p^2 \\ -\phi / c_p^2 \end{pmatrix}. \end{align}

For a comprehensive discussion on this model see Amano 2016.

Definition at line 90 of file twoFluidEMHD.h.

Constructor & Destructor Documentation

◆ TwoFluidEMHD() [1/2]

TwoFluidEMHD::TwoFluidEMHD ( )

Default constructor.

◆ TwoFluidEMHD() [2/2]

TwoFluidEMHD::TwoFluidEMHD ( Data data)

Parameterized constructor.

Stores a pointer to the Data class for reference in its methods

Parameters
*dataPointer to Data class containing global simulation data

◆ ~TwoFluidEMHD()

virtual TwoFluidEMHD::~TwoFluidEMHD ( )
inlinevirtual

Destructor.

Definition at line 105 of file twoFluidEMHD.h.

Member Function Documentation

◆ finalise()

void TwoFluidEMHD::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 214 of file twoFluidEMHD.h.

◆ fluxVector()

void TwoFluidEMHD::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 Anton 2010, with the inclusion of divergence cleaning from Muddle 2016.

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 TwoFluidEMHD::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 separates the fluids, then subtracts the EM fields implementing a resistive MHD single fluid proceedure to each species. 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 TwoFluidEMHD::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 TwoFluidEMHD::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 Amano 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 TwoFluidEMHD::sourceTerm ( double *  cons,
double *  prims,
double *  aux,
double *  source 
)
virtual

Source term contribution.

Source terms arise from the weighted sum of the species conserved vectors 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 TwoFluidEMHD::sourceTermSingleCell ( double *  cons,
double *  prims,
double *  aux,
double *  source,
int  i = -1,
int  j = -1,
int  k = -1 
)
virtual

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: