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
add1c5e2
Commit
add1c5e2
authored
Oct 01, 2020
by
Dorchies David
Browse files
fix(PreBarrage): wrong discharge distribution for small headlosses
Refs
#279
parent
91f31349
Changes
2
Hide whitespace changes
Inline
Side-by-side
spec/pre_barrage/prebarrage_jalhyd279.spec.ts
0 → 100644
View file @
add1c5e2
import
{
PreBarrage
,
Session
}
from
"
../../src/index
"
;
import
{
checkResultConsistency
}
from
"
../test_func
"
;
describe
(
"
PreBarrage
"
,
()
=>
{
describe
(
"
jalhyd#279
"
,
()
=>
{
it
(
"
Discharge in first bassin should be greater than 0.4
"
,
()
=>
{
// tslint:disable-next-line:max-line-length
const
sessionJson
=
`{"header":{"source":"jalhyd","format_version":"1.3","created":"2020-10-01T06:43:50.495Z"},"settings":{"precision":1e-7,"maxIterations":100,"displayPrecision":3},"documentation":"","session":[{"uid":"cG9yaG","props":{"calcType":"PreBarrage"},"meta":{"title":"Prébarrages"},"children":[{"uid":"c29nYW","props":{"calcType":"PbBassin"},"children":[],"parameters":[{"symbol":"S","mode":"SINGLE","value":13.8},{"symbol":"ZF","mode":"SINGLE","value":95}]},{"uid":"ajB2cn","props":{"calcType":"PbCloison","upstreamBasin":"","downstreamBasin":"c29nYW"},"children":[{"uid":"dGtvMW","props":{"calcType":"Structure","loiDebit":"WeirCunge80","structureType":"SeuilRectangulaire"},"children":[],"parameters":[{"symbol":"ZDV","mode":"SINGLE","value":95.3},{"symbol":"L","mode":"SINGLE","value":0.4},{"symbol":"CdCunge","mode":"SINGLE","value":1}]}],"parameters":[]},{"uid":"a2t5eG","props":{"calcType":"PbCloison","upstreamBasin":"c29nYW","downstreamBasin":""},"children":[{"uid":"enJhZT","props":{"calcType":"Structure","loiDebit":"WeirCunge80","structureType":"SeuilRectangulaire"},"children":[],"parameters":[{"symbol":"ZDV","mode":"SINGLE","value":95.3},{"symbol":"L","mode":"SINGLE","value":0.4},{"symbol":"CdCunge","mode":"SINGLE","value":1}]}],"parameters":[]},{"uid":"ODUxdn","props":{"calcType":"PbCloison","upstreamBasin":"","downstreamBasin":""},"children":[{"uid":"YWFqdm","props":{"calcType":"Structure","loiDebit":"WeirCunge80","structureType":"SeuilRectangulaire"},"children":[],"parameters":[{"symbol":"ZDV","mode":"SINGLE","value":95.3},{"symbol":"L","mode":"SINGLE","value":0.4},{"symbol":"CdCunge","mode":"SINGLE","value":1}]}],"parameters":[]}],"parameters":[{"symbol":"Q","mode":"SINGLE","value":1},{"symbol":"Z1","mode":"CALCUL"},{"symbol":"Z2","mode":"SINGLE","value":100}]}]}`
;
Session
.
getInstance
().
unserialise
(
sessionJson
);
const
nub
=
Session
.
getInstance
().
findNubByUid
(
"
cG9yaG
"
)
as
PreBarrage
;
// nub.DBG = true;
nub
.
CalcSerie
();
expect
(
nub
.
bassins
[
0
].
result
.
values
.
Q
).
toBeGreaterThan
(
0.4
);
});
});
});
src/prebarrage/pre_barrage.ts
View file @
add1c5e2
...
...
@@ -533,7 +533,7 @@ export class PreBarrage extends Nub {
// Calculation of repartition regarding actual water elevations
let
QT2
:
number
=
0
;
for
(
const
c
of
cloisons
)
{
c
.
prms
.
Q
.
initValue
=
c
.
prms
.
Q
.
v
;
c
.
prms
.
Q
.
initValue
=
Math
.
max
(
0
,
c
.
prms
.
Q
.
v
)
;
c
.
Calc
(
"
Q
"
);
// Relax! On ne prend pas toute la modification proposée !
if
(
c
.
prms
.
Q
.
v
>
0
)
{
...
...
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