-
Notifications
You must be signed in to change notification settings - Fork 0
/
HydroModel.h
71 lines (54 loc) · 2.27 KB
/
HydroModel.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
#ifndef HYDROMODEL_H
#define HYDROMODEL_H
#include <datastr/GeographicMap.h>
#include <datastr/ScaledGeographicMap.h>
#include <datastr/TemporalGeographicMap.h>
#include <datastr/PartialConfidenceTemporalGeographicMap.h>
#include <datastr/TimeSeries.h>
#include <datastr/DividedRange.h>
#include "DInfinityMap.h"
using namespace openworld;
class HydroModel {
protected:
DividedRange latitudes;
DividedRange longitudes;
// Inputs
GeographicMap<double>* elevation;
GeographicMap<double>* slope;
DInfinityMap* direction;
PartialConfidenceTemporalGeographicMap<double>* precipitation;
PartialConfidenceTemporalGeographicMap<double>* surfaceTemp;
TemporalGeographicMap<double>* snowCover;
double precipCoefficient;
double meltCoefficient;
// Results (evaluated at time = now)
Measure now;
MatrixGeographicMap<double>* riverVolume; // m^3
MatrixGeographicMap<double>* surfaceVolume; // m^3
MatrixGeographicMap<double>* riverConf;
MatrixGeographicMap<double>* surfaceConf;
// Records of outflows from a particular cell
unsigned rrFlow, ccFlow;
list<double> outFlow;
double minSurface, minRiver;
double maxSurfaceVelocity, maxRiverVelocity;
public:
HydroModel(DividedRange latitudes, DividedRange longitudes, double precipCoefficient, double meltCoefficient, double latFlow, double longFlow);
HydroModel(DividedRange latitudes, DividedRange longitudes, double precipCoefficient, double meltCoefficient, unsigned rrFlow, unsigned ccFlow);
void setElevation(GeographicMap<double>* elevation);
void setDInfinity(GeographicMap<double>* slope, DInfinityMap* direction);
void setPrecipitation(PartialConfidenceTemporalGeographicMap<double>* precipitation);
void setTemperature(PartialConfidenceTemporalGeographicMap<double>* surfaceTemp);
void setSnowCover(TemporalGeographicMap<double>* snowCover);
void runTo(time_t time);
void stepDay();
list<double> getOutFlows();
GeographicMap<double>* getRiverVolume();
// Utility functions
double calcManning(double coeff, double radius, double slope);
GeographicMap<double>& calcManningRiver(GeographicMap<double>* volume);
GeographicMap<double>& calcManningSurface(GeographicMap<double>* volume);
double calcMinimumDistance(GeographicMap<double>& map);
double calcRiverWidth(double volume);
};
#endif