-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathWFS_fireweather.h
100 lines (86 loc) · 2.85 KB
/
WFS_fireweather.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#ifndef FIREWEATHER_H
#define FIREWEATHER_H
#include <iostream>
#include <string>
#include <vector>
#include <sstream>
#include <cmath>
#include "csvreader.h"
#include "utility.h"
#include "globals.h"
#include "cell.h"
#include "fire.h"
namespace wildland_firesim {
template<typename T>
struct distrParameter {
T param1;
T param2;
};
/*!
* \brief The WindCondition struct
* contains probabilities for change of wind conditions from windy and calm and to stay calm.
*/
struct WindCondition {
float windyToCalm;
float stayCalm;
};
constexpr int WindDirectionsCount = 8;
/*!
* \brief The FireWeather class
* containing functions and parameter to simulate fire weather.
*/
class FireWeather
{
public:
FireWeather();
/*!
* \brief importMeteorologicalParameter
* extracts meteorological parameters from file.
* \param fileName
*/
void importMeteorologicalParameter(const std::string fileName);
/*!
* \brief getFixedFireWeatherParameter
* imports fixed fire weather parameter from file.
* \param fileName
*/
void getFixedFireWeatherParameter(const std::string fileName, FireWeatherVariables *weather);
/*!
* \brief calculateFireWeather
* simulates hourly fire weather. Temperature is calculated using a model by
* Cesaraccio et al. (2001). The parameters are received from temperature distribution, while
* sunset and sunrise times are received from the parameter file. Relative humidity is chosen
* from a normal distribution. For the simulation of wind, it has to be determined if wind is
* blowing. It the conditions are windy, wind direction is set according to a certain probability
* and the wind speed chosen from a Weilbull distribution.
* \param month
* \param durationOfBurn
*/
void calculateFireWeather(int month, int durationOfBurn);
/*!
* \brief setStartingTime
* sets time to start a fire.
* \param startOfFire
*/
void setStartingTime(int startOfFire);
//Meteorological Variables
bool windyConditions;
float windSpeed;
int windDirection;
float relHumidity;
float temperature;
private:
distrParameter<float> m_minimumDailyTemperatureParameter[NumberOfMonths];
distrParameter<float> m_maximumDailyTemperatureParameter[NumberOfMonths];
distrParameter<float> m_relativeHumidityParameter[NumberOfMonths];
distrParameter<float> m_windSpeedParameter[NumberOfMonths];
WindCondition m_windConditionChange[NumberOfMonths];
float m_windDirectionProbability[NumberOfMonths][WindDirectionsCount];
float m_sunriseTime [NumberOfMonths];
float m_sunsetTime [NumberOfMonths];
// Tn: min temperature, Tx: max temperature, Tp: min temperature of following day
float Tn, Tx, Tp;
int startingTime; //time for fire weather
};
} //namespace wildland_firesim
#endif // FIREWEATHER_H