Numerical Methods

Introduction to Vlasov Solvers

A simple 1D-1V Vlasov code for two-stream instability is developed. The code is based on a splitting scheme proposed by Cheng and Knorr in 1975.

Vorticity – Stream Function Formulation for Axisymmetric Flow

Vorticity - Stream Function formulation for incompressible Navier Stokes equation is developed and demonstrated with Python code for flow in a cylindrical cavity. More complex geometry from a Java code is also shown.

Brief Intro to GPU PIC with CUDA

This post shows how to develop a PIC plasma simulation code that uses NVIDIA CUDA to perform computations on the graphics card (GPU). Even without any optimization, the GPU version runs almost twice as fast as the CPU version for a large number of pa...

Finite Element Particle in Cell (FEM-PIC)

Example Finite Element Particle in Cell code for flow of ions past a charged sphere on an unstructured mesh

Particle In Cell Method in Cylindrical Coordinates

Details of implementing plasma simulations with the Particle In Cell Method in cylindrical coordinates. We develop a simulation of a simplistic ion gun.

Stretched Mesh

Tutorial on implementing mesh stretching in Particle In Cell codes. Equations for node positions and finite difference coefficients are derived.

Flow in a Nozzle

By considering one-dimensional flow, we can derive an expression for the variation of Mach number in a nozzle with a variable area change. Such a relationship is explored here with an interactive demo that allows you to change the shape of a convergi...

Computing Intersections Between a Cubic Bezier Curve and a Line

Interactive SVG+Javascript code for computing intersections between a line and a cubic Bezier curve.

Bird’s DSMC0.FOR in Java

G.A. Bird included several example codes with his book on the DSMC method. These codes are written in Fortran 77 which makes them somewhat hard to understand due to short variable names and reliance on global variables. This post is a summary of my e...

Efficient Particle Data Structures

Particle codes have very different memory optimization requirements than fluid-based solvers. Here we consider three types of data structures for holding particles that offer an efficient way of adding and removing particles and compare their perform...

2D Finite Element Method in MATLAB

This tutorial discusses how to generate unstructured meshes using a Matlab code distmesh.m and how to use the mesh in a Matlab Finite Element Solver to solve the Poisson's equation on an unstructured domain.

Interpolation using an arbitrary quadrilateral

This article describes how to interpolate data between a particle and an arbitrary quadrilateral cell used in non-Cartesian grids. The technique is illustrated with several Matlab / Octave examples. The examples show how pick points located inside th...

Nonlinear Poisson Solver

Nonlinear Poisson's equation arises in typical plasma simulations which use a fluid approximation to model electron density. This article describes how to solve the non-linear Poisson's equation using the Newton's method and demonstrates the algorith...

Code Optimization: Speed up your code by rearranging data access

Often, a significant code speed up can be accomplished by simply rearranging the way data is stored or accessed in memory. This article compares data access with arrays vs. linked lists, and compares loop ordering for 3D data sets. It also looks at a...

Orthogonal Curvilinear Coordinates

Cylindrical and spherical coordinates are just two examples of general orthogonal curvilinear coordinates. In this article we derive the vector operators such as gradient, divergence, Laplacian, and curl for a general orthogonal curvilinear coordinat...

Simple Particle In Cell Code in Matlab

This article includes the source code for a simple particle in cell code. The code simulates flow of plasma over a charged plate and is written in Matlab.

Multiscale Modeling of Hall Thrusters

One of the topics we specialize in at Particle In Cell Consulting is modeling of electric propulsion (EP) thrusters. These devices generate thrust by accelerating ionized propellant (plasma). One of the most efficient EP devices is the Hall thruster....

Get results faster with Java multithreading

Code parallelization is the process of modifying a simulation program so that it can take advantage of multiple computational cores to obtain results faster. One method is to distribute the workload locally in the form of computational threads. Java...

The Finite Volume Method

The Finite Volume Method (FVM) is an algorithm for solving differential equations. It is based on the integral formulation of the problem, with each computational element corresponding to a volume over which the integration is performed. It is somewh...