Coder Social home page Coder Social logo

cchandre / vlasov1d Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 30.12 MB

One-dimensional Vlasov-Poisson equation and its Hamiltonian fluid reductions

License: BSD 2-Clause "Simplified" License

Mathematica 97.73% Python 1.96% MATLAB 0.31%
plasma-physics matlab matlab-code livescript vlasov-equation fluid-simulation fluid-solver numpy scipy mathematica hamiltonian hamiltonian-dynamics python3

vlasov1d's Introduction

One-dimensional Vlasov-Poisson equation and its Hamiltonian fluid reductions

  • Vlasov1D_4field.mlx: MATLAB live script to compute and represent the series expansion of the explicit closure S4=S4(S2,S3) and S5=S5(S2,S3); also compute the series expansions of the three Casimir invariants C1, C2 and C3

  • ParametricClosure4.nb: Mathematica notebook to check and represent the parametric closure S2=S223), S3=S323), S4=S423) and S5=S523)

  • VP1D4f python code

    • VP1D4f_dict.py: to be edited to change the parameters of the VP1D4f computation (see below for a dictionary of parameters)

    • VP1D4f.py: contains the VP1D4f class and main functions (not to be edited)

    • VP1D4f_modules.py: contains the methods to run VP1D4f (not to be edited)

    • VP1D4f_AnalyzeData.m: MATLAB script to analyze the output saved in the .mat file

    • Once VP1D4f_dict.py has been edited with the relevant parameters, run the file as

    python3 VP1D4f.py

    or

    nohup python3 -u VP1D4f.py &>VP1D4f.out < /dev/null &

    The list of Python packages and their version are specified in modules_version.txt


Parameter dictionary for VP1D4f

  • kappa: double; value of κ defining the fluid reduction

  • Tf: double; duration of the integration (in units of ωp-1)

  • integrator_kinetic: string ('position-Verlet', 'velocity-Verlet', 'Forest-Ruth', 'PEFRL', 'BM4', 'BM6'); choice of solver for the integration of the Vlasov equation

  • nsteps: integer; number of steps in one period of plasma oscillations (1/ωp) for the integration of the Vlasov equation

  • integrator_fluid: string ('RK45', ‘RK23’, ‘DOP853’, ‘BDF’, ‘LSODA’); choice of solver for the integration of the fluid equation (see ivp_solve for more details)

  • precision: double; numerical precision of the integrator for the fluid equations; threshold for the Fourier transforms

  • n_casimirs: integer; number of Casimir invariants to be monitored

  • Lx: double; the x-axis is (-Lx, Lx)

  • Lv: double; the v-axis is (-Lv, Lv)

  • Nx: integer; number of points in x to represent the field variables

  • Nv: integer; number of points in v to represent the field variables

  • f_init: lambda function; initial distribution f(x,v,t=0)

  • output_var: string in ['E', 'rho', 'u', 'P', 'q']; variable to be saved in a .mat file

  • output_modes: integer or string in ['all', 'real']; number of Fourier modes of the variable to be saved in the .mat file; if 'all', all Fourier modes are saved; if 'real', the variable is saved in real space; use the MATLAB script VP1D4f_AnalyzeData.m to plot the output

  • Kinetic: list of strings in ['Compute', 'Plot', 'Save']; list of instructions for the Vlasov-Poisson simulation; if contains 'Save', the results are saved in a .mat file

  • Fluid: list of strings in ['Compute', 'Plot', 'Save']; list of instructions for the fluid simulation; if contains 'Save', the results are saved in a .mat file

  • darkmode: boolean; if True, plots are done in dark mode


Reference: C. Chandre, B.A. Shadwick, Four-field Hamiltonian fluid closures of the one-dimensional Vlasov-Poisson equation, Physics of Plasmas 29, 102101 (2022); arXiv:2206.06850

@article{chandre2022,
         title = {Four-field Hamiltonian fluid closures of the one-dimensional Vlasov-Poisson equation},
         author = {Chandre, C. and Shadwick, B.A.},
         journal = {Physics of Plasmas},
         volume = {29},
         number = {10},
         pages = {102101},
         year = {2022},
         doi = {10.1063/5.0102418},
         URL = {https://doi.org/10.1063/5.0102418}
}

For more information: [email protected]

Example

vlasov1d's People

Contributors

cchandre avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.