https://github.com/juliaastrosim/astroic.jl
Initial conditions of astrophysical simulations
https://github.com/juliaastrosim/astroic.jl
Last synced: 3 months ago
JSON representation
Initial conditions of astrophysical simulations
- Host: GitHub
- URL: https://github.com/juliaastrosim/astroic.jl
- Owner: JuliaAstroSim
- License: gpl-3.0
- Created: 2019-12-04T13:44:03.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-12-12T12:15:57.000Z (over 1 year ago)
- Last Synced: 2025-03-25T14:21:25.925Z (about 1 year ago)
- Language: Julia
- Size: 229 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README
# AstroIC.jl
Initial condition generator for astrophysical simulations
[](https://codecov.io/gh/JuliaAstroSim/AstroIC.jl)
[![][docs-dev-img]][docs-dev-url]
## Installation
```julia
]add AstroIC
```
or
```julia
using Pkg; Pkg.add("AstroIC")
```
or
```julia
using Pkg; Pkg.add("https://github.com/JuliaAstroSim/AstroIC.jl")
```
To test the Package:
```julia
]test AstroIC
```
## Documentation
- [**Dev**][docs-dev-url] — *documentation of the in-development version.*
[docs-dev-img]: https://img.shields.io/badge/docs-dev-blue.svg
[docs-dev-url]: https://juliaastrosim.github.io/AstroIC.jl/dev
For beginners, it is highly recommended to read the [documentation of PhysicalParticles.jl](https://juliaastrosim.github.io/PhysicalParticles.jl/dev/).
## Usage
### Generating a star cluster using Plummer model
```julia
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
```julia
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
```julia
using Dates
using AstroIC
particles = solarsystem(now()) # SI units
```
## Package ecosystem
- Basic data structure: [PhysicalParticles.jl](https://github.com/JuliaAstroSim/PhysicalParticles.jl)
- File I/O: [AstroIO.jl](https://github.com/JuliaAstroSim/AstroIO.jl)
- Initial Condition: [AstroIC.jl](https://github.com/JuliaAstroSim/AstroIC.jl)
- Parallelism: [ParallelOperations.jl](https://github.com/JuliaAstroSim/ParallelOperations.jl)
- Trees: [PhysicalTrees.jl](https://github.com/JuliaAstroSim/PhysicalTrees.jl)
- Meshes: [PhysicalMeshes.jl](https://github.com/JuliaAstroSim/PhysicalMeshes.jl)
- Plotting: [AstroPlot.jl](https://github.com/JuliaAstroSim/AstroPlot.jl)
- Simulation: [ISLENT](https://github.com/JuliaAstroSim/ISLENT)