MOCASSIN 2.02 manual

Running multiple spatial grids

WARNING: This section is out of date -- new help is in the process of being written as we speak -- almost ;-) . Please email me if you want to use multiple grids and need some help

From Version 2.00 onwards you can choose to run simulations including multiple spatial sampling. A typical example of when this would be need is for the modelling of knots embedded in a gaseous nebula. The density enhancement in the knot requires a finer spatial grid than one that may be sufficient to model the main nebula. In such cases the subgrid describing the knot can be modelled simultaneously and self consistently by MOCASSIN's multigrid routines. The radiation field will be safely transferred from mother to sub grids with (hopefully) no error being introduced by the process. The overheads involved only reflect the eventual introduction of extra grid cells.

A typical example of how such a model would be set up is briefly described below. All files mentioned should be included in the examples/multigrid subdirectory.

The example below shows the input.in file for a plane parallel model consisting of a cubic blob embedded into a cubic grid:

autoPackets 0.20 2. 1000000000
output
contShape  blackbody
nebComposition 'examples/abunHII40.in'
maxIterateMC  30 95.
nPhotons 10000000
nx 10
ny 10
nz 10
planeIonization 3.0
Rin 0.
Rout 2.1e19
TStellar 45000.
writeGrid 5.
convLimit 0.03
densityFile 'examples/cubenew.dat'
multiGrids 2 'examples/subGrids.in'

The density distribution of the mother grid (containing the main nebula) is provided provided by an external file using the densityFile keyword as described in Section 3.1; e.g.

densityFile 'examples/cube.dat'

MOCASSIN knows that it will have to deal with more than one grid (in this case 2) thanks to the line

multiGrids 2 'examples/subGrids.in'

the integer after the multiGrids keyword is the total number of grids including the mother grid; the file 'example/subGrids.in' contains all the information regarding the position of the subgrids and their specification. This file is created automatically by using the makeSubGrids.f90 program included in the 'accessories/' directory.

The makeSubGrids.f90 program reads the makeSubGrids.in input file, that has the following form

1
cube.dat 10 10 10 1
cubenew.dat
1 9 9 9 knot_den.in
7.e18 14.e18 7.e18 14.e18 7.e18 14.e18
100. -1

The maximum number of subgrids that may be included in a simulation is controlled by the parameter maxGrids in the source/constants_mod.f90 module; in the example above only one subgrid is included, additional subgrids could be included by simply repeating lines 4,5 and 6 for each subgrid.

The knot_den.in file above has the following format

0.0000000E+00  0.0000000E+00  0.0000000E+00   100.0000
0.0000000E+00  0.0000000E+00  0.1250000       100.0000
0.0000000E+00  0.0000000E+00  0.2500000       100.0000
0.0000000E+00  0.0000000E+00  0.3750000       100.0000
0.0000000E+00  0.0000000E+00  0.5000000       100.0000
0.0000000E+00  0.0000000E+00  0.6250000       100.0000
0.0000000E+00  0.0000000E+00  0.7500000       100.0000
0.0000000E+00  0.0000000E+00  0.8750000       100.0000
0.0000000E+00  0.0000000E+00   1.000000       100.0000
0.0000000E+00  0.1250000      0.0000000E+00   100.0000
0.0000000E+00  0.1250000      0.1250000       100.0000
etc ........

Columns 1, 2 and 3 contain the x, y, and z positions in the subgrid, normalised to 1. The fourth column contains the h number density. (when running a multiChemistry model a fifth column would appear; containing the abundance file index).

It is worth noticing that since the x y and z positions in the knot_den.in files are given normalised to unity, we can include knots with the same geometry and density at several grid locations without the need to create a density file for each knot. this can be done by specifying the same filename for the knots in the makeSubgrids.in file.

The makeSubgrids.f90 file will also process the cube.dat file (which is the original mother grid density file provided by the user) turning off all the cells that are to be replaced by subgrids. The new file will be called cubenew.dat in the above example and this is the file that must be specified in the input.in file of MOCASSIN.

The makeSubgrids.f90 file can only create subgrids of homogeneous density and chemical indeces. It should be very easy for the user to customise the grids obtained to included their 'favourite' density/chemistry distribution.

The output from multigrid models will be summarised in the usual files and an overall, as well as grid by grid result will be provided.

Christophe Morisset of UNAM is currently in the process of creating an IDL visualisation tool that is able to deal with multiGrids and reconstruction for a quick and efficient analysis of the results. It is intended to distribute the new tool as soon as it becomes available.

« 6.1 Analytical and Monte Carlo line fluxescontents 6.3 Running models that include dust and gas »