Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Mayer
CircularGreenSimCity
Commits
ed5875ed
Commit
ed5875ed
authored
Jul 05, 2023
by
Eric Duminil
Browse files
DRY
parent
61a747b4
Changes
1
Show whitespace changes
Inline
Side-by-side
tree-water-demand/src/main/java/de/hft/stuttgart/water/TreeWaterDemand.java
View file @
ed5875ed
...
...
@@ -101,14 +101,10 @@ public class TreeWaterDemand {
int
dayOfYear
=
counter
.
getDayOfYear
();
double
hourOfDay
=
counter
.
getHour
()
+
0.5
;
//TODO: DRY
double
netRadiation
=
rn
(
temp
,
actualVaporPressure
,
incomingRadiation
,
height
,
dayOfYear
,
hourOfDay
,
lz
,
lm
);
double
extraterrestrialRadiation
=
extraterrestrialRadiation
(
dayOfYear
,
hourOfDay
,
lz
,
lm
);
double
netLongwaveRadiation
=
rnl
(
temp
,
actualVaporPressure
,
incomingRadiation
,
height
,
dayOfYear
,
hourOfDay
,
lz
,
lm
);
double
et0
=
et0
(
temp
,
actualVaporPressure
,
incomingRadiation
,
height
,
windSpeed
,
humidity
,
dayOfYear
,
hourOfDay
,
lz
,
lm
);
double
extraterrestrialRadiation
=
extraterrestrialRadiation
(
dayOfYear
,
hourOfDay
,
lz
,
lm
);
// ra
double
netLongwaveRadiation
=
rnl
(
temp
,
actualVaporPressure
,
incomingRadiation
,
height
,
extraterrestrialRadiation
);
// rnl
double
netRadiation
=
rn
(
incomingRadiation
,
netLongwaveRadiation
);
double
et0
=
et0
(
temp
,
actualVaporPressure
,
incomingRadiation
,
height
,
windSpeed
,
humidity
,
netRadiation
);
double
et0u
=
et0u
(
svf
,
advection
,
et0
);
...
...
@@ -163,9 +159,7 @@ public class TreeWaterDemand {
}
private
static
double
et0
(
double
temperature
,
double
actualVaporPressure
,
double
shortWaveRadiation
,
double
height
,
double
windSpeed
,
double
humidity
,
int
dayOfYear
,
double
hourOfDay
,
double
lz
,
double
lm
)
{
double
netRadiation
=
rn
(
temperature
,
actualVaporPressure
,
shortWaveRadiation
,
height
,
dayOfYear
,
hourOfDay
,
lz
,
lm
);
double
windSpeed
,
double
humidity
,
double
netRadiation
)
{
double
gamma
=
gamma
(
height
);
double
saturationVaporPressure
=
saturationVaporPressure
(
temperature
);
double
delta
=
delta
(
temperature
,
saturationVaporPressure
);
...
...
@@ -197,21 +191,18 @@ public class TreeWaterDemand {
}
// unit is apparently [MJ / (m².h)]
private
static
double
rn
(
double
temperature
,
double
actualVaporPressure
,
double
shortWaveRadiation
,
double
height
,
int
dayOfYear
,
double
hourOfDay
,
double
lz
,
double
lm
)
{
private
static
double
rn
(
double
shortWaveRadiation
,
double
rnl
)
{
// 1 - 0.23: albedo effect of grass
return
(
1
-
0.23
)
*
shortWaveRadiation
-
rnl
(
temperature
,
actualVaporPressure
,
shortWaveRadiation
,
height
,
dayOfYear
,
hourOfDay
,
lz
,
lm
);
return
(
1
-
0.23
)
*
shortWaveRadiation
-
rnl
;
}
// unit is apparently [MJ / (m².h)]
private
static
double
rnl
(
double
temperature
,
double
actualVaporPressure
,
double
shortWaveRadiation
,
double
height
,
int
dayOfYear
,
double
hourOfDay
,
double
lz
,
double
lm
)
{
double
extraterrestrialRadiation
)
{
// divide by 24 for hourly
double
sigma
=
4.903
E
-
9
/
24
;
double
rs
=
shortWaveRadiation
;
double
ra
=
extraterrestrialRadiation
(
dayOfYear
,
hourOfDay
,
lz
,
lm
);
double
rso
=
(
0.75
+
2
*
10
E
-
5
*
height
)
*
ra
;
double
rso
=
(
0.75
+
2
*
10
E
-
5
*
height
)
*
extraterrestrialRadiation
;
double
rsRsoQuotient
=
0.5
;
if
(
rso
!=
0
)
{
rsRsoQuotient
=
rs
/
rso
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment