PLUTO
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
maxrate.c
Go to the documentation of this file.
1
#include "
pluto.h
"
2
#include "
cooling_defs.h
"
3
4
/* ********************************************************************* */
5
double
GetMaxRate
(
double
*v0,
double
*k1,
double
T0)
6
/*!
7
* Return an estimate of the maximum rate (dimension 1/time) in the
8
* chemical network.
9
* This will serve as a "stiffness" detector in the main ode integrator.
10
*
11
* For integration to be carried explicitly all the time,
12
* return a small value (1.e-12).
13
*
14
*********************************************************************** */
15
{
16
int
nv;
17
double
ev1[
NIONS
+1];
18
double
scrh
, maxrate;
19
static
double
**J1;
20
21
if
(J1 == NULL) {
22
J1 =
ARRAY_2D
(
NIONS
+1,
NIONS
+1,
double
);
23
}
24
25
maxrate = 0.0;
26
for
(nv = 0; nv <
NIONS
-
Fe_IONS
; nv++) {
/* -- exclude Iron -- */
27
28
/* ----------------------------------------------
29
if the initial concentration is close to 0,
30
do not take Crate as a stiffness indicator
31
---------------------------------------------- */
32
33
if
(v0[
NFLX
+ nv] < 1.e-6)
continue
;
34
35
maxrate =
MAX
(maxrate,
CoolCoeffs
.
Crate
[nv]);
36
}
37
maxrate *=
UNIT_LENGTH
/
UNIT_VELOCITY
;
38
39
/*
40
Numerical_Jacobian (v0, J1);
41
lmax = Decompose(J1[0], NIONS + 1, ev1);
42
Radiat(v0, k1);
43
scrh = maxrate/fabs(lmax) - 1.0;
44
if (fabs(scrh) > 5.e-2){
45
printf ("Crate are not the max eig, %12.6e %12.6e\n",
46
maxrate, fabs(lmax));
47
QUIT_PLUTO(1);
48
}
49
return(fabs(lmax));
50
*/
51
52
return
(maxrate);
53
}
MAX
#define MAX(a, b)
Definition:
macros.h:101
COOLING_COEFFICIENTS::Crate
double Crate[NIONS]
Definition:
cooling_defs.h:31
configure.scrh
tuple scrh
Definition:
configure.py:200
CoolCoeffs
COOL_COEFF CoolCoeffs
Definition:
radiat.c:38
cooling_defs.h
UNIT_VELOCITY
#define UNIT_VELOCITY
Unit velocity in cm/sec.
Definition:
pluto.h:377
NFLX
#define NFLX
Definition:
mod_defs.h:32
UNIT_LENGTH
#define UNIT_LENGTH
Unit Length in cm.
Definition:
pluto.h:373
NIONS
#define NIONS
Definition:
cooling.h:28
GetMaxRate
double GetMaxRate(real *v0, real *k1, real T0)
Definition:
maxrate.c:4
pluto.h
PLUTO main header file.
Fe_IONS
#define Fe_IONS
Definition:
cooling.h:18
ARRAY_2D
#define ARRAY_2D(nx, ny, type)
Definition:
prototypes.h:171
Src
Cooling
MINEq
maxrate.c
Generated by
1.8.10