AstroIC.jl

Initial conditions of astrophysical simulations
Author JuliaAstroSim
Popularity
1 Star
Updated Last
4 Months Ago
Started In
December 2019

AstroIC.jl

Initial condition generator for astrophysical simulations

codecov

Installation

]add AstroIC

or

using Pkg; Pkg.add("AstroIC")

or

using Pkg; Pkg.add("https://github.com/JuliaAstroSim/AstroIC.jl")

To test the Package:

]test AstroIC

Documentation

  • Devdocumentation of the in-development version.

For beginners, it is highly recommended to read the documentation of PhysicalParticles.jl.

Usage

Generating a star cluster using Plummer model

using AstroIC
using PhysicalParticles, UnitfulAstro

## First define a config. Keywords are necessary since the config type is immutable
config = PlummerStarCluster(
    collection = STAR,
    NumSamples = 100,
    VirialRadius = 0.010u"kpc",
    TotalMass = 1.0e5u"Msun",
    model = AstroIC.Newton(),
)

## Now generate particles. MaxRadius restricts the sampling region.
particles = generate(config, MaxRadius = 0.1u"kpc")

# Default units is uAstro, to use SI units:
particles = generate(config, uSI)

Generating a gas cloud

using AstroIC
using PhysicalParticles, UnitfulAstro

config = GasCloud(
    collection = GAS,
    Radius = 20u"kpc",
    rho0 = 1250u"Msun/kpc^3",
    T = 300u"K",
    ParticleMass = Constant().m_p,
    Nx = 11,
    Ny = 11,
    Nz = 11,
)

particles = generate(config)

Generating our solar system

using Dates
using AstroIC
particles = solarsystem(now())  # SI units

Package ecosystem