GithubHelp home page GithubHelp logo

ianfr / asteroid2023 Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 30 KB

Rubble-pile asteroid simulation with gravity and collisions.

CMake 1.80% Python 2.62% Fortran 94.43% Shell 1.15%
asteroids physics physics-simulation simulation

asteroid2023's Introduction

Asteroid Simulation

About

3D rubble-pile asteroid simulation. Tested with Intel Fortran on Ubuntu 22.04 64-bit.

Goals

  • Generate asteroids made of point particles according to the user specification
  • Generate data for easy post-processing with Paraview
  • Simulate the motion of the particles under gravity
  • Perform collision detection
  • Implement cohesion
  • Parallelize for CPU

Simulation Details:

Forces:

  • Gravity [Brute force, O(n^2) time complexity]
  • Gravity [Radially constrained brute force with probablistic full brute force (mostly O(n), sometimes O(n^2)) [WIP]]

Integration options:

  • Euler (order 1)
  • Velocity Verlet (order 2, symplectic)
  • Runge-Kutta (order 4)

Collision detection schemes:

  • Filter collision calculation calls based on relative positions (O(n^2) time complexity)

Adaptive time-stepping based on:

  • Maximum particle velocity
  • Mean particle velocity and radius

Building & Running

This project uses the CMake build system. To build and run, execute the following commands:

  • cd asteroid2022
  • mkdir build && cd build
  • cmake ..
  • make
  • ./prog to run the program.

Configuration

The first step for configuring a run is to set high-level parameters in the main file main_prog.f90 (like the timestep size & number of asteroids).

Additionally, the output directory set in control.txt must exist before the program runs. Assuming you're already in the project directory, the command would be mkdir OUT/X where X is the value of the output directory field in control.txt.

Viewing the results

A Python script is included to facilitate viewing results when Paraview cannot load too many files at one time, but Paraview is the preferred method.

Paraview allows for opening "grouped" CSV files in numerical filename order, which is what the program outputs. In Paraview:

  • Open the CSV group 'ast.*' in the relevant output directory
  • Click 'Apply' and then X out of the default Table View
  • Right-click on the group then do Add Filter -> Alphabetical -> Table to Points
  • Set the X, Y, and Z Columns to rx, ry, and rx respectively with the dropdown menus
  • Hit 'Apply'
  • Change 'Representation' to 'Point Gaussian'
  • Change 'Coloring' to 'col_ast'

To view a frame-by-frame animation, just click the play button at the top!

Repository copyright Ian Friedrichs 2023. All rights reserved.

asteroid2023's People

Contributors

ianfr 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.