From de32aba15d19f6ce80d06338af4944f6554a9bde Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Wed, 22 Feb 2012 00:17:12 +0000 Subject: [PATCH] All Debye-Huckel tests use a shared copy of the test executable --- test_problems/SConscript | 56 +++++---- .../DH_NaCl_NM.xml | 0 .../DH_NaCl_NM_blessed.csv | 0 .../DH_NaCl_Pitzer.xml | 0 .../DH_NaCl_Pitzer_blessed.csv | 0 .../DH_NaCl_acommon.xml | 0 .../DH_NaCl_acommon_blessed.csv | 0 .../DH_NaCl_bdotak.xml | 0 .../DH_NaCl_bdotak_blessed.csv | 0 .../cathermo/DH_graph_1/DH_graph_1.cpp | 2 - .../cathermo/DH_graph_NM/DH_graph_1.cpp | 116 ------------------ .../cathermo/DH_graph_NM/Makefile.am | 23 ---- test_problems/cathermo/DH_graph_NM/runtest | 42 ------- .../cathermo/DH_graph_Pitzer/DH_graph_1.cpp | 116 ------------------ .../cathermo/DH_graph_Pitzer/Makefile.am | 23 ---- .../cathermo/DH_graph_Pitzer/runtest | 42 ------- .../cathermo/DH_graph_acommon/DH_graph_1.cpp | 116 ------------------ .../cathermo/DH_graph_acommon/Makefile.am | 23 ---- .../cathermo/DH_graph_acommon/runtest | 42 ------- .../cathermo/DH_graph_bdotak/DH_graph_1.cpp | 116 ------------------ .../cathermo/DH_graph_bdotak/Makefile.am | 23 ---- .../cathermo/DH_graph_bdotak/runtest | 42 ------- 22 files changed, 31 insertions(+), 751 deletions(-) rename test_problems/cathermo/{DH_graph_NM => DH_graph_1}/DH_NaCl_NM.xml (100%) rename test_problems/cathermo/{DH_graph_NM => DH_graph_1}/DH_NaCl_NM_blessed.csv (100%) rename test_problems/cathermo/{DH_graph_Pitzer => DH_graph_1}/DH_NaCl_Pitzer.xml (100%) rename test_problems/cathermo/{DH_graph_Pitzer => DH_graph_1}/DH_NaCl_Pitzer_blessed.csv (100%) rename test_problems/cathermo/{DH_graph_acommon => DH_graph_1}/DH_NaCl_acommon.xml (100%) rename test_problems/cathermo/{DH_graph_acommon => DH_graph_1}/DH_NaCl_acommon_blessed.csv (100%) rename test_problems/cathermo/{DH_graph_bdotak => DH_graph_1}/DH_NaCl_bdotak.xml (100%) rename test_problems/cathermo/{DH_graph_bdotak => DH_graph_1}/DH_NaCl_bdotak_blessed.csv (100%) delete mode 100644 test_problems/cathermo/DH_graph_NM/DH_graph_1.cpp delete mode 100644 test_problems/cathermo/DH_graph_NM/Makefile.am delete mode 100755 test_problems/cathermo/DH_graph_NM/runtest delete mode 100644 test_problems/cathermo/DH_graph_Pitzer/DH_graph_1.cpp delete mode 100644 test_problems/cathermo/DH_graph_Pitzer/Makefile.am delete mode 100755 test_problems/cathermo/DH_graph_Pitzer/runtest delete mode 100644 test_problems/cathermo/DH_graph_acommon/DH_graph_1.cpp delete mode 100644 test_problems/cathermo/DH_graph_acommon/Makefile.am delete mode 100755 test_problems/cathermo/DH_graph_acommon/runtest delete mode 100644 test_problems/cathermo/DH_graph_bdotak/DH_graph_1.cpp delete mode 100644 test_problems/cathermo/DH_graph_bdotak/Makefile.am delete mode 100755 test_problems/cathermo/DH_graph_bdotak/runtest diff --git a/test_problems/SConscript b/test_problems/SConscript index ad1c2e0b4..c24d6d6f1 100644 --- a/test_problems/SConscript +++ b/test_problems/SConscript @@ -107,31 +107,37 @@ class CompileAndTest(Test): return Test.clean(self, env, files=files) -CompileAndTest('DH_graph_1', - pjoin('cathermo', 'DH_graph_1'), - 'DH_graph_1', 'DH_NaCl_dilute_blessed.csv', - artifacts=['DH_graph_1.log'], - arguments='DH_NaCl_dilute.xml') -CompileAndTest('DH_graph_acommon', - pjoin('cathermo', 'DH_graph_acommon'), - 'DH_graph_acommon', 'DH_NaCl_acommon_blessed.csv', - artifacts=['DH_graph_1.log'], - arguments='DH_NaCl_acommon.xml') -CompileAndTest('DH_graph_bdotak', - pjoin('cathermo', 'DH_graph_bdotak'), - 'DH_graph_bdotak', 'DH_NaCl_bdotak_blessed.csv', - artifacts=['DH_graph_1.log'], - arguments='DH_NaCl_bdotak.xml') -CompileAndTest('DH_graph_NM', - pjoin('cathermo', 'DH_graph_NM'), - 'DH_graph_NM', 'DH_NaCl_NM_blessed.csv', - artifacts=['DH_graph_1.log'], - arguments='DH_NaCl_NM.xml') -CompileAndTest('DH_graph_Pitzer', - pjoin('cathermo', 'DH_graph_Pitzer'), - 'DH_graph_Pitzer', 'DH_NaCl_Pitzer_blessed.csv', - artifacts=['DH_graph_1.log'], - arguments='DH_NaCl_Pitzer.xml') +dhGraph = localenv.Program('cathermo/DH_graph_1/DH_graph_1', + mglob(env, 'cathermo/DH_graph_1', 'cpp'), + LIBS=env['cantera_libs']) +dhGraph_name = dhGraph[0].name + +Test('DH_graph_dilute', + pjoin('cathermo', 'DH_graph_1'), + dhGraph, 'DH_NaCl_dilute_blessed.csv', + artifacts=['DH_graph_1.log', dhGraph_name], + arguments='DH_NaCl_dilute.xml') +Test('DH_graph_acommon', + pjoin('cathermo', 'DH_graph_1'), + dhGraph, 'DH_NaCl_acommon_blessed.csv', + artifacts=['DH_graph_1.log', dhGraph_name], + arguments='DH_NaCl_acommon.xml') +Test('DH_graph_bdotak', + pjoin('cathermo', 'DH_graph_1'), + dhGraph, 'DH_NaCl_bdotak_blessed.csv', + artifacts=['DH_graph_1.log', dhGraph_name], + arguments='DH_NaCl_bdotak.xml') +Test('DH_graph_NM', + pjoin('cathermo', 'DH_graph_1'), + dhGraph, 'DH_NaCl_NM_blessed.csv', + artifacts=['DH_graph_1.log', dhGraph_name], + arguments='DH_NaCl_NM.xml') +Test('DH_graph_Pitzer', + pjoin('cathermo', 'DH_graph_1'), + dhGraph, 'DH_NaCl_Pitzer_blessed.csv', + artifacts=['DH_graph_1.log', dhGraph_name], + arguments='DH_NaCl_Pitzer.xml') + CompileAndTest('HMW_dupl_test', pjoin('cathermo', 'HMW_dupl_test'), 'HMW_dupl_test', 'output_blessed.txt', diff --git a/test_problems/cathermo/DH_graph_NM/DH_NaCl_NM.xml b/test_problems/cathermo/DH_graph_1/DH_NaCl_NM.xml similarity index 100% rename from test_problems/cathermo/DH_graph_NM/DH_NaCl_NM.xml rename to test_problems/cathermo/DH_graph_1/DH_NaCl_NM.xml diff --git a/test_problems/cathermo/DH_graph_NM/DH_NaCl_NM_blessed.csv b/test_problems/cathermo/DH_graph_1/DH_NaCl_NM_blessed.csv similarity index 100% rename from test_problems/cathermo/DH_graph_NM/DH_NaCl_NM_blessed.csv rename to test_problems/cathermo/DH_graph_1/DH_NaCl_NM_blessed.csv diff --git a/test_problems/cathermo/DH_graph_Pitzer/DH_NaCl_Pitzer.xml b/test_problems/cathermo/DH_graph_1/DH_NaCl_Pitzer.xml similarity index 100% rename from test_problems/cathermo/DH_graph_Pitzer/DH_NaCl_Pitzer.xml rename to test_problems/cathermo/DH_graph_1/DH_NaCl_Pitzer.xml diff --git a/test_problems/cathermo/DH_graph_Pitzer/DH_NaCl_Pitzer_blessed.csv b/test_problems/cathermo/DH_graph_1/DH_NaCl_Pitzer_blessed.csv similarity index 100% rename from test_problems/cathermo/DH_graph_Pitzer/DH_NaCl_Pitzer_blessed.csv rename to test_problems/cathermo/DH_graph_1/DH_NaCl_Pitzer_blessed.csv diff --git a/test_problems/cathermo/DH_graph_acommon/DH_NaCl_acommon.xml b/test_problems/cathermo/DH_graph_1/DH_NaCl_acommon.xml similarity index 100% rename from test_problems/cathermo/DH_graph_acommon/DH_NaCl_acommon.xml rename to test_problems/cathermo/DH_graph_1/DH_NaCl_acommon.xml diff --git a/test_problems/cathermo/DH_graph_acommon/DH_NaCl_acommon_blessed.csv b/test_problems/cathermo/DH_graph_1/DH_NaCl_acommon_blessed.csv similarity index 100% rename from test_problems/cathermo/DH_graph_acommon/DH_NaCl_acommon_blessed.csv rename to test_problems/cathermo/DH_graph_1/DH_NaCl_acommon_blessed.csv diff --git a/test_problems/cathermo/DH_graph_bdotak/DH_NaCl_bdotak.xml b/test_problems/cathermo/DH_graph_1/DH_NaCl_bdotak.xml similarity index 100% rename from test_problems/cathermo/DH_graph_bdotak/DH_NaCl_bdotak.xml rename to test_problems/cathermo/DH_graph_1/DH_NaCl_bdotak.xml diff --git a/test_problems/cathermo/DH_graph_bdotak/DH_NaCl_bdotak_blessed.csv b/test_problems/cathermo/DH_graph_1/DH_NaCl_bdotak_blessed.csv similarity index 100% rename from test_problems/cathermo/DH_graph_bdotak/DH_NaCl_bdotak_blessed.csv rename to test_problems/cathermo/DH_graph_1/DH_NaCl_bdotak_blessed.csv diff --git a/test_problems/cathermo/DH_graph_1/DH_graph_1.cpp b/test_problems/cathermo/DH_graph_1/DH_graph_1.cpp index a42e1ed47..652bcdb36 100644 --- a/test_problems/cathermo/DH_graph_1/DH_graph_1.cpp +++ b/test_problems/cathermo/DH_graph_1/DH_graph_1.cpp @@ -10,8 +10,6 @@ using namespace std; using namespace Cantera; -typedef double doublereal; - void printUsage() { cout << "usage: DH_test " << endl; diff --git a/test_problems/cathermo/DH_graph_NM/DH_graph_1.cpp b/test_problems/cathermo/DH_graph_NM/DH_graph_1.cpp deleted file mode 100644 index 652bcdb36..000000000 --- a/test_problems/cathermo/DH_graph_NM/DH_graph_1.cpp +++ /dev/null @@ -1,116 +0,0 @@ -/** - * @file DH_graph_1 - */ - -#include "fileLog.h" -#include "cantera/thermo/DebyeHuckel.h" - -#include - -using namespace std; -using namespace Cantera; - -void printUsage() -{ - cout << "usage: DH_test " << endl; - cout <<" -> Everything is hardwired" << endl; -} - -void pAtable(DebyeHuckel* DH) -{ - int nsp = DH->nSpecies(); - double acMol[100]; - double mf[100]; - double activities[100]; - double moll[100]; - - DH->getMolalityActivityCoefficients(acMol); - DH->getMoleFractions(mf); - DH->getActivities(activities); - DH->getMolalities(moll); - string sName; - printf(" Name Activity ActCoeffMolal " - " MoleFract Molality\n"); - for (int k = 0; k < nsp; k++) { - sName = DH->speciesName(k); - printf("%16s %13g %13g %13g %13g\n", - sName.c_str(), activities[k], acMol[k], mf[k], moll[k]); - } -} - -int main(int argc, char** argv) -{ - - int retn = 0; - int i; - string fName = "DH_graph_1.log"; - fileLog* fl = new fileLog(fName); - try { - - char iFile[80]; - strcpy(iFile, "DH_NaCl.xml"); - if (argc > 1) { - strcpy(iFile, argv[1]); - } - setLogger(fl); - - DebyeHuckel* DH = new DebyeHuckel(iFile, "NaCl_electrolyte"); - - int nsp = DH->nSpecies(); - double acMol[100]; - double mf[100]; - double moll[100]; - DH->getMoleFractions(mf); - string sName; - - DH->setState_TP(298.15, 1.01325E5); - - int i1 = DH->speciesIndex("Na+"); - int i2 = DH->speciesIndex("Cl-"); - int i3 = DH->speciesIndex("H2O(L)"); - for (i = 1; i < nsp; i++) { - moll[i] = 0.0; - } - DH->setMolalities(moll); - double Itop = 10.; - double Ibot = 0.0; - double ISQRTtop = sqrt(Itop); - double ISQRTbot = sqrt(Ibot); - double ISQRT; - double Is = 0.0; - int its = 100; - printf(" Is, sqrtIs, meanAc," - " log10(meanAC), acMol_Na+," - ", acMol_Cl-, ac_Water\n"); - for (i = 0; i < its; i++) { - ISQRT = ISQRTtop*((double)i)/(its - 1.0) - + ISQRTbot*(1.0 - (double)i/(its - 1.0)); - Is = ISQRT * ISQRT; - moll[i1] = Is; - moll[i2] = Is; - DH->setMolalities(moll); - DH->getMolalityActivityCoefficients(acMol); - double meanAC = sqrt(acMol[i1] * acMol[i2]); - printf("%15g, %15g, %15g, %15g, %15g, %15g, %15g\n", - Is, ISQRT, meanAC, log10(meanAC), - acMol[i1], acMol[i2], acMol[i3]); - } - - - delete DH; - DH = 0; - /* - * This delete the file logger amongst other things. - */ - Cantera::appdelete(); - - return retn; - - } catch (CanteraError) { - showErrors(); - if (fl) { - delete fl; - } - return -1; - } -} diff --git a/test_problems/cathermo/DH_graph_NM/Makefile.am b/test_problems/cathermo/DH_graph_NM/Makefile.am deleted file mode 100644 index 1182f8991..000000000 --- a/test_problems/cathermo/DH_graph_NM/Makefile.am +++ /dev/null @@ -1,23 +0,0 @@ -cc_sources = DH_graph_1.cpp - -INC = -I. -I$(top_builddir)/build/include/ -AM_CPPFLAGS = $(INC) -AM_CXXFLAGS = $(AM_CPPFLAGS) - -LINK = -lctcxx -luser -loneD -lzeroD -lequil -lkinetics -ltransport -lthermo -LINK += -lctnumerics -lctmath -ltpx -lctspectra -lconverters -lctbase -lcvode -LINK += -lctlapack -lctblas -lctf2c -lm -lstdc++ -AM_LDFLAGS = -L$(top_builddir)/build/lib/ -LIBS = $(LINK) - -bin_PROGRAMS = DH_graph_1 -library_includedir = $(INC) - -#----------------------- -# Cantera DH graph test -#----------------------- - -DH_graph_1_SOURCES = $(cc_sources) - -TESTS_ENVIRONMENT = -TESTS = runtest diff --git a/test_problems/cathermo/DH_graph_NM/runtest b/test_problems/cathermo/DH_graph_NM/runtest deleted file mode 100755 index 420212925..000000000 --- a/test_problems/cathermo/DH_graph_NM/runtest +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh -# -# run_test -# -########################################################################## -# A couple of validity checks -if test ! $# -eq 0 ; then - echo 'usage: runtest' - echo ' ' - exit -1 -fi - -temp_success="0" -/bin/rm -f output.txt outputa.txt -########################################################################## -CANTERA_DATA=${CANTERA_DATA:=../../../data/inputs}; export CANTERA_DATA - -CANTERA_BIN=${CANTERA_BIN:=../../../bin} - -prog=DH_graph_1 -if test ! -x $prog ; then - echo $prog ' does not exist' - exit -1 -fi - -########################################################################## -/bin/rm -f test.out test.diff DH_NaCl_NM.csv - -./$prog DH_NaCl_NM.xml > DH_NaCl_NM.csv -retnStat=$? -diff DH_NaCl_NM.csv DH_NaCl_NM_blessed.csv > output.txt -zres=$? -if test "$zres" = "0" -a "$retnStat" = "0"; then - echo "successful diff comparison on $prog NM test" - return 0 -else - echo "unsuccessful diff comparison on $prog NM test" - echo "FAILED" > csvCode.txt - temp_success="0" - return 1 -fi - diff --git a/test_problems/cathermo/DH_graph_Pitzer/DH_graph_1.cpp b/test_problems/cathermo/DH_graph_Pitzer/DH_graph_1.cpp deleted file mode 100644 index 652bcdb36..000000000 --- a/test_problems/cathermo/DH_graph_Pitzer/DH_graph_1.cpp +++ /dev/null @@ -1,116 +0,0 @@ -/** - * @file DH_graph_1 - */ - -#include "fileLog.h" -#include "cantera/thermo/DebyeHuckel.h" - -#include - -using namespace std; -using namespace Cantera; - -void printUsage() -{ - cout << "usage: DH_test " << endl; - cout <<" -> Everything is hardwired" << endl; -} - -void pAtable(DebyeHuckel* DH) -{ - int nsp = DH->nSpecies(); - double acMol[100]; - double mf[100]; - double activities[100]; - double moll[100]; - - DH->getMolalityActivityCoefficients(acMol); - DH->getMoleFractions(mf); - DH->getActivities(activities); - DH->getMolalities(moll); - string sName; - printf(" Name Activity ActCoeffMolal " - " MoleFract Molality\n"); - for (int k = 0; k < nsp; k++) { - sName = DH->speciesName(k); - printf("%16s %13g %13g %13g %13g\n", - sName.c_str(), activities[k], acMol[k], mf[k], moll[k]); - } -} - -int main(int argc, char** argv) -{ - - int retn = 0; - int i; - string fName = "DH_graph_1.log"; - fileLog* fl = new fileLog(fName); - try { - - char iFile[80]; - strcpy(iFile, "DH_NaCl.xml"); - if (argc > 1) { - strcpy(iFile, argv[1]); - } - setLogger(fl); - - DebyeHuckel* DH = new DebyeHuckel(iFile, "NaCl_electrolyte"); - - int nsp = DH->nSpecies(); - double acMol[100]; - double mf[100]; - double moll[100]; - DH->getMoleFractions(mf); - string sName; - - DH->setState_TP(298.15, 1.01325E5); - - int i1 = DH->speciesIndex("Na+"); - int i2 = DH->speciesIndex("Cl-"); - int i3 = DH->speciesIndex("H2O(L)"); - for (i = 1; i < nsp; i++) { - moll[i] = 0.0; - } - DH->setMolalities(moll); - double Itop = 10.; - double Ibot = 0.0; - double ISQRTtop = sqrt(Itop); - double ISQRTbot = sqrt(Ibot); - double ISQRT; - double Is = 0.0; - int its = 100; - printf(" Is, sqrtIs, meanAc," - " log10(meanAC), acMol_Na+," - ", acMol_Cl-, ac_Water\n"); - for (i = 0; i < its; i++) { - ISQRT = ISQRTtop*((double)i)/(its - 1.0) - + ISQRTbot*(1.0 - (double)i/(its - 1.0)); - Is = ISQRT * ISQRT; - moll[i1] = Is; - moll[i2] = Is; - DH->setMolalities(moll); - DH->getMolalityActivityCoefficients(acMol); - double meanAC = sqrt(acMol[i1] * acMol[i2]); - printf("%15g, %15g, %15g, %15g, %15g, %15g, %15g\n", - Is, ISQRT, meanAC, log10(meanAC), - acMol[i1], acMol[i2], acMol[i3]); - } - - - delete DH; - DH = 0; - /* - * This delete the file logger amongst other things. - */ - Cantera::appdelete(); - - return retn; - - } catch (CanteraError) { - showErrors(); - if (fl) { - delete fl; - } - return -1; - } -} diff --git a/test_problems/cathermo/DH_graph_Pitzer/Makefile.am b/test_problems/cathermo/DH_graph_Pitzer/Makefile.am deleted file mode 100644 index 1182f8991..000000000 --- a/test_problems/cathermo/DH_graph_Pitzer/Makefile.am +++ /dev/null @@ -1,23 +0,0 @@ -cc_sources = DH_graph_1.cpp - -INC = -I. -I$(top_builddir)/build/include/ -AM_CPPFLAGS = $(INC) -AM_CXXFLAGS = $(AM_CPPFLAGS) - -LINK = -lctcxx -luser -loneD -lzeroD -lequil -lkinetics -ltransport -lthermo -LINK += -lctnumerics -lctmath -ltpx -lctspectra -lconverters -lctbase -lcvode -LINK += -lctlapack -lctblas -lctf2c -lm -lstdc++ -AM_LDFLAGS = -L$(top_builddir)/build/lib/ -LIBS = $(LINK) - -bin_PROGRAMS = DH_graph_1 -library_includedir = $(INC) - -#----------------------- -# Cantera DH graph test -#----------------------- - -DH_graph_1_SOURCES = $(cc_sources) - -TESTS_ENVIRONMENT = -TESTS = runtest diff --git a/test_problems/cathermo/DH_graph_Pitzer/runtest b/test_problems/cathermo/DH_graph_Pitzer/runtest deleted file mode 100755 index 8efb10075..000000000 --- a/test_problems/cathermo/DH_graph_Pitzer/runtest +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh -# -# run_test -# -########################################################################## -# A couple of validity checks -if test ! $# -eq 0 ; then - echo 'usage: runtest' - echo ' ' - exit -1 -fi - -temp_success="0" -/bin/rm -f output.txt outputa.txt -########################################################################## -CANTERA_DATA=${CANTERA_DATA:=../../../data/inputs}; export CANTERA_DATA - -CANTERA_BIN=${CANTERA_BIN:=../../../bin} - -prog=DH_graph_1 -if test ! -x $prog ; then - echo $prog ' does not exist' - exit -1 -fi - -########################################################################## -/bin/rm -f test.out test.diff DH_NaCl_Pitzer.csv - -./$prog DH_NaCl_Pitzer.xml > DH_NaCl_Pitzer.csv -retnStat=$? -diff DH_NaCl_Pitzer.csv DH_NaCl_Pitzer_blessed.csv > output.txt -zres=$? -if test "$zres" = "0" -a "$retnStat" = "0"; then - echo "successful diff comparison on $prog Pitzer test" - return 0 -else - echo "unsuccessful diff comparison on $prog Pitzer test" - echo "FAILED" > csvCode.txt - temp_success="0" - return 1 -fi - diff --git a/test_problems/cathermo/DH_graph_acommon/DH_graph_1.cpp b/test_problems/cathermo/DH_graph_acommon/DH_graph_1.cpp deleted file mode 100644 index 652bcdb36..000000000 --- a/test_problems/cathermo/DH_graph_acommon/DH_graph_1.cpp +++ /dev/null @@ -1,116 +0,0 @@ -/** - * @file DH_graph_1 - */ - -#include "fileLog.h" -#include "cantera/thermo/DebyeHuckel.h" - -#include - -using namespace std; -using namespace Cantera; - -void printUsage() -{ - cout << "usage: DH_test " << endl; - cout <<" -> Everything is hardwired" << endl; -} - -void pAtable(DebyeHuckel* DH) -{ - int nsp = DH->nSpecies(); - double acMol[100]; - double mf[100]; - double activities[100]; - double moll[100]; - - DH->getMolalityActivityCoefficients(acMol); - DH->getMoleFractions(mf); - DH->getActivities(activities); - DH->getMolalities(moll); - string sName; - printf(" Name Activity ActCoeffMolal " - " MoleFract Molality\n"); - for (int k = 0; k < nsp; k++) { - sName = DH->speciesName(k); - printf("%16s %13g %13g %13g %13g\n", - sName.c_str(), activities[k], acMol[k], mf[k], moll[k]); - } -} - -int main(int argc, char** argv) -{ - - int retn = 0; - int i; - string fName = "DH_graph_1.log"; - fileLog* fl = new fileLog(fName); - try { - - char iFile[80]; - strcpy(iFile, "DH_NaCl.xml"); - if (argc > 1) { - strcpy(iFile, argv[1]); - } - setLogger(fl); - - DebyeHuckel* DH = new DebyeHuckel(iFile, "NaCl_electrolyte"); - - int nsp = DH->nSpecies(); - double acMol[100]; - double mf[100]; - double moll[100]; - DH->getMoleFractions(mf); - string sName; - - DH->setState_TP(298.15, 1.01325E5); - - int i1 = DH->speciesIndex("Na+"); - int i2 = DH->speciesIndex("Cl-"); - int i3 = DH->speciesIndex("H2O(L)"); - for (i = 1; i < nsp; i++) { - moll[i] = 0.0; - } - DH->setMolalities(moll); - double Itop = 10.; - double Ibot = 0.0; - double ISQRTtop = sqrt(Itop); - double ISQRTbot = sqrt(Ibot); - double ISQRT; - double Is = 0.0; - int its = 100; - printf(" Is, sqrtIs, meanAc," - " log10(meanAC), acMol_Na+," - ", acMol_Cl-, ac_Water\n"); - for (i = 0; i < its; i++) { - ISQRT = ISQRTtop*((double)i)/(its - 1.0) - + ISQRTbot*(1.0 - (double)i/(its - 1.0)); - Is = ISQRT * ISQRT; - moll[i1] = Is; - moll[i2] = Is; - DH->setMolalities(moll); - DH->getMolalityActivityCoefficients(acMol); - double meanAC = sqrt(acMol[i1] * acMol[i2]); - printf("%15g, %15g, %15g, %15g, %15g, %15g, %15g\n", - Is, ISQRT, meanAC, log10(meanAC), - acMol[i1], acMol[i2], acMol[i3]); - } - - - delete DH; - DH = 0; - /* - * This delete the file logger amongst other things. - */ - Cantera::appdelete(); - - return retn; - - } catch (CanteraError) { - showErrors(); - if (fl) { - delete fl; - } - return -1; - } -} diff --git a/test_problems/cathermo/DH_graph_acommon/Makefile.am b/test_problems/cathermo/DH_graph_acommon/Makefile.am deleted file mode 100644 index 3b1413de9..000000000 --- a/test_problems/cathermo/DH_graph_acommon/Makefile.am +++ /dev/null @@ -1,23 +0,0 @@ -cc_sources = DH_graph_1.cpp - -INC = -I. -I$(top_builddir)/build/include/ -AM_CPPFLAGS = $(INC) -AM_CXXFLAGS = $(AM_CPPFLAGS) - -LINK = -lctcxx -luser -loneD -lzeroD -lequil -lkinetics -ltransport -lthermo -LINK += -lctnumerics -lctmath -ltpx -lctspectra -lconverters -lctbase -lcvode -LINK += -lctlapack -lctblas -lctf2c -lm -lstdc++ -AM_LDFLAGS = -L$(top_builddir)/build/lib/ -LIBS = $(LINK) - -bin_PROGRAMS = DH_graph_1 -library_includedir = $(INC) - -#----------------------- -# Cantera DH graph test -#----------------------- - -DH_graph_1_SOURCES = $(cc_sources) - -TESTS_ENVIRONMENT = -TESTS = runtest \ No newline at end of file diff --git a/test_problems/cathermo/DH_graph_acommon/runtest b/test_problems/cathermo/DH_graph_acommon/runtest deleted file mode 100755 index 5d98da1d3..000000000 --- a/test_problems/cathermo/DH_graph_acommon/runtest +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh -# -# run_test -# -########################################################################## -# A couple of validity checks -if test ! $# -eq 0 ; then - echo 'usage: runtest' - echo ' ' - exit -1 -fi - -temp_success="0" -/bin/rm -f output.txt outputa.txt -########################################################################## -CANTERA_DATA=${CANTERA_DATA:=../../../data/inputs}; export CANTERA_DATA - -CANTERA_BIN=${CANTERA_BIN:=../../../bin} - -prog=DH_graph_1 -if test ! -x $prog ; then - echo $prog ' does not exist' - exit -1 -fi - -########################################################################## -/bin/rm -f test.out test.diff DH_NaCl_acommon.csv - -./$prog DH_NaCl_acommon.xml > DH_NaCl_acommon.csv -retnStat=$? -diff DH_NaCl_acommon.csv DH_NaCl_acommon_blessed.csv > output.txt -zres=$? -if test "$zres" = "0" -a "$retnStat" = "0"; then - echo "successful diff comparison on $prog _acommon test" - return 0 -else - echo "unsuccessful diff comparison on $prog _acommon test" - echo "FAILED" > csvCode.txt - temp_success="0" - return 1 -fi - diff --git a/test_problems/cathermo/DH_graph_bdotak/DH_graph_1.cpp b/test_problems/cathermo/DH_graph_bdotak/DH_graph_1.cpp deleted file mode 100644 index 652bcdb36..000000000 --- a/test_problems/cathermo/DH_graph_bdotak/DH_graph_1.cpp +++ /dev/null @@ -1,116 +0,0 @@ -/** - * @file DH_graph_1 - */ - -#include "fileLog.h" -#include "cantera/thermo/DebyeHuckel.h" - -#include - -using namespace std; -using namespace Cantera; - -void printUsage() -{ - cout << "usage: DH_test " << endl; - cout <<" -> Everything is hardwired" << endl; -} - -void pAtable(DebyeHuckel* DH) -{ - int nsp = DH->nSpecies(); - double acMol[100]; - double mf[100]; - double activities[100]; - double moll[100]; - - DH->getMolalityActivityCoefficients(acMol); - DH->getMoleFractions(mf); - DH->getActivities(activities); - DH->getMolalities(moll); - string sName; - printf(" Name Activity ActCoeffMolal " - " MoleFract Molality\n"); - for (int k = 0; k < nsp; k++) { - sName = DH->speciesName(k); - printf("%16s %13g %13g %13g %13g\n", - sName.c_str(), activities[k], acMol[k], mf[k], moll[k]); - } -} - -int main(int argc, char** argv) -{ - - int retn = 0; - int i; - string fName = "DH_graph_1.log"; - fileLog* fl = new fileLog(fName); - try { - - char iFile[80]; - strcpy(iFile, "DH_NaCl.xml"); - if (argc > 1) { - strcpy(iFile, argv[1]); - } - setLogger(fl); - - DebyeHuckel* DH = new DebyeHuckel(iFile, "NaCl_electrolyte"); - - int nsp = DH->nSpecies(); - double acMol[100]; - double mf[100]; - double moll[100]; - DH->getMoleFractions(mf); - string sName; - - DH->setState_TP(298.15, 1.01325E5); - - int i1 = DH->speciesIndex("Na+"); - int i2 = DH->speciesIndex("Cl-"); - int i3 = DH->speciesIndex("H2O(L)"); - for (i = 1; i < nsp; i++) { - moll[i] = 0.0; - } - DH->setMolalities(moll); - double Itop = 10.; - double Ibot = 0.0; - double ISQRTtop = sqrt(Itop); - double ISQRTbot = sqrt(Ibot); - double ISQRT; - double Is = 0.0; - int its = 100; - printf(" Is, sqrtIs, meanAc," - " log10(meanAC), acMol_Na+," - ", acMol_Cl-, ac_Water\n"); - for (i = 0; i < its; i++) { - ISQRT = ISQRTtop*((double)i)/(its - 1.0) - + ISQRTbot*(1.0 - (double)i/(its - 1.0)); - Is = ISQRT * ISQRT; - moll[i1] = Is; - moll[i2] = Is; - DH->setMolalities(moll); - DH->getMolalityActivityCoefficients(acMol); - double meanAC = sqrt(acMol[i1] * acMol[i2]); - printf("%15g, %15g, %15g, %15g, %15g, %15g, %15g\n", - Is, ISQRT, meanAC, log10(meanAC), - acMol[i1], acMol[i2], acMol[i3]); - } - - - delete DH; - DH = 0; - /* - * This delete the file logger amongst other things. - */ - Cantera::appdelete(); - - return retn; - - } catch (CanteraError) { - showErrors(); - if (fl) { - delete fl; - } - return -1; - } -} diff --git a/test_problems/cathermo/DH_graph_bdotak/Makefile.am b/test_problems/cathermo/DH_graph_bdotak/Makefile.am deleted file mode 100644 index 1182f8991..000000000 --- a/test_problems/cathermo/DH_graph_bdotak/Makefile.am +++ /dev/null @@ -1,23 +0,0 @@ -cc_sources = DH_graph_1.cpp - -INC = -I. -I$(top_builddir)/build/include/ -AM_CPPFLAGS = $(INC) -AM_CXXFLAGS = $(AM_CPPFLAGS) - -LINK = -lctcxx -luser -loneD -lzeroD -lequil -lkinetics -ltransport -lthermo -LINK += -lctnumerics -lctmath -ltpx -lctspectra -lconverters -lctbase -lcvode -LINK += -lctlapack -lctblas -lctf2c -lm -lstdc++ -AM_LDFLAGS = -L$(top_builddir)/build/lib/ -LIBS = $(LINK) - -bin_PROGRAMS = DH_graph_1 -library_includedir = $(INC) - -#----------------------- -# Cantera DH graph test -#----------------------- - -DH_graph_1_SOURCES = $(cc_sources) - -TESTS_ENVIRONMENT = -TESTS = runtest diff --git a/test_problems/cathermo/DH_graph_bdotak/runtest b/test_problems/cathermo/DH_graph_bdotak/runtest deleted file mode 100755 index e5f3d5cf7..000000000 --- a/test_problems/cathermo/DH_graph_bdotak/runtest +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh -# -# run_test -# -########################################################################## -# A couple of validity checks -if test ! $# -eq 0 ; then - echo 'usage: runtest' - echo ' ' - exit -1 -fi - -temp_success="0" -/bin/rm -f output.txt outputa.txt -########################################################################## -CANTERA_DATA=${CANTERA_DATA:=../../../data/inputs}; export CANTERA_DATA - -CANTERA_BIN=${CANTERA_BIN:=../../../bin} - -prog=DH_graph_1 -if test ! -x $prog ; then - echo $prog ' does not exist' - exit -1 -fi - -########################################################################## -/bin/rm -f test.out test.diff DH_NaCl_bdotak.csv - -./$prog DH_NaCl_bdotak.xml > DH_NaCl_bdotak.csv -retnStat=$? -diff DH_NaCl_bdotak.csv DH_NaCl_bdotak_blessed.csv > output.txt -zres=$? -if test "$zres" = "0" -a "$retnStat" = "0"; then - echo "successful diff comparison on $prog bdotak test" - return 0 -else - echo "unsuccessful diff comparison on $prog bdotak test" - echo "FAILED" > csvCode.txt - temp_success="0" - return 1 -fi -