bur_brn.h
Go to the documentation of this file.
1 //
2 // $Id$
3 //
4 /*{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}
5 * Name: bur_brn.h
6 * Desc: Defines for Burnup code.
7 *
8 {*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}*/
9 
10 #define e_BurEqu 999 /* Burnpup Equation number */
11 
12 /* Combustion Efficiencies, Flaming and Smoldering */
13 #define e_ComEffFla 0.97
14 #define e_ComEffSmo 0.67
15 
16 /* These get used to adjust values going into the tpig & tchar arrays */
17 /* while they get loaded before burnup runs */
18 #define e_tpig_adj 273.0
19 #define e_tchar_adj 273.0
20 
21 /*.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.*/
22 /* Defines Burnup uses in 'BRN_CheckData' function to check limits */
23 #define e_cht1 1000.0 /* burnup's limit checks for */
24 
25 /*........................................................ */
26 /* original #define e_cht2 2000.0 */
27 /* ER said ok to change to 3000 */
28 #define e_cht2 3000.0 /* 'cheat' arrary */
29 
30 
31 #define e_tig1 200.0
32 #define e_tig2 400.0
33 
34 #define e_tch1 250.0
35 #define e_tch2 500.0
36 
37 /*.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.*/
38 
39 #define e_wdf1 (double) 0.1 /* duff loading limits, kg/m2 */
40 /* #define wdf2 (double) 30.0 Original Amount */
41 /* changed 12/28/01, they wanted higher, some cover types have lots of duf */
42 /* 80 kg/m2 is about 357 tons per acre */
43 #define e_wdf2 (double) 80.0 /* kg/m2 */
44 
45 
46 /*.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.*/
47 #define e_dfm1 (double) 0.1 /* Duff Moisture limits */
48 #define e_dfm2 (double) 1.972
49 
50 #define e_fms1 (double) 0.01 /* Moisture Limits */
51 #define e_fms2 (double) 3.0
52 
53 /*.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.*/
54 /* These are the actual Fuel Load Limits the Burnup calc uses */
55 /* #define small (double) 1.e-06 */
56 #define e_small (double) 1.e-08 /* load limits */
57 #define e_big (double) 1.e+06
58 
59 /*.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.*/
60 /* Defualt settings for Burnup input parameters, like the ones used when */
61 /* Building an input file for burnup to use */
62 #define e_MAX_TIMES 3000
63 #define e_INTENSITY 50.00
64 #define e_IG_TIME 60.00
65 #define e_WINDSPEED 0.00
66 #define e_DEPTH 0.3
67 #define e_AMBIENT_TEMP 27.00
68 #define e_R0 1.83
69 #define e_DR 0.40
70 #define e_TIMESTEP 15.00
71 
72 /*.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.*/
73 /* Sigmas input parameters used by burnup */
74 #define e_SURat_Lit 8200.0
75 #define e_SURat_DW1 1480.0
76 #define e_SURat_DW10 394.0
77 #define e_SURat_DW100 105.0
78 #define e_SURat_DWk_3_6 39.4
79 #define e_SURat_DWk_6_9 21.9
80 #define e_SURat_DWk_9_20 12.7
81 #define e_SURat_DWk_20 5.91
82 
83 
84 
85 
86 
87 /*.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.*/
88 /* These get loaded into burnup arrays along with the individual fuel loads */
89 /* before runing Burnup */
90 /* below we have #defines for running Burnup with and without input file */
91 /* ***>>> NOTE READ this */
92 /* NOTE READ */
93 /* If you change any of these you got change them in both places, in the */
94 /* printf format statement and the individual #defines below */
95 
96 /* printf format statements for creating burnup input file */
97 #define e_SoundFmt "1 %2d %13.8f 18600.0 %5.3f 513.0 %7.2f 2750.0 0.133 327.0 377.0 0.05\n"
98 #define e_RottenFmt "1 %2d %13.8f 18600.0 %5.3f 224.0 %7.2f 2750.0 0.133 302.0 377.0 0.05\n"
99 
100 
101 /* Defines sent into Burnup directly, when NOT using an input file */
102 /* **>> NOTE READ explaination above, before CHANGING any of these */
103 #define e_htval 18600.0 /* low heat of combustion , J / kg */
104 #define e_Snd_dendry 513.0 /* ovendry mass density, kg/cum Sound */
105 #define e_Rot_dendry 224.0 /* ovendry mass density, kg/cum Rotten */
106 #define e_cheat 2750.0 /* specific heat capacity (J / K) / kg dry mass */
107 #define e_condry 0.133 /* thermal conductivity W / m K , ovendry */
108 #define e_Snd_tpig 327.0 /* ignition temperature , K Sound */
109 #define e_Rot_tpig 302.0 /* ignition temperature , K Rotten */
110 #define e_tchar 377.0 /* char temperature , K */
111 #define e_ash 0.05 /* mineral content , fraction dry mass */
112 
113 
114 /*.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.*/
115 #define false 0
116 #define true 1
117 #define bool int
118 
119 /*.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.*/
120 
121 /* This was orginally 150, this is used to set array sizies */
122 /* #define MAXNO 150 */ /* Max # of Fuel Loadings allowed */
123 #ifdef DOS
124  #define MAXNO 12 /* Max # of Fuel Loadings allowed */
125 #else
126  #define MAXNO 20 /* Max # of Fuel Loadings allowed */
127 #endif
128 
129 #define MAXTYPES 3
130 #define MAXKL (MAXNO * ( MAXNO + 1 ) / 2 + MAXNO )
131 #define MXSTEP 20
132 
133 /*.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.*/
134 /* This struct is used to check data in the input Burnup loading file */
135 typedef struct {
140  int i_DEPTH;
142  int i_r0;
143  int i_dr;
147  } d_CFF;
148 
149 void CFF_Init (d_CFF *a_CFF);
150 int CFF_ChkAll (d_CFF *a_CFF);
151 
152 
153 /*.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.*/
154 
155 
156 
157 int BRN_Run_UIF (char cr_InFN[], char cr_Err[], float f_DufConPerCent,
158  char cr_LoadFN[], char cr_HeatFN[], float f_BrnCon);
159 int BRN_Run (char cr_LoadFN[], char cr_HeatFN[], float f_DufConPerCent, float f_BrnCon, char cr_ErrMes[]);
160 
161 void BRN_Init(void);
162 
163 int BRN_ReadInFil (char cr_FN[], char cr_Err[]);
164 int BRN_CheckData (char cr_ErrMes[]);
165 void BRN_SetFireDat (long NumIter, double Fi, double Ti, double U, double D, double Tamb,
166  double R0, double Dr, double Dt, double Wdf, double Dfm);
167 int BRN_ChkSwi (char cr[]);
168 float BRN_Intensity (float f_Con);
169 int BRN_SetFuel (int *aiX, char cr_SR[], float f_Load, float f_Moist, float f_Sigma);
170 
171 
172 
173 
174 int BurnupNone (char cr_HeatFN[], float f_Con );
175 void Heat_Heading (FILE *fh);
176 void Arrays (void);
177 long loc (long k, long l);
178 double func (double h, double theta);
179 double ff (double x, double tpfi, double tpig);
180 int Start(double tis, long now, long *ncalls, double *ad_Con);
181 void OverLaps(void);
182 double FireIntensity(double *ad_pcSmoCon);
183 double DryTime(double enu, double theta);
184 int Stash(char *HistFile, double tis, long now);
185 void Sorter(void);
186 double TIgnite(double tpdr, double tpig, double tpfi, double cond, double chtd, double fmof, double dend, double hbar);
187 double TempF(double q, double r);
188 void HeatExchange (double dia, double tf, double ts, double *hfm, double *hbar, double cond, double *en);
189 void DuffBurn (double wdf, double dfm, double *dfi, double *tdf,
190  float f_DufConPerCent, double *ad_Duf_CPTS);
191 void Step (double dt, double tin, double fid, long *ncalls, double *ad_Con);
192 int Summary (char *OutFile,char cr_ErrMes[]);
193 long Nint(double input);
194 void CalculateEmissions(int i_Fst);
195 
196 
197 double pow2(double input);
198 
199 /*.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.*/
200 /* Emission Sturcture */
201 typedef struct {
202  double d_FlaCon; /* Store consumed for time step */
203  double d_SmoCon;
204 
205  double dN_FlaCon; /* Store consumed totals */
206  double dN_SmoCon;
207 
208  double d_PM25; /* single time step amounts */
209  double d_PM10;
210  double d_CH4;
211  double d_CO2;
212  double d_CO;
213  double d_NOX;
214  double d_SOX;
215 
216 
217  double dN_PM25F; /* Flame Totals */
218  double dN_CH4F ;
219  double dN_COF ;
220  double dN_CO2F ;
221  double dN_PM10F;
222  double dN_NOXF;
223  double dN_SOXF;
224 
225  double dN_PM25S; /* Smoldering Totals */
226  double dN_CH4S ;
227  double dN_COS ;
228  double dN_CO2S ;
229  double dN_PM10S;
230  double dN_NOXS;
231  double dN_SOXS;
232 
233 
234  double d_FlaDur; /* Duration, last time step that */
235  double d_SmoDur; /* consumed something */
236  } d_ES;
237 
238 int ES_Calc (d_ES *a_ES, double d_WooLit, double d_Duff, double d_HSFB,
239  double d_pcSmo, double d_time);
240 
241 void ES_Init (d_ES *a_ES);
242 float ES_FlaDur (void);
243 float ES_SmoDur (void);
244 float ES_PM25F(void);
245 float ES_PM10F(void);
246 float ES_CH4F (void);
247 float ES_COF (void);
248 float ES_CO2F (void);
249 float ES_NOXF (void);
250 float ES_SOXF (void);
251 
252 
253 float ES_PM25S(void);
254 float ES_PM10S(void);
255 float ES_CH4S (void);
256 float ES_COS (void);
257 float ES_CO2S (void);
258 float ES_NOXS (void);
259 float ES_SOXS (void);
260 
261 float ES_FlaCon (void);
262 float ES_SmoCon (void);
263 
264 void Save_SGV (d_ES *a_ES, double d_time, double d_FirInt);
265 double Get_Cons (double d_old, double d_new);
266 double Duff_CPTS (double *ad_Duf_Tot, double d_Duf_Sec, double d_NumSec);
267 int Bur_ChkArgs (char cr_Line[]);
268 void Bur_Error (char cr_Err[], char cr1[], char cr_Line[]);
269 int EFM_Write (d_ES *a_ES, double d_Time, double d_FirInt);
270 int EFM_Open (char cr_FN[]);
271 void EFM_Close (void);
272 void Bur_RemoveTmp (void);
273 void Bur_SumDivErr (void);
274 void bstrupr (char cr[]);
int BurnupNone(char cr_HeatFN[], float f_Con)
double d_FlaCon
Definition: bur_brn.h:202
long loc(long k, long l)
Definition: bur_brn.c:926
double ff(double x, double tpfi, double tpig)
Definition: bur_brn.c:951
float ES_CH4S(void)
Definition: bur_brn.c:1724
int EFM_Open(char cr_FN[])
Definition: bur_brn.c:1778
int i_TIMESTEP
Definition: bur_brn.h:144
double dN_SOXF
Definition: bur_brn.h:223
double d_FlaDur
Definition: bur_brn.h:234
float ES_SmoCon(void)
Definition: bur_brn.c:1734
void Heat_Heading(FILE *fh)
Definition: bur_brn.c:1477
float ES_CH4F(void)
Definition: bur_brn.c:1716
float ES_PM25S(void)
Definition: bur_brn.c:1723
int EFM_Write(d_ES *a_ES, double d_Time, double d_FirInt)
Definition: bur_brn.c:1812
float ES_COF(void)
Definition: bur_brn.c:1717
float ES_CO2F(void)
Definition: bur_brn.c:1718
int BRN_Run_UIF(char cr_InFN[], char cr_Err[], float f_DufConPerCent, char cr_LoadFN[], char cr_HeatFN[], float f_BrnCon)
double TIgnite(double tpdr, double tpig, double tpfi, double cond, double chtd, double fmof, double dend, double hbar)
Definition: bur_brn.c:979
double func(double h, double theta)
Definition: bur_brn.c:1844
double dN_SmoCon
Definition: bur_brn.h:206
double dN_FlaCon
Definition: bur_brn.h:205
double d_SOX
Definition: bur_brn.h:214
double dN_PM25F
Definition: bur_brn.h:217
void Bur_Error(char cr_Err[], char cr1[], char cr_Line[])
Definition: bur_brn.c:1936
double d_SmoCon
Definition: bur_brn.h:203
double dN_COF
Definition: bur_brn.h:219
void Bur_SumDivErr(void)
void CalculateEmissions(int i_Fst)
double pow2(double input)
Definition: bur_brn.c:1838
Definition: bur_brn.h:201
int i_AMBIENT_TEMP
Definition: bur_brn.h:141
float ES_FlaDur(void)
Definition: bur_brn.c:1730
int Bur_ChkArgs(char cr_Line[])
Definition: bur_brn.c:1905
double Get_Cons(double d_old, double d_new)
Definition: bur_brn.c:1555
void Step(double dt, double tin, double fid, long *ncalls, double *ad_Con)
Definition: bur_brn.c:423
void bstrupr(char cr[])
Definition: bur_brn.c:2017
float ES_NOXF(void)
Definition: bur_brn.c:1719
void HeatExchange(double dia, double tf, double ts, double *hfm, double *hbar, double cond, double *en)
Definition: bur_brn.c:1333
float ES_SmoDur(void)
Definition: bur_brn.c:1731
int i_DEPTH
Definition: bur_brn.h:140
double d_CO
Definition: bur_brn.h:212
double d_CO2
Definition: bur_brn.h:211
float ES_FlaCon(void)
Definition: bur_brn.c:1733
long Nint(double input)
Definition: bur_brn.c:936
float ES_PM25F(void)
Definition: bur_brn.c:1715
double dN_PM10F
Definition: bur_brn.h:221
double dN_PM10S
Definition: bur_brn.h:229
void BRN_Init(void)
Definition: bur_brn.c:724
float ES_COS(void)
Definition: bur_brn.c:1725
int Stash(char *HistFile, double tis, long now)
Definition: bur_brn.h:135
double tpig[MAXNO]
Definition: bur_brn.c:32
float ES_PM10F(void)
Definition: bur_brn.c:1714
void Bur_RemoveTmp(void)
int BRN_ChkSwi(char cr[])
Definition: bur_brn.c:1953
float ES_SOXS(void)
Definition: bur_brn.c:1728
double wdf
Definition: bur_brn.c:27
int i_DUFF_LOAD
Definition: bur_brn.h:145
double d_SmoDur
Definition: bur_brn.h:235
double FireIntensity(double *ad_pcSmoCon)
Definition: bur_brn.c:1374
double dN_SOXS
Definition: bur_brn.h:231
void CFF_Init(d_CFF *a_CFF)
Definition: bur_brn.c:1997
double dN_CH4F
Definition: bur_brn.h:218
int Start(double tis, long now, long *ncalls, double *ad_Con)
Definition: bur_brn.c:190
float ES_PM10S(void)
Definition: bur_brn.c:1722
double DryTime(double enu, double theta)
Definition: bur_brn.c:1451
int Summary(char *OutFile, char cr_ErrMes[])
int i_MAX_TIMES
Definition: bur_brn.h:136
int BRN_Run(char cr_LoadFN[], char cr_HeatFN[], float f_DufConPerCent, float f_BrnCon, char cr_ErrMes[])
Definition: bur_brn.c:90
void Arrays(void)
Definition: bur_brn.c:1029
double dN_NOXF
Definition: bur_brn.h:222
double d_PM25
Definition: bur_brn.h:208
int i_dr
Definition: bur_brn.h:143
double dN_COS
Definition: bur_brn.h:227
double dN_CH4S
Definition: bur_brn.h:226
double Duff_CPTS(double *ad_Duf_Tot, double d_Duf_Sec, double d_NumSec)
Definition: bur_brn.c:1573
int BRN_ReadInFil(char cr_FN[], char cr_Err[])
Definition: bur_brn.c:2120
double d_NOX
Definition: bur_brn.h:213
double d_PM10
Definition: bur_brn.h:209
double dfm
Definition: bur_brn.c:27
double dN_PM25S
Definition: bur_brn.h:225
double d_CH4
Definition: bur_brn.h:210
int i_r0
Definition: bur_brn.h:142
void Sorter(void)
Definition: bur_brn.c:1170
float BRN_Intensity(float f_Con)
Definition: bur_brn.c:1859
double dt
Definition: bur_brn.c:27
real, dimension(mxsnag) dend
Definition: fmcom_mod.f90:251
int i_INTENSITY
Definition: bur_brn.h:137
float ES_SOXF(void)
Definition: bur_brn.c:1720
int CFF_ChkAll(d_CFF *a_CFF)
Definition: bur_brn.c:1976
float ES_CO2S(void)
Definition: bur_brn.c:1726
double dN_CO2S
Definition: bur_brn.h:228
int i_WINDSPEED
Definition: bur_brn.h:139
float ES_NOXS(void)
Definition: bur_brn.c:1727
void OverLaps(void)
Definition: bur_brn.c:1255
int i_DUFF_MOIST
Definition: bur_brn.h:146
int BRN_CheckData(char cr_ErrMes[])
Definition: bur_brn.c:767
void EFM_Close(void)
Definition: bur_brn.c:1796
int ES_Calc(d_ES *a_ES, double d_WooLit, double d_Duff, double d_HSFB, double d_pcSmo, double d_time)
Definition: bur_brn.c:1619
double dN_NOXS
Definition: bur_brn.h:230
double dN_CO2F
Definition: bur_brn.h:220
void Save_SGV(d_ES *a_ES, double d_time, double d_FirInt)
Definition: bur_brn.c:1881
void BRN_SetFireDat(long NumIter, double Fi, double Ti, double U, double D, double Tamb, double R0, double Dr, double Dt, double Wdf, double Dfm)
Definition: bur_brn.c:904
int BRN_SetFuel(int *aiX, char cr_SR[], float f_Load, float f_Moist, float f_Sigma)
Definition: bur_brn.c:2049
void DuffBurn(double wdf, double dfm, double *dfi, double *tdf, float f_DufConPerCent, double *ad_Duf_CPTS)
Definition: bur_brn.c:1512
double TempF(double q, double r)
Definition: bur_brn.c:1130
void ES_Init(d_ES *a_ES)
Definition: bur_brn.c:1741
int i_IG_TIME
Definition: bur_brn.h:138