From d430d12909a86080a028efb7977af2330179bc6f Mon Sep 17 00:00:00 2001 From: abv Date: Fri, 2 Oct 2020 23:54:16 +0300 Subject: [PATCH] 0030800: Foundation Classes, UnitsAPI - poise dynamic viscosity unit is not defined correctly Definition of Poise unit corrected. Added test bugs fclasses bug30800 --- src/UnitsAPI/Units.dat | 2 +- src/UnitsAPI/UnitsAPI_Units_dat.pxx | 2 +- tests/bugs/fclasses/bug30800 | 14 ++++++++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 tests/bugs/fclasses/bug30800 diff --git a/src/UnitsAPI/Units.dat b/src/UnitsAPI/Units.dat index a9a1a54fa9..daf0995fcb 100755 --- a/src/UnitsAPI/Units.dat +++ b/src/UnitsAPI/Units.dat @@ -260,7 +260,7 @@ pound force per square inch psi M L T I K N J P S DYNAMIC VISCOSITY 1 -1 -1 0 0 0 0 0 0 .................................................................................................................................... -poise Po 1 gf/cm\xB2.s +poise Po 1 g/cm/s poiseuille Pl 10 Po .................................................................................................................................... M L T I K N J P S diff --git a/src/UnitsAPI/UnitsAPI_Units_dat.pxx b/src/UnitsAPI/UnitsAPI_Units_dat.pxx index 629ed8220a..f54cc7f8fa 100644 --- a/src/UnitsAPI/UnitsAPI_Units_dat.pxx +++ b/src/UnitsAPI/UnitsAPI_Units_dat.pxx @@ -263,7 +263,7 @@ static const char UnitsAPI_Units_dat[] = " M L T I K N J P S\n" "DYNAMIC VISCOSITY 1 -1 -1 0 0 0 0 0 0\n" "....................................................................................................................................\n" - "poise Po 1 gf/cm\xB2.s\n" + "poise Po 1 g/cm/s\n" "poiseuille Pl 10 Po\n" "....................................................................................................................................\n" " M L T I K N J P S\n" diff --git a/tests/bugs/fclasses/bug30800 b/tests/bugs/fclasses/bug30800 new file mode 100644 index 0000000000..ec8253ff73 --- /dev/null +++ b/tests/bugs/fclasses/bug30800 @@ -0,0 +1,14 @@ +puts "# ==========================================================================================" +puts "# 0030800: Foundation Classes, UnitsAPI - poise dynamic viscosity unit is not defined correctly" +puts "# ==========================================================================================" +puts "" + +puts "Check that 1 Poise is 0.1 Pa*s" +if { [regexp {result: ([0-9.e+-]+)} [unitconvtoSI 1. Po] res poise_si] } { + checkreal "Poise in SI (Pa*s)" $poise_si 0.1 1e-6 1e-6 +} else { + puts "Error: cannot convert Poise to SI" +} + +puts "Check that 1 Poise is 0.001 kg/cm/s" +checkreal "Poise in kg/cm/s" [unit 1. Po kg/cm/s] 0.001 1e-6 1e-6