Skip to content

JuliaAstroSim/AstroIC.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 = AstroSimBase.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

About

Initial conditions of astrophysical simulations

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages