This repository has been archived by the owner on Apr 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
TODO
220 lines (140 loc) · 4.08 KB
/
TODO
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
-TODO ---things that needs to be done with Daisy -*- outline -*-
* Make PLF gnuplots in ref manual work on windows
* make MacOS work
* src directory
* GMSR
** Færdiggør rapport
* hysteresis
** Math:
*** We have two retention curves
Theta_w (h) and Theta_d (h)
*** The two curves must have identical endpoints:
gr
Theta_w (0) = Theta_d (0) = Theta_sat
Theta_w (-inf) = Theta_h (-inf) = Theta_res
*** When we switch from drying to wetting, we scale the curve linearly:
(1) Theta_s (h) = Theta_w (h) * alpha + beta
(2) Theta_s (0) = Theta_sat
(3) Theta_s (h_1) = Theta_1
Where (h_1, Theta_1) are the tension and water content at the point
where we switched from drying to wetting.
We now have two unknowns (alpha and beta) and known points (2) and (3)
to find them with.
Theta_sat = Theta_sat * alpha + beta
Theta_1 = Theta_w (h_1) * alpha + beta
==>
beta = Theta_1 - Theta_w (h_1) * alpha
Theta_sat = Theta_sat * alpha + Theta_1 - Theta_w (h_1) * alpha
Theta_sat - Theta_1 = (Theta_sat - Theta_w (h_1)) * alpha
alpha = (Theta_sat - Theta_1) / (Theta_sat - Theta_w (h_1))
beta = Theta_sat / (Theta_sat * alpha)
** How to find Cw2_s (specific water capacity)
(4) Cw2_s (h) = dTheta_s (h) / dh
Insert (1):
(5) Cw2_s (h) = (dTheta_w (h) * alpha + beta) / dh
==>
(6) Cw2_s (h) = Cw2_w (h) + alpha
** How to find h_s (Theta)
Theta_s (h) = Theta_w (h) * alpha + beta
==>
Theta_w (h) = (Theta_s (h) - beta) / alpha
h_w (Theta_w (h)) = h_w ((Theta_s (h) - beta) / alpha)
h = h_w ((Theta_s (h) - beta) / alpha)
h = h (!)
h_s (Theta_s) = h_w ((Theta_s - beta) / alpha)
** We need two soil->hydraulic
One for state one for fast access
class HydraulicHysteresis : public Hydraulic
{
// The two curves.
const Hydraulic& wetting;
const Hydraulic& drying;
// State
bool is_wetting;
double Theta_alpha;
double Theta_beta;
double K_alpha;
double K_beta;
double Theta (double h) const
{
if (is_wetting)
return wetting.Theta (h) * Theta_alpha + Theta_beta;
else
return drying.Theta (h) * Theta_alpha + Theta_beta;
}
double h (double Theta) const
{
if (is_wetting)
return wetting.h ((Theta - Theta_beta) / Theta_alpha);
else
return drying.h ((Theta - Theta_beta) / Theta_alpha);
}
double Cw2 (double h) const
{
if (is_wetting)
return wetting.Cw2 (h) + Theta_alpha ;
else
return drying.Cw2 (h) + Theta_alpha;
}
double K (h) const
{
if (is_wetting)
return wetting.K (h) * K_alpha + K_beta;
else
return drying.K (h) * K_alpha + K_beta;
}
void tick (double h_old, double h, double dt)
{
if (is_wetting && h_old > h)
{
Theta_old = Theta (h_old);
set_drying (h_old, Theta_old);
}
if (!is_wetting && h_old < h)
{
Theta_old = Theta (h_old);
set_wetting (h_old, Theta_old);
}
}
void set_wetting (double h_s, double Theta_s)
{
Theta_sat = wetting.Theta (0)
Theta_alpha = (Theta_sat - Theta_s) / (Theta_sat - wetting.Theta (h_s))
Theta_beta = Theta_sat / (Theta_sat * alpha)
// TODO: Find K_alpha and K_beta
is_wetting = true;
}
void set_drying (double h_s, double Theta_s)
{
// TODO: Find Theta_alpha and Theta_beta
// TODO: Find K_alpha and K_beta
is_wetting = false;
}
};
** New state variables
** Mofidy functions
*** hyseresis (h_old, h, dt)
*** set_porosity
*** tillage
* Daisy
** Weather:
*** WindHeight [m]
New parameter, mandatory if wind speed is specified
*** Field-Windbreak [dg]
Optional parameter, default 0
* Få Daisy til at oversætte til Windows igen (Fra Linux?)
* Artikler
** Rodartikel ES&M
** OM init
* Skyethed med timeværdier?
* Ny version af Hypres ark
* Ny version af Charlottes afdræningstest.
* Tidlig vækst
Erstat DSLAI05 med Seed baseret tidlig vækst. Søren havde en formel,
men vi skal have en test setup.
* Regression test
* Daisy problemer
** DMI's nye "nedbørskorrigering"
** Ny ligning for biopore til matrix flow fra Søren
** Brug massebalance til at udregne (vertical) flux fra bunden.
Husk drænnoder!