45 integer,
intent(in) :: ixI^L, ixO^L
46 double precision,
intent(in) :: w(ixI^S,1:nw), x(ixI^S,1:ndim)
47 double precision,
intent(out):: chi(ixI^S), bpl(ixI^S)
64 integer,
intent(in) :: ixi^
l, ixo^
l
65 double precision,
intent(in) :: w(ixi^s,1:nw), x(ixi^s,1:
ndim)
66 double precision,
intent(out):: chi(ixi^s), bpl(ixi^s)
74 integer,
intent(in) :: ixi^
l, ixo^
l
75 double precision,
intent(in) :: w(ixi^s,1:nw), x(ixi^s,1:
ndim)
76 double precision,
intent(out):: chi(ixi^s), bpl(ixi^s)
87 integer,
intent(in) :: ixI^L, ixO^L
88 double precision,
intent(in) :: w(ixI^S,1:nw), x(ixI^S,1:ndim)
89 double precision,
intent(out):: chi(ixI^S), bpl(ixI^S)
90 logical,
intent(in) :: tabulated
91 double precision :: Tloc(ixI^S), pgas(ixI^S), Tc, rc, kcgs, scap
93 call eos%get_Te(w, x, ixi^l, ixo^l, tloc)
94 call eos%get_thermal_pressure(w, x, ixi^l, ixo^l, pgas)
95 {
do ix^db = ixomin^db, ixomax^db\}
106 kcgs = 1.0d-25*dsqrt(max(rc,1.0d-30))*tc**7.7d0 &
107 + 4.0d25*max(rc,1.0d-30)*tc**(-3.5d0) + 0.34d0
113 chi(ix^d) = chi(ix^d)*scap
114 bpl(ix^d) = bpl(ix^d)*scap
123 double precision,
intent(in) :: t_k, p_code
124 double precision :: tsw, psw
136 double precision,
intent(in) :: t_code, rho_code
137 double precision :: lt, lr
140 lr = dlog10(rho_code) - 3.0d0*lt
146 double precision,
intent(in) :: lt, lr
148 double precision :: tt, tr, ka, kb
155 tt = min(max(tt, 0.d0), 1.d0); tr = min(max(tr, 0.d0), 1.d0)
159 logk = ka + tt*(kb - ka)
165 integer,
intent(in) :: n
166 double precision,
intent(in) :: xx(n), xq
168 if (xq <= xx(1)) then; jl = 1; return;
end if
169 if (xq >= xx(n)) then; jl = n-1; return;
end if
171 do while (ju - jl > 1)
173 if (xq >= xx(jm)) then; jl = jm; else; ju = jm;
end if
184 character(len=256) :: dum
189 read(funit,
'(A)') dum
202 if (
mype==0) print *,
'read_opacity_table: Rosseland table ',
nt_op,
' logT x ',
nr_op,
' logR'
The opacity and source the solvers call. rt_sc_setup points it at one of the built-in routines,...
subroutine, public mpistop(message)
Exit MPI-AMRVAC with an error message.
Equation of state for AMRVAC, handled through a single eos_container object.
This module contains definitions of global parameters and variables and some generic functions/subrou...
double precision arad_norm
Normalised radiation constant.
double precision unit_density
Physical scaling factor for density.
double precision unit_opacity
Physical scaling factor for Opacity.
integer, parameter ndim
Number of spatial dimensions for grid variables.
integer mype
The rank of the current MPI task.
double precision, dimension(:), allocatable, parameter d
double precision unit_temperature
Physical scaling factor for temperature.
Opacity and Planck source of the short-characteristics (SC) radiative transfer.
double precision, dimension(:), allocatable op_logt
The Rosseland table, shifted to code units when it is read. It holds log10 kappa on a grid of log10 T...
double precision, public rt_sc_dtcap
double precision function kappa_code_cell(t_code, rho_code)
Rosseland opacity of one cell from the table, with temperature, density and opacity all in code units...
double precision, public rt_sc_dp_tr
procedure(rt_sc_chib_iface), pointer, public rt_sc_chib
double precision function interp_logkappa(lt, lr)
Bilinear interpolation of log10 kappa in (log10 T, log10 R).
integer function op_locate(xx, n, xq)
Index jl of the table interval [xx(jl), xx(jl+1)] that holds xq, found by bisection....
double precision, public rt_sc_tcap
The built-in opacities keep the SC transfer on where the gas is cool (T < Tcap) or dense (p > p_TR),...
pure double precision function, public rt_sc_switch(t_k, p_code)
Transition switch of the built-in opacities, from the temperature in K and the gas pressure in code u...
character(len=std_len), public rt_sc_kappa_table
The Rosseland table file, read in rt_sc_setup when the table model is chosen.
subroutine, public read_opacity_table()
Read the Rosseland table and shift it to code units. The file is in cgs, with T in K and R = rho/T6^3...
subroutine, public rt_sc_chib_rosseland(ixil, ixol, w, x, chi, bpl)
Table Rosseland opacity, chi = kappa_R(rho, T) rho, and source B = a T^4, both multiplied by the tran...
double precision, public rt_sc_p_tr
double precision, dimension(:,:), allocatable op_logk
double precision, public rt_sc_lp_tr
log10 of p_TR in code units, set by rt_sc_setup
subroutine, public rt_sc_chib_kramers(ixil, ixol, w, x, chi, bpl)
Analytic H-minus and Kramers opacity, with the source and the switch as in rt_sc_chiB_rosseland.
character(len=10), public rt_sc_opacity
The opacity model, either 'Rosseland' (the table), 'Kramers' (the analytic fit) or 'usr',...
subroutine chib_builtin(ixil, ixol, w, x, chi, bpl, tabulated)
chi and B of the built-in opacities, the table when tabulated is set and the analytic fit otherwise....
double precision, dimension(:), allocatable op_logr