cloudy trunk
Loading...
Searching...
No Matches
parse_coronal.cpp
Go to the documentation of this file.
1/* This file is part of Cloudy and is copyright (C)1978-2013 by Gary J. Ferland and
2 * others. For conditions of distribution and use see copyright notice in license.txt */
3/*ParseCoronal parse parameters off coronal equilibrium command */
4#include "cddefines.h"
5#include "rfield.h"
6#include "thermal.h"
7#include "input.h"
8#include "optimize.h"
9#include "phycon.h"
10#include "radius.h"
11#include "dynamics.h"
12#include "parser.h"
13#include "atmdat.h"
14
15/*ParseCoronal parse parameters off coronal equilibrium command */
17{
18 double a;
19
20 DEBUG_ENTRY( "ParseCoronal()" );
21
22 /* use coronal command to establish initial conditions in a cooling
23 * time-varying cloud */
24 if( p.nMatch( "INIT" ) && p.nMatch( "TIME" ) )
25 {
27 if( p.nMatch( "TRAC" ) )
29 }
30
31 /* coronal equilibrium; set constant temperature to number on line */
34
35 // kinetic temperatures for a given ion are higher for coronal equilibrium
36 // simulations - large Fe chianti models are needed to get the full cooling
37 // tests show that this mainly affects the cooling around 1e7 K.
38 // the other elements included in Chianti hardly affect the cooling so
39 // are not changed
41 {
44 }
45
46 a = p.FFmtRead();
47 if( p.lgEOL() )
48 {
49 fprintf( ioQQQ, " There should be a temperature on this line.\n" );
51 }
52
53 /* numbers less than or equal to 10 are the log of the temperature */
54 if( (a <= 10. && !p.nMatch("LINE")) || p.nMatch(" LOG") )
55 {
56 thermal.ConstTemp = (realnum)pow(10.,a);
57 }
58 else
59 {
61 }
62
63 /* check temperature bounds */
65 {
67 fprintf( ioQQQ, " PROBLEM Te too low, reset to %g K.\n",
69 }
71 {
73 fprintf( ioQQQ, " PROBLEM Te too high, reset to %g K.\n",
75 }
76
77 /* now simulate a LASER line */
78 strcpy( rfield.chSpType[rfield.nShape], "LASER" );
79 /* scan off the laser's energy ion Rydbergs */
81 /* default width is 0.05 */
82 rfield.cutoff[rfield.nShape][0] = 0.05;
83
84 /* simulate an ionization parameter line */
85 strcpy( rfield.chRSpec[p.m_nqh], "SQCM" );
86 strcpy( rfield.chSpNorm[p.m_nqh], "IONI" );
87
88 /* >>chng 96 jun 17, to stop mole network from crashing */
89 /* >>chng 05 aug 15, this sets ionization parameter, in test case ism_hot_brems the
90 * value of 1e-10 was enough to dominate the ionization of he-like N - it's ionization
91 * then jumped due to large optical depth in the continuum - change U from -10 to -15 */
92 /* >>chng 05 aug 16, this very strongly affected the coll_t4 sim - apparently there
93 * was a significant photoionization contribution from the -10 continuum,
94 * this was close to a 'no photoionization' case, but lower further to insure
95 * no photo contribution
96 * chang from -15 to -20 */
97 rfield.totpow[p.m_nqh] = -20.f;
98
99 ++rfield.nShape;
100 if( rfield.nShape >= LIMSPC )
101 {
102 /* too many continua were entered */
103 fprintf( ioQQQ, " Too many continua entered; increase LIMSPC\n" );
105 }
106 ++p.m_nqh;
107 if( p.m_nqh >= LIMSPC )
108 {
109 /* too many continua were entered */
110 fprintf( ioQQQ, " Too many continua entered; increase LIMSPC\n" );
112 }
113
114 /* set R to large value if U specified but R is not */
115 /* set radius to very large value if not already set */
116 /* >>chng 01 jul 24, from Radius == 0 to this, as per PvH comments */
117 if( !radius.lgRadiusKnown )
118 {
119 radius.Radius = pow(10.,radius.rdfalt);
120 }
121
122 /* vary option */
123 if( optimize.lgVarOn )
124 {
125 /* no luminosity options on vary */
127 strcpy( optimize.chVarFmt[optimize.nparm], "COROnal equilibrium %f LOG" );
129 strcat( optimize.chVarFmt[optimize.nparm], " TIME INIT" );
130
131 /* pointer to where to write */
133
134 /* log of temp will be pointer */
139 ++optimize.nparm;
140 }
141 return;
142}
t_atmdat atmdat
Definition: atmdat.cpp:6
FILE * ioQQQ
Definition: cddefines.cpp:7
#define EXIT_FAILURE
Definition: cddefines.h:140
#define cdEXIT(FAIL)
Definition: cddefines.h:434
float realnum
Definition: cddefines.h:103
#define DEBUG_ENTRY(funcname)
Definition: cddefines.h:684
Definition: parser.h:32
double FFmtRead(void)
Definition: parser.cpp:353
bool nMatch(const char *chKey) const
Definition: parser.h:135
bool lgEOL(void) const
Definition: parser.h:98
long int m_nqh
Definition: parser.h:41
t_dynamics dynamics
Definition: dynamics.cpp:44
t_input input
Definition: input.cpp:12
t_optimize optimize
Definition: optimize.cpp:5
void ParseCoronal(Parser &p)
t_phycon phycon
Definition: phycon.cpp:6
t_radius radius
Definition: radius.cpp:5
t_rfield rfield
Definition: rfield.cpp:8
const int LIMSPC
Definition: rfield.h:18
long nChiantiMaxLevels
Definition: atmdat.h:214
long nChiantiMaxLevelsFe
Definition: atmdat.h:212
const long nChiantiCollLevelsFe
Definition: atmdat.h:224
const long nChiantiCollLevels
Definition: atmdat.h:226
bool lgChiantiLevelsSet
Definition: atmdat.h:216
bool lg_coronal_time_init
Definition: dynamics.h:93
bool lgTracePrint
Definition: dynamics.h:177
long int nRead
Definition: input.h:49
long int nparm
Definition: optimize.h:201
realnum vincr[LIMPAR]
Definition: optimize.h:191
realnum vparm[LIMEXT][LIMPAR]
Definition: optimize.h:188
bool lgVarOn
Definition: optimize.h:203
long int nvarxt[LIMPAR]
Definition: optimize.h:194
char chVarFmt[LIMPAR][FILENAME_PATH_LENGTH_2]
Definition: optimize.h:263
realnum varang[LIMPAR][2]
Definition: optimize.h:198
long int nvfpnt[LIMPAR]
Definition: optimize.h:195
const double TEMP_LIMIT_HIGH
Definition: phycon.h:113
const double TEMP_LIMIT_LOW
Definition: phycon.h:111
double rdfalt
Definition: radius.h:124
bool lgRadiusKnown
Definition: radius.h:116
double Radius
Definition: radius.h:25
char chSpNorm[LIMSPC][5]
Definition: rfield.h:351
long int nShape
Definition: rfield.h:322
char chSpType[LIMSPC][6]
Definition: rfield.h:353
char chRSpec[LIMSPC][5]
Definition: rfield.h:352
double slope[LIMSPC]
Definition: rfield.h:301
realnum egamry
Definition: rfield.h:52
double cutoff[LIMSPC][3]
Definition: rfield.h:302
double totpow[LIMSPC]
Definition: rfield.h:300
bool lgTemperatureConstantCommandParsed
Definition: thermal.h:38
bool lgTemperatureConstant
Definition: thermal.h:32
realnum ConstTemp
Definition: thermal.h:44
t_thermal thermal
Definition: thermal.cpp:5