SEDR_SBAGNOLD.h
浏览该文件的文档.
1/*!
2 * \file SEDR_SBAGNOLD.h
3 * \brief Sediment routing using simplified version of Bagnold(1997) stream power equation,
4 * which is based on fall velocity and degradation on stream.
5 *
6 * reWrite from route.f and rtsed_bagnold.f of SWAT
7 *
8 * Changelog:
9 * - 1. 2012-07-31 - wh - Initial implementation based on rtsed.f of SWAT.
10 * - 2. 2016-05-30 - lj -
11 * -# Move m_erodibilityFactor, m_coverFactor, to reach collection of MongoDB as DT_Array1D inputs.
12 * -# Add point source loadings from Scenario database.
13 * -# Add SEDRECHConc output with the unit g/cm^3 (i.e., Mg/m^3).
14 * - 3. 2016-08-31 - jz - Code review.
15 * - 4. 2016-09-30 - lj -
16 * -# ReCheck and Update code according to route.f and rtsed.f
17 * -# Change the module name from SEDR_VCD to SEDR_SBAGNOLD.
18 * - 5. 2018-05-14 - lj - Code review and reformat.
19 * - 6. 2018-06-28 - lj -
20 * -# The initialization of m_sedSto should be done in Set1DData after m_chSto.
21 * -# Bug fixed about code related to the IN/OUTPUT variables.
22 * - 7. 2018-08-15 - lj - Update from rtsed.f to rtsed_bagnold.f of SWAT.
23 * - 8. 2022-08-22 - lj - Change float to FLTPT.
24 *
25 * \author Liangjun Zhu, Hui Wu, Junzhi Liu
26 */
27#ifndef SEIMS_MODULE_SEDR_SBAGNOLD_H
28#define SEIMS_MODULE_SEDR_SBAGNOLD_H
29
30#include "SimulationModule.h"
31
32/** \defgroup SEDR_SBAGNOLD
33 * \ingroup Erosion
34 * \brief Sediment routing using Simplified version of Bagnold(1997) stream power equation
35 */
36/*!
37 * \class SEDR_SBAGNOLD
38 * \ingroup SEDR_SBAGNOLD
39 *
40 * \brief Sediment routing using variable channel dimension(VCD) method at daily time scale
41 *
42 */
44public:
46
48
49 void SetValue(const char* key, FLTPT value) OVERRIDE;
50
51 void SetValue(const char* key, int value) OVERRIDE;
52
53 void SetValueByIndex(const char* key, int index, FLTPT value) OVERRIDE;
54
55 void Set1DData(const char* key, int n, FLTPT* data) OVERRIDE;
56
58
60
62
64
66
68
69 void GetValue(const char* key, FLTPT* value) OVERRIDE;
70
71 void Get1DData(const char* key, int* n, FLTPT** data) OVERRIDE;
72
73private:
74 void PointSourceLoading();
75
76 void SedChannelRouting(int i);
77
78 void ChannelDowncuttingWidening(int i);
79private:
80 int m_dt; ///< time step (sec)
81 int m_inputSubbsnID; ///< current subbasin ID, 0 for the entire watershed
82
83 /// INPUT PARAMETERS FROM DATABASE
84
85 int m_nreach; ///< reach/channel number (= subbasin number)
86 bool m_vcd; ///< compute channel degredation or not
87 FLTPT m_peakRateAdj; ///< the peak rate adjustment factor
88 FLTPT m_sedTransEqCoef; ///< Coefficient in sediment transport equation, spcon in SWAT
89 FLTPT m_sedTransEqExp; ///< Exponent in sediment transport equation, spexp in SWAT
90 FLTPT m_initChSto; ///< initial channel storage per meter of reach length (m^3/m)
91
92 int* m_reachDownStream; ///< downstream id (The value is 0 if there if no downstream reach)
93 int* m_chOrder; ///< Channel order ID
94 FLTPT* m_chWth; ///< Channel width at bankfull, m
95 FLTPT* m_chDepth; ///< Channel depth at bankfull, m
96 FLTPT* m_chWthDepthRt; ///< Channel width to depth ratio, ch_wdr in SWAT
97 FLTPT* m_chLen; ///< Channel length, m
98 FLTPT* m_chSlope; ///< Channel slope
99 FLTPT* m_chSideSlope; ///< inverse of the channel side slope, by default is 2. chside in SWAT.
100 FLTPT* m_chBnkBD; ///< Bulk density of channel bank
101 FLTPT* m_chBedBD; ///< Bulk density of channel bed
102 FLTPT* m_chBnkCov; /// Channel bank cover factor, ch_cov1 in SWAT
103 // FLTPT* m_chBedCov; /// Channel bed cover factor, ch_cov2 in SWAT, currently not used
104 FLTPT* m_chBnkErod; ///< channel bank erodibility factor, cm^3/N/s
105 FLTPT* m_chBedErod; ///< channel bed erodibility factor, cm^3/N/s
106 FLTPT* m_chBnkTc; ///< Critical shear stress of channel bank, N/m^2
107 FLTPT* m_chBedTc; ///< Critical shear stress of channel bed, N/m^2
108 FLTPT* m_chBnkSand; ///< Fraction of sand in channel bank sediment
109 FLTPT* m_chBnkSilt; ///< Fraction of silt in channel bank sediment
110 FLTPT* m_chBnkClay; ///< Fraction of clay in channel bank sediment
111 FLTPT* m_chBnkGravel; ///< Fraction of gravel in channel bank sediment
112 FLTPT* m_chBedSand; ///< Fraction of sand in channel bed sediment
113 FLTPT* m_chBedSilt; ///< Fraction of silt in channel bed sediment
114 FLTPT* m_chBedClay; ///< Fraction of clay in channel bed sediment
115 FLTPT* m_chBedGravel; ///< Fraction of gravel in channel bed sediment
116
117 map<int, vector<int> > m_reachLayers; ///< Reach layers according to \a LayeringMethod
118 /*!
119 * Index of upstream Ids (The value is -1 if there if no upstream reach)
120 * m_reachUpStream.size() = N+1
121 * m_reachUpStream[1] = [2, 3] means Reach 2 and Reach 3 flow into Reach 1.
122 */
123 vector<vector<int> > m_reachUpStream;
124
125 /* point source operations
126 * key: unique index, BMPID * 100000 + subScenarioID
127 * value: point source management factory instance
128 */
129 map<int, BMPPointSrcFactory *> m_ptSrcFactory;
130 /// The point source loading (kg), m_ptSub[id], id is the reach id, load from m_Scenario
131 FLTPT* m_ptSub;
132
133 /// Temporary variables
134
135 FLTPT* m_initChDepth; ///< Initial channel depth at bankfull, m
136 FLTPT* m_initChLen; ///< Initial channel length, m
137 FLTPT* m_initChSlope; ///< Initial channel slope
138 FLTPT* m_preRchDep; ///< Deposition sediment in previous timestep, depprch in SWAT
139 FLTPT* m_preFldplnDep; ///< Deposition sediment on floodplain in previous timestep, depprfp in SWAT
140
141 /// INPUT from other modules
142
143 FLTPT* m_sedtoCh; ///< sediment from hillslope erosion module (e.g., IUH_SED_OL), kg
144 FLTPT* m_sandtoCh; ///< sand from hillslope erosion, kg
145 FLTPT* m_silttoCh; ///< sand from hillslope erosion, kg
146 FLTPT* m_claytoCh; ///< sand from hillslope erosion, kg
147 FLTPT* m_sagtoCh; ///< sand from hillslope erosion, kg
148 FLTPT* m_lagtoCh; ///< sand from hillslope erosion, kg
149 FLTPT* m_graveltoCh; ///< sand from hillslope erosion, kg
150
151 FLTPT* m_qRchOut; ///< channel outflow, m^3/s
152 FLTPT* m_chSto; ///< channel storage (m^3) after channel routing, rchstor in SWAT
153 FLTPT* m_rteWtrOut; ///< Water leaving reach on day after channel routing, m^3, rtwtr in SWAT
154 FLTPT* m_chBtmWth; ///< Channel bottom width, m
155 FLTPT* m_chWtrDepth; ///< channel water depth, m, rchdep in SWAT
156 FLTPT* m_chWtrWth; ///< channel top water width, m, topw in SWAT
157
158 // OUTPUT
159
160 FLTPT* m_sedRchOut; ///< reach sediment out (kg) at time t, sedrch * 1000 in SWAT
161 FLTPT* m_sedConcRchOut; ///< sediment concentration (g/L, i.e., kg/m^3)
162 FLTPT* m_sandRchOut; ///< sand out (kg), rch_san * 1000 in SWAT
163 FLTPT* m_siltRchOut; ///< silt out (kg), rch_sil * 1000 in SWAT
164 FLTPT* m_clayRchOut; ///< clay out (kg), rch_cla * 1000 in SWAT
165 FLTPT* m_sagRchOut; ///< small aggregate out (kg), rch_sag * 1000 in SWAT
166 FLTPT* m_lagRchOut; ///< large aggregate out (kg), rch_lag * 1000 in SWAT
167 FLTPT* m_gravelRchOut; ///< gravel out (kg), rch_gra * 1000 in SWAT
168
169 FLTPT* m_rchBnkEro; ///< Bank erosion sediment, bnkrte * 1000 in SWAT
170 FLTPT* m_rchDeg; ///< Channel degradation sediment, degrte * 1000 in SWAT
171
172 FLTPT* m_rchDep; ///< Deposition sediment, depch in SWAT
173 FLTPT* m_dltRchDep; ///< Channel new deposition during the current time step, rchdy(57,jrch) in SWAT
174 FLTPT* m_rchDepSand; ///< depsanch in SWAT
175 FLTPT* m_rchDepSilt; ///< depsilch in SWAT
176 FLTPT* m_rchDepClay; ///< depclach in SWAT
177 FLTPT* m_rchDepSag; ///< depsagch in SWAT
178 FLTPT* m_rchDepLag; ///< deplagch in SWAT
179 FLTPT* m_rchDepGravel; ///< depgrach in SWAT
180
181 FLTPT* m_fldplnDep; ///< Deposition sediment on floodplain, depfp in SWAT
182 FLTPT* m_dltFldplnDep; ///< Floodplain new deposits during the current timestep, rchdy(58,jrch) in SWAT
183 FLTPT* m_fldplnDepSilt; ///< Deposition silt on floodplain, depsilfp in SWAT
184 FLTPT* m_fldplnDepClay; ///< Deposition clay on floodplain, depclafp in SWAT
185
186 FLTPT* m_sedSto; ///< channel sediment storage (kg), sedst * 1000 in SWAT
187 FLTPT* m_sandSto; ///< Sand storage in reach (kg), sanst * 1000 in SWAT
188 FLTPT* m_siltSto; ///< Silt storage in reach (kg), silst * 1000 in SWAT
189 FLTPT* m_claySto; ///< Clay storage in reach (kg), clast * 1000 in SWAT
190 FLTPT* m_sagSto; ///< Small aggregate storage in reach (kg), sagst * 1000 in SWAT
191 FLTPT* m_lagSto; ///< Large aggregate storage in reach (kg), lagst * 1000 in SWAT
192 FLTPT* m_gravelSto; ///< Gravel storage in reach (kg), sanst * 1000 in SWAT
193};
194#endif /* SEIMS_MODULE_SEDR_SBAGNOLD_H */
Parent class for all modules in SEIMS
@ TIMESTEP_CHANNEL
Channel scale
Definition: SimulationModule.h:37
#define OVERRIDE
A compatible reference to override or blank if not supported by the compiler.
Definition: basic.h:160
Main class of scenario in BMP database
Definition: Scenario.h:47
void Set1DData(const char *key, int n, FLTPT *data) OVERRIDE
Set 1D data, by default, DT_Raster1D, float
bool CheckInputData() OVERRIDE
Check the input data.
void InitialOutputs() OVERRIDE
Initialize output variables.
void SetValue(const char *key, int value) OVERRIDE
Set data, DT_Single, integer
void SetValueByIndex(const char *key, int index, FLTPT value) OVERRIDE
Set single value to array1D by index, used in MPI version for passing values of subbasins,...
TimeStepType GetTimeStepType() OVERRIDE
Get time step type, default is hillslope process.
Definition: SEDR_SBAGNOLD.h:67
void SetReaches(clsReaches *reaches) OVERRIDE
Set pointer of clsReaches class which contains all reaches information. Added by LJ,...
int Execute() OVERRIDE
Execute the simulation. Return 0 for success.
void SetScenario(Scenario *sce) OVERRIDE
Set pointer of Scenario class which contains all BMP information. Added by LJ, 2016-6-14
void SetValue(const char *key, FLTPT value) OVERRIDE
Set data, DT_Single, float point number (float or double)
void Get1DData(const char *key, int *n, FLTPT **data) OVERRIDE
Get 1D data, by default, DT_Raster1D, float
void GetValue(const char *key, FLTPT *value) OVERRIDE
Get value, DT_Single, float
Sediment routing using variable channel dimension(VCD) method at daily time scale
Definition: SEDR_SBAGNOLD.h:43
Read and store all reaches information as input parameters
Definition: clsReach.h:88
Base module for all simulation modules in SEIMS
Definition: SimulationModule.h:46
TimeStepType
Time step types.
Definition: SimulationModule.h:35