inttau2 Module

inttau2 is the heart of the MCRT simulation. It moves the photons though the simulated media. tauint2 is the only public function here and is the main function that moves the photon. Changes should only be made here if bugs are discovered or new methods of tracking photons (i.e phase tracking) or moving photons (i.e new geometry method) is needed.


Uses


Functions

private function find(val, a)

searches for bracketing indices for a value value in an array a

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: val

value to find in array

real(kind=wp), intent(in) :: a(:)

array to find val in

Return Value integer

private function wall_dist(grid, celli, cellj, cellk, pos, dir, ldir) result(res)

funtion that returns distant to nearest wall and which wall that is (x, y, or z)

Arguments

Type IntentOptional Attributes Name
type(cart_grid), intent(in) :: grid
integer, intent(inout) :: celli
integer, intent(inout) :: cellj
integer, intent(inout) :: cellk
type(vector), intent(in) :: pos
type(vector), intent(in) :: dir
logical, intent(inout) :: ldir(:)

Return Value real(kind=wp)


Subroutines

public subroutine tauint2(grid, packet, sdfs_array)

optical depth integration subroutine Moves photons to interaction location Calculated is any reflection or refraction happens whilst moving

Arguments

Type IntentOptional Attributes Name
type(cart_grid), intent(in) :: grid
type(photon), intent(inout) :: packet
type(sdf), intent(in) :: sdfs_array(:)

private subroutine update_grids(grid, pos, dir, d_sdf, packet, mua)

record fluence using path length estimators. Uses voxel grid

Arguments

Type IntentOptional Attributes Name
type(cart_grid), intent(in) :: grid

grid stores voxel grid information (voxel walls and etc)

type(vector), intent(inout) :: pos

pos is current position with origin in centre of medium (0,0,0)

type(vector), intent(in) :: dir

dir is the current direction (0,0,1) is up

real(kind=wp), intent(in) :: d_sdf

d_sdf is the distance to travel in voxel grid

type(photon), intent(inout) :: packet

packet stores the photon related variables

real(kind=wp), intent(in), optional :: mua

absoprtion coefficent

private subroutine update_pos(grid, pos, celli, cellj, cellk, dcell, wall_flag, dir, ldir, delta)

routine that updates positions of photon and calls Fresnel routines if photon leaves current voxel

Arguments

Type IntentOptional Attributes Name
type(cart_grid), intent(in) :: grid
type(vector), intent(inout) :: pos
integer, intent(inout) :: celli
integer, intent(inout) :: cellj
integer, intent(inout) :: cellk
real(kind=wp), intent(in) :: dcell
logical, intent(in) :: wall_flag
type(vector), intent(in) :: dir
logical, intent(in) :: ldir(:)
real(kind=wp), intent(in) :: delta

public subroutine update_voxels(grid, pos, celli, cellj, cellk)

updates the current voxel based upon position

Arguments

Type IntentOptional Attributes Name
type(cart_grid), intent(in) :: grid

grid

type(vector), intent(in) :: pos

current photon packet position

integer, intent(inout) :: celli

position of photon packet in grid

integer, intent(inout) :: cellj

position of photon packet in grid

integer, intent(inout) :: cellk

position of photon packet in grid