Functions

microphysics/prototypes.h File Reference

Go to the source code of this file.

Functions

void conduction (DomainS *pD)
 Explicit thermal conduction.
void conduction_init (MeshS *pM)
 Allocate temporary arrays.
void conduction_destruct (void)
 Free temporary arrays.
Real KoyInut (const Real dens, const Real Press, const Real dt)
 Analytic fit to cooling in the diffuse ISM given by eq.
Real diff_dt (MeshS *pM)
 Computes diffusion timestep.
void get_eta (GridS *pG)
 Get magnetic diffusivities.
void eta_single_const (GridS *pG, int i, int j, int k, Real *eta_O, Real *eta_H, Real *eta_A)
 Single-ion prescription with constant diffusivities.
void eta_single_user (GridS *pG, int i, int j, int k, Real *eta_O, Real *eta_H, Real *eta_A)
 Single-ion prescription with user defined diffusivities.
void eta_general_user (GridS *pG, int i, int j, int k, Real *eta_O, Real *eta_H, Real *eta_A)
 Generalized prescription with user defined conductivities.
void integrate_diff (MeshS *pM)
 Called in main loop, sets timestep and/or orchestrates subcycling, calls appropriate functions for each diffusion operator.
void integrate_diff_init (MeshS *pM)
 Call functions to allocate memory.
void integrate_diff_destruct (void)
 Frees memory associated with diffusion funcs.
void resistivity (DomainS *pD)
 Explicit resistivity.
void resistivity_init (MeshS *pM)
 Allocate temporary arrays.
void resistivity_destruct ()
 Free temporary arrays.
void viscosity (DomainS *pD)
 Adds explicit viscosity terms to the momentum and energy equations.
void viscosity_init (MeshS *pM)
 Allocate temporary arrays.
void viscosity_destruct (void)
 Free temporary arrays.

Function Documentation

void conduction ( DomainS pD  ) 

Explicit thermal conduction.

Definition at line 56 of file conduction.c.

References ConsS::B1c, ConsS::B2c, ConsS::B3c, ConsS::d, GridS::dt, GridS::dx1, GridS::dx2, GridS::dx3, ConsS::E, Gamma_1, DomainS::Grid, HeatFlux_aniso(), HeatFlux_iso(), GridS::ie, GridS::is, GridS::je, jl, GridS::js, ju, kappa_aniso, kappa_iso, GridS::ke, kl, GridS::ks, ku, ConsS::M1, ConsS::M2, ConsS::M3, GridS::Nx, Temp, GridS::U, Real3Vect::x, Real3Vect::y, and Real3Vect::z.

Referenced by integrate_diff().

Here is the call graph for this function:

Here is the caller graph for this function:

void conduction_destruct ( void   ) 

Free temporary arrays.

Definition at line 429 of file conduction.c.

References free_3d_array(), and Temp.

Referenced by conduction_init(), and integrate_diff_destruct().

Here is the call graph for this function:

Here is the caller graph for this function:

void conduction_init ( MeshS pM  ) 

Allocate temporary arrays.

Definition at line 379 of file conduction.c.

References ath_error(), calloc_3d_array(), conduction_destruct(), MeshS::Domain, MeshS::DomainsPerLevel, DomainS::Grid, MeshS::NLevels, MeshS::Nx, GridS::Nx, and Temp.

Referenced by integrate_diff_init().

Here is the call graph for this function:

Here is the caller graph for this function:

Real diff_dt ( MeshS pM  ) 

Computes diffusion timestep.

Definition at line 29 of file diff_dt.c.

References CourNo, MeshS::Domain, MeshS::DomainsPerLevel, MeshS::dx, GridS::eta_AD, GridS::eta_Hall, GridS::eta_Ohm, eta_Ohm, fac, DomainS::Grid, GridS::ie, il, GridS::is, iu, GridS::je, jl, GridS::js, ju, kappa_aniso, kappa_iso, GridS::ke, kl, GridS::ks, ku, MeshS::NLevels, nu_aniso, nu_iso, GridS::Nx, MeshS::Nx, Q_AD, and Q_Hall.

Referenced by integrate_diff().

Here is the caller graph for this function:

void eta_general_user ( GridS pG,
int  i,
int  j,
int  k,
Real eta_O,
Real eta_H,
Real eta_A 
)

Generalized prescription with user defined conductivities.

This corresponds to CASE 3. Note the same get_eta_user() function is used to calculate conductivities rather than diffusivities here.

Definition at line 155 of file get_eta.c.

References convert_diffusion(), and get_eta_user().

Here is the call graph for this function:

void eta_single_const ( GridS pG,
int  i,
int  j,
int  k,
Real eta_O,
Real eta_H,
Real eta_A 
)

Single-ion prescription with constant diffusivities.

NEED global parameters: eta_Ohm, Q_Hall and Q_AD. ONLY eta_Ohm has the dimension of diffusivity. This correspond to CASE 1.

Definition at line 108 of file get_eta.c.

References ConsS::B1c, ConsS::B2c, ConsS::B3c, ConsS::d, d_ind, eta_Ohm, Q_AD, Q_Hall, and GridS::U.

void eta_single_user ( GridS pG,
int  i,
int  j,
int  k,
Real eta_O,
Real eta_H,
Real eta_A 
)

Single-ion prescription with user defined diffusivities.

This corresponds to CASE 2.

Definition at line 136 of file get_eta.c.

References get_eta_user().

Here is the call graph for this function:

void get_eta ( GridS pG  ) 

Get magnetic diffusivities.

Definition at line 63 of file get_eta.c.

References GridS::eta_AD, GridS::eta_Hall, GridS::eta_Ohm, get_myeta, GridS::ie, il, GridS::is, iu, GridS::je, jl, GridS::js, ju, GridS::ke, kl, GridS::ks, ku, and GridS::Nx.

Referenced by integrate_diff().

Here is the caller graph for this function:

void integrate_diff ( MeshS pM  ) 

Called in main loop, sets timestep and/or orchestrates subcycling, calls appropriate functions for each diffusion operator.

Definition at line 27 of file integrate_diffusion.c.

References conduction(), diff_dt(), MeshS::Domain, MeshS::DomainsPerLevel, GridS::dt, MeshS::dt, get_eta(), DomainS::Grid, MeshS::NLevels, resistivity(), and viscosity().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

void integrate_diff_destruct ( void   ) 

Frees memory associated with diffusion funcs.

Definition at line 116 of file integrate_diffusion.c.

References conduction_destruct(), resistivity_destruct(), and viscosity_destruct().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

void integrate_diff_init ( MeshS pM  ) 

Call functions to allocate memory.

Definition at line 87 of file integrate_diffusion.c.

References ath_error(), conduction_init(), eta_Ohm, kappa_aniso, kappa_iso, nu_aniso, nu_iso, Q_AD, Q_Hall, resistivity_init(), and viscosity_init().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

Real KoyInut ( const Real  dens,
const Real  Press,
const Real  dt 
)

Analytic fit to cooling in the diffuse ISM given by eq.

(4) in Koyama & Inutsuka, ApJ 564, L97 (2002); Returns rate in cgs.

Definition at line 48 of file cool.c.

References Gamma_1, HeatRate, kb, mbar, n, and Tmin.

void resistivity ( DomainS pD  ) 

Explicit resistivity.

Definition at line 67 of file resistivity.c.

References ConsS::B1c, GridS::B1i, ConsS::B2c, GridS::B2i, ConsS::B3c, GridS::B3i, GridS::dt, GridS::dx1, GridS::dx2, GridS::dx3, ConsS::E, EField_AD(), EField_Hall(), EField_Ohm(), emf, emfp, EnerFlux, eta_Ohm, DomainS::Grid, GridS::ie, GridS::is, GridS::je, jl, GridS::js, ju, GridS::ke, kl, GridS::ks, ku, GridS::Nx, Q_AD, Q_Hall, GridS::U, Real3Vect::x, Real3Vect::y, and Real3Vect::z.

Referenced by integrate_diff().

Here is the call graph for this function:

Here is the caller graph for this function:

void resistivity_destruct (  ) 

Free temporary arrays.

Definition at line 1073 of file resistivity.c.

References Bcor, emf, emfp, EnerFlux, free_3d_array(), and get_myeta.

Referenced by integrate_diff_destruct(), and resistivity_init().

Here is the call graph for this function:

Here is the caller graph for this function:

void resistivity_init ( MeshS pM  ) 

Allocate temporary arrays.

Definition at line 991 of file resistivity.c.

References ath_error(), Bcor, calloc_3d_array(), MeshS::Domain, MeshS::DomainsPerLevel, emf, emfp, EnerFlux, get_myeta, DomainS::Grid, MeshS::NLevels, MeshS::Nx, GridS::Nx, par_geti_def(), Q_Hall, and resistivity_destruct().

Referenced by integrate_diff_init().

Here is the call graph for this function:

Here is the caller graph for this function:

void viscosity ( DomainS pD  ) 

Adds explicit viscosity terms to the momentum and energy equations.

Definition at line 62 of file viscosity.c.

References cc_pos(), ConsS::d, divv, GridS::dt, GridS::dx1, GridS::dx2, GridS::dx3, ConsS::E, Cons1DS::E, ViscFluxS::E, DomainS::Grid, GridS::ie, GridS::is, GridS::je, jl, GridS::js, ju, GridS::ke, kl, GridS::ks, ku, ConsS::M1, ConsS::M2, ConsS::M3, Cons1DS::Mx, ViscFluxS::Mx, Cons1DS::My, ViscFluxS::My, Cons1DS::Mz, ViscFluxS::Mz, nu_aniso, nu_iso, GridS::Nx, Omega_0, qshear, GridS::U, ViscStress_aniso(), ViscStress_iso(), Real3Vect::x, x2Flux, x3Flux, Real3Vect::y, and Real3Vect::z.

Referenced by integrate_diff().

Here is the call graph for this function:

Here is the caller graph for this function:

void viscosity_destruct ( void   ) 

Free temporary arrays.

Definition at line 812 of file viscosity.c.

References divv, free_3d_array(), x2Flux, and x3Flux.

Referenced by integrate_diff_destruct(), and viscosity_init().

Here is the call graph for this function:

Here is the caller graph for this function:

void viscosity_init ( MeshS pM  ) 

Allocate temporary arrays.

Definition at line 754 of file viscosity.c.

References ath_error(), calloc_3d_array(), divv, MeshS::Domain, MeshS::DomainsPerLevel, DomainS::Grid, MeshS::NLevels, MeshS::Nx, GridS::Nx, viscosity_destruct(), x2Flux, and x3Flux.

Referenced by integrate_diff_init().

Here is the call graph for this function:

Here is the caller graph for this function: