diff options
Diffstat (limited to 'Python/pywarpx/picmi.py')
-rw-r--r-- | Python/pywarpx/picmi.py | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/Python/pywarpx/picmi.py b/Python/pywarpx/picmi.py index 8e4860078..621757132 100644 --- a/Python/pywarpx/picmi.py +++ b/Python/pywarpx/picmi.py @@ -889,6 +889,7 @@ class Cartesian3DGrid(picmistandard.PICMI_Cartesian3DGrid): else: pywarpx.amr.max_level = 0 + class ElectromagneticSolver(picmistandard.PICMI_ElectromagneticSolver): """ See `Input Parameters <https://warpx.readthedocs.io/en/latest/usage/parameters.html>`_ for more information. @@ -998,6 +999,63 @@ class ElectromagneticSolver(picmistandard.PICMI_ElectromagneticSolver): pywarpx.warpx.pml_has_particles = self.pml_has_particles pywarpx.warpx.do_pml_j_damping = self.do_pml_j_damping + +class HybridPICSolver(picmistandard.base._ClassWithInit): + """ + Hybrid-PIC solver based on Ohm's law. + See `Theory Section <https://warpx.readthedocs.io/en/latest/theory/kinetic_fluid_hybrid_model.html>`_ for more information. + + Parameters + ---------- + Te: float + Electron temperature in eV. + + n0: float + Reference plasma density in m^-3. + + gamma: float, default=3/2 + Exponent in calculation of electron pressure. + + n_floor: float, optional + Minimum density used in Ohm's law calculation. + + plasma_resistivity: float or str + Value or expression to use for the plasma resistivity. + + substeps: int, default=100 + Number of substeps to take when updating the B-field. + """ + def __init__(self, grid, Te=None, n0=None, gamma=None, + n_floor=None, plasma_resistivity=None, substeps=None, **kw): + self.grid = grid + self.method = "hybrid" + + self.Te = Te + self.n0 = n0 + self.gamma = gamma + self.n_floor = n_floor + self.plasma_resistivity = plasma_resistivity + + self.substeps = substeps + + self.handle_init(kw) + + def initialize_inputs(self): + + self.grid.initialize_inputs() + + pywarpx.algo.maxwell_solver = self.method + + pywarpx.hybridpicmodel.elec_temp = self.Te + pywarpx.hybridpicmodel.n0_ref = self.n0 + pywarpx.hybridpicmodel.gamma = self.gamma + pywarpx.hybridpicmodel.n_floor = self.n_floor + pywarpx.hybridpicmodel.__setattr__( + 'plasma_resistivity(rho)', self.plasma_resistivity + ) + pywarpx.hybridpicmodel.substeps = self.substeps + + class ElectrostaticSolver(picmistandard.PICMI_ElectrostaticSolver): """ See `Input Parameters <https://warpx.readthedocs.io/en/latest/usage/parameters.html>`_ for more information. |