24 #include "grins_config.h"
26 #ifdef GRINS_HAVE_CPPUNIT
27 #ifdef GRINS_HAVE_ANTIOCH
29 #include <cppunit/extensions/HelperMacros.h>
30 #include <cppunit/TestCase.h>
33 #include "grins_test_paths.h"
59 std::string input_file = std::string(GRINS_TEST_SRCDIR)+
"/input_files/antioch.in";
60 _input.reset(
new GetPot(input_file) );
67 libMesh::UniquePtr<Antioch::ChemicalMixture<libMesh::Real> > chem_mix
71 CPPUNIT_ASSERT_EQUAL( 5, (
int)chem_mix->n_species() );
73 const std::vector<Antioch::ChemicalSpecies<libMesh::Real>*> & all_species =
74 chem_mix->chemical_species();
76 CPPUNIT_ASSERT_EQUAL( 5, (
int)all_species.size() );
83 libMesh::UniquePtr<Antioch::ChemicalMixture<libMesh::Real> > chem_mix
86 libMesh::UniquePtr<Antioch::ReactionSet<libMesh::Real> > reaction_set
89 CPPUNIT_ASSERT_EQUAL( 5, (
int)reaction_set->n_species() );
90 CPPUNIT_ASSERT_EQUAL( 5, (
int)reaction_set->n_reactions() );
97 libMesh::UniquePtr<Antioch::ChemicalMixture<libMesh::Real> > chem_mix
100 libMesh::UniquePtr<Antioch::NASAThermoMixture<libMesh::Real,Antioch::CEACurveFit<libMesh::Real> > >
104 CPPUNIT_ASSERT(nasa_mix->check());
111 libMesh::Real min_T_exact = 114.15;
114 CPPUNIT_ASSERT_DOUBLES_EQUAL( min_T_exact, min_T, std::numeric_limits<libMesh::Real>::epsilon() );
121 bool clip_negative_rho_exact =
true;
124 CPPUNIT_ASSERT_EQUAL( clip_negative_rho_exact, clip_negative_rho );
151 std::string input_file = std::string(GRINS_TEST_SRCDIR)+
"/input_files/antioch.in";
152 _input.reset(
new GetPot(input_file) );
159 libMesh::UniquePtr<GRINS::ConstantViscosity> visc =
162 libMesh::Real mu = (*visc)();
164 CPPUNIT_ASSERT_DOUBLES_EQUAL( 3.14, mu, std::numeric_limits<libMesh::Real>::epsilon() );
171 libMesh::UniquePtr<GRINS::ConstantConductivity> conductivity =
174 libMesh::Real k = (*conductivity)();
176 CPPUNIT_ASSERT_DOUBLES_EQUAL( 2.71, k, std::numeric_limits<libMesh::Real>::epsilon() );
183 libMesh::UniquePtr<GRINS::ConstantPrandtlConductivity> conductivity =
186 libMesh::Real mu = 1.2;
187 libMesh::Real cp = 2.3;
188 libMesh::Real Pr = 0.7;
189 libMesh::Real k = (*conductivity)( mu, cp );
190 libMesh::Real k_exact = mu*cp/Pr;
192 CPPUNIT_ASSERT_DOUBLES_EQUAL( k_exact, k, std::numeric_limits<libMesh::Real>::epsilon() );
199 libMesh::UniquePtr<Antioch::ConstantLewisDiffusivity<libMesh::Real> > diff =
202 libMesh::Real rho = 1.2;
203 libMesh::Real cp = 2.3;
204 libMesh::Real k = 3.4;
205 libMesh::Real Le = 1.4;
207 libMesh::Real D = diff->D(rho,cp,k);
209 libMesh::Real D_exact = k/rho/cp/Le;
211 CPPUNIT_ASSERT_DOUBLES_EQUAL( D_exact, D, std::numeric_limits<libMesh::Real>::epsilon() );
218 libMesh::UniquePtr<GRINS::AntiochConstantTransportMixture<Antioch::CEACurveFit<libMesh::Real>,
221 (*
_input,
"TestMaterial");
223 libMesh::Real mu = mixture->mu();
224 libMesh::Real k = (mixture->conductivity())();
226 libMesh::Real rho = 1.2;
227 libMesh::Real cp = 2.3;
229 libMesh::Real Le = 1.4;
231 libMesh::Real D = mixture->diffusivity().D(rho,cp,k);
233 libMesh::Real D_exact = k/rho/cp/Le;
235 CPPUNIT_ASSERT_DOUBLES_EQUAL( 3.14, mu, std::numeric_limits<libMesh::Real>::epsilon() );
236 CPPUNIT_ASSERT_DOUBLES_EQUAL( 2.71, k, std::numeric_limits<libMesh::Real>::epsilon() );
237 CPPUNIT_ASSERT_DOUBLES_EQUAL( D_exact, D, std::numeric_limits<libMesh::Real>::epsilon() );
244 libMesh::UniquePtr<GRINS::AntiochConstantTransportMixture<Antioch::CEACurveFit<libMesh::Real>,
247 (*
_input,
"TestMaterial");
249 libMesh::Real mu = mixture->mu();
250 libMesh::Real cp = 2.3;
251 libMesh::Real Pr = 0.7;
252 libMesh::Real k = (mixture->conductivity())(mu, cp);
253 libMesh::Real k_exact = mu*cp/Pr;
255 libMesh::Real rho = 1.2;
257 libMesh::Real Le = 1.4;
259 libMesh::Real D = mixture->diffusivity().D(rho,cp,k);
261 libMesh::Real D_exact = k/rho/cp/Le;
263 CPPUNIT_ASSERT_DOUBLES_EQUAL( 3.14, mu, std::numeric_limits<libMesh::Real>::epsilon() );
264 CPPUNIT_ASSERT_DOUBLES_EQUAL( k_exact, k, std::numeric_limits<libMesh::Real>::epsilon() );
265 CPPUNIT_ASSERT_DOUBLES_EQUAL( D_exact, D, std::numeric_limits<libMesh::Real>::epsilon() );
284 #ifdef ANTIOCH_HAVE_GSL
286 #endif // ANTIOCH_HAVE_GSL
294 std::string input_file = std::string(GRINS_TEST_SRCDIR)+
"/input_files/antioch.in";
295 _input.reset(
new GetPot(input_file) );
302 libMesh::UniquePtr<GRINS::AntiochMixtureAveragedTransportMixture<Antioch::CEACurveFit<libMesh::Real>,
303 Antioch::IdealGasMicroThermo<Antioch::NASAEvaluator<libMesh::Real,Antioch::CEACurveFit<libMesh::Real> >, libMesh::Real>,
304 Antioch::SutherlandViscosity<libMesh::Real>,
305 Antioch::EuckenThermalConductivity<Antioch::IdealGasMicroThermo<Antioch::NASAEvaluator<libMesh::Real,Antioch::CEACurveFit<libMesh::Real> >, libMesh::Real> > ,
306 Antioch::ConstantLewisDiffusivity<libMesh::Real> > >
307 mixture = builder.
build_mixture<Antioch::CEACurveFit<libMesh::Real>,
308 Antioch::IdealGasMicroThermo<Antioch::NASAEvaluator<libMesh::Real,Antioch::CEACurveFit<libMesh::Real> >, libMesh::Real>,
309 Antioch::SutherlandViscosity<libMesh::Real>,
310 Antioch::EuckenThermalConductivity<Antioch::IdealGasMicroThermo<Antioch::NASAEvaluator<libMesh::Real,Antioch::CEACurveFit<libMesh::Real> >, libMesh::Real> >,
311 Antioch::ConstantLewisDiffusivity<libMesh::Real> >( *
_input,
"TestMaterial" );
313 CPPUNIT_ASSERT(mixture);
320 libMesh::UniquePtr<GRINS::AntiochMixtureAveragedTransportMixture<Antioch::CEACurveFit<libMesh::Real>,
321 Antioch::StatMechThermodynamics<libMesh::Real>,
322 Antioch::SutherlandViscosity<libMesh::Real>,
323 Antioch::EuckenThermalConductivity<Antioch::StatMechThermodynamics<libMesh::Real> >,
324 Antioch::ConstantLewisDiffusivity<libMesh::Real> > >
325 mixture = builder.
build_mixture<Antioch::CEACurveFit<libMesh::Real>,
326 Antioch::StatMechThermodynamics<libMesh::Real>,
327 Antioch::SutherlandViscosity<libMesh::Real>,
328 Antioch::EuckenThermalConductivity<Antioch::StatMechThermodynamics<libMesh::Real> >,
329 Antioch::ConstantLewisDiffusivity<libMesh::Real> >( *
_input,
"TestMaterial" );
331 CPPUNIT_ASSERT(mixture);
334 #ifdef ANTIOCH_HAVE_GSL
335 void test_build_cea_kinetic_theory_mix()
339 libMesh::UniquePtr<GRINS::AntiochMixtureAveragedTransportMixture<Antioch::CEACurveFit<libMesh::Real>,
340 Antioch::IdealGasMicroThermo<Antioch::NASAEvaluator<libMesh::Real,Antioch::CEACurveFit<libMesh::Real> >, libMesh::Real>,
341 Antioch::KineticsTheoryViscosity<libMesh::Real,Antioch::GSLSpliner>,
342 Antioch::KineticsTheoryThermalConductivity<Antioch::IdealGasMicroThermo<Antioch::NASAEvaluator<libMesh::Real,Antioch::CEACurveFit<libMesh::Real> >, libMesh::Real>,libMesh::Real>,
343 Antioch::MolecularBinaryDiffusion<libMesh::Real,Antioch::GSLSpliner> > >
344 mixture = builder.
build_mixture<Antioch::CEACurveFit<libMesh::Real>,
345 Antioch::IdealGasMicroThermo<Antioch::NASAEvaluator<libMesh::Real,Antioch::CEACurveFit<libMesh::Real> >, libMesh::Real>,
346 Antioch::KineticsTheoryViscosity<libMesh::Real,Antioch::GSLSpliner>,
347 Antioch::KineticsTheoryThermalConductivity<Antioch::IdealGasMicroThermo<Antioch::NASAEvaluator<libMesh::Real,Antioch::CEACurveFit<libMesh::Real> >, libMesh::Real>,libMesh::Real>,
348 Antioch::MolecularBinaryDiffusion<libMesh::Real,Antioch::GSLSpliner> >( *
_input,
"TestMaterial" );
350 CPPUNIT_ASSERT(mixture);
352 #endif // ANTIOCH_HAVE_GSL
366 #endif // GRINS_HAVE_ANTIOCH
367 #endif // GRINS_HAVE_CPPUNIT
bool parse_clip_negative_rho(const GetPot &input, const std::string &material)
void test_parse_clip_negative_rho()
void test_build_constant_conductivity()
CPPUNIT_TEST_SUITE_REGISTRATION(AntiochAirNASA9ThermoTest)
libMesh::UniquePtr< AntiochConstantTransportMixture< KineticsThermoCurveFit, Conductivity > > build_mixture(const GetPot &input, const std::string &material)
CPPUNIT_TEST(test_build_cea_sutherland_eucken_constlewis_mix)
libMesh::UniquePtr< Antioch::ReactionSet< libMesh::Real > > build_reaction_set(const GetPot &input, const std::string &material, const Antioch::ChemicalMixture< libMesh::Real > &chem_mix)
CPPUNIT_TEST_SUITE(AntiochMixtureBuilderBaseTest)
CPPUNIT_TEST(test_build_chem_mix)
libMesh::UniquePtr< GetPot > _input
Base class building Antioch mixture wrappers.
void test_build_nasa_thermo_mix_cea()
libMesh::UniquePtr< Antioch::NASAThermoMixture< libMesh::Real, KineticsThermoCurveFit > > build_nasa_thermo_mix(const GetPot &input, const std::string &material, const Antioch::ChemicalMixture< libMesh::Real > &chem_mix)
void test_build_reaction_set()
libMesh::UniquePtr< Antioch::ConstantLewisDiffusivity< libMesh::Real > > build_constant_lewis_diff(const GetPot &input, const std::string &material)
libMesh::UniquePtr< ConstantViscosity > build_constant_viscosity(const GetPot &input, const std::string &material)
void test_build_constant_lewis_diff()
void test_build_cea_sutherland_eucken_constlewis_mix()
void test_build_constant_prandtl_conductivity()
void test_build_cea_constcond_mix()
CPPUNIT_TEST_SUITE(AntiochMixtureAveragedTransportMixtureBuilderTest)
void test_build_constant_viscosity()
void test_build_chem_mix()
libMesh::UniquePtr< Conductivity > build_constant_conductivity(const GetPot &input, const std::string &material)
libMesh::UniquePtr< GetPot > _input
libMesh::Real parse_min_T(const GetPot &input, const std::string &material)
CPPUNIT_TEST_SUITE(AntiochConstantTransportMixtureBuilderTest)
libMesh::UniquePtr< Antioch::ChemicalMixture< libMesh::Real > > build_chem_mix(const GetPot &input, const std::string &material)
void test_build_cea_constpr_mix()
libMesh::UniquePtr< GetPot > _input
void test_build_cea_statmech_sutherland_eucken_constlewis_mix()
libMesh::UniquePtr< AntiochMixtureAveragedTransportMixture< KineticsThermoCurveFit, Thermo, Viscosity, Conductivity, Diffusivity > > build_mixture(const GetPot &input, const std::string &material)
CPPUNIT_TEST(test_build_constant_viscosity)