Git Product home page Git Product logo

gawain's Introduction

Gawain

This is a simple python MHD simulation code. Currently only 2D simulations are supported.

The numerical method is a MUSCL-Hancock scheme on an Eulerian grid with the minmod flux limiter.

Getting Started

Prerequisites

The aim of this code was simplicity so the dependencies have been kept to a minimum. However, a few key external libraries are required and can be installed using

 pip install -r requirements.txt

Installing

The package is set up using

python ./setup.py install

Examples

A few example simulation scripts and jupyter notebooks can be found in the 'example_scripts' directory. The notebooks provide a detailed how-to on creating and running a simulation.

To run a simulation using a script, follow these steps:

  1. Specify the parameters and the initial and boundary conditions in arun_name.py script. See the 'example_scripts' directory for some examples.
  2. Run with python run_name.py
  3. Output will be dumped into a folder output/<name>. Where <name> is the simulation name specified in the run script.

gawain's People

Contributors

henrywatkins avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

gawain's Issues

sound_speed in numeric.py

I obtained the result pressure can be a negative when I did simulation longer than your blast example.
It causes error calculating sound_speed due to the negative in sqrt.

I corrected code

def sound_speed(self):
"""Return the sound speed for every mesh cell"""
# pressure can be negative
pressure = np.abs(self.pressure())
return np.sqrt(self.adi_idx * pressure / self.dens())

velocity_boundary_indices

Hi I'm studying mhd by your code. and I run the test of blast wave.

I found miss in velocity_boundary_indices.

velocity_boundary_indices = self.velocity_boundary_indices(axis, direction) missing shape

This code is in line 479 of numerics.py

Thanks

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.