Skip to content

Commit

Permalink
Test added with input file
Browse files Browse the repository at this point in the history
Conflicts:
	test/Makefile.am
  • Loading branch information
SylvainPlessis committed Mar 5, 2015
1 parent ddca963 commit e1810b9
Show file tree
Hide file tree
Showing 5 changed files with 189 additions and 0 deletions.
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ AC_CONFIG_FILES(test/parsing_xml.sh, [chmod +x test/parsing_
AC_CONFIG_FILES(test/parsing_chemkin.sh, [chmod +x test/parsing_chemkin.sh])
AC_CONFIG_FILES(test/kinetics_reactive_scheme_unit.sh, [chmod +x test/kinetics_reactive_scheme_unit.sh])
AC_CONFIG_FILES(test/nasa_evaluator_unit.sh, [chmod +x test/nasa_evaluator_unit.sh])
AC_CONFIG_FILES(test/ascii_parser_unit.sh, [chmod +x test/ascii_parser_unit.sh])

dnl-----------------------------------------------
dnl Generate header files
Expand Down
3 changes: 3 additions & 0 deletions test/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ check_PROGRAMS += kinetics_theory_thermal_conductivity_vec_unit
check_PROGRAMS += rotational_relaxation_unit
check_PROGRAMS += rotational_relaxation_vec_unit
check_PROGRAMS += ideal_gas_micro_thermo_unit
check_PROGRAMS += ascii_parser_unit

#GSL Tests
check_PROGRAMS += molecular_binary_diffusion_unit
Expand Down Expand Up @@ -141,6 +142,7 @@ kinetics_theory_thermal_conductivity_unit_SOURCES = kinetics_theory_thermal_cond
kinetics_theory_thermal_conductivity_vec_unit_SOURCES = kinetics_theory_thermal_conductivity_vec_unit.C
rotational_relaxation_unit_SOURCES = rotational_relaxation_unit.C
rotational_relaxation_vec_unit_SOURCES = rotational_relaxation_vec_unit.C
ascii_parser_unit_SOURCES = ascii_parser_unit.C

# GSL Tests
molecular_binary_diffusion_unit_SOURCES = molecular_binary_diffusion_unit.C
Expand Down Expand Up @@ -213,6 +215,7 @@ TESTS += kinetics_theory_thermal_conductivity_vec_unit
TESTS += rotational_relaxation_unit
TESTS += rotational_relaxation_vec_unit
TESTS += ideal_gas_micro_thermo_unit
TESTS += ascii_parser_unit.sh

# GSL Tests
TESTS += molecular_binary_diffusion_unit
Expand Down
67 changes: 67 additions & 0 deletions test/ascii_parser_unit.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
//-----------------------------------------------------------------------bl-
//--------------------------------------------------------------------------
//-----------------------------------------------------------------------el-

#include "antioch/chemical_mixture.h"
#include "antioch/transport_mixture.h"
#include "antioch/ascii_parser.h"
#include "antioch/ideal_gas_internal_thermo.h"
#include "antioch/cea_curve_fit.h"
#include "antioch/nasa_mixture.h"
#include "antioch/nasa_evaluator.h"
#include "antioch/thermo_evaluator.h"

#include <iomanip>
#include <string>

template <typename Scalar>
int tester(const std::string& filename)
{

std::vector<std::string> species_list;
species_list.push_back("N2");
species_list.push_back("O2");
species_list.push_back("H2");

Antioch::ChemicalMixture<Scalar> chem_mix(species_list);
//thermo
//// macro
Antioch::NASAThermoMixture<Scalar, Antioch::CEACurveFit<Scalar> > nasa_mixture( chem_mix);
Antioch::NASAEvaluator<Scalar, Antioch::CEACurveFit<Scalar> > nasa_thermo( nasa_mixture );

typedef Antioch::NASAEvaluator<Scalar, Antioch::CEACurveFit<Scalar> > NASAThermoType;

//// micro
Antioch::IdealGasInternalThermo<NASAThermoType,Scalar> micro_thermo(nasa_thermo,chem_mix);

typedef Antioch::IdealGasInternalThermo<NASAThermoType,Scalar> StatThermoType;

//// eval
Antioch::ThermoEvaluator<Scalar,NASAThermoType,StatThermoType> thermo(nasa_thermo,micro_thermo);

typedef Antioch::ThermoEvaluator<Scalar,NASAThermoType,StatThermoType> ThermoEval;

//transport
///// mixture and stat thermo for conduction
// read
Antioch::ASCIIParser<Scalar> parser(filename,true);

parser.set_ignored_columns(std::vector<unsigned int>(1,0));

Antioch::TransportMixture<ThermoEval,Scalar> tran_mixture( chem_mix, thermo, parser);

return tran_mixture.transport_species().empty(); // false is winner
}

int main(int argc, char* argv[])
{
// Check command line count.
if( argc < 2 )
{
// TODO: Need more consistent error handling.
std::cerr << "Error: Must specify ascii transport input file." << std::endl;
antioch_error();
}

return tester<double>(std::string(argv[1]));
}
8 changes: 8 additions & 0 deletions test/ascii_parser_unit.sh.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

PROG="@top_builddir@/test/ascii_parser_unit"

INPUT="@top_srcdir@/test/input_files/test_parsing.ASCII"

$PROG $INPUT

110 changes: 110 additions & 0 deletions test/input_files/test_parsing.ASCII
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
AR 0 136.500 3.330 0.000 0.000 0.000
C 0 71.400 3.298 0.000 0.000 0.000 ! *
C2 1 97.530 3.621 0.000 1.760 4.000
C2O 1 232.400 3.828 0.000 0.000 1.000 ! *
CN2 1 232.400 3.828 0.000 0.000 1.000 ! OIS
C2H 1 209.000 4.100 0.000 0.000 2.500
C2H2 1 209.000 4.100 0.000 0.000 2.500
C2H2OH 2 224.700 4.162 0.000 0.000 1.000 ! *
C2H3 2 209.000 4.100 0.000 0.000 1.000 ! *
C2H4 2 280.800 3.971 0.000 0.000 1.500
C2H5 2 252.300 4.302 0.000 0.000 1.500
C2H6 2 252.300 4.302 0.000 0.000 1.500
C2N 1 232.400 3.828 0.000 0.000 1.000 ! OIS
C2N2 1 349.000 4.361 0.000 0.000 1.000 ! OIS
C3H2 2 209.000 4.100 0.000 0.000 1.000 ! *
C3H4 1 252.000 4.760 0.000 0.000 1.000
C3H6 2 266.800 4.982 0.000 0.000 1.000
C3H7 2 266.800 4.982 0.000 0.000 1.000
C4H6 2 357.000 5.180 0.000 0.000 1.000
I*C3H7 2 266.800 4.982 0.000 0.000 1.000
N*C3H7 2 266.800 4.982 0.000 0.000 1.000
C3H8 2 266.800 4.982 0.000 0.000 1.000
C4H 1 357.000 5.180 0.000 0.000 1.000
C4H2 1 357.000 5.180 0.000 0.000 1.000
C4H2OH 2 224.700 4.162 0.000 0.000 1.000 ! *
C4H8 2 357.000 5.176 0.000 0.000 1.000
C4H9 2 357.000 5.176 0.000 0.000 1.000
I*C4H9 2 357.000 5.176 0.000 0.000 1.000
C5H2 1 357.000 5.180 0.000 0.000 1.000
C5H3 1 357.000 5.180 0.000 0.000 1.000
C6H2 1 357.000 5.180 0.000 0.000 1.000
C6H5 2 412.300 5.349 0.000 0.000 1.000 ! JAM
C6H5O 2 450.000 5.500 0.000 0.000 1.000 ! JAM
C5H5OH 2 450.000 5.500 0.000 0.000 1.000 ! JAM
C6H6 2 412.300 5.349 0.000 0.000 1.000 ! SVE
C6H7 2 412.300 5.349 0.000 0.000 1.000 ! JAM
CH 1 80.000 2.750 0.000 0.000 0.000
CH2 1 144.000 3.800 0.000 0.000 0.000
CH2(S) 1 144.000 3.800 0.000 0.000 0.000
CH2* 1 144.000 3.800 0.000 0.000 0.000
CH2CHCCH 2 357.000 5.180 0.000 0.000 1.000 ! JAM
CH2CHCCH2 2 357.000 5.180 0.000 0.000 1.000 ! JAM
CH2CHCH2 2 260.000 4.850 0.000 0.000 1.000 ! JAM
CH2CHCHCH 2 357.000 5.180 0.000 0.000 1.000 ! JAM
CH2CHCHCH2 2 357.000 5.180 0.000 0.000 1.000 ! JAM
CH2CO 2 436.000 3.970 0.000 0.000 2.000
CH2O 2 498.000 3.590 0.000 0.000 2.000
CH2OH 2 417.000 3.690 1.700 0.000 2.000
CH3 1 144.000 3.800 0.000 0.000 0.000
CH3CC 2 252.000 4.760 0.000 0.000 1.000 ! JAM
CH3CCCH2 2 357.000 5.180 0.000 0.000 1.000 ! JAM
CH3CCCH3 2 357.000 5.180 0.000 0.000 1.000 ! JAM
CH3CCH2 2 260.000 4.850 0.000 0.000 1.000 ! JAM
CH3CHCH 2 260.000 4.850 0.000 0.000 1.000 ! JAM
CH3CH2CCH 2 357.000 5.180 0.000 0.000 1.000 ! JAM
CH3CHO 2 436.000 3.970 0.000 0.000 2.000
CH2CHO 2 436.000 3.970 0.000 0.000 2.000
CH3CO 2 436.000 3.970 0.000 0.000 2.000
CH3O 2 417.000 3.690 1.700 0.000 2.000
CH3OH 2 481.800 3.626 0.000 0.000 1.000 ! SVE
CH4 2 141.400 3.746 0.000 2.600 13.000
CH4O 2 417.000 3.690 1.700 0.000 2.000
CN 1 75.000 3.856 0.000 0.000 1.000 ! OIS
CNC 1 232.400 3.828 0.000 0.000 1.000 ! OIS
CNN 1 232.400 3.828 0.000 0.000 1.000 ! OIS
CO 1 98.100 3.650 0.000 1.950 1.800
CO2 1 244.000 3.763 0.000 2.650 2.100
H 0 145.000 2.050 0.000 0.000 0.000
H2C4O 2 357.000 5.180 0.000 0.000 1.000 ! JAM
H2 1 38.000 2.920 0.000 0.790 280.000
H2CCCCH 2 357.000 5.180 0.000 0.000 1.000 ! JAM
H2CCCCH2 2 357.000 5.180 0.000 0.000 1.000 ! JAM
H2CCCH 2 252.000 4.760 0.000 0.000 1.000 ! JAM
H2CN 1 569.000 3.630 0.000 0.000 1.000 ! os/jm
H2NO 2 116.700 3.492 0.000 0.000 1.000 ! JAM
H2O 2 572.400 2.605 1.844 0.000 4.000
H2O2 2 107.400 3.458 0.000 0.000 3.800
HC2N2 1 349.000 4.361 0.000 0.000 1.000 ! OIS
HCCHCCH 2 357.000 5.180 0.000 0.000 1.000 ! JAM
HCCO 2 150.000 2.500 0.000 0.000 1.000 ! *
HCNN 2 150.000 2.500 0.000 0.000 1.000 ! *
HCCOH 2 436.000 3.970 0.000 0.000 2.000
HCN 1 569.000 3.630 0.000 0.000 1.000 ! OIS
HCO 2 498.000 3.590 0.000 0.000 0.000
HE 0 10.200 2.576 0.000 0.000 0.000 ! *
HCNO 2 232.400 3.828 0.000 0.000 1.000 ! JAM
HOCN 2 232.400 3.828 0.000 0.000 1.000 ! JAM
HNCO 2 232.400 3.828 0.000 0.000 1.000 ! OIS
HNNO 2 232.400 3.828 0.000 0.000 1.000 ! *
HNO 2 116.700 3.492 0.000 0.000 1.000 ! *
HNOH 2 116.700 3.492 0.000 0.000 1.000 ! JAM
HO2 2 107.400 3.458 0.000 0.000 1.000 ! *
N 0 71.400 3.298 0.000 0.000 0.000 ! *
N2 1 97.530 3.621 0.000 1.760 4.000
N2H2 2 71.400 3.798 0.000 0.000 1.000 ! *
N2H3 2 200.000 3.900 0.000 0.000 1.000 ! *
N2H4 2 205.000 4.230 0.000 4.260 1.500
N2O 1 232.400 3.828 0.000 0.000 1.000 ! *
NCN 1 232.400 3.828 0.000 0.000 1.000 ! OIS
NCO 1 232.400 3.828 0.000 0.000 1.000 ! OIS
NH 1 80.000 2.650 0.000 0.000 4.000
NH2 2 80.000 2.650 0.000 2.260 4.000
NH3 2 481.000 2.920 1.470 0.000 10.000
NNH 2 71.400 3.798 0.000 0.000 1.000 ! *
NO 1 97.530 3.621 0.000 1.760 4.000
NCNO 2 232.400 3.828 0.000 0.000 1.000 ! OIS
NO2 2 200.000 3.500 0.000 0.000 1.000 ! *
O 0 80.000 2.750 0.000 0.000 0.000
O2 1 107.400 3.458 0.000 1.600 3.800
OH 1 80.000 2.750 0.000 0.000 0.000

0 comments on commit e1810b9

Please sign in to comment.