Torus: Difference between revisions

From Monnier Group Research Wiki
Jump to navigationJump to search
mNo edit summary
Line 19: Line 19:
==hydro==
==hydro==


<nowiki>hydro T   ! vertical hydrostatic eq. puffs up inner disk
{|
 
|hydro T  
 
|! vertical hydrostatic eq. puffs up inner disk
nhydrothreads 17  ! number of hydro threads.. ehhh? 16+1 control.. see how this goes.
|-
 
|nhydrothreads 17  
 
  |! number of hydro threads.. ehhh? 16+1 control.. see how this goes.
nhydro 4       ! max number of hydro iterations. i think default is 5
|-
 
|nhydro 4  
 
|! max number of hydro iterations. i think default is 5
splitovermpi T</nowiki>
|-
|splitovermpi T
|
|}


==dustphysics==
==dustphysics==
Line 37: Line 40:


==Grid setup==
==Grid setup==
amrgridsize
amrgridsize


Line 52: Line 56:
Here is a sample AMR mesh setup:
Here is a sample AMR mesh setup:


<nowiki>! AMR grid parameters
{|
 
|readgrid F            
readgrid F           ! we aren't reading a grid, we will set one up from scratch
|! we aren't reading a grid, we will set one up from scratch
 
|-
! inputfile grid_out.dat  ! if we did read in a grid, this is how to call it
|! inputfile grid_out.dat   
 
|! if we did read in a grid, this is how to call it
writegrid T            ! write the grid to file (this includes the grid cells, and the EOS in each cell)
|-
 
|writegrid T             
outputfile grid_out.dat    ! name of the output grid
|! write the grid to file (this includes the grid cells, and the EOS in each cell)
 
|-
amrgridsize 2.0e6          ! units of 10^10cm (here, I've made grid a little bigger than disk itself- the outermost cells will be huge and empty)
|outputfile grid_out.dat     
 
|! name of the output grid
amrgridcentrex 1.0e6      ! the linear size of the top-level AMR mesh in units of 10^10 cm. This is useful if you use multiple sources
|-
 
|amrgridsize 2.0e6           
amr2d T                  ! this is a 2d (cylindical) model
|! units of 10^10cm (here, I've made grid a little bigger than disk itself- the outermost cells will be huge and empty)
 
|-
maxdepthamr 22            ! capping the AMR mesh depth helps TORUS to converge faster, saves some CPU. Set this based on how fine a resolution you need in final model.</nowiki>
|amrgridcentrex 1.0e6       
|! the linear size of the top-level AMR mesh in units of 10^10 cm. This is useful if you use multiple sources
|-
|amr2d T                   
|! this is a 2d (cylindical) model
|-
|maxdepthamr 22             
|! capping the AMR mesh depth helps TORUS to converge faster, saves some CPU. Set this based on how fine a resolution you need in final model.
|}


==Special grid options==
==Special grid options==
Line 74: Line 86:
TORUS can smooth the grid, reducing large cell-to-cell variations in cell refinement and optical depth.
TORUS can smooth the grid, reducing large cell-to-cell variations in cell refinement and optical depth.


<nowiki>smoothgridtau T     ! smooths the grid for optical depth, in order to resolve disc photosphere
{|
 
|smoothgridtau T      
dosmoothgrid T              ! smooth the grid for jumps in cell refinement
|! smooths the grid for optical depth, in order to resolve disc photosphere
 
|-
smoothfactor 3.0            ! make sure that neighboring cells are not only one AMR depth apart
|dosmoothgrid T               
 
|! smooth the grid for jumps in cell refinement
lambdasmooth 5500.0
|-
 
|smoothfactor 3.0             
taumax 1.
|! make sure that neighboring cells are not only one AMR depth apart
 
|-
taumin 0.01
|lambdasmooth 5500.0
</nowiki>
|
|-
|taumax 1.
|
|-
|taumin 0.01
|
|}


=TORUS output=
=TORUS output=
Line 95: Line 114:
===SEDs===
===SEDs===


<nowiki>nphotons 100000    ! the number of photon packets in SED
{|
 
|nphotons 100000     
! Output SEDs
|! the number of photon packets in SED
 
|}
spectrum T  ! produce a spectrum
 
! SED parameters
 
ninc 2              ! number of inclinations
 
firstinc 1.0        ! the first inclination (degrees)
 
lastinc 48.0        ! the last inclination (degrees)
 
filename MWC275      ! the root of the output filename
 
sised T              ! Write spectrum as lambda vs F lambda in SI units


sedlammin 0.12      ! minimum wavelength in SED file
<nowiki>! Output SEDs</nowiki>


sedlammax 2000      ! maximum wavelength in SED file
{|
|spectrum T 
|! produce a spectrum
|}


sedwavlin F          ! Linear spacing in SED file?
<nowiki>! SED parameters</nowiki>


sednumlam 1000     ! number of wavelength points in SED
{|
</nowiki>
|ninc 2             
|! number of inclinations
|-
|firstinc 1.0       
|! the first inclination (degrees)
|-
|lastinc 48.0       
|! the last inclination (degrees)
|-
|filename MWC275     
|! the root of the output filename
|-
|sised T             
|! Write spectrum as lambda vs F lambda in SI units
|-
|sedlammin 0.12     
|! minimum wavelength in SED file
|-
|sedlammax 2000     
|! maximum wavelength in SED file
|-
|sedwavlin F         
|! Linear spacing in SED file?
|-
|sednumlam 1000      
|! number of wavelength points in SED
|}


The comments make this fairly self-explanatory, but note: you must set nphotons for an SED or an image. In general, the SEDs need fewer photons than the images to get decent signal to noise (in the SED, divide the total number of photons by the number of wavelength points). I've found 50,000 photons or more for the SEDs works well. Also, if you don't specify sednumlam, the default is 200 wavelength points, and that can produce a jagged, noisy SED.
The comments make this fairly self-explanatory, but note: you must set nphotons for an SED or an image. In general, the SEDs need fewer photons than the images to get decent signal to noise (in the SED, divide the total number of photons by the number of wavelength points). I've found 50,000 photons or more for the SEDs works well. Also, if you don't specify sednumlam, the default is 200 wavelength points, and that can produce a jagged, noisy SED.
Line 126: Line 161:
===Images===
===Images===


<nowiki>nphotons 10000000    ! the number of photon packets in image
{|
 
|nphotons 10000000     
image T    ! produce images
|! the number of photon packets in image
 
|-
nimage 4    ! how many images?
|image T     
 
|! produce images
imageaxisunits AU
|-
 
|nimage 4     
imagesize 20  ! Size of your image across each side in AU. divide this by your npixels to get desired AU/pixel resolution.
|! how many images?
 
|-
imagefile1 kband_20AU.fits  ! name of first image file
|imageaxisunits AU
 
|-
lambdaimage1 21590.     ! monochromatic wavelength in Angstroms
|imagesize 20   
 
|! Size of your image across each side in AU. divide this by your npixels to get desired AU/pixel resolution.
npixels1 256                ! number of pixels. I generally don't adjust this (the more pixels, the more photons you need)
|-
 
|imagefile1 kband_20AU.fits   
inclination1 0              ! inclination of the system; if unknown, try a few different values in multiple images
|! name of first image file
 
|-
imagetype1 dustonly     ! choose freefree, forbidden, recombination, or dustonly
|lambdaimage1 21590.      
|! monochromatic wavelength in Angstroms
|-
|npixels1 256                 
|! number of pixels. I generally don't adjust this (the more pixels, the more photons you need)
|-
|inclination1 0               
|! inclination of the system; if unknown, try a few different values in multiple images
|-
|imagetype1 dustonly      
|! choose freefree, forbidden, recombination, or dustonly
|-
|imagefile2 nband_1_20AU.fits
|
|-
|lambdaimage2 77000
|! 7.7um
|-
|npixels2 256
|
|-
|inclination2 0
|
|-
|imagetype2 dustonly
|
|-
|imagefile3 nband_2_20AU.fits
|
|-
|lambdaimage3 99000
|! 9.9um
|-
|npixels3 256
|
|-
|inclination3 0
|
|-
|imagetype3 dustonly
|
|-
|imagefile4 nband_3_20AU.fits
|
|-
|lambdaimage4 126000
|! 12.6um
|-
|npixels4 256
|
|-
|inclination4 0
|
|-
|imagetype4 dustonly
|
|}


imagefile2 nband_1_20AU.fits
lambdaimage2 77000 ! 7.7
npixels2 256
inclination2 0
imagetype2 dustonly
imagefile3 nband_2_20AU.fits
lambdaimage3 99000 ! 9.9um
npixels3 256
inclination3 0
imagetype3 dustonly
imagefile4 nband_3_20AU.fits
lambdaimage4 126000 ! 12.6um
npixels4 256
inclination4 0
imagetype4 dustonly
</nowiki>
===Line profiles===
===Line profiles===


To calculate line profiles, you must run the TORUS model with the comoving frame option enabled.
To calculate line profiles, you must run the TORUS model with the comoving frame option enabled.


<nowiki>cmf T     ! comoving frame (vs sobolev approx)</nowiki>
{|
|cmf T      
|! comoving frame (vs sobolev approx)</nowiki>
|}


also, specify the atomic physics option and its parameters:
also, specify the atomic physics option and its parameters:


<nowiki>atomicphysics T      ! Include atomic physics
{|
natom 1              ! One model atom
|atomicphysics T       
atom1 H.atm          ! Hydrogen
|! Include atomic physics
xabundance 1.0      ! Pure hydrogen
|-
yabundance 0.        ! no helium
|natom 1               
 
|! One model atom
vturb 20.            ! microturbulence in km/s
|-
|atom1 H.atm           
|! Hydrogen
|-
|xabundance 1.0       
|! Pure hydrogen
|-
|yabundance 0.         
|! no helium
|-
|vturb 20.             
|! microturbulence in km/s
|}


TORUS will output a velocity space data cube per your input parameters:
TORUS will output a velocity space data cube per your input parameters:


! output a datacube
<nowiki>! output a datacube</nowiki>
 
datacube T                    ! produce a fits datacube
inclination 1.          ! viewing angle
positionangle 0.          ! position angle
datacubefile cmf_i1_ha.fits  ! title of fits output
imageside 1500.            ! size of image in 10^10cm
npixels 200              ! number of pixels
nv 200                    ! number of velocity bins
maxVel 800.d0            ! -800 to +800 km/s
distance 140.            ! distance to object in pc
lamline 6563.            ! wavelength in Angstroms</nowiki>


{|
|datacube T                   
|! produce a fits datacube
|-
|inclination 1.         
|! viewing angle
|-
|positionangle 0.         
|! position angle
|-
|datacubefile cmf_i1_ha.fits 
|! title of fits output
|-
|imageside 1500.           
|! size of image in 10^10cm
|-
|npixels 200             
|! number of pixels
|-
|nv 200                   
|! number of velocity bins
|-
|maxVel 800.d0           
|! -800 to +800 km/s
|-
|distance 140.           
|! distance to object in pc
|-
|lamline 6563.           
|! wavelength in Angstroms</nowiki>
|}


=The nitty-gritty: input parameters=
=The nitty-gritty: input parameters=

Revision as of 16:58, 24 April 2012

Preface

TORUS is a three-dimensional radiative transfer code which uses an adaptive mesh refinement scheme and a Monte-Carlo method to solve for the radiative equilibrium, hydrostatic equilibrium, and dust sublimation in circumstellar discs around both low and high-mass pre-main-sequence stars. TORUS is either an acronym for Transport of Radiation Under Sobolev, or Transport of Radiation Using Stokes.

Much of this is covered in detail on the TORUS wiki at Exeter, TorusWeb. To gain access to that resource, you must make an account; if you have SVN access to the TORUS distribution, that username/password should also work for the wiki (I think..). Here, I will discuss TORUS from an example-driven perspective.


Physics modules in TORUS

radeq

perform a radiative equilibrium calculation

stateq

photoionphysics

radiationhydro

hydro

hydro T ! vertical hydrostatic eq. puffs up inner disk
nhydrothreads 17 ! number of hydro threads.. ehhh? 16+1 control.. see how this goes.
nhydro 4 ! max number of hydro iterations. i think default is 5
splitovermpi T

dustphysics

Use dust microphysics; this has to be on if you want a disk there!

AMR grid

Grid setup

amrgridsize

amrgridcentre[x/y]

amr2d

maxdepthamr

The volume of the smallest grid cell (your finest resolution in the grid) is:

Vol = (grid size / 2^(maxdepthamr))^3 So, for a grid 2000 AU across (1000 AU, radially speaking) and a max cell depth of 20, the smallest cell is 0.0019 AU to a side.

Here is a sample AMR mesh setup:

readgrid F ! we aren't reading a grid, we will set one up from scratch
! inputfile grid_out.dat ! if we did read in a grid, this is how to call it
writegrid T ! write the grid to file (this includes the grid cells, and the EOS in each cell)
outputfile grid_out.dat ! name of the output grid
amrgridsize 2.0e6 ! units of 10^10cm (here, I've made grid a little bigger than disk itself- the outermost cells will be huge and empty)
amrgridcentrex 1.0e6 ! the linear size of the top-level AMR mesh in units of 10^10 cm. This is useful if you use multiple sources
amr2d T ! this is a 2d (cylindical) model
maxdepthamr 22 ! capping the AMR mesh depth helps TORUS to converge faster, saves some CPU. Set this based on how fine a resolution you need in final model.

Special grid options

TORUS can smooth the grid, reducing large cell-to-cell variations in cell refinement and optical depth.

smoothgridtau T ! smooths the grid for optical depth, in order to resolve disc photosphere
dosmoothgrid T ! smooth the grid for jumps in cell refinement
smoothfactor 3.0 ! make sure that neighboring cells are not only one AMR depth apart
lambdasmooth 5500.0
taumax 1.
taumin 0.01

TORUS output

Once your TORUS model has reached the criteria for convergence (more on this later), the final grid is written to a temporary output file, and then TORUS will calculate SEDs, images, and/or line profiles by sending however many photons you specify through the converged grid. If you don't calculate the SEDs/images/line profiles while running TORUS, fear not; change the lucy_grid_tmp.dat file to a different name and use it as an input to TORUS, turning off all the other physics modules. In this way, you can 'hot start' TORUS and calculate output data without re-running your model.

Sample output calls

SEDs

nphotons 100000 ! the number of photon packets in SED

! Output SEDs

spectrum T ! produce a spectrum

! SED parameters

ninc 2 ! number of inclinations
firstinc 1.0 ! the first inclination (degrees)
lastinc 48.0 ! the last inclination (degrees)
filename MWC275 ! the root of the output filename
sised T ! Write spectrum as lambda vs F lambda in SI units
sedlammin 0.12 ! minimum wavelength in SED file
sedlammax 2000 ! maximum wavelength in SED file
sedwavlin F ! Linear spacing in SED file?
sednumlam 1000 ! number of wavelength points in SED

The comments make this fairly self-explanatory, but note: you must set nphotons for an SED or an image. In general, the SEDs need fewer photons than the images to get decent signal to noise (in the SED, divide the total number of photons by the number of wavelength points). I've found 50,000 photons or more for the SEDs works well. Also, if you don't specify sednumlam, the default is 200 wavelength points, and that can produce a jagged, noisy SED.

Images

nphotons 10000000 ! the number of photon packets in image
image T ! produce images
nimage 4 ! how many images?
imageaxisunits AU
imagesize 20 ! Size of your image across each side in AU. divide this by your npixels to get desired AU/pixel resolution.
imagefile1 kband_20AU.fits ! name of first image file
lambdaimage1 21590. ! monochromatic wavelength in Angstroms
npixels1 256 ! number of pixels. I generally don't adjust this (the more pixels, the more photons you need)
inclination1 0 ! inclination of the system; if unknown, try a few different values in multiple images
imagetype1 dustonly ! choose freefree, forbidden, recombination, or dustonly
imagefile2 nband_1_20AU.fits
lambdaimage2 77000 ! 7.7um
npixels2 256
inclination2 0
imagetype2 dustonly
imagefile3 nband_2_20AU.fits
lambdaimage3 99000 ! 9.9um
npixels3 256
inclination3 0
imagetype3 dustonly
imagefile4 nband_3_20AU.fits
lambdaimage4 126000 ! 12.6um
npixels4 256
inclination4 0
imagetype4 dustonly

Line profiles

To calculate line profiles, you must run the TORUS model with the comoving frame option enabled.

cmf T ! comoving frame (vs sobolev approx)</nowiki>

also, specify the atomic physics option and its parameters:

atomicphysics T ! Include atomic physics
natom 1 ! One model atom
atom1 H.atm ! Hydrogen
xabundance 1.0 ! Pure hydrogen
yabundance 0. ! no helium
vturb 20. ! microturbulence in km/s

TORUS will output a velocity space data cube per your input parameters:

! output a datacube

datacube T ! produce a fits datacube
inclination 1. ! viewing angle
positionangle 0. ! position angle
datacubefile cmf_i1_ha.fits ! title of fits output
imageside 1500. ! size of image in 10^10cm
npixels 200 ! number of pixels
nv 200 ! number of velocity bins
maxVel 800.d0 ! -800 to +800 km/s
distance 140. ! distance to object in pc
lamline 6563. ! wavelength in Angstroms</nowiki>

The nitty-gritty: input parameters

Source parameters

Awesomely, TORUS can handle multiple input sources; to add additional sources, simply change the numerical value after each parameter, and set nsource to whatever value greater than 1 applies.

! Source parameters nsource 1  ! there is just one source radius1 2.0  ! it has a radius of 1 solar radius teff1 10000.  ! the source effective temperature contflux1 kurucz  ! the continuum flux (other option is blackbody) mass1 2.5  ! the source has a mass of one solar mass sourcepos1 0. 0. 0  ! it is located at the grid cntre distance 150.  ! Distance to observer, pc


Disk geometries

These are the input options for the geometry parameter:


benchmark

A Pascucci benchmark disk

shakara

This is a sample pulled from an MWC 275 parameter file.

geometry shakara  ! flared protostellar disk rinner 0.22  ! inner disc radius (AU) --this is from ajay's paper router 200.  ! outer disc radius (AU) height 10.  ! disc scaleheight at 100 AU (in AU) mdisc 0.01  ! Msun alphadisc 1.0  ! this is from ajay's paper betadisc 1.125  ! disc scaleheight goes as r^beta


ttauri

Options that apply to any disk geometry

smoothinneredge T  ! exponential density decay at inner disk edge gasopacity T

The gasopacity switch is, I believe, the only way that gas is applied in TORUS: the gas is a source of opacity, and it is a radiation source (probably mostly emission), but it isn't coupled to the gas (i.e., doesn't play a role in the hydrostatic equilibrium of the disk).

Dust options

These dust parameters apply when dustphysics T.

iso_scatter T  ! Assume isotropic scattering (assumed by benchmark) ndusttype 1 graintype1 sil_dl  ! Drain and Lee silicates amin1 0.01  ! minimum grain size (microns) amax1 0.25  ! maximum grain size (microns) qdist1 1.5  ! power law index (a^-qdist) dusttogas 0.01  ! torus assumes this value, even if you don't explicitly define it. vardustsub T

Important! If you set variable dust sublimation, vertical hydrostatic equilibrium must be on (hydro T) to allow the inner disk to puff up!!