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
9af01069
Commit
9af01069
authored
Feb 17, 2021
by
Dorchies David
Browse files
feat(macrorugo): Add intermediate parameter Cx for handling changes of Cd0 transparently
Fix
#291
parent
9d4dc05b
Changes
6
Hide whitespace changes
Inline
Side-by-side
doc/scilab_tests/macrorugo_resultats_complementaires.sci
View file @
9af01069
...
...
@@ -35,7 +35,11 @@ function macrorugo_resultComp(z_amont, S, long, Q, L, pf, C, Cd0, h, D)
q_technique=0.815*(pf/D)^1.45*S^0.557*C^(-0.456)*(9.81*D)^0.5.*D*L;
V_technique=4.54*(pf/D)^0.32*S^0.56*(9.81*D)^0.5;
end
coeff_contraction = (Cd0 * 0.4 + 1.21) / 1.5;
if Cd0 > 2
coeff_contraction=1.5;
else
coeff_contraction=1.1;
end
Vmax=Vg.*coeff_contraction*calcfFr(Fr);
print_r("Vmax");
print_r("V_technique");
...
...
doc/scilab_tests/main_macrorugo.sce
View file @
9af01069
...
...
@@ -16,43 +16,43 @@ z_amont = 12.5; // Cote amont (m)
long = 6; // Longueur rampe (m)
// *****************************************************************************
printf("\n*** Emergent conditions Cd=1.1***\n")
printf("\n*** Emergent conditions Cd=1.1
003
***\n")
// *****************************************************************************
h = 0.6
k = 0.7
Cd0 = 1.1 // Forme ronde
Cd0 = 1.1
003
// Forme ronde
macrorugo_searchQ(ks, D, k, Cd0, S, B, h, C, z_amont, long, bDbg)
// *****************************************************************************
printf("\n*** Emergent conditions Cd=2.
6
***\n")
printf("\n*** Emergent conditions Cd=2.
592
***\n")
// *****************************************************************************
h = 0.6
k = 0.7
Cd0 = 2.
6
// Forme plane
Cd0 = 2.
592
// Forme plane
macrorugo_searchQ(ks, D, k, Cd0, S, B, h, C, z_amont, long, bDbg)
// *****************************************************************************
printf("\n*** Submerged conditions Cd=1.1***\n")
printf("\n*** Submerged conditions Cd=1.1
003
***\n")
// *****************************************************************************
k = 0.7
h = 0.8
Cd0 = 1.1 // Forme ronde
Cd0 = 1.1
003
// Forme ronde
C = 0.13
macrorugo_searchQ(ks, D, k, Cd0, S, B, h, C, z_amont, long, bDbg)
// *****************************************************************************
printf("\n*** JalHyd #85 ***\n")
// *****************************************************************************
Cd0 = 1.1
Cd0 = 1.1
003
k = 0.8
C = 0.2; // Concentration
Q = []
for h = 0.7:0.1:1.2
Q = [Q, macrorugo_searchQ(ks, D, k, Cd0, S, B, h, C, z_amont, long, bDbg)]
end
disp Q
print_r("Q")
macrorugo_searchQ(ks, D, 0.5, 2.
6
, S, 2, 0.85, C, z_amont, long, bDbg)
macrorugo_searchQ(ks, D, 0.5, 2.
592
, S, 2, 0.85, C, z_amont, long, bDbg)
// *****************************************************************************
printf("\n*** JalHyd #144 ***\n")
...
...
doc/scilab_tests/print_r.sci
View file @
9af01069
...
...
@@ -10,7 +10,7 @@ function print_r(s)
if size(e,2) > 1 then
e = e'
end
printf("%f ",e)
printf("%f
,
",e)
printf("]\n")
else
printf("%s: %"+pat+",\n",s,e);
...
...
spec/macrorugo/macrorugo.spec.ts
View file @
9af01069
...
...
@@ -4,152 +4,152 @@ import { MacrorugoParams } from "../../src/macrorugo/macrorugo_params";
import
{
checkResult
}
from
"
../test_func
"
;
/*
**
*
Emergent conditions Cd=1.1***
** Emergent conditions Cd=1.1
003
***
*** INPUT ***
ks
=
0.010000
D
=
0.500000
ks
:
0.010000
,
D
:
0.500000
,
k = 0.700000
Cd0
=
1.10000
0
S
=
0.050000
B
=
1.000000
h
=
0.600000
C
=
0.130000
Cd0
:
1.100
3
00
,
S
:
0.050000
,
B
:
1.000000
,
h
:
0.600000
,
C
:
0.130000
,
RESULTS:
find_Q_nat(1.052
971
)=0.600
890
Q=0.692
437
fVal=0.000000
cote_bas =
12.200000
Vdeb
=
1.15
4061
Vg: 1.804
786
,
Fr
=
0.743
902
P
=
566.0
66964
flowcond
=
emergent
Vmax
=
2.673
954
V_technique
=
1.991299
q_technique
=
0.561860
Strickler
=
7.25
5093
find_Q_nat(1.052
827
)=0.600
769
Q=0.692
366
fVal=0.000000
ZF2:
12.200000
,
Vdeb
:
1.15
3943,
Vg: 1.804
601
,
Fr
:
0.743
826,
P
V:
566.0
09124,
flowcond
:
emergent
,
Vmax
:
2.673
506,
V_technique
:
1.991299
,
q_technique
:
0.561860
,
Strickler
:
7.25
4351,
*/
function
macroRugoInstanceEmergentCd1
1
():
MacroRugo
{
function
macroRugoInstanceEmergentCd1
():
MacroRugo
{
return
new
MacroRugo
(
new
MacrorugoParams
(
12.5
,
// ZF1
6
,
// L
1
,
// B
0.05
,
// If
0.692
437
,
// Q
0.692
366
,
// Q
0.6
,
// h
0.01
,
// Ks
0.13
,
// C
0.5
,
// D
0.7
,
// k
1
.1
// Cd0
1
// Cd0
)
);
}
const
macroRugoExtraResultEmergentCd1
1
:
{
[
key
:
string
]:
number
|
MacroRugoFlowType
}
=
{
const
macroRugoExtraResultEmergentCd1
:
{
[
key
:
string
]:
number
|
MacroRugoFlowType
}
=
{
ENUM_MacroRugoFlowType
:
MacroRugoFlowType
.
EMERGENT
,
ZF2
:
12.200000
,
Vdeb
:
1.15
4061
,
Vg
:
1.804
786
,
Fr
:
0.743
902
,
PV
:
566.0
6696
4
,
Vmax
:
2.673
954
,
Strickler
:
7.25
5093
Vdeb
:
1.15
3943
,
Vg
:
1.804
601
,
Fr
:
0.743
826
,
PV
:
566.0
0912
4
,
Vmax
:
2.673
506
,
Strickler
:
7.25
4351
};
/*
** Emergent conditions Cd=2.
6
***
** Emergent conditions Cd=2.
592
***
*** INPUT ***
ks: 0.010000,
D: 0.500000,
k = 0.700000
Cd0: 2.
600
000,
Cd0: 2.
592
000,
S: 0.050000,
B: 1.000000,
h: 0.600000,
C: 0.130000,
RESULTS:
find_Q_nat(0.67
417
4)=0.32
0793
Q=0.48
1698
fVal=0.000000
find_Q_nat(0.67
521
4)=0.32
1449
Q=0.48
2344
fVal=0.000000
ZF2: 12.200000,
Vdeb: 0.80
2831
,
Vg: 1.25
5512
,
Fr: 0.51
7500
,
PV: 39
3.788411
,
Vdeb: 0.80
3907
,
Vg: 1.25
7195
,
Fr: 0.51
8194
,
PV: 39
4.316317
,
flowcond: emergent,
Vmax: 2.16
3235
,
Vmax: 2.16
6970
,
V_technique: 1.991299,
q_technique: 0.561860,
Strickler: 5.0
47056
Strickler: 5.0
53822
*/
function
macroRugoInstanceEmergentCd2
6
():
MacroRugo
{
const
nub
:
MacroRugo
=
macroRugoInstanceEmergentCd1
1
();
nub
.
prms
.
Cd0
.
singleValue
=
2
.6
;
function
macroRugoInstanceEmergentCd2
():
MacroRugo
{
const
nub
:
MacroRugo
=
macroRugoInstanceEmergentCd1
();
nub
.
prms
.
Cd0
.
singleValue
=
2
;
nub
.
prms
.
Q
.
singleValue
=
0.481698
;
return
nub
;
}
const
macroRugoExtraResultEmergentCd2
6
:
{
[
key
:
string
]:
number
|
MacroRugoFlowType
}
=
{
const
macroRugoExtraResultEmergentCd2
:
{
[
key
:
string
]:
number
|
MacroRugoFlowType
}
=
{
ENUM_MacroRugoFlowType
:
MacroRugoFlowType
.
EMERGENT
,
ZF2
:
12.200000
,
Vdeb
:
0.80
2831
,
Vg
:
1.25
5512
,
Fr
:
0.51
7500
,
PV
:
39
3.788411
,
Vmax
:
2.16
3235
,
Strickler
:
5.0
47056
Vdeb
:
0.80
3907
,
Vg
:
1.25
7195
,
Fr
:
0.51
8194
,
PV
:
39
4.316317
,
Vmax
:
2.16
6970
,
Strickler
:
5.0
53822
};
/*
**
*
Submerged conditions Cd=1.1***
** Submerged conditions Cd=1.1
003
***
*** INPUT ***
ks: 0.010000,
D: 0.500000,
k = 0.700000
Cd0: 1.100
0
00,
Cd0: 1.100
3
00,
S: 0.050000,
B: 1.000000,
h: 0.800000,
C: 0.130000,
RESULTS:
find_Q_nat(1.403
961
)=0.14344
5
Q=1.289
205
fVal=0.000000
find_Q_nat(1.403
770
)=0.1434
1
4
Q=1.289
038
fVal=0.000000
ZF2: 12.200000,
Vdeb: 1.611
506
,
Vg: 2.5
20165
,
Fr: 0.899
600
,
PV: 790.
443862
,
Vdeb: 1.611
298
,
Vg: 2.5
19839
,
Fr: 0.899
484
,
PV: 790.
341606
,
flowcond: immerge,
q_technique: 0.940450,
Strickler: 8.36
2838
Strickler: 8.36
1756
*/
function
macroRugoInstanceSubmerged
():
MacroRugo
{
const
nub
:
MacroRugo
=
macroRugoInstanceEmergentCd1
1
();
const
nub
:
MacroRugo
=
macroRugoInstanceEmergentCd1
();
nub
.
prms
.
Y
.
singleValue
=
0.8
;
nub
.
prms
.
Q
.
singleValue
=
1.289
205
;
nub
.
prms
.
Q
.
singleValue
=
1.289
038
;
return
nub
;
}
const
macroRugoExtraResultSubmerged
:
{
[
key
:
string
]:
number
|
MacroRugoFlowType
}
=
{
ENUM_MacroRugoFlowType
:
MacroRugoFlowType
.
SUBMERGED
,
ZF2
:
12.200000
,
Vdeb
:
1.611
506
,
PV
:
790.
443862
,
Strickler
:
8.36
2838
Vdeb
:
1.611
298
,
PV
:
790.
341606
,
Strickler
:
8.36
1756
};
function
MacroRugoFactory
(
sInstance
:
string
):
MacroRugo
{
let
nub
:
MacroRugo
;
switch
(
sInstance
)
{
case
"
EmergentCd1
1
"
:
{
nub
=
macroRugoInstanceEmergentCd1
1
();
case
"
EmergentCd1
"
:
{
nub
=
macroRugoInstanceEmergentCd1
();
break
;
}
case
"
EmergentCd2
6
"
:
{
nub
=
macroRugoInstanceEmergentCd2
6
();
case
"
EmergentCd2
"
:
{
nub
=
macroRugoInstanceEmergentCd2
();
break
;
}
case
"
Submerged
"
:
{
...
...
@@ -206,7 +206,7 @@ function testMacroRugoConfig(sInstance: string, Q0: number, fVal0: number, mrExt
}
function
macroRugoInstanceJalHyd85
():
MacroRugo
{
const
nubMR
=
macroRugoInstanceEmergentCd1
1
();
const
nubMR
=
macroRugoInstanceEmergentCd1
();
nubMR
.
prms
.
C
.
singleValue
=
0.2
;
nubMR
.
prms
.
PBH
.
singleValue
=
0.8
;
nubMR
.
calculatedParam
=
nubMR
.
prms
.
Q
;
...
...
@@ -215,8 +215,8 @@ function macroRugoInstanceJalHyd85(): MacroRugo {
describe
(
"
Class MacroRugo:
"
,
()
=>
{
testMacroRugoConfig
(
"
EmergentCd1
1
"
,
1.052
971
,
0.600
890
,
macroRugoExtraResultEmergentCd1
1
);
testMacroRugoConfig
(
"
EmergentCd2
6
"
,
0.67
417
4
,
0.32
0793
,
macroRugoExtraResultEmergentCd2
6
);
testMacroRugoConfig
(
"
EmergentCd1
"
,
1.052
827
,
0.600
769
,
macroRugoExtraResultEmergentCd1
);
testMacroRugoConfig
(
"
EmergentCd2
"
,
0.67
521
4
,
0.32
1449
,
macroRugoExtraResultEmergentCd2
);
// Le test passe en debug mais pas sous Jasmine !??
// describe(`Condition Submerged` , () => {
// it(`resolveAlpha_t(0.07) should be 0.074752`, () => {
...
...
@@ -224,7 +224,7 @@ describe("Class MacroRugo: ", () => {
// expect(macroRugoInstanceSubmerged()["resolveAlpha_t"](0.07)).toBeCloseTo(0.074752, 5);
// });
// });
testMacroRugoConfig
(
"
Submerged
"
,
1.403
961
,
0.14344
5
,
macroRugoExtraResultSubmerged
);
testMacroRugoConfig
(
"
Submerged
"
,
1.403
770
,
0.1434
1
4
,
macroRugoExtraResultSubmerged
);
describe
(
"
JalHyd #85
"
,
()
=>
{
it
(
"
CalcSerie Q should return the good result :)
"
,
()
=>
{
...
...
@@ -232,7 +232,7 @@ describe("Class MacroRugo: ", () => {
const
nubMR2
=
macroRugoInstanceJalHyd85
();
nubMR
.
prms
.
Y
.
setValues
(
0.7
,
1.2
,
0.1
);
const
aQ
:
number
[]
=
[
0.688
5501
,
0.824
4762
,
1.16639
25
,
1.47
60379
,
1.850
6109
,
2.288
3764
];
const
aQ
:
number
[]
=
[
0.688
476
,
0.824
387
,
1.166
2
39
,
1.47
5853
,
1.850
393
,
2.288
123
];
nubMR
.
CalcSerie
();
for
(
let
i
=
0
;
i
<
aQ
.
length
;
i
++
)
{
...
...
src/macrorugo/macrorugo.ts
View file @
9af01069
...
...
@@ -158,7 +158,7 @@ export class MacroRugo extends FishPass {
public
Equation
(
sVarCalc
:
string
):
Result
{
const
Q
=
this
.
prms
.
Q
.
v
;
const
q0
=
Math
.
sqrt
(
2
*
MacroRugo
.
g
*
this
.
prms
.
If
.
v
*
this
.
prms
.
PBD
.
v
*
(
1
-
(
this
.
sigma
*
this
.
prms
.
C
.
v
))
/
(
this
.
prms
.
Cd0
.
v
*
this
.
prms
.
C
.
v
))
*
this
.
prms
.
Y
.
v
*
this
.
prms
.
B
.
v
;
(
this
.
Cx
*
this
.
prms
.
C
.
v
))
*
this
.
prms
.
Y
.
v
*
this
.
prms
.
B
.
v
;
let
r
:
Result
;
if
(
q0
>
0
)
{
this
.
setFlowType
();
...
...
@@ -299,12 +299,23 @@ export class MacroRugo extends FishPass {
}
}
/**
* Interpolation of Cd0 for Cd from calibrated Cd0 (See #291)
* Cx = 1.1 for Cd0 = 1 and Cx = 2.592 for Cd0 = 2
*/
private
get
Cx
():
number
{
if
(
this
.
_cache
.
Cx
===
undefined
)
{
this
.
_cache
.
Cx
=
this
.
prms
.
Cd0
.
v
*
1.4917
-
0.3914
;
}
return
this
.
_cache
.
Cx
;
}
/**
* Calculation of Cd : drag coefficient of a block under the actual flow conditions
*/
private
get
Cd
():
number
{
if
(
this
.
_cache
.
Cd
===
undefined
)
{
this
.
_cache
.
Cd
=
this
.
prms
.
Cd0
.
v
*
Math
.
min
(
3
,
(
1
+
1
/
Math
.
pow
(
this
.
prms
.
Y
.
v
/
this
.
prms
.
PBD
.
v
,
2
)));
this
.
_cache
.
Cd
=
this
.
Cx
*
Math
.
min
(
3
,
(
1
+
1
/
Math
.
pow
(
this
.
prms
.
Y
.
v
/
this
.
prms
.
PBD
.
v
,
2
)));
}
return
this
.
_cache
.
Cd
;
}
...
...
@@ -440,7 +451,7 @@ export class MacroRugo extends FishPass {
*/
private
get
r
():
number
{
if
(
this
.
_cache
.
r
===
undefined
)
{
this
.
_cache
.
r
=
(
this
.
prms
.
Cd0
.
v
*
0.
4
+
1.21
)
/
1.5
;
this
.
_cache
.
r
=
0.4
*
this
.
prms
.
Cd0
.
v
+
0.
7
;
}
return
this
.
_cache
.
r
;
}
...
...
src/session.ts
View file @
9af01069
...
...
@@ -475,7 +475,7 @@ export class Session {
0.13
,
// C
0.4
,
// D
0.4
,
// k
1
.2
// Cd0
1
// Cd0
),
dbg
);
break
;
...
...
@@ -539,7 +539,7 @@ export class Session {
0.13
,
// C
0.4
,
// D
0.4
,
// k
1
.2
// Cd0
1
// Cd0
),
dbg
);
break
;
...
...
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