Contains the declaration of various utility functions for MHD.
More...
#include <vector>
#include "../global/global.h"
#include "../global/global_cuda.h"
#include "../grid/grid3D.h"
#include "../utils/basic_structs.h"
#include "../utils/cuda_utilities.h"
#include "../utils/gpu.hpp"
#include "../utils/math_utilities.h"
Go to the source code of this file.
|
| namespace | mhd |
| | Namespace for MHD code.
|
| |
| namespace | mhd::utils::internal |
| | Namespace for functions required by functions within the mhd::utils namespace. Everything in this name space should be regarded as private but is made accesible for testing.
|
| |
|
| __host__ __device__ Real | mhd::utils::internal::_magnetosonicSpeed (Real const &density, Real const &gasPressure, Real const &magneticX, Real const &magneticY, Real const &magneticZ, Real const &gamma, Real const &waveChoice) |
| | Compute the fast or slow magnetosonic wave speeds.
|
| |
| __host__ __device__ Real | mhd::utils::computeMagneticEnergy (Real const &magneticX, Real const &magneticY, Real const &magneticZ) |
| | Compute the magnetic energy.
|
| |
| __host__ __device__ Real | mhd::utils::computeThermalEnergy (Real const &energyTot, Real const &density, Real const &momentumX, Real const &momentumY, Real const &momentumZ, Real const &magneticX, Real const &magneticY, Real const &magneticZ, Real const &gamma) |
| | Compute the MHD thermal energy in a cell.
|
| |
| __host__ __device__ Real | mhd::utils::computeTotalPressure (Real const &gasPressure, Real const &magneticX, Real const &magneticY, Real const &magneticZ) |
| | Compute the total MHD pressure. I.e. magnetic pressure + gas pressure.
|
| |
|
__host__ __device__ Real | mhd::utils::computeTotalPressure (Real const &gasPressure, hydro_utilities::VectorXYZ< Real > const &magnetic) |
| | Overload for Vector objects.
|
| |
| __host__ __device__ Real | mhd::utils::fastMagnetosonicSpeed (Real const &density, Real const &pressure, Real const &magneticX, Real const &magneticY, Real const &magneticZ, Real const &gamma) |
| | Compute the speed of the fast magnetosonic wave.
|
| |
| __host__ __device__ Real | mhd::utils::slowMagnetosonicSpeed (Real const &density, Real const &pressure, Real const &magneticX, Real const &magneticY, Real const &magneticZ, Real const &gamma) |
| | Compute the speed of the slow magnetosonic wave.
|
| |
| __host__ __device__ Real | mhd::utils::alfvenSpeed (Real const &magneticX, Real const &density) |
| | Compute the speed of the Alfven wave in a cell.
|
| |
Contains the declaration of various utility functions for MHD.
- Author
- Robert 'Bob' Caddy (rvc@p.nosp@m.itt..nosp@m.edu)
◆ alfvenSpeed()
| __host__ __device__ Real mhd::utils::alfvenSpeed |
( |
Real const & |
magneticX, |
|
|
Real const & |
density |
|
) |
| |
|
inline |
Compute the speed of the Alfven wave in a cell.
- Parameters
-
| [in] | magneticX | The magnetic field in the x direction, ie the direction along with the Riemann solver is acting |
| [in] | density | The density in the cell |
- Returns
- Real The Alfven wave speed
◆ computeMagneticEnergy()
| __host__ __device__ Real mhd::utils::computeMagneticEnergy |
( |
Real const & |
magneticX, |
|
|
Real const & |
magneticY, |
|
|
Real const & |
magneticZ |
|
) |
| |
|
inline |
Compute the magnetic energy.
- Parameters
-
| [in] | magneticX | The magnetic field in the X-direction |
| [in] | magneticY | The magnetic field in the Y-direction |
| [in] | magneticZ | The magnetic field in the Z-direction |
- Returns
- Real The magnetic energy
◆ computeThermalEnergy()
| __host__ __device__ Real mhd::utils::computeThermalEnergy |
( |
Real const & |
energyTot, |
|
|
Real const & |
density, |
|
|
Real const & |
momentumX, |
|
|
Real const & |
momentumY, |
|
|
Real const & |
momentumZ, |
|
|
Real const & |
magneticX, |
|
|
Real const & |
magneticY, |
|
|
Real const & |
magneticZ, |
|
|
Real const & |
gamma |
|
) |
| |
|
inline |
Compute the MHD thermal energy in a cell.
- Parameters
-
| [in] | energyTot | The total energy |
| [in] | density | The density |
| [in] | momentumX | Momentum in the x-direction |
| [in] | momentumY | Momentum in the y-direction |
| [in] | momentumZ | Momentum in the z-direction |
| [in] | magneticX | Magnetic field in the x-direction |
| [in] | magneticY | Magnetic field in the y-direction |
| [in] | magneticZ | Magnetic field in the z-direction |
| [in] | gamma | The adiabatic index |
- Returns
- Real The thermal energy in a cell
◆ computeTotalPressure()
| __host__ __device__ Real mhd::utils::computeTotalPressure |
( |
Real const & |
gasPressure, |
|
|
Real const & |
magneticX, |
|
|
Real const & |
magneticY, |
|
|
Real const & |
magneticZ |
|
) |
| |
|
inline |
Compute the total MHD pressure. I.e. magnetic pressure + gas pressure.
- Parameters
-
| [in] | gasPressure | The gas pressure |
| [in] | magneticX | Magnetic field in the x-direction |
| [in] | magneticY | Magnetic field in the y-direction |
| [in] | magneticZ | Magnetic field in the z-direction |
- Returns
- Real The total MHD pressure
◆ fastMagnetosonicSpeed()
| __host__ __device__ Real mhd::utils::fastMagnetosonicSpeed |
( |
Real const & |
density, |
|
|
Real const & |
pressure, |
|
|
Real const & |
magneticX, |
|
|
Real const & |
magneticY, |
|
|
Real const & |
magneticZ, |
|
|
Real const & |
gamma |
|
) |
| |
|
inline |
Compute the speed of the fast magnetosonic wave.
- Parameters
-
| density | The gas pressure |
| pressure | The density |
| magneticX | Magnetic field in the x-direction |
| magneticY | Magnetic field in the y-direction |
| magneticZ | Magnetic field in the z-direction |
| gamma | The adiabatic index |
- Returns
- Real The speed of the fast magnetosonic wave
◆ slowMagnetosonicSpeed()
| __host__ __device__ Real mhd::utils::slowMagnetosonicSpeed |
( |
Real const & |
density, |
|
|
Real const & |
pressure, |
|
|
Real const & |
magneticX, |
|
|
Real const & |
magneticY, |
|
|
Real const & |
magneticZ, |
|
|
Real const & |
gamma |
|
) |
| |
|
inline |
Compute the speed of the slow magnetosonic wave.
- Parameters
-
| density | The gas pressure |
| pressure | The density |
| magneticX | Magnetic field in the x-direction |
| magneticY | Magnetic field in the y-direction |
| magneticZ | Magnetic field in the z-direction |
| gamma | The adiabatic index |
- Returns
- Real The speed of the slow magnetosonic wave