The command “presparx” can show the usage
$ presparx presparx -o < Output File > -e : error estimation -p : profile plot -v : generate vtk file
-o : the filename of the HDF data for SPARX input
-e : estimate the error of mass and the largest velocity dispersion
-p : generate a simple plot of the physical profile
-v : generate the VTK file for visualization purpose
grid.py for an example of a spherical 1D uniform grid
# Grid Type : SPH1D / SPH3D / CYL3D /REC3D / REC1D GridType = 'SPH1D' # spacing type : uniform / stretch spacing = 'uniform' # resolution of the radius nr = 64 # inner radius (pc) Rin = 0.0 # outer radius (pc) Rout = 0.1
model.py for an example of Shu’s 1D collapsing cloud
# Model Type : Function / Constant / TABLE / ZEUS ModelType = 'Function' # Molecule molec = 'hco+' # CMB temperature (Kelvin, outer B.C.) T_cmb = 2.73 # inner Boundary condition T_in = 0.0 # reference radius r_ref = 0.01 # reference H2 number density (m^-3) n_H2_ref = 1e10 # reference velocity (m/s) V_ref = -200.0 # Gas Density (number/m^3) def Density1D(r): n_H2 = n_H2_ref * ( r / r_ref )**-2. return n_H2 class model: def __init__(self,r): # Gas Density (number/m^3) self.n_H2 = Density1D(r) # Velocity (m/s) self.Vr = V_ref * ( r / r_ref )**-0.5 # Temperature (Kelvin) self.T_k = 10. # turbulent speed (m/s) self.Vt = 200. # Molecular Abundance (fraction) self.X_mol = 1e-9 # dust-to-gas ratio self.dust_to_gas = 0.01 # Dust Temperature (Kelvin) self.T_d = self.T_k # dust kappa self.kapp_d = 'table,jena_thin_e5'
Command “presparx” and specify the model file name.
Append “-epv” to check out the error, profile plot, and the VTK file
$ presparx -o model -epv Analytical Mass : 0.103706 Msun Mass Error of the Gridding : 0.640518 % Largest Velocity Dispersion to Turbulent Velocity : 1.512118 Largest Dispersion occurs at spatial index = 0 profile.png generated visual.vtk generated wrote out "model"
The options “-p” and “-v” would generate a figure ‘profile.png’ and a VTK file ‘visual.vtk’. The profile of this model is shown as below
The Preprocessor: PRESPARX