diff --git a/docs/en/calculators/hyd_en_charge/lechapt-calmon.md b/docs/en/calculators/hyd_en_charge/lechapt-calmon.md index ee025f7132a3d3ac30521a69f5be9a834301c629..ba97396cb5fa2362d01c04983159eab37b4bbd6d 100644 --- a/docs/en/calculators/hyd_en_charge/lechapt-calmon.md +++ b/docs/en/calculators/hyd_en_charge/lechapt-calmon.md @@ -8,7 +8,7 @@ It allows the calculation of the value of one of the following quantities: - Pipe diameter (m) - Total head loss (m) - Pipe length (m) -- Singular pressure loss coefficient (m) +- Singular pressure loss coefficient The total head loss is the sum of the linear head losses \(J_L\) obtained from the Lechapt and Calmon abacuses and singular \(J_S\) depending on the above coefficient. diff --git a/docs/en/calculators/hyd_en_charge/perte_de_charge.md b/docs/en/calculators/hyd_en_charge/perte_de_charge.md new file mode 100644 index 0000000000000000000000000000000000000000..3ed9b791fec622b298ce49440f77f31c9b895302 --- /dev/null +++ b/docs/en/calculators/hyd_en_charge/perte_de_charge.md @@ -0,0 +1,34 @@ +# Pressure loss + +This module computes linear head losses in a circular pipe with the following laws: + +- [Lechapt et Calmon](lechapt-calmon.md) +- [Strickler](strickler.md) + + +The following values can be computed: + +- Flow (m<sup>3</sup>/s) +- Pipe diameter (m) +- Total pressure loss (m) +- Pipe length (m) +- Singular head loss coefficient + +The total pressure loss is the sum of linear losses \(J_{lin}\), according to the used law, and singular losses \(J_{loc}\) depending on the above coefficient. + +## Singular pressure loss + +$$ J_{loc} = K_{loc} \frac{V^2}{2g}$$ + +Given : + +- \(K_{loc}\) : singular head loss coefficient +- \(V\) : water speed in the pipe (\(V = 4 Q / \pi / D^2\)) + +## Linear head loss coefficient + +$$ K_{lin} = \frac{2g J_{lin}}{V^2} $$ + +## Darcy head loss coefficient + +$$ f_D = \frac{2g J D}{l_T V^2} $$ diff --git a/docs/en/calculators/hyd_en_charge/strickler.md b/docs/en/calculators/hyd_en_charge/strickler.md new file mode 100644 index 0000000000000000000000000000000000000000..ea7870e9f1127378070137d44385da317cedb72c --- /dev/null +++ b/docs/en/calculators/hyd_en_charge/strickler.md @@ -0,0 +1,11 @@ +# Strickler formula + +This linear head loss law is parameterised by the Stricker coefficient \(K_S\). + +The other law parameters are shared with all pressure loss formulas: + +- \(Q\) : flow (m<sup>3</sup>/s) +- \(D\) : pipe diameter (m) +- \(l_T\) : pipe length (m) + +$$J_L=\frac{l_T.Q^2}{(K_S.\pi.D^2/4)^2.(D/4)^{4/3}}$$ diff --git a/docs/fr/calculators/hyd_en_charge/perte_de_charge.md b/docs/fr/calculators/hyd_en_charge/perte_de_charge.md index 955d4a1b2a67dde51bcb1ce6c79925e48d3767aa..2cc8b986876d9defc3bd85b0716da084e5fd81ee 100644 --- a/docs/fr/calculators/hyd_en_charge/perte_de_charge.md +++ b/docs/fr/calculators/hyd_en_charge/perte_de_charge.md @@ -2,8 +2,8 @@ Ce module permet de calculer les pertes de charge dans une conduite circulaire à partir des lois suivantes donnant les pertes de charge linéaires : -- Lechapt et Calmon -- Strickler +- [Lechapt et Calmon](lechapt-calmon.md) +- [Strickler](strickler.md) Il permet le calcul de la valeur d'une des grandeurs suivantes : diff --git a/e2e/calculator.po.ts b/e2e/calculator.po.ts index f2b98b2d9f606cd83c86316d46287b1e493676c1..91878a7380ec1d33e7fbedfab4b36a1c6abd00a7 100644 --- a/e2e/calculator.po.ts +++ b/e2e/calculator.po.ts @@ -441,4 +441,11 @@ export class CalculatorPage { n++; } } + + /** + * get help button related to calculator + */ + getCalculatorHelpButton() { + return element(by.css("#help-calc")); + } } diff --git a/e2e/documentation.e2e-spec.ts b/e2e/documentation.e2e-spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..e3a142432e2468131827ff80666eb351322b0a48 --- /dev/null +++ b/e2e/documentation.e2e-spec.ts @@ -0,0 +1,68 @@ +import { ListPage } from "./list.po"; +import { CalculatorPage } from "./calculator.po"; +import { Navbar } from "./navbar.po"; +import { browser, by, element } from "protractor"; +import { PreferencesPage } from "./preferences.po"; + +describe("documentation − ", () => { + let listPage: ListPage; + let calcPage: CalculatorPage; + let prefPage: PreferencesPage; + let navbar: Navbar; + + beforeAll(() => { + calcPage = new CalculatorPage(); + prefPage = new PreferencesPage(); + navbar = new Navbar(); + listPage = new ListPage(); + + // browser.manage().window().setPosition(2000, 30); + }); + + async function checkMathjaxInHelp(lang: number) { + // change language setup + await prefPage.navigateTo(); + await prefPage.changeLanguage(lang); + await browser.sleep(200); + + // start page + await navbar.clickNewCalculatorButton(); + + // open "fish ladder: fall" calculator + await listPage.clickMenuEntryForCalcType(12); + await browser.sleep(200); + + // click help + await calcPage.getCalculatorHelpButton().click(); + await browser.sleep(200); + + browser.getAllWindowHandles().then(async (handles) => { + browser.ignoreSynchronization = true; // deprecated but the only solution to work in the newly opened tab + + // switch to help tab + browser.switchTo().window(handles[1]).then(async () => { + // check Mathjax element is present + expect(element(by.css("mjx-container")).isPresent()).toBe(true); + }).then(async () => { + // close help tab + await browser.close(); + // switch back to calculator (required to avoid failure of next language test) + await browser.switchTo().window(handles[0]); + browser.ignoreSynchronization = false; + }); + + // switch back to calculator (required to avoid failure of next language test) + await browser.switchTo().window(handles[0]); + + browser.ignoreSynchronization = false; + }); + } + + it("check Mathjax formula are displayed in calculator French help", async () => { + await checkMathjaxInHelp(1); // fr + }); + + it("check Mathjax formula are displayed in calculator English help", async () => { + await checkMathjaxInHelp(0); // en + }); +}); diff --git a/scripts/mkdocs-postprocess.js b/scripts/mkdocs-postprocess.js index 558e8300fe0d45f43ee54530b3a9208fb2725d07..96f0794bb39917ea0db9bb3036a0f1e2e59b02b3 100644 --- a/scripts/mkdocs-postprocess.js +++ b/scripts/mkdocs-postprocess.js @@ -8,7 +8,7 @@ const fs = require('fs-extra'); const destPath_JS = "src/assets/docs/javascripts"; const destPath_FR_JS = "src/assets/docs/fr/javascripts"; // pour la compilation en local (français) -const destPath_EN_JS = "src/assets/docs/fr/javascripts"; // pour la compilation en local (anglais) +const destPath_EN_JS = "src/assets/docs/en/javascripts"; // pour la compilation en local (anglais) const destPath_CSS = "src/assets/docs/stylesheets"; const destPath_FR_CSS = "src/assets/docs/fr/stylesheets"; // pour la compilation en local (français)