Cholla 3.0.1-dev
Cholla - Massively parallel hydro on GPUs
Loading...
Searching...
No Matches
Namespaces | Functions
mhd_utilities.h File Reference

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"
Include dependency graph for mhd_utilities.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

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.
 

Functions

__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.
 

Detailed Description

Contains the declaration of various utility functions for MHD.

Author
Robert 'Bob' Caddy (rvc@p.nosp@m.itt..nosp@m.edu)

Function Documentation

◆ 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]magneticXThe magnetic field in the x direction, ie the direction along with the Riemann solver is acting
[in]densityThe 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]magneticXThe magnetic field in the X-direction
[in]magneticYThe magnetic field in the Y-direction
[in]magneticZThe 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]energyTotThe total energy
[in]densityThe density
[in]momentumXMomentum in the x-direction
[in]momentumYMomentum in the y-direction
[in]momentumZMomentum in the z-direction
[in]magneticXMagnetic field in the x-direction
[in]magneticYMagnetic field in the y-direction
[in]magneticZMagnetic field in the z-direction
[in]gammaThe 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]gasPressureThe gas pressure
[in]magneticXMagnetic field in the x-direction
[in]magneticYMagnetic field in the y-direction
[in]magneticZMagnetic 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
densityThe gas pressure
pressureThe density
magneticXMagnetic field in the x-direction
magneticYMagnetic field in the y-direction
magneticZMagnetic field in the z-direction
gammaThe 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
densityThe gas pressure
pressureThe density
magneticXMagnetic field in the x-direction
magneticYMagnetic field in the y-direction
magneticZMagnetic field in the z-direction
gammaThe adiabatic index
Returns
Real The speed of the slow magnetosonic wave