WarpX
|
This class contains the parameters needed to evaluate hybrid field solutions (kinetic ions with fluid electrons). More...
#include <HybridPICModel.H>
Public Member Functions | |
HybridPICModel (int nlevs_max) | |
void | ReadParameters () |
void | AllocateMFs (int nlevs_max) |
void | AllocateLevelMFs (int lev, const amrex::BoxArray &ba, const amrex::DistributionMapping &dm, int ncomps, const amrex::IntVect &ngJ, const amrex::IntVect &ngRho, const amrex::IntVect &jx_nodal_flag, const amrex::IntVect &jy_nodal_flag, const amrex::IntVect &jz_nodal_flag, const amrex::IntVect &rho_nodal_flag) |
void | ClearLevel (int lev) |
void | InitData () |
void | GetCurrentExternal (amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> const &edge_lengths) |
Function to evaluate the external current expressions and populate the external current multifab. Note the external current can be a function of time and therefore this should be re-evaluated at every step. More... | |
void | GetCurrentExternal (std::array< std::unique_ptr< amrex::MultiFab >, 3 > const &edge_lengths, int lev) |
void | CalculateCurrentAmpere (amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> const &Bfield, amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> const &edge_lengths) |
Function to calculate the total current based on Ampere's law while neglecting displacement current (J = curl x B). Used in the Ohm's law solver (kinetic-fluid hybrid model). More... | |
void | CalculateCurrentAmpere (std::array< std::unique_ptr< amrex::MultiFab >, 3 > const &Bfield, std::array< std::unique_ptr< amrex::MultiFab >, 3 > const &edge_lengths, int lev) |
void | HybridPICSolveE (amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> &Efield, amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> const &Jfield, amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> const &Bfield, amrex::Vector< std::unique_ptr< amrex::MultiFab >> const &rhofield, amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> const &edge_lengths, bool include_resistivity_term) |
Function to update the E-field using Ohm's law (hybrid-PIC model). More... | |
void | HybridPICSolveE (std::array< std::unique_ptr< amrex::MultiFab >, 3 > &Efield, std::array< std::unique_ptr< amrex::MultiFab >, 3 > const &Jfield, std::array< std::unique_ptr< amrex::MultiFab >, 3 > const &Bfield, std::unique_ptr< amrex::MultiFab > const &rhofield, std::array< std::unique_ptr< amrex::MultiFab >, 3 > const &edge_lengths, int lev, bool include_resistivity_term) |
void | HybridPICSolveE (std::array< std::unique_ptr< amrex::MultiFab >, 3 > &Efield, std::array< std::unique_ptr< amrex::MultiFab >, 3 > const &Jfield, std::array< std::unique_ptr< amrex::MultiFab >, 3 > const &Bfield, std::unique_ptr< amrex::MultiFab > const &rhofield, std::array< std::unique_ptr< amrex::MultiFab >, 3 > const &edge_lengths, int lev, PatchType patch_type, bool include_resistivity_term) |
void | BfieldEvolveRK (amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> &Bfield, amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> &Efield, amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> const &Jfield, amrex::Vector< std::unique_ptr< amrex::MultiFab >> const &rhofield, amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> const &edge_lengths, amrex::Real dt, DtType a_dt_type, amrex::IntVect ng, std::optional< bool > nodal_sync) |
void | BfieldEvolveRK (amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> &Bfield, amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> &Efield, amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> const &Jfield, amrex::Vector< std::unique_ptr< amrex::MultiFab >> const &rhofield, amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> const &edge_lengths, amrex::Real dt, int lev, DtType dt_type, amrex::IntVect ng, std::optional< bool > nodal_sync) |
void | FieldPush (amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> &Bfield, amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> &Efield, amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> const &Jfield, amrex::Vector< std::unique_ptr< amrex::MultiFab >> const &rhofield, amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> const &edge_lengths, amrex::Real dt, DtType dt_type, amrex::IntVect ng, std::optional< bool > nodal_sync) |
void | CalculateElectronPressure (DtType a_dt_type) |
Function to calculate the electron pressure at a given timestep type using the simulation charge density. Used in the Ohm's law solver (kinetic-fluid hybrid model). More... | |
void | CalculateElectronPressure (int lev, DtType a_dt_type) |
void | FillElectronPressureMF (std::unique_ptr< amrex::MultiFab > const &Pe_field, amrex::MultiFab *const &rho_field) const |
Fill the electron pressure multifab given the kinetic particle charge density (and assumption of quasi-neutrality) using the user specified electron equation of state. More... | |
amrex::MultiFab * | get_pointer_current_fp_ampere (int lev, int direction) const |
amrex::MultiFab * | get_pointer_current_fp_external (int lev, int direction) const |
amrex::MultiFab * | get_pointer_electron_pressure_fp (int lev) const |
This class contains the parameters needed to evaluate hybrid field solutions (kinetic ions with fluid electrons).
HybridPICModel::HybridPICModel | ( | int | nlevs_max | ) |
void HybridPICModel::AllocateLevelMFs | ( | int | lev, |
const amrex::BoxArray & | ba, | ||
const amrex::DistributionMapping & | dm, | ||
int | ncomps, | ||
const amrex::IntVect & | ngJ, | ||
const amrex::IntVect & | ngRho, | ||
const amrex::IntVect & | jx_nodal_flag, | ||
const amrex::IntVect & | jy_nodal_flag, | ||
const amrex::IntVect & | jz_nodal_flag, | ||
const amrex::IntVect & | rho_nodal_flag | ||
) |
void HybridPICModel::AllocateMFs | ( | int | nlevs_max | ) |
Allocate hybrid-PIC specific multifabs. Called in constructor.
void HybridPICModel::BfieldEvolveRK | ( | amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> & | Bfield, |
amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> & | Efield, | ||
amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> const & | Jfield, | ||
amrex::Vector< std::unique_ptr< amrex::MultiFab >> const & | rhofield, | ||
amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> const & | edge_lengths, | ||
amrex::Real | dt, | ||
DtType | a_dt_type, | ||
amrex::IntVect | ng, | ||
std::optional< bool > | nodal_sync | ||
) |
void HybridPICModel::BfieldEvolveRK | ( | amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> & | Bfield, |
amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> & | Efield, | ||
amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> const & | Jfield, | ||
amrex::Vector< std::unique_ptr< amrex::MultiFab >> const & | rhofield, | ||
amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> const & | edge_lengths, | ||
amrex::Real | dt, | ||
int | lev, | ||
DtType | dt_type, | ||
amrex::IntVect | ng, | ||
std::optional< bool > | nodal_sync | ||
) |
void HybridPICModel::CalculateCurrentAmpere | ( | amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> const & | Bfield, |
amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> const & | edge_lengths | ||
) |
Function to calculate the total current based on Ampere's law while neglecting displacement current (J = curl x B). Used in the Ohm's law solver (kinetic-fluid hybrid model).
[in] | Bfield | Magnetic field from which the current is calculated. |
[in] | edge_lengths | Length of cell edges taking embedded boundaries into account |
void HybridPICModel::CalculateCurrentAmpere | ( | std::array< std::unique_ptr< amrex::MultiFab >, 3 > const & | Bfield, |
std::array< std::unique_ptr< amrex::MultiFab >, 3 > const & | edge_lengths, | ||
int | lev | ||
) |
void HybridPICModel::CalculateElectronPressure | ( | DtType | a_dt_type | ) |
Function to calculate the electron pressure at a given timestep type using the simulation charge density. Used in the Ohm's law solver (kinetic-fluid hybrid model).
void HybridPICModel::ClearLevel | ( | int | lev | ) |
Helper function to clear values from hybrid-PIC specific multifabs.
void HybridPICModel::FieldPush | ( | amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> & | Bfield, |
amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> & | Efield, | ||
amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> const & | Jfield, | ||
amrex::Vector< std::unique_ptr< amrex::MultiFab >> const & | rhofield, | ||
amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> const & | edge_lengths, | ||
amrex::Real | dt, | ||
DtType | dt_type, | ||
amrex::IntVect | ng, | ||
std::optional< bool > | nodal_sync | ||
) |
void HybridPICModel::FillElectronPressureMF | ( | std::unique_ptr< amrex::MultiFab > const & | Pe_field, |
amrex::MultiFab *const & | rho_field | ||
) | const |
Fill the electron pressure multifab given the kinetic particle charge density (and assumption of quasi-neutrality) using the user specified electron equation of state.
[out] | Pe_filed | scalar electron pressure MultiFab at a given level |
[in] | rho_field | scalar ion charge density Multifab at a given level |
|
inline |
|
inline |
|
inline |
void HybridPICModel::GetCurrentExternal | ( | amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> const & | edge_lengths | ) |
Function to evaluate the external current expressions and populate the external current multifab. Note the external current can be a function of time and therefore this should be re-evaluated at every step.
void HybridPICModel::GetCurrentExternal | ( | std::array< std::unique_ptr< amrex::MultiFab >, 3 > const & | edge_lengths, |
int | lev | ||
) |
void HybridPICModel::HybridPICSolveE | ( | amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> & | Efield, |
amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> const & | Jfield, | ||
amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> const & | Bfield, | ||
amrex::Vector< std::unique_ptr< amrex::MultiFab >> const & | rhofield, | ||
amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 >> const & | edge_lengths, | ||
bool | include_resistivity_term | ||
) |
Function to update the E-field using Ohm's law (hybrid-PIC model).
void HybridPICModel::HybridPICSolveE | ( | std::array< std::unique_ptr< amrex::MultiFab >, 3 > & | Efield, |
std::array< std::unique_ptr< amrex::MultiFab >, 3 > const & | Jfield, | ||
std::array< std::unique_ptr< amrex::MultiFab >, 3 > const & | Bfield, | ||
std::unique_ptr< amrex::MultiFab > const & | rhofield, | ||
std::array< std::unique_ptr< amrex::MultiFab >, 3 > const & | edge_lengths, | ||
int | lev, | ||
bool | include_resistivity_term | ||
) |
void HybridPICModel::HybridPICSolveE | ( | std::array< std::unique_ptr< amrex::MultiFab >, 3 > & | Efield, |
std::array< std::unique_ptr< amrex::MultiFab >, 3 > const & | Jfield, | ||
std::array< std::unique_ptr< amrex::MultiFab >, 3 > const & | Bfield, | ||
std::unique_ptr< amrex::MultiFab > const & | rhofield, | ||
std::array< std::unique_ptr< amrex::MultiFab >, 3 > const & | edge_lengths, | ||
int | lev, | ||
PatchType | patch_type, | ||
bool | include_resistivity_term | ||
) |
void HybridPICModel::InitData | ( | ) |
void HybridPICModel::ReadParameters | ( | ) |
Read user-defined model parameters. Called in constructor.
amrex::GpuArray<int, 3> HybridPICModel::Bx_IndexType |
Gpu Vector with index type of the Bx multifab
amrex::GpuArray<int, 3> HybridPICModel::By_IndexType |
Gpu Vector with index type of the By multifab
amrex::GpuArray<int, 3> HybridPICModel::Bz_IndexType |
Gpu Vector with index type of the Bz multifab
amrex::Vector<std::array< std::unique_ptr<amrex::MultiFab>, 3 > > HybridPICModel::current_fp_ampere |
amrex::Vector<std::array< std::unique_ptr<amrex::MultiFab>, 3 > > HybridPICModel::current_fp_external |
amrex::Vector<std::array< std::unique_ptr<amrex::MultiFab>, 3 > > HybridPICModel::current_fp_temp |
amrex::Vector< std::unique_ptr<amrex::MultiFab> > HybridPICModel::electron_pressure_fp |
amrex::GpuArray<int, 3> HybridPICModel::Ex_IndexType |
Gpu Vector with index type of the Ex multifab
amrex::GpuArray<int, 3> HybridPICModel::Ey_IndexType |
Gpu Vector with index type of the Ey multifab
amrex::GpuArray<int, 3> HybridPICModel::Ez_IndexType |
Gpu Vector with index type of the Ez multifab
amrex::GpuArray<int, 3> HybridPICModel::Jx_IndexType |
Gpu Vector with index type of the Jx multifab
amrex::GpuArray<int, 3> HybridPICModel::Jy_IndexType |
Gpu Vector with index type of the Jy multifab
amrex::GpuArray<int, 3> HybridPICModel::Jz_IndexType |
Gpu Vector with index type of the Jz multifab
amrex::Real HybridPICModel::m_elec_temp |
Electron temperature in eV
amrex::ParserExecutor<2> HybridPICModel::m_eta |
std::string HybridPICModel::m_eta_expression = "0.0" |
Plasma resistivity
amrex::Real HybridPICModel::m_eta_h = 0.0 |
Plasma hyper-resisitivity
bool HybridPICModel::m_external_field_has_time_dependence = false |
amrex::Real HybridPICModel::m_gamma = 5.0/3.0 |
Electron pressure scaling exponent
std::array< amrex::ParserExecutor<4>, 3> HybridPICModel::m_J_external |
std::array< std::unique_ptr<amrex::Parser>, 3> HybridPICModel::m_J_external_parser |
std::string HybridPICModel::m_Jx_ext_grid_function = "0.0" |
External current
std::string HybridPICModel::m_Jy_ext_grid_function = "0.0" |
std::string HybridPICModel::m_Jz_ext_grid_function = "0.0" |
amrex::Real HybridPICModel::m_n0_ref = 1.0 |
Reference electron density
amrex::Real HybridPICModel::m_n_floor = 1.0 |
Plasma density floor - if n < n_floor it will be set to n_floor
bool HybridPICModel::m_resistivity_has_J_dependence = false |
std::unique_ptr<amrex::Parser> HybridPICModel::m_resistivity_parser |
int HybridPICModel::m_substeps = 10 |
Number of substeps to take when evolving B
amrex::Vector< std::unique_ptr<amrex::MultiFab> > HybridPICModel::rho_fp_temp |