Potential flow simulator

Martian

Senior Member
Messages
1,137
Here's a simple program I wrote to help visualize electric & magnetic fields using potential flow (sources, sinks, & vortices). It's not meant to replace a finite element method program, and it doesn't output any meaningful numbers. But it can give a convenient way to design unique coils or electrostatic devices and see how the fields will be before you build it. It only gives a 2 dimensional image.

It's written in FreeBasic, which is, as the name implies, free to download (FreeBASIC Compiler). I personally recommend using the FreeBasic IDE for development, as it makes things easier. The source code for the potential flow program is attached to this thread. Consider it public domain, and use it if it will help you. :)

The electrostatic field between capacitor plates, using sources & sinks:
flow1.png

The magnetic field inside a toroidal coil, using vortices (note that this is a 2D cross section):
flow2.png

The magnetic field of a solenoid, using vortices:
flow3.png

The program is controlled via keyboard input. The numbers 1-6 add different flow types at the current mouse position. Space clears the screen, and ESC exits. The plus & minus keys change the grid size.

Again, it's only for a quick & dirty visualization tool.
 

Attachments

  • flow.zip
    2.5 KB · Views: 4

Top