Skip to content
Snippets Groups Projects
Commit cae41e81 authored by François Grand's avatar François Grand
Browse files

feat: backwater curve: generate error when discretisation step is greater than reach length

refs #565
refs jalhyd#316
parent ba84d775
No related branches found
No related tags found
1 merge request!165Resolve "Courbe de remous (et bief): remonter une erreur quand le pas de discrétisation est supérieur la longueur du bief"
Pipeline #139817 passed
......@@ -3,6 +3,7 @@ import { CalculatorPage } from "./calculator.po";
import { browser } from "protractor";
import { Navbar } from "./navbar.po";
import { PreferencesPage } from "./preferences.po";
import { SideNav } from "./sidenav.po";
/**
* Remous
......@@ -12,12 +13,14 @@ describe("ngHyd − remous", () => {
let calcPage: CalculatorPage;
let navBar: Navbar;
let prefPage: PreferencesPage;
let sidenav: SideNav;
beforeEach(async () => {
listPage = new ListPage();
prefPage = new PreferencesPage();
calcPage = new CalculatorPage();
navBar = new Navbar();
sidenav = new SideNav();
// disable evil option "empty fields on module creation"
await prefPage.navigateTo();
await prefPage.disableEvilEmptyFields();
......@@ -70,4 +73,24 @@ describe("ngHyd − remous", () => {
const hasResults = await calcPage.hasResults();
expect(hasResults).toBe(true);
});
it("Check that calculation with dx >= reach length fails", async () => {
// load backwater curve session file with Dx>=Long
await navBar.clickMenuButton();
await browser.sleep(200);
await sidenav.clickLoadSessionButton();
await browser.sleep(200);
await sidenav.loadSessionFile("./session/session-remous-dx-bief.json");
await browser.sleep(500);
// Calculate, the calculation should fail
await calcPage.getCalculateButton().click();
await browser.sleep(500);
// check error message in log
expect(await calcPage.nbLogEntries()).toBe(1);
// check there is no result
expect(await calcPage.presentAndVisible("var-results")).toBe(false);
});
});
{"header":{"source":"jalhyd","format_version":"1.3","created":"2022-06-30T14:31:54.872Z"},"settings":{"precision":1e-7,"maxIterations":100},"documentation":"","session":[{"uid":"amozNT","props":{"calcType":"CourbeRemous","methodeResolution":"RungeKutta4"},"children":[{"uid":"ZzIyZm","props":{"calcType":"Section","nodeType":"SectionRectangle"},"children":[],"parameters":[{"symbol":"Ks","mode":"SINGLE","value":157544.77102709157},{"symbol":"Q","mode":"SINGLE","value":983277.9803235843},{"symbol":"YB","mode":"SINGLE","value":984997.3273467234},{"symbol":"LargeurBerge","mode":"SINGLE","value":756267.5581282576}]}],"parameters":[{"symbol":"Long","mode":"SINGLE","value":639697.7975510269},{"symbol":"Dx","mode":"SINGLE","value":680775.9048205647},{"symbol":"Z1","mode":"SINGLE","value":662459.5272556832},{"symbol":"Z2","mode":"SINGLE","value":142093.39302660408},{"symbol":"ZF1","mode":"SINGLE","value":150635.28017481393},{"symbol":"ZF2","mode":"SINGLE","value":-375069.6377087354}]}]}
\ No newline at end of file
devel
316-courbe-de-remous-et-bief-remonter-une-erreur-quand-le-pas-de-discretisation-est-superieur-la
......@@ -66,6 +66,7 @@
"WARNING_REMOUS_PAS_CALCUL_DEPUIS_AVAL": "Downstream boundary condition < Critical elevation: no possible calculation from downstream",
"ERROR_REMOUS_PAS_CALCUL": "No possible calculation, neither from upstream nor from downstream",
"ERROR_REMOUS_PENTE_FORTE": "The water line slope is too steep at abscissa %x% m (the discretisation step should be reduced)",
"ERROR_REMOUS_PAS_SUPERIEUR_BIEF": "Discretisation step should be less than or equal to the reach length",
"ERROR_RU_CIRC_LEVEL_TOO_HIGH": "Uniform flow cannot be calculated with a pipe under load",
"ERROR_NEWTON_NON_CONVERGENCE": "Non-convergence (Newton's method)",
"ERROR_SECTION_NON_CONVERGENCE_NEWTON_HCONJUG": "Non-convergence of the calculation of the combined depth (Newton's method)",
......
......@@ -66,6 +66,7 @@
"WARNING_REMOUS_PAS_CALCUL_DEPUIS_AVAL": "Condition limite aval < Hauteur critique&nbsp;: pas de calcul possible depuis l'aval",
"ERROR_REMOUS_PAS_CALCUL": "Aucun calcul possible ni depuis l'amont ni depuis l'aval",
"ERROR_REMOUS_PENTE_FORTE": "La pente de la ligne d'eau est trop forte à l'abscisse %x% m (il faudrait réduire le pas de discrétisation)",
"ERROR_REMOUS_PAS_SUPERIEUR_BIEF": "Le pas de discrétisation doit être inférieur ou égal à la longueur du bief",
"ERROR_RU_CIRC_LEVEL_TOO_HIGH": "Le régime uniforme ne peut pas être calculé avec une conduite en charge",
"ERROR_NEWTON_NON_CONVERGENCE": "Non convergence (Méthode de Newton)",
"ERROR_SECTION_NON_CONVERGENCE_NEWTON_HCONJUG": "Non convergence du calcul de la hauteur conjuguée (Méthode de Newton)",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment