Some functions used by the radiation module.
More...
Contains some functions used to compute radiation-matter interaction terms, and to solve systems of linear equations during the implicit step.
- Authors
- J. D. Melon Fuksman (fuksm.nosp@m.an@m.nosp@m.pia.d.nosp@m.e)
- Date
- Dec 12, 2019
◆ Blackbody()
double Blackbody |
( |
double |
temperature | ) |
|
Return the blackbody intensity corresponding to the input temperature.
- Parameters
-
[in] | temperature | Input temperature. |
- Returns
- Return (4*PI)B(T)=radiationConst*T^4.
◆ GaussianSolve()
int GaussianSolve |
( |
double ** |
C, |
|
|
double * |
b, |
|
|
double * |
x, |
|
|
int |
N |
|
) |
| |
Solve the system of linear equations given by C.x=b, using gaussian elimination with scaled partial pivoting (see e.g. Burden R. L. and Faires J. D., Numerical Analysis).
- Parameters
-
[in] | C | matrix of coefficients. |
[in] | b | vector of constant terms. |
[in] | N | dimension of the system. |
[out] | x | vector of solutions. |
- Returns
- Returns 1 if the system is solved, and 0 if no unique solution exists.
◆ GetTemperature()
double GetTemperature |
( |
double |
rho, |
|
|
double |
prs |
|
) |
| |
Return the (ideal) gas temperature corresponding to given gas pressure and density.
- Parameters
-
[in] | rho | Input mass density. |
[in] | prs | Input (gas) pressure. |
- Returns
- Return T = g_idealGasConst*prs/rho, where g_idealGasConst is the equilibrium ratio prs/(T*rho) for the considered ideal gas.
◆ RadFPMatrices()
void RadFPMatrices |
( |
Rad_data * |
rad_data, |
|
|
double * |
b, |
|
|
double ** |
C |
|
) |
| |
Compute the components of the matrix C and the column vector in eq. (52) of Takahashi et al. 2013, ApJ 772(2):127. Used if RADIATION_IMPL == RADIATION_FIXEDPOINT_RAD.
- Parameters
-
[in] | rad_data | pointer to rad_data structure |
[out] | b | column vector |
[out] | C | matrix C |