From f5f7227e796122dd48ee18ab8f52d16b472b4104 Mon Sep 17 00:00:00 2001 From: Ingmar Schoegl Date: Sun, 3 Nov 2019 18:58:17 -0600 Subject: [PATCH] [Thermo] reformat NasaPoly2::validate warning --- src/thermo/NasaPoly2.cpp | 27 ++++++++++--------- .../VPsilane_test/output_blessed.txt | 20 +++++--------- test_problems/cxx_ex/equil_example1.cpp | 3 ++- test_problems/cxx_ex/output_blessed.txt | 19 +++++-------- test_problems/silane_equil/output_blessed.txt | 20 +++++--------- 5 files changed, 38 insertions(+), 51 deletions(-) diff --git a/src/thermo/NasaPoly2.cpp b/src/thermo/NasaPoly2.cpp index 0cc4836da..a3312c89b 100644 --- a/src/thermo/NasaPoly2.cpp +++ b/src/thermo/NasaPoly2.cpp @@ -34,28 +34,31 @@ void NasaPoly2::validate(const std::string& name) double delta = cp_low - cp_high; if (fabs(delta/(fabs(cp_low)+1.0E-4)) > 0.01) { - writelog("\n\n**** WARNING ****\nFor species {}, discontinuity" - " in cp/R detected at Tmid = {}\n", name, m_midT); - writelog("\tValue computed using low-temperature polynomial: {}\n", cp_low); - writelog("\tValue computed using high-temperature polynomial: {}\n", cp_high); + warn_user("NasaPoly2::validate", + "\nFor species {}, discontinuity in cp/R detected at Tmid = {}\n" + "\tValue computed using low-temperature polynomial: {}\n" + "\tValue computed using high-temperature polynomial: {}\n", + name, m_midT, cp_low, cp_high); } // enthalpy delta = h_low - h_high; if (fabs(delta/cp_low) > 0.001) { - writelog("\n\n**** WARNING ****\nFor species {}, discontinuity" - " in h/RT detected at Tmid = {}\n", name, m_midT); - writelog("\tValue computed using low-temperature polynomial: {}\n", h_low); - writelog("\tValue computed using high-temperature polynomial: {}\n", h_high); + warn_user("NasaPoly2::validate", + "\nFor species {}, discontinuity in h/RT detected at Tmid = {}\n" + "\tValue computed using low-temperature polynomial: {}\n" + "\tValue computed using high-temperature polynomial: {}\n", + name, m_midT, h_low, h_high); } // entropy delta = s_low - s_high; if (fabs(delta/(fabs(s_low)+cp_low)) > 0.001) { - writelog("\n\n**** WARNING ****\nFor species {}, discontinuity" - " in s/R detected at Tmid = {}\n", name, m_midT); - writelog("\tValue computed using low-temperature polynomial: {}\n", s_low); - writelog("\tValue computed using high-temperature polynomial: {}\n", s_high); + warn_user("NasaPoly2::validate", + "\nFor species {}, discontinuity in s/R detected at Tmid = {}\n" + "\tValue computed using low-temperature polynomial: {}\n" + "\tValue computed using high-temperature polynomial: {}\n", + name, m_midT, s_low, s_high); } } diff --git a/test_problems/VPsilane_test/output_blessed.txt b/test_problems/VPsilane_test/output_blessed.txt index 5693c2be6..ce97259e1 100644 --- a/test_problems/VPsilane_test/output_blessed.txt +++ b/test_problems/VPsilane_test/output_blessed.txt @@ -1,40 +1,34 @@ - - -**** WARNING **** +UserWarning: 'NasaPoly2::validate': For species SI2H6, discontinuity in h/RT detected at Tmid = 1000 Value computed using low-temperature polynomial: 19.8328 Value computed using high-temperature polynomial: 19.9055 - -**** WARNING **** +UserWarning: 'NasaPoly2::validate': For species SI2H6, discontinuity in s/R detected at Tmid = 1000 Value computed using low-temperature polynomial: 49.5493 Value computed using high-temperature polynomial: 49.7214 - -**** WARNING **** +UserWarning: 'NasaPoly2::validate': For species SI3H8, discontinuity in h/RT detected at Tmid = 1000 Value computed using low-temperature polynomial: 29.3028 Value computed using high-temperature polynomial: 29.4297 - -**** WARNING **** +UserWarning: 'NasaPoly2::validate': For species SI3H8, discontinuity in s/R detected at Tmid = 1000 Value computed using low-temperature polynomial: 65.9731 Value computed using high-temperature polynomial: 66.2781 - -**** WARNING **** +UserWarning: 'NasaPoly2::validate': For species SI2, discontinuity in h/RT detected at Tmid = 1000 Value computed using low-temperature polynomial: 74.0115 Value computed using high-temperature polynomial: 74.0387 - -**** WARNING **** +UserWarning: 'NasaPoly2::validate': For species SI2, discontinuity in s/R detected at Tmid = 1000 Value computed using low-temperature polynomial: 32.8813 Value computed using high-temperature polynomial: 32.9489 + silane: temperature 1500 K diff --git a/test_problems/cxx_ex/equil_example1.cpp b/test_problems/cxx_ex/equil_example1.cpp index e3de5bcde..5f6e629de 100644 --- a/test_problems/cxx_ex/equil_example1.cpp +++ b/test_problems/cxx_ex/equil_example1.cpp @@ -55,7 +55,8 @@ int equil_example1(int job) std::cout << "Chemical equilibrium." << std::endl; if (job > 0) { std::cout << "Equilibrium composition and pressure for a " - << "range of temperatures at constant density." << std::endl; + << "range of temperatures at constant density." + << std::endl << std::endl; } if (job <= 1) { return 0; diff --git a/test_problems/cxx_ex/output_blessed.txt b/test_problems/cxx_ex/output_blessed.txt index a4b8afbd9..5cdda4fe9 100644 --- a/test_problems/cxx_ex/output_blessed.txt +++ b/test_problems/cxx_ex/output_blessed.txt @@ -40,41 +40,36 @@ Description: Chemical equilibrium. Equilibrium composition and pressure for a range of temperatures at constant density. - -**** WARNING **** +UserWarning: 'NasaPoly2::validate': For species SI2H6, discontinuity in h/RT detected at Tmid = 1000 Value computed using low-temperature polynomial: 19.8328 Value computed using high-temperature polynomial: 19.9055 - -**** WARNING **** +UserWarning: 'NasaPoly2::validate': For species SI2H6, discontinuity in s/R detected at Tmid = 1000 Value computed using low-temperature polynomial: 49.5493 Value computed using high-temperature polynomial: 49.7214 - -**** WARNING **** +UserWarning: 'NasaPoly2::validate': For species SI3H8, discontinuity in h/RT detected at Tmid = 1000 Value computed using low-temperature polynomial: 29.3028 Value computed using high-temperature polynomial: 29.4297 - -**** WARNING **** +UserWarning: 'NasaPoly2::validate': For species SI3H8, discontinuity in s/R detected at Tmid = 1000 Value computed using low-temperature polynomial: 65.9731 Value computed using high-temperature polynomial: 66.2781 - -**** WARNING **** +UserWarning: 'NasaPoly2::validate': For species SI2, discontinuity in h/RT detected at Tmid = 1000 Value computed using low-temperature polynomial: 74.0115 Value computed using high-temperature polynomial: 74.0387 - -**** WARNING **** +UserWarning: 'NasaPoly2::validate': For species SI2, discontinuity in s/R detected at Tmid = 1000 Value computed using low-temperature polynomial: 32.8813 Value computed using high-temperature polynomial: 32.9489 + Output files: eq1.csv (Excel CSV file) eq1.dat (Tecplot data file) diff --git a/test_problems/silane_equil/output_blessed.txt b/test_problems/silane_equil/output_blessed.txt index 1e6be20bf..f3a7f930a 100644 --- a/test_problems/silane_equil/output_blessed.txt +++ b/test_problems/silane_equil/output_blessed.txt @@ -1,36 +1,30 @@ - - -**** WARNING **** +UserWarning: 'NasaPoly2::validate': For species SI2H6, discontinuity in h/RT detected at Tmid = 1000 Value computed using low-temperature polynomial: 19.8328 Value computed using high-temperature polynomial: 19.9055 - -**** WARNING **** +UserWarning: 'NasaPoly2::validate': For species SI2H6, discontinuity in s/R detected at Tmid = 1000 Value computed using low-temperature polynomial: 49.5493 Value computed using high-temperature polynomial: 49.7214 - -**** WARNING **** +UserWarning: 'NasaPoly2::validate': For species SI3H8, discontinuity in h/RT detected at Tmid = 1000 Value computed using low-temperature polynomial: 29.3028 Value computed using high-temperature polynomial: 29.4297 - -**** WARNING **** +UserWarning: 'NasaPoly2::validate': For species SI3H8, discontinuity in s/R detected at Tmid = 1000 Value computed using low-temperature polynomial: 65.9731 Value computed using high-temperature polynomial: 66.2781 - -**** WARNING **** +UserWarning: 'NasaPoly2::validate': For species SI2, discontinuity in h/RT detected at Tmid = 1000 Value computed using low-temperature polynomial: 74.0115 Value computed using high-temperature polynomial: 74.0387 - -**** WARNING **** +UserWarning: 'NasaPoly2::validate': For species SI2, discontinuity in s/R detected at Tmid = 1000 Value computed using low-temperature polynomial: 32.8813 Value computed using high-temperature polynomial: 32.9489 +