PLUTO  4.4-patch2
Functions
rad_tools.c File Reference

Some functions used by the radiation module. More...

#include "pluto.h"

Functions

double Blackbody (double temperature)
 
double GetTemperature (double rho, double prs)
 
void RadFPMatrices (Rad_data *rad_data, double *b, double **C)
 
int GaussianSolve (double **C, double *b, double *x, int N)
 

Detailed Description

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

Function Documentation

◆ Blackbody()

double Blackbody ( double  temperature)

Return the blackbody intensity corresponding to the input temperature.

Parameters
[in]temperatureInput 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]Cmatrix of coefficients.
[in]bvector of constant terms.
[in]Ndimension of the system.
[out]xvector 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]rhoInput mass density.
[in]prsInput (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_datapointer to rad_data structure
[out]bcolumn vector
[out]Cmatrix C