WARPXM v1.10.0
Loading...
Searching...
No Matches
two_stream_instability Namespace Reference

Variables

str torder = 'RK4'
 
str sorder = 'thirdOrder'
 
bool periodic_boundary_conditions = True
 
float skin_depth_norm = 1.0
 
float omega_p_norm = 1.0
 
int charge = 1
 
int mass = 1
 
int charge_to_mass = charge/mass
 
float cfl = 0.235
 
float perturbation = 0.01
 
float thermal_velocity = 0.1
 
float density = 1.0
 
np velocity_separation = np.pi/2.0
 
list v_space_num_elements = [160]
 
list min_v = [-10.0]
 
list dv = [0.125]
 
int num_physical_elements = 80
 
int L = 2 * np.pi
 
float k = 0.5
 
warpy mesh
 
warpy distribution
 
warpy field
 
warpy fluid
 
warpy distribution_ic
 Initial conditions-------------------------------— Step 1: define the function as an application:
 
warpy maxwell_ic
 
warpy distribution_ic_va
 
warpy maxwell_ic_va
 
warpy ic_ha
 
list apps_kinetic
 Initial conditions-------------------------------—.
 
list apps_physical
 
list applications_moments = []
 
list variable_adjusters = []
 Variable adjusters.
 
warpy writer
 Variable writer.
 
warpy spatial_solver_kinetic
 Spatial solver.
 
warpy spatial_solver_physical
 
warpy temporal_solver
 Temporal solver.
 
int dt = 1e-1
 Simulation (dg) dt = 1e-5.
 
int t_final = 80
 
warpy dt_controller = warpy.dt_calc.stability_dt(dt)
 
int write_steps = 1000
 
datetime now = datetime.datetime.now().strftime("%Y_%m_%d")
 
str sim_name = '80x160_3rdorder_rk4_t80_1000writes_vth_0p1_sep_pi_over_2'
 
warpy config_args = warpy.load_configs()
 
warpy case_loc = config_args['test_rundir'](f'kinetics/two_stream_instability/{now}', '')
 
list max_vx = min_v[0] + dv[0] * v_space_num_elements[0]
 
sim_param
 
warpy sim
 
 gen_xdmf
 Run Simulation ... 1.
 
 detect_nonscalar
 

Variable Documentation

◆ applications_moments

list two_stream_instability.applications_moments = []

◆ apps_kinetic

list two_stream_instability.apps_kinetic
Initial value:
1= [warpy.apps.vlasovmaxwell.vlasovmaxwell(name = 'advection_squares',
2 pdf_variable = distribution,
3 field_variable = field,
4 skin_depth_norm = skin_depth_norm,
5 charge_to_mass = charge_to_mass)]
Vlasov-Maxwell.
Definition: vlasovmaxwell.py:4

Initial conditions-------------------------------—.

Applications (consists of equation sets and boundary conditions)

◆ apps_physical

list two_stream_instability.apps_physical
Initial value:
1= [warpy.apps.maxwell.flux(name='maxwell',
2 field=field,
3 skin_depth_norm=skin_depth_norm,
4 omega_p_norm=omega_p_norm)]
Maxwell flux.
Definition: maxwell.py:4

◆ case_loc

warpy two_stream_instability.case_loc = config_args['test_rundir'](f'kinetics/two_stream_instability/{now}', '')

◆ cfl

float two_stream_instability.cfl = 0.235

◆ charge

int two_stream_instability.charge = 1

◆ charge_to_mass

int two_stream_instability.charge_to_mass = charge/mass

◆ config_args

warpy two_stream_instability.config_args = warpy.load_configs()

◆ density

float two_stream_instability.density = 1.0

◆ detect_nonscalar

two_stream_instability.detect_nonscalar

◆ distribution

warpy two_stream_instability.distribution
Initial value:
1= warpy.variable(name = 'distribution',
2 components = ['f'],
3 basis_array_set = sorder,
4 phase_space_basis_array_set = sorder,
5 v_space_num_elements = v_space_num_elements)
Definition: variable.py:4

◆ distribution_ic

warpy two_stream_instability.distribution_ic
Initial value:
2 distribution=distribution,
3 thermal_velocity = thermal_velocity,
4 density = density,
5 perturbation = perturbation,
6 wave_number = k,
7 velocity_separation = velocity_separation
8)
Velocity distribution initialization routine for the 1d1v Two stream Instability.
Definition: kinetics.py:97

Initial conditions-------------------------------— Step 1: define the function as an application:

◆ distribution_ic_va

warpy two_stream_instability.distribution_ic_va
Initial value:
2 priority=0,
3 spatial_order=sorder,
4 phase_space_spatial_order=sorder,
5 v_space_num_elements=v_space_num_elements,
6 min_v=min_v,
7 dv=dv,
8 on_subdomains=['all'],
9 applications=[distribution_ic])
phase_space function evaluator
Definition: function_evaluation.py:42

◆ dt

int two_stream_instability.dt = 1e-1

Simulation (dg) dt = 1e-5.

◆ dt_controller

warpy two_stream_instability.dt_controller = warpy.dt_calc.stability_dt(dt)

◆ dv

list two_stream_instability.dv = [0.125]

◆ field

warpy two_stream_instability.field
Initial value:
1= warpy.variable(name = 'field',
2 components = ['Ex','Ey','Ez','Bx','By','Bz'],
3 basis_array_set = sorder)

◆ fluid

warpy two_stream_instability.fluid
Initial value:
1= warpy.variable(name = 'fluid',
2 components = ['n','nvx','nvy','nvz'],
3 basis_array_set = sorder,
4 explodable=False)

◆ gen_xdmf

two_stream_instability.gen_xdmf

Run Simulation ... 1.

◆ ic_ha

warpy two_stream_instability.ic_ha
Initial value:
2 variable_adjusters=[distribution_ic_va, maxwell_ic_va])
Runs a list of host actions.
Definition: va_runner.py:5

◆ k

float two_stream_instability.k = 0.5

◆ L

int two_stream_instability.L = 2 * np.pi

◆ mass

int two_stream_instability.mass = 1

◆ max_vx

list two_stream_instability.max_vx = min_v[0] + dv[0] * v_space_num_elements[0]

◆ maxwell_ic

warpy two_stream_instability.maxwell_ic
Initial value:
2 fields=field,
3 omega_p_tau=omega_p_norm,
4 skin_depth_norm=skin_depth_norm,
5 density=density,
6 charge=charge,
7 perturbation = perturbation,
8 wave_number = k
9 )
Velocity distribution initialization routine.
Definition: maxwell.py:274

◆ maxwell_ic_va

warpy two_stream_instability.maxwell_ic_va
Initial value:
2 priority=0,
3 spatial_order=sorder,
4 on_subdomains=['all'],
5 applications=[maxwell_ic])
function evaluator
Definition: function_evaluation.py:4

◆ mesh

warpy two_stream_instability.mesh
Initial value:
1= warpy.mesh.block(Bounds = [0, 2*np.pi/k],
2 NumCells = [num_physical_elements],
3 NodeSets = ['Left', 'Right'],
4 NumLayers = 1,
5 PeriodicBoundaries = ['Left','Right'] if periodic_boundary_conditions else None,
6 basis_array_set = sorder)
block mesh generator
Definition: mesh.py:87

◆ min_v

list two_stream_instability.min_v = [-10.0]

◆ now

datetime two_stream_instability.now = datetime.datetime.now().strftime("%Y_%m_%d")

◆ num_physical_elements

int two_stream_instability.num_physical_elements = 80

◆ omega_p_norm

float two_stream_instability.omega_p_norm = 1.0

◆ periodic_boundary_conditions

bool two_stream_instability.periodic_boundary_conditions = True

◆ perturbation

float two_stream_instability.perturbation = 0.01

◆ sim

warpy two_stream_instability.sim
Initial value:
1= warpy.dg_sim(name = sim_name,
2 meshes = [mesh],
3 initial_conditions = [ic_ha],
4 temporal_solvers = [temporal_solver],
5 writers = [writer],
6 time = [0,t_final],
7 dt_controller = dt_controller,
8 flexible_writeout = False,
9 write_steps = write_steps,
10 verbosity = 'info',
11 # num_partitions=4
12)
Discontinuous finite element RK simulation.
Definition: dg_sim.py:11

◆ sim_name

str two_stream_instability.sim_name = '80x160_3rdorder_rk4_t80_1000writes_vth_0p1_sep_pi_over_2'

◆ sim_param

two_stream_instability.sim_param
Initial value:
1= \
2f'''case_loc={case_loc}
3specific_case={sim_name}
4start_frame=0
5end_frame={write_steps}
6domain=domain
7variable={distribution.name()}
8v_space_num_vx={v_space_num_elements[0]}
9basis_name={sorder}
10min_vx={min_v[0]}
11max_vx={max_vx}
12'''

◆ skin_depth_norm

float two_stream_instability.skin_depth_norm = 1.0

◆ sorder

str two_stream_instability.sorder = 'thirdOrder'

◆ spatial_solver_kinetic

warpy two_stream_instability.spatial_solver_kinetic
Initial value:
1= warpy.spatial_solvers.dg_kinetic(name="dg_kinetic",
2 spatial_order = sorder,
3 phase_space_spatial_order = sorder,
4 v_space_num_elements = v_space_num_elements,
5 min_v = min_v,
6 dv = dv,
7 applications = apps_kinetic,
8 on_subdomains = ['all'],
9 cfl = cfl)

Spatial solver.

◆ spatial_solver_physical

warpy two_stream_instability.spatial_solver_physical
Initial value:
1= warpy.spatial_solvers.dg(name="dg_physical",
2 spatial_order=sorder,
3 applications=apps_physical,
4 cfl = cfl)

◆ t_final

int two_stream_instability.t_final = 80

◆ temporal_solver

warpy two_stream_instability.temporal_solver
Initial value:
1= warpy.host_actions.erk(name = 'rk',
2 scheme = torder,
3 spatial_solvers = [spatial_solver_physical,spatial_solver_kinetic],
4 variable_adjusters = variable_adjusters)
Explicit Runge-Kutta temporal solver Note: Dormand45 currently will not work correctly with limiters ...
Definition: erk.py:5

Temporal solver.

◆ thermal_velocity

float two_stream_instability.thermal_velocity = 0.1

◆ torder

str two_stream_instability.torder = 'RK4'

◆ v_space_num_elements

list two_stream_instability.v_space_num_elements = [160]

◆ variable_adjusters

list two_stream_instability.variable_adjusters = []

Variable adjusters.

◆ velocity_separation

np two_stream_instability.velocity_separation = np.pi/2.0

◆ write_steps

int two_stream_instability.write_steps = 1000

◆ writer

warpy two_stream_instability.writer
Initial value:
1= warpy.host_actions.writer(name = 'writer',
2 ReadVars = [distribution, field, fluid])
Writes out a list of variables.
Definition: writer.py:4

Variable writer.