|
MPI-AMRVAC 3.2
The MPI - Adaptive Mesh Refinement - Versatile Advection Code (development version)
|
Go to the source code of this file.
Modules | |
| module | mod_rt_sc_kernel |
| Transport kernel of the short-characteristics (SC) radiative transfer. | |
Functions/Subroutines | |
| pure integer function | mod_rt_sc_kernel::ray_sign (a) |
| Sign of a direction cosine as -1, 0 or 1. The zero case occurs, for example for the GL rays at phi = pi/2. | |
| subroutine | mod_rt_sc_kernel::rt_sc_init () |
| Build the quadrature into mux, muy, muz and wmu as full 3D cosines, according to rt_sc_quad. | |
| subroutine | mod_rt_sc_kernel::rt_sc_dedup_rays () |
| Merge rays that share (mux, muy) and add up their weights. Since the 2D sweep and the moments see only those two cosines, Carlson's +-muz pairs and GL's phi, 2pi-phi pairs sweep the same. The total weight is preserved, so J, Fx and Fy are unchanged to round-off. | |
| subroutine | mod_rt_sc_kernel::build_gl () |
| Product Gauss-Legendre set, with nmu polar nodes about rt_sc_polar_axis and ndir azimuths at the midpoints of equal intervals. | |
| subroutine | mod_rt_sc_kernel::build_carlson () |
| Carlson A4 level-symmetric set, built from the three cyclic permutations of (mu1, mu2, mu2) with mu1^2 + 2 mu2^2 = 1 in each of the 8 octants, which gives 24 directions of weight 1/24 as in MURaM's carlson3. | |
| subroutine | mod_rt_sc_kernel::gauss_legendre_nodes (n, x, w) |
| Gauss-Legendre nodes and weights on [-1,1] for n in {2,4,6,8}. Any other n is moved up to the next supported order. | |
| pure double precision function | mod_rt_sc_kernel::blend_heating (chi, jm, bpl, divf, tau) |
| Heating of one cell. The thin imbalance c chi (J - B) is blended with the thick, conservative -div F through w = exp(-rt_sc_blend_k tau), and the taper tau^2/(tau^2 + tau_min^2) removes the heating where the column above is optically thin. | |
| subroutine | mod_rt_sc_kernel::rt_sc_heat_blend () |
| Heating q_g, blending the thin imbalance c chi (J - B) with the thick, conservative -div F through w = exp(-rt_sc_blend_k tau), tau measured from the top. Taking -div F at depth avoids the stiff, cancelling J - B there. Needs jm_g, b_g, fx_g, fy_g and chi_g. | |
| subroutine | mod_rt_sc_kernel::rt_grid_alloc () |
| Allocate the replicated grid at nxg by nyg, and keep it when its size is unchanged. | |
| subroutine | mod_rt_sc_kernel::sc_pad_grid () |
| Pad the replicated grid with one ghost layer for sc_sweep_block, once per band after chi_g and b_g are filled. Beyond the band ends chi and B take the edge rows and the intensity is the band-end inflow, B for a thermal end and zero for an open one. A closed horizontal edge is padded the same way, while a periodic one needs no ghosts of course. | |
| subroutine | mod_rt_sc_kernel::sc_sweep_2d (nx, ny) |
| One sweep of the whole replicated grid for direction (nx, ny) into ii_g. The padded grid of sc_pad_grid is swept as a single block, which wraps in x when the domain is periodic. The wrap is not exact: a ray swept column by column reaches the seam before its upwind column holds this ray, so the seam takes a vacuum inflow for it. This is accepted, since the gather is only a comparison path; the KBA solvers wrap with the intensity of the previous solve. | |
| subroutine | mod_rt_sc_kernel::ka_coeffs (dtau, ex, psi0, psiu) |
| Textbook Olson-Kunasz weights for linear short characteristics over an optical-depth step dtau. | |
| subroutine | mod_rt_sc_kernel::sc_sweep_block (nx, ny, dxb, dyb, xwrap, ixil, ixol, chi, bpl, ii) |
| Sweep of one block for ray (nx, ny), the kernel of the wavefront solvers. The upwind face and corner values sit in the ghost ring that getbc fills. With xwrap the block spans the whole periodic x-domain and wraps iu in place. Otherwise the x-upwind values come from the ghosts, and the block at the periodic seam reads the wrap ghost left by the previous solve. | |
| integer function | upwind_x (i) |
| x-upwind index of column i, wrapped in place when the block spans the periodic domain | |
Variables | |
| character(len=16), public | mod_rt_sc_kernel::rt_sc_quad = 'GL' |
| The angular quadrature, either 'GL' (Gauss-Legendre polar nodes times equally spaced azimuths) or 'Carlson', the level-symmetric A4 set that MURaM uses. | |
| integer, public | mod_rt_sc_kernel::rt_sc_ndir = 6 |
| Azimuthal directions and polar nodes of the GL set, with nmu one of 2, 4, 6 or 8. | |
| integer, public | mod_rt_sc_kernel::rt_sc_nmu = 4 |
| integer, public | mod_rt_sc_kernel::rt_sc_nray = 0 |
| integer, public | mod_rt_sc_kernel::rt_sc_polar_axis = 2 |
| Stratification axis (1 = x, 2 = y), set by the driver before rt_sc_init. The GL set places its polar nodes about this axis, while Carlson is symmetric and does not need it. | |
| double precision, public | mod_rt_sc_kernel::rt_sc_blend_k = 10.0d0 |
| Weight of the heating blend, w = exp(-blend_k tau), and the scale of the taper tau^2/(tau^2 + tau_min^2) that switches the SC heating off where the column above is thin. | |
| double precision, public | mod_rt_sc_kernel::rt_sc_tau_min = 1.0d-6 |
| logical, public | mod_rt_sc_kernel::bc_lo_thermal = .true. |
| Incoming intensity at the lower and upper ends of the current band, thermal (I = B) when set and open (I = 0) otherwise. | |
| logical, public | mod_rt_sc_kernel::bc_hi_thermal = .false. |
| logical, public | mod_rt_sc_kernel::bc_h_periodic = .true. |
| The horizontal edges wrap when the domain is periodic and otherwise act as inflow boundaries, exactly like the band ends. rt_sc_setup copies these from periodB(hdim). | |
| logical, public | mod_rt_sc_kernel::bc_hlo_thermal = .false. |
| logical, public | mod_rt_sc_kernel::bc_hhi_thermal = .false. |
| double precision, dimension(:), allocatable, public | mod_rt_sc_kernel::mux |
| Direction cosines and weights, normalised so that sum(wmu) = 1. In 2D the out-of-plane muz only lengthens the path of each step through ds. | |
| double precision, dimension(:), allocatable, public | mod_rt_sc_kernel::muy |
| double precision, dimension(:), allocatable, public | mod_rt_sc_kernel::muz |
| double precision, dimension(:), allocatable, public | mod_rt_sc_kernel::wmu |
| double precision, dimension(:,:), allocatable, public | mod_rt_sc_kernel::chi_g |
| The replicated single-level grid with chi = kappa rho, B = a T^4, the mean intensity J, the intensity of the ray being swept, the heating, both flux components and tau from the top. | |
| double precision, dimension(:,:), allocatable, public | mod_rt_sc_kernel::b_g |
| double precision, dimension(:,:), allocatable, public | mod_rt_sc_kernel::jm_g |
| double precision, dimension(:,:), allocatable, public | mod_rt_sc_kernel::ii_g |
| double precision, dimension(:,:), allocatable, public | mod_rt_sc_kernel::q_g |
| double precision, dimension(:,:), allocatable, public | mod_rt_sc_kernel::fx_g |
| double precision, dimension(:,:), allocatable, public | mod_rt_sc_kernel::fy_g |
| double precision, dimension(:,:), allocatable, public | mod_rt_sc_kernel::tau_g |
| integer, public | mod_rt_sc_kernel::nxg = -1 |
| integer, public | mod_rt_sc_kernel::nyg = -1 |
| double precision, public | mod_rt_sc_kernel::dxg |
| double precision, public | mod_rt_sc_kernel::dyg |
| double precision, dimension(:,:), allocatable | mod_rt_sc_kernel::chi_p |
| double precision, dimension(:,:), allocatable | mod_rt_sc_kernel::b_p |
| double precision, dimension(:,:), allocatable | mod_rt_sc_kernel::i_p |
| integer function sc_sweep_block::upwind_x | ( | integer, intent(in) | i | ) |
x-upwind index of column i, wrapped in place when the block spans the periodic domain
Definition at line 410 of file mod_rt_sc_kernel.t.
