Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jalhyd
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Cassiopée
jalhyd
Commits
bc2933e7
Commit
bc2933e7
authored
5 years ago
by
Dorchies David
Browse files
Options
Downloads
Patches
Plain Diff
#206
Add speed in Uniform flow bug test
parent
bdf67e7a
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
spec/open-channel/regime_uniforme/regime_uniforme_rect.spec.ts
+34
-67
34 additions, 67 deletions
...open-channel/regime_uniforme/regime_uniforme_rect.spec.ts
with
34 additions
and
67 deletions
spec/open-channel/regime_uniforme/regime_uniforme_rect.spec.ts
+
34
−
67
View file @
bc2933e7
...
...
@@ -5,75 +5,42 @@ import { SessionSettings } from "../../../src/session_settings";
import
{
MessageCode
}
from
"
../../../src/util/message
"
;
import
{
precDist
}
from
"
../../test_config
"
;
import
{
checkResult
}
from
"
../../test_func
"
;
import
{
acSection
}
from
"
../../../src/open-channel/section/section_type
"
;
function
generateRectangularSection
():
cSnRectang
{
const
prms
=
new
ParamsSectionRectang
(
0.8
,
// tirant d'eau
2.5
,
// largeur de fond
40
,
// Ks=Strickler
1.5676680
,
// Q=Débit
0.001
,
// If=pente du fond
1
,
// YB=hauteur de berge
);
return
new
cSnRectang
(
prms
,
false
);
}
function
generateRegimeUniforme
(
sect
:
acSection
):
RegimeUniforme
{
return
new
RegimeUniforme
(
sect
,
false
);
}
let
ruRect1
=
generateRegimeUniforme
(
generateRectangularSection
());
describe
(
"
Class RegimeUniforme / section rectangulaire :
"
,
()
=>
{
describe
(
"
pas de débordement :
"
,
()
=>
{
/**
* test de la largeur de fond (= largeur de berge pour le rectangulaire)
*/
it
(
"
LargeurBerge should be 2.5
"
,
()
=>
{
const
prms
=
new
ParamsSectionRectang
(
0.8
,
// tirant d'eau
undefined
,
// largeur de fond
40
,
// Ks=Strickler
1.568
,
// Q=Débit
0.001
,
// If=pente du fond
1
,
// YB=hauteur de berge
);
SessionSettings
.
precision
=
precDist
;
const
sect
=
new
cSnRectang
(
prms
,
false
);
const
ru
=
new
RegimeUniforme
(
sect
,
false
);
checkResult
(
ru
.
Calc
(
"
LargeurBerge
"
,
0
),
2.5
);
});
it
(
"
Strickler should be 30.619
"
,
()
=>
{
const
prms
=
new
ParamsSectionRectang
(
0.8
,
// tirant d'eau
2.5
,
// largeur de fond
undefined
,
// Ks=Strickler
1.2
,
// Q=Débit
0.001
,
// If=pente du fond
1
,
// YB=hauteur de berge
);
SessionSettings
.
precision
=
precDist
;
const
sect
=
new
cSnRectang
(
prms
);
const
ru
=
new
RegimeUniforme
(
sect
);
checkResult
(
ru
.
Calc
(
"
Ks
"
,
1
e
-
8
),
30.619
);
});
it
(
"
If should be 0.001
"
,
()
=>
{
const
prms
=
new
ParamsSectionRectang
(
0.8
,
// tirant d'eau
2.5
,
// largeur de fond
40
,
// Ks=Strickler
1.568
,
// Q=Débit
undefined
,
// If=pente du fond
1
,
// YB=hauteur de berge
);
SessionSettings
.
precision
=
precDist
;
const
sect
=
new
cSnRectang
(
prms
);
const
ru
=
new
RegimeUniforme
(
sect
,
false
);
// nom variable à calculer, valeur de Ks
checkResult
(
ru
.
Calc
(
"
If
"
,
0.001
),
0.001
);
});
it
(
"
Q should be 1.568
"
,
()
=>
{
const
prms
=
new
ParamsSectionRectang
(
0.8
,
// tirant d'eau
2.5
,
// largeur de fond
40
,
// Ks=Strickler
undefined
,
// Q=Débit
0.001
,
// If=pente du fond
1
,
// YB=hauteur de berge
);
SessionSettings
.
precision
=
precDist
;
const
sect
=
new
cSnRectang
(
prms
);
const
ru
=
new
RegimeUniforme
(
sect
);
checkResult
(
ru
.
Calc
(
"
Q
"
,
0
),
1.568
);
});
fdescribe
(
"
pas de débordement :
"
,
()
=>
{
beforeEach
(()
=>
{
ruRect1
=
generateRegimeUniforme
(
generateRectangularSection
());
SessionSettings
.
precision
=
1
E
-
7
;
})
for
(
const
p
of
ruRect1
.
calculableParameters
)
{
it
(
`
${
p
.
symbol
}
should be
${
p
.
singleValue
}
`
,
()
=>
{
const
ref
:
number
=
p
.
singleValue
;
p
.
singleValue
=
undefined
;
p
.
initValue
=
1
e
-
8
;
ruRect1
.
calculatedParam
=
p
;
checkResult
(
ruRect1
.
CalcSerie
(),
ref
);
expect
(
ruRect1
.
result
.
values
.
V
).
toBeCloseTo
(
0.784
,
3
);
});
}
it
(
"
Q should be 0.731
"
,
()
=>
{
const
prms
=
new
ParamsSectionRectang
(
1.1
,
// tirant d'eau
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment