arepoICgen
Package for creating Initial Conditions for the AMR code AREPO1 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 "*". The default option assumed if not specified is marked in bold. Some parameters have default assumed values if not specified, marked in bold brackets ().
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 (for sphere types) |
| turbulence | static, 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 | 128, integer | The size of the velocity grid (assumed equal length cubic), needed only for turbFile | |
| rotation | none, rotation | Whether to add rotation to the cloud | beta, rotationRadius |
| extras | none, bossBodenheimer, densityGradient, bonnorEbert | What density perturbation to add to the cloud, either Boss Bodenheimer2, a linear density gradient3 or a Bonnor-Ebert4 density profile | |
| padBox | False, True | Whether to pad the cloud with low density particles | tempFactor, boxDims, paddingDensity, paddingPercent |
| bField | False, True | 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 |
| 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 [cm]$ | 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 [cm]$ | 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]$, (20) | The inital temperature of the gas inside the cloud | |
| mu* | $\mu$, (1.4) | 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}}$, (2) | The virial parameter of the cloud, used for scaling turbulent velocities | turbulence |
| beta | $\beta = \rm \frac{E_{Rot}}{E_{Grav}}$, (0.01) | The ratio between rotational and gravitational energy | rotation |
| rotationRadius | AU (0) | The radius outside of which to add rotation. Allows no angular momentum in the centre of the cloud so that numerical rings do not form | rotation |
| boxSize | [x, y, z], ([2,2,2]) | The factor by which the box should be larger than the cloud in each dimension (i.e 2x, 3x, 4x the size) | padBox |
| tempFactor | (2) | How much hotter to make the padding particles compared to the cloud particles | padBox |
| paddingDensity | (0.01) | What fraction of the cloud's density should the padding region be (ignored for Bonnor-Ebert profile, padding density set to match outer BE sphere density) | padBox |
| paddingPercent | (0.02) | Number of cells to pad the box with, as a percent of ngas. | padBox |
| uMass | $1.991\times10^{33} , \rm g$ | Mass code unit | * |
| uDist | $1\times10^{17} , \rm cm$ | Distance code unit | * |
| uVelo | $36447.2682 , \rm cm , s^{-1}$ | Velocity code unit | * |
| uEner | $1.328\times10^{9} , \rm erg$ | Energy code unit | * |
Calling generateICs
arepoICgen is called using code similar to the following, where it is wrapped in the generateICs function:
from arepoICgen import arepoICgen
config = {}
params = {}
arepoICgen(config, params)
Examples
See examples.txt for some example setups of the config and params dictionaries.
Release files for arepoICgen 0.2.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| arepoicgen-0.2.8.tar.gz | 18.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| arepoicgen-0.2.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 38.3 kB
Release files / arepoicgen-0.2.8.tar.gz
| Download URL | arepoicgen-0.2.8.tar.gz |
|---|---|
| Size | 18.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
028f0e0839ee3602fac3c9e5cd78d3014944913b11ca78dd2b88499307804f40
|
|
BLAKE2b-256 checksum How to use checksums |
1131dd9affd9e9d350798f93436f433c1641990dd57352577b9f811cde938224
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.25
|
Release files / arepoicgen-0.2.8-py3-none-any.whl
| Download URL | arepoicgen-0.2.8-py3-none-any.whl |
|---|---|
| Size | 19.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bd2ee1e4cb960e622e85f57e2777b3d6ba4aca0bd56b6b413ee28227ecfdaffe
|
|
BLAKE2b-256 checksum How to use checksums |
f17f42af7de300c25ab6f9186265fa03b521eb289c296b33f879b2fa63e5dce3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.25
|