cloudy  trunk
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
timesc.cpp
Go to the documentation of this file.
1 /* This file is part of Cloudy and is copyright (C)1978-2017 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"
8 
10 {
11  /* age of the cloud, to check for time-steady */
12  CloudAgeSet = -1.f;
13  /* some timescale for CO and H2 */
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.;
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;
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];
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 }
void calc_therm_timesc(long izone)
Definition: timesc.cpp:26
const double BIGDOUBLE
Definition: cpu.h:249
t_struc struc
Definition: struc.cpp:6
double time_H2_Form_here
Definition: timesc.h:48
double time_therm_short
Definition: timesc.h:29
double TimeH21cm
Definition: timesc.h:64
long int nzone
Definition: cddefines.cpp:14
#define MIN2(a, b)
Definition: cddefines.h:807
double * coolstr
Definition: struc.h:78
double BigCOMoleForm
Definition: timesc.h:48
double time_H2_Dest_longest
Definition: timesc.h:48
double sound_speed_isothermal
Definition: timesc.h:55
realnum CloudAgeSet
Definition: timesc.h:43
void zero()
Definition: timesc.cpp:9
double time_H2_Dest_here
Definition: timesc.h:48
realnum * DenParticles
Definition: struc.h:25
t_timesc timesc
Definition: timesc.cpp:7
long int nzlim
Definition: struc.h:19
#define ASSERT(exp)
Definition: cddefines.h:617
#define MAX2(a, b)
Definition: cddefines.h:828
realnum * testr
Definition: struc.h:25
double time_H2_Form_longest
Definition: timesc.h:48
double time_therm_long
Definition: timesc.h:29