Skip to main content

Package for generating initial conditions for AREPO

Project description

PyPI package version number

arepoICgen

Package for creating Initial Conditions for the AMR code AREPO[^1] for simulations of molecular clouds intended for scientific research. Many parts of this code are adapted from a FORTRAN code developed by Paul Clark called setpartarepo.

This code is available via a direct clone of this repository, or through pip: pip install arepoICgen

Usage Guide

arepoICgen takes in two python dictionaries as inputs, config and params. Config provides the code information about the geometry and metadata of the cloud, while params supplies the physical parameters of the cloud. Some config and param flags are required, and others are optional. Required flags will be marked with a "*".

Config
Flag Options Description Associated Params
verbose True, False Whether to print extended feedback as the code runs (does not affect the ICs)
grid* boxGrid, boxRan, sphereGrid, sphereRan, ellipseRan, cylinderRan The geometry and particle distribution (gridded or random). lengths, radii
turbulence turbFile Whether to apply to turbulent velocity field from a file virialParam
turbFile path_to_file The path to a turbulent velocity grid file, needed only for turbFile
turbSize integer The size of the velocity grid (assumed equal length cubic), needed only for turbFile
rotation rotation Whether to add rotation to the cloud beta
extras bossBodenheimer, densityGradient, bonnorEbert What density perturbation to add to the cloud, either Boss Bodenheimer[^2], a linear density gradient[^3] or a Bonnor-Ebert[^4] density profile
padding* True, False Whether to pad the cloud with low density particles tempFactor, boxDims, paddingDensity
bField True, False Whether we need to give the particles an inital magnetic field value (note this does not do anything besides gives particles an initial B field of 0)
outValue masses, density Option to output the mass field as density (note this needs AREPO to be compiled with the right config flag for this) density
output* hdf5 Filetype to write the ICs as (type 2 binary coming... one day)
filename* "..." Name of the IC file (note that the file extension is not needed)
Params

Note that lengths and radii are both marked as required, but only one may be needed in some cases.

Flag Format/Units Description Associated Config
ngas* Number of particles to populate the cloud with
lengths* [xLength, yLength, zLength] $\rm [pc]$ The length of the box or ellipse in each direction (for the cylinder, xLength is taken as the length of the cylinder) grid
radii* Radius $\rm [pc]$ The radius of a spherical cloud, or the radius of the face of a cylinder (not needed by box or elliptical setups) grid
mass* $\rm [M_\odot]$ The total mass of the cloud
temp* $\rm [K]$ The inital temperature of the gas inside the cloud
mu* $\mu$ The mean molecular weight of the gas in the cloud, typically 1.4 for atomic and 2.4 for molecular
virialParam $\alpha = \rm\frac{E_{Kin}}{E_{Grav}}$ The virial parameter of the cloud, used for scaling turbulent velocities turbulence
beta $\beta = \rm \frac{E_{Rot}}{E_{Grav}}$ The ratio between rotational and gravitational energy rotation
boxSize [x, y, z] The factor by which the box should be larger than the cloud in each dimension (i.e 2x, 3x, 4x the size) padding
tempFactor How much hotter to make the padding particles compared to the cloud particles padding
paddingDensity What fraction of the cloud's density should the padding region be padding
density $\rm cm^{-3}$ Density to give particles when outputting mass as density outValue

Calling generateICs

arepoICgen is called using code similar to the following, where it is wrapped in the generateICs function:

from arepoICgen import generateICs

config = {}
params = {}

generateICs(config, params)
Examples

See examples.txt for some example setups of the config and params dictionaries.

[^1]: AREPO is publicly available, see here [^2]: See Boss & Bodenheimer (1979) [^3]: See Bonnell et al. (2008) [^4]: See Bonnor (1956) and Ebert (1955)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

arepoICgen-0.1.3.tar.gz (15.7 kB view details)

Uploaded Source

Built Distribution

arepoICgen-0.1.3-py3-none-any.whl (16.8 kB view details)

Uploaded Python 3

File details

Details for the file arepoICgen-0.1.3.tar.gz.

File metadata

  • Download URL: arepoICgen-0.1.3.tar.gz
  • Upload date:
  • Size: 15.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for arepoICgen-0.1.3.tar.gz
Algorithm Hash digest
SHA256 da8b30160296ac8bbfd3ed7fcb15db1542fcf52e6ef15849ec15ddb6717107d8
MD5 e4ee760f94ceee994db204ddbb745f54
BLAKE2b-256 aca106455a6f3dbb66454b93b295b629ca7a55df9175fb6c236de115fb2b61cb

See more details on using hashes here.

File details

Details for the file arepoICgen-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: arepoICgen-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 16.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for arepoICgen-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c74d809b2f3831beca35ece2bb1f371d7d94732f53d07d9cf3a38e85688bc6a2
MD5 4bc604d5ae2ba2ae8fba745305fdf268
BLAKE2b-256 67f24d7450909d6a4448d0fde4fd37bfc0dd83ea7dcb5c9b295957bfbef31835

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page