cloudy
trunk
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
source
timesc.cpp
Go to the documentation of this file.
1
/* This file is part of Cloudy and is copyright (C)1978-2022 by Gary J. Ferland and
2
* others. For conditions of distribution and use see copyright notice in license.txt */
3
#include "
cddefines.h
"
4
#include "
timesc.h
"
5
#include "
physconst.h
"
6
#include "
struc.h
"
7
t_timesc
timesc
;
8
9
void
t_timesc::zero
()
10
{
11
/* age of the cloud, to check for time-steady */
12
CloudAgeSet
= -1.f;
13
/* some timescale for CO and H2 */
14
time_H2_Dest_longest
= 0.;
15
time_H2_Form_longest
= 0.;
16
/* remains neg if not evaluated */
17
time_H2_Dest_here
= -1.;
18
time_H2_Form_here
= 0.;
19
20
BigCOMoleForm
= 0.;
21
22
TimeH21cm
= 0.;
23
sound_speed_isothermal
= 0.;
24
}
25
26
void
t_timesc::calc_therm_timesc
(
long
int
izone )
27
{
28
if
( izone <= 0 )
29
{
30
izone =
MAX2
(1,
nzone
-1);
31
ASSERT
( izone <
struc
.
nzlim
);
32
33
/* NZLIM is the size of the struc vectors - should be dynamic
34
* izone = MIN2( izone, NZLIM-1 );*/
35
}
36
37
time_therm_long
= 0;
38
time_therm_short
=
BIGDOUBLE
;
39
40
for
(
long
i = 0; i < izone; i++ )
41
{
42
/* >>chng 99 feb 01, had div by heating, changed to cooling so constant
43
* temperature models are more realistic */
44
double
dt = 1.5 * BOLTZMANN *
struc
.
DenParticles
[i] *
struc
.
testr
[i] /
struc
.
coolstr
[i];
45
time_therm_long
=
MAX2
(
time_therm_long
, dt );
46
time_therm_short
=
MIN2
(
time_therm_short
, dt );
47
// printf("dt = %g\t long = %g\t short = %g\n", dt, time_therm_long, time_therm_short);
48
}
49
// printf( "*** long = %g\t short = %g\n", time_therm_long, time_therm_short );
50
51
return
;
52
}
struc.h
t_timesc::calc_therm_timesc
void calc_therm_timesc(long izone)
Definition:
timesc.cpp:26
BIGDOUBLE
const double BIGDOUBLE
Definition:
cpu.h:249
struc
t_struc struc
Definition:
struc.cpp:6
t_timesc::time_H2_Form_here
double time_H2_Form_here
Definition:
timesc.h:48
t_timesc::time_therm_short
double time_therm_short
Definition:
timesc.h:29
t_timesc::TimeH21cm
double TimeH21cm
Definition:
timesc.h:64
t_timesc
Definition:
timesc.h:14
nzone
long int nzone
Definition:
cddefines.cpp:14
MIN2
#define MIN2(a, b)
Definition:
cddefines.h:803
t_struc::coolstr
double * coolstr
Definition:
struc.h:78
t_timesc::BigCOMoleForm
double BigCOMoleForm
Definition:
timesc.h:48
t_timesc::time_H2_Dest_longest
double time_H2_Dest_longest
Definition:
timesc.h:48
t_timesc::sound_speed_isothermal
double sound_speed_isothermal
Definition:
timesc.h:55
t_timesc::CloudAgeSet
realnum CloudAgeSet
Definition:
timesc.h:43
t_timesc::zero
void zero()
Definition:
timesc.cpp:9
t_timesc::time_H2_Dest_here
double time_H2_Dest_here
Definition:
timesc.h:48
t_struc::DenParticles
realnum * DenParticles
Definition:
struc.h:25
timesc
t_timesc timesc
Definition:
timesc.cpp:7
t_struc::nzlim
long int nzlim
Definition:
struc.h:19
ASSERT
#define ASSERT(exp)
Definition:
cddefines.h:613
cddefines.h
timesc.h
MAX2
#define MAX2(a, b)
Definition:
cddefines.h:824
t_struc::testr
realnum * testr
Definition:
struc.h:25
physconst.h
t_timesc::time_H2_Form_longest
double time_H2_Form_longest
Definition:
timesc.h:48
t_timesc::time_therm_long
double time_therm_long
Definition:
timesc.h:29
Generated by
1.8.5