Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
cassiopee
jalhyd
Commits
3313b562
Commit
3313b562
authored
Feb 01, 2021
by
Dorchies David
Browse files
fix: Error in Calculation of PV
Fix
#282
parent
37fae007
Changes
4
Hide whitespace changes
Inline
Side-by-side
doc/matlab_macro_rugo/rampe_rugueuse.m
View file @
3313b562
...
...
@@ -563,28 +563,28 @@ end
if
Q
==
0
N
=
0
;
q0
=
(
2
*
g
.*
S
.*
D
.*
(
1
-
(
sigma
*
C
))
.
/(
Cd
.*
C
.*
(
1
+
N
)))
.^
0.5
*
pf
*
L
;
[
Q
res
]
=
fminsearch
(
@
(
Qi
)
find_Q_nat
(
z_amont
,
ks
,
D
,
h
,
Cd
,
S
,
L
,
pf
,
C
,
Qi
,
sigma
),
q0
,
optimset
(
'MaxIter'
,
maxiter
,
'MaxFunEvals'
,
maxfun
,
'Tolfun'
,
tolfun
,
'TolX'
,
tolx
))
set
(
handles
.
edit10
,
'string'
,
num2str
(
Q
))
elseif
pf
==
0
[
pf
res
]
=
fminsearch
(
@
(
pfi
)
find_Q_nat
(
z_amont
,
ks
,
D
,
h
,
Cd
,
S
,
L
,
pfi
,
C
,
Q
,
sigma
),
h
*
1.1
,
optimset
(
'MaxIter'
,
maxiter
,
'MaxFunEvals'
,
maxfun
,
'Tolfun'
,
tolfun
,
'TolX'
,
tolx
))
set
(
handles
.
edit8
,
'string'
,
num2str
(
pf
))
elseif
L
==
0
[
L
res
]
=
fminsearch
(
@
(
Li
)
find_Q_nat
(
z_amont
,
ks
,
D
,
h
,
Cd
,
S
,
Li
,
pf
,
C
,
Q
,
sigma
),
10
,
optimset
(
'MaxIter'
,
maxiter
,
'MaxFunEvals'
,
maxfun
,
'Tolfun'
,
tolfun
,
'TolX'
,
tolx
))
set
(
handles
.
edit7
,
'string'
,
num2str
(
L
))
elseif
S
==
0
S0
=
0.1
;
[
S
res
]
=
fminsearch
(
@
(
Si
)
find_Q_nat
(
z_amont
,
ks
,
D
,
h
,
Cd
,
Si
,
L
,
pf
,
C
,
Q
,
sigma
),
S0
,
optimset
(
'MaxIter'
,
maxiter
,
'MaxFunEvals'
,
maxfun
,
'Tolfun'
,
tolfun
,
'TolX'
,
tolx
))
set
(
handles
.
edit6
,
'string'
,
num2str
(
S
))
elseif
C
==
0
C0
=
0.1
;
[
C
res
]
=
fminsearch
(
@
(
Ci
)
find_Q_nat
(
z_amont
,
ks
,
D
,
h
,
Cd
,
S
,
L
,
pf
,
Ci
,
Q
,
sigma
),
C0
,
optimset
(
'MaxIter'
,
maxiter
,
'MaxFunEvals'
,
maxfun
,
'Tolfun'
,
tolfun
,
'TolX'
,
tolx
))
set
(
handles
.
edit9
,
'string'
,
num2str
(
C
))
end
...
...
@@ -606,7 +606,7 @@ end
set
(
handles
.
edit16
,
'string'
,
num2str
(
Vmax
))
P
=
1000
*
g
*
Q
/
L
*
S
;
P
=
1000
*
g
*
Vdeb
*
S
;
set
(
handles
.
edit13
,
'string'
,
num2str
(
P
))
...
...
@@ -823,89 +823,89 @@ if Q~=0 & pf~=0 & L~=0 & S~=0 & C~=0
end
for
tt
=
1
:
length
(
para
)
if
D
==
0
N
=
0
;
q0
=
(
2
*
g
.*
S
.*
para
(
tt
)
.*
(
1
-
(
sigma
*
C
))
.
/(
Cd
.*
C
.*
(
1
+
N
)))
.^
0.5
*
pf
*
L
;
[
Qr
(
tt
)
res
]
=
fminsearch
(
@
(
Qi
)
find_Q_nat
(
z_amont
,
ks
,
para
(
tt
),
h
,
Cd
,
S
,
L
,
pf
,
C
,
Qi
,
sigma
),
q0
,
optimset
(
'MaxIter'
,
maxiter
,
'MaxFunEvals'
,
maxfun
,
'Tolfun'
,
tolfun
,
'TolX'
,
tolx
))
;
Vdeb
(
tt
)
=
Qr
(
tt
)/
L
/
pf
;
Vg
(
tt
)
=
Qr
(
tt
)/
L
/
pf
/(
1
-
C
^
0.5
);
Fr
(
tt
)
=
Vg
(
tt
)
.
/(
g
.*
pf
)
.^
0.5
;
Strickler
(
tt
)
=
Qr
(
tt
)
/(
pf
*
L
*
(
pf
)
^
(
2
/
3
)
*
S
^
(
1
/
2
));
elseif
Q
==
0
N
=
0
;
[
pf2
(
tt
)
res
]
=
fminsearch
(
@
(
pfi
)
find_Q_nat
(
z_amont
,
ks
,
D
,
h
,
Cd
,
S
,
L
,
pfi
,
C
,
para
(
tt
),
sigma
),
pf
,
optimset
(
'MaxIter'
,
maxiter
,
'MaxFunEvals'
,
maxfun
,
'Tolfun'
,
tolfun
,
'TolX'
,
tolx
));
Vdeb
(
tt
)
=
para
(
tt
)/
L
/
pf2
(
tt
);
Vg
(
tt
)
=
para
(
tt
)/
L
/
pf2
(
tt
)/(
1
-
C
^
0.5
);
Fr
(
tt
)
=
Vg
(
tt
)
.
/(
g
.*
pf2
(
tt
))
.^
0.5
;
Strickler
(
tt
)
=
para
(
tt
)
/(
pf2
(
tt
)
*
L
*
pf2
(
tt
)
^
(
2
/
3
)
*
S
^
(
1
/
2
));
elseif
pf
==
0
N
=
0
;
q0
=
(
2
*
g
.*
S
.*
D
.*
(
1
-
(
sigma
*
C
))
.
/(
Cd
.*
C
.*
(
1
+
N
)))
.^
0.5
*
para
(
tt
)
*
L
;
[
Qr
(
tt
)
res
]
=
fminsearch
(
@
(
Qi
)
find_Q_nat
(
z_amont
,
ks
,
D
,
h
,
Cd
,
S
,
L
,
para
(
tt
),
C
,
Qi
,
sigma
),
q0
,
optimset
(
'MaxIter'
,
maxiter
,
'MaxFunEvals'
,
maxfun
,
'Tolfun'
,
tolfun
,
'TolX'
,
tolx
));
Vdeb
(
tt
)
=
Qr
(
tt
)/
L
/
para
(
tt
);
Vg
(
tt
)
=
Qr
(
tt
)/
L
/
para
(
tt
)/(
1
-
C
^
0.5
);
Fr
(
tt
)
=
Vg
(
tt
)
.
/(
g
.*
para
(
tt
))
.^
0.5
;
Strickler
(
tt
)
=
Qr
(
tt
)
/(
para
(
tt
)
*
L
*
para
(
tt
)
^
(
2
/
3
)
*
S
^
(
1
/
2
));
elseif
L
==
0
N
=
0
;
q0
=
(
2
*
g
.*
S
.*
D
.*
(
1
-
(
sigma
*
C
))
.
/(
Cd
.*
C
.*
(
1
+
N
)))
.^
0.5
*
pf
*
para
(
tt
);
[
Qr
(
tt
)
res
]
=
fminsearch
(
@
(
Qi
)
find_Q_nat
(
z_amont
,
ks
,
D
,
h
,
Cd
,
S
,
para
(
tt
),
pf
,
C
,
Qi
,
sigma
),
q0
,
optimset
(
'MaxIter'
,
maxiter
,
'MaxFunEvals'
,
maxfun
,
'Tolfun'
,
tolfun
,
'TolX'
,
tolx
));
Vdeb
(
tt
)
=
Qr
(
tt
)/
para
(
tt
)/
pf
;
Vg
(
tt
)
=
Qr
(
tt
)/
para
(
tt
)/
pf
/(
1
-
C
^
0.5
);
Fr
(
tt
)
=
Vg
(
tt
)
.
/(
g
.*
pf
)
.^
0.5
;
Strickler
(
tt
)
=
Qr
(
tt
)
/(
pf
*
para
(
tt
)
*
pf
^
(
2
/
3
)
*
S
^
(
1
/
2
));
elseif
S
==
0
S0
=
0.1
;
N
=
0
;
q0
=
(
2
*
g
.*
para
(
tt
)
.*
D
.*
(
1
-
(
sigma
*
C
))
.
/(
Cd
.*
C
.*
(
1
+
N
)))
.^
0.5
*
pf
*
L
;
[
Qr
(
tt
)
res
]
=
fminsearch
(
@
(
Qi
)
find_Q_nat
(
z_amont
,
ks
,
D
,
h
,
Cd
,
para
(
tt
),
L
,
pf
,
C
,
Qi
,
sigma
),
q0
,
optimset
(
'MaxIter'
,
maxiter
,
'MaxFunEvals'
,
maxfun
,
'Tolfun'
,
tolfun
,
'TolX'
,
tolx
));
Vdeb
(
tt
)
=
Qr
(
tt
)/
L
/
pf
;
Vg
(
tt
)
=
Qr
(
tt
)/
L
/
pf
/(
1
-
C
^
0.5
);
Fr
(
tt
)
=
Vg
(
tt
)
.
/(
g
.*
pf
)
.^
0.5
;
Strickler
(
tt
)
=
Qr
(
tt
)
/(
pf
*
L
*
pf
^
(
2
/
3
)
*
para
(
tt
)
^
(
1
/
2
));
elseif
C
==
0
N
=
0
;
q0
=
(
2
*
g
.*
S
.*
D
.*
(
1
-
(
sigma
*
para
(
tt
)))
.
/(
Cd
.*
para
(
tt
)
.*
(
1
+
N
)))
.^
0.5
*
pf
*
L
;
[
Qr
(
tt
)
res
]
=
fminsearch
(
@
(
Qi
)
find_Q_nat
(
z_amont
,
ks
,
D
,
h
,
Cd
,
S
,
L
,
pf
,
para
(
tt
),
Qi
,
sigma
),
q0
,
optimset
(
'MaxIter'
,
maxiter
,
'MaxFunEvals'
,
maxfun
,
'Tolfun'
,
tolfun
,
'TolX'
,
tolx
))
;
Vdeb
(
tt
)
=
Qr
(
tt
)/
L
/
pf
;
Vg
(
tt
)
=
Qr
(
tt
)/
L
/
pf
/(
1
-
para
(
tt
)
^
0.5
);
Fr
(
tt
)
=
Vg
(
tt
)
.
/(
g
.*
pf
)
.^
0.5
;
Strickler
(
tt
)
=
Qr
(
tt
)
/(
pf
*
L
*
(
pf
)
^
(
2
/
3
)
*
S
^
(
1
/
2
));
end
if
Cd
==
2
Vmax
(
tt
)
=
Vg
(
tt
)
.*
(
min
(
1.6
.
/(
1
-
(
Fr
(
tt
)
.^
2
)/
4
),
Fr
(
tt
)
.^
(
-
2
/
3
)));
%
else
Vmax
(
tt
)
=
Vg
(
tt
)
.*
(
min
(
1.2
.
/(
1
-
(
Fr
(
tt
)
.^
2
)/
4
),
Fr
(
tt
)
.^
(
-
2
/
3
)));
end
end
...
...
@@ -920,14 +920,14 @@ plot(para,Vdeb,'k-.','LineWidth',2)
if
D
==
0
xlabel
(
'Diametre (m)'
,
'Interpreter'
,
'Latex'
,
'FontSize'
,
24
)
elseif
Q
==
0
xlabel
(
'Débit (m2/s)'
,
'Interpreter'
,
'Latex'
,
'FontSize'
,
24
)
xlabel
(
'D
�
bit (m2/s)'
,
'Interpreter'
,
'Latex'
,
'FontSize'
,
24
)
elseif
pf
==
0
xlabel
(
'Profondeur'
,
'Interpreter'
,
'Latex'
,
'FontSize'
,
24
)
elseif
L
==
0
xlabel
(
'Largeur'
,
'Interpreter'
,
'Latex'
,
'FontSize'
,
24
)
elseif
S
==
0
xlabel
(
'Pente'
,
'Interpreter'
,
'Latex'
,
'FontSize'
,
24
)
elseif
C
==
0
xlabel
(
'Concentration'
,
'Interpreter'
,
'Latex'
,
'FontSize'
,
24
)
end
...
...
@@ -949,14 +949,14 @@ end
if
D
==
0
xlabel
(
'Diametre (m)'
,
'Interpreter'
,
'Latex'
,
'FontSize'
,
24
)
elseif
Q
==
0
xlabel
(
'Débit (m3/s)'
,
'Interpreter'
,
'Latex'
,
'FontSize'
,
24
)
xlabel
(
'D
�
bit (m3/s)'
,
'Interpreter'
,
'Latex'
,
'FontSize'
,
24
)
elseif
pf
==
0
xlabel
(
'profondeur'
,
'Interpreter'
,
'Latex'
,
'FontSize'
,
24
)
elseif
L
==
0
xlabel
(
'Largeur'
,
'Interpreter'
,
'Latex'
,
'FontSize'
,
24
)
elseif
S
==
0
xlabel
(
'Pente'
,
'Interpreter'
,
'Latex'
,
'FontSize'
,
24
)
elseif
C
==
0
xlabel
(
'Concentration'
,
'Interpreter'
,
'Latex'
,
'FontSize'
,
24
)
end
...
...
@@ -965,10 +965,10 @@ end
if
Q
==
0
ylabel
(
'Profondeur (m)'
,
'Interpreter'
,
'Latex'
,
'FontSize'
,
24
)
else
ylabel
(
'Débit (m3/s)'
,
'Interpreter'
,
'Latex'
,
'FontSize'
,
24
)
ylabel
(
'D
�
bit (m3/s)'
,
'Interpreter'
,
'Latex'
,
'FontSize'
,
24
)
end
%hleng=legend('Débit (m^2/s)');
%hleng=legend('D
�
bit (m^2/s)');
%set(hleng, 'FontName','Times New Roman','FontSize',20)
set
(
gca
,
'FontSize'
,
14
,
'fontName'
,
'Times'
);
...
...
@@ -983,14 +983,14 @@ end
if
D
==
0
xlabel
(
'Diametre (m)'
,
'Interpreter'
,
'Latex'
,
'FontSize'
,
24
)
elseif
Q
==
0
xlabel
(
'Débit (m3/s)'
,
'Interpreter'
,
'Latex'
,
'FontSize'
,
24
)
xlabel
(
'D
�
bit (m3/s)'
,
'Interpreter'
,
'Latex'
,
'FontSize'
,
24
)
elseif
pf
==
0
xlabel
(
'profondeur'
,
'Interpreter'
,
'Latex'
,
'FontSize'
,
24
)
elseif
L
==
0
xlabel
(
'Largeur'
,
'Interpreter'
,
'Latex'
,
'FontSize'
,
24
)
elseif
S
==
0
xlabel
(
'Pente'
,
'Interpreter'
,
'Latex'
,
'FontSize'
,
24
)
elseif
C
==
0
xlabel
(
'Concentration'
,
'Interpreter'
,
'Latex'
,
'FontSize'
,
24
)
end
...
...
@@ -999,7 +999,7 @@ end
ylabel
(
'Strcikler'
,
'Interpreter'
,
'Latex'
,
'FontSize'
,
24
)
%hleng=legend('Débit (m^2/s)');
%hleng=legend('D
�
bit (m^2/s)');
%set(hleng, 'FontName','Times New Roman','FontSize',20)
set
(
gca
,
'FontSize'
,
14
,
'fontName'
,
'Times'
);
...
...
doc/scilab_tests/macrorugo_resultats_complementaires.sci
View file @
3313b562
...
...
@@ -12,7 +12,7 @@ function macrorugo_resultComp(z_amont, S, long, Q, L, pf, C, Cd, h, D)
Fr=Vg./(g.*pf).^0.5;
print_r("Fr");
P=1000*g*
Q/L
*S;
P=1000*g*
Vdeb
*S;
print_r("P");
if pf/h<1
...
...
spec/macrorugo/macrorugo.spec.ts
View file @
3313b562
...
...
@@ -48,7 +48,7 @@ function macroRugoInstanceEmergentCd15(): MacroRugo {
const
macroRugoExtraResultEmergentCd15
:
{
[
key
:
string
]:
number
|
MacroRugoFlowType
}
=
{
ENUM_MacroRugoFlowType
:
MacroRugoFlowType
.
EMERGENT
,
Fr
:
0.530425
,
PV
:
242.174003
,
PV
:
403.623339
,
Vdeb
:
0.822881
,
Vmax
:
1.799502
,
Strickler
:
5.173107
,
...
...
@@ -89,7 +89,7 @@ function macroRugoInstanceEmergentCd2(): MacroRugo {
const
macroRugoExtraResultEmergentCd2
:
{
[
key
:
string
]:
number
|
MacroRugoFlowType
}
=
{
ENUM_MacroRugoFlowType
:
MacroRugoFlowType
.
EMERGENT
,
Fr
:
0.404817
,
PV
:
184.825731
,
PV
:
308.042886
,
Vdeb
:
0.628018
,
Vmax
:
1.536129
,
Strickler
:
3.948084
,
...
...
@@ -128,7 +128,7 @@ function macroRugoInstanceSubmerged(): MacroRugo {
const
macroRugoExtraResultSubmerged
:
{
[
key
:
string
]:
number
|
MacroRugoFlowType
}
=
{
ENUM_MacroRugoFlowType
:
MacroRugoFlowType
.
SUBMERGED
,
Fr
:
0.776130
,
PV
:
545.564782
,
PV
:
681.955977
,
Vdeb
:
1.390328
,
Strickler
:
7.215044
,
ZF2
:
12.2
...
...
src/macrorugo/macrorugo.ts
View file @
3313b562
...
...
@@ -117,7 +117,7 @@ export class MacroRugo extends FishPass {
}
r
.
resultElement
.
values
.
Vmax
=
resVmax
;
// Puissance dissipée
r
.
resultElement
.
values
.
PV
=
1000
*
MacroRugo
.
g
*
this
.
prms
.
Q
.
V
/
this
.
prms
.
B
.
v
*
this
.
prms
.
If
.
v
;
r
.
resultElement
.
values
.
PV
=
1000
*
MacroRugo
.
g
*
r
.
resultElement
.
values
.
Vdeb
*
this
.
prms
.
If
.
v
;
// Type d'écoulement
if
(
this
.
prms
.
Y
.
v
/
this
.
prms
.
PBH
.
v
<
1
)
{
r
.
resultElement
.
values
.
ENUM_MacroRugoFlowType
=
MacroRugoFlowType
.
EMERGENT
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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