GRINS-0.7.0
Functions
antioch_mixture_averaged_transport_evaluator_regression.C File Reference
#include "grins_config.h"
#include <iomanip>
#include <limits>
#include <vector>
#include "grins/antioch_mixture_averaged_transport_mixture.h"
#include "grins/antioch_mixture_averaged_transport_evaluator.h"
#include "grins/cached_values.h"
#include "grins/materials_parsing.h"
#include "grins/physics_naming.h"
#include "libmesh/getpot.h"
Include dependency graph for antioch_mixture_averaged_transport_evaluator_regression.C:

Go to the source code of this file.

Functions

int test_generic (const libMesh::Real value, const libMesh::Real value_reg, const std::string &name)
 
template<typename Viscosity >
int test_mu (const libMesh::Real mu)
 
template<typename Thermo , typename Conductivity >
int test_k (const libMesh::Real k)
 
template<typename Thermo , typename Viscosity , typename Conductivity , typename Diffusivity >
int test_D (const std::vector< libMesh::Real > &D)
 
template<>
int test_mu< Antioch::BlottnerViscosity< libMesh::Real > > (const libMesh::Real mu)
 
template<typename Thermo , typename Viscosity , typename Conductivity , typename Diffusivity >
int test_evaluator (const GetPot &input)
 
int main (int argc, char *argv[])
 

Function Documentation

int main ( int  argc,
char *  argv[] 
)

Definition at line 167 of file antioch_mixture_averaged_transport_evaluator_regression.C.

168 {
169  // Check command line count.
170  if( argc < 2 )
171  {
172  // TODO: Need more consistent error handling.
173  std::cerr << "Error: Must specify input file." << std::endl;
174  exit(1);
175  }
176 
177  GetPot input( argv[1] );
178 
179  int return_flag = 0;
180 
181  std::cout << std::endl << "Running StatMesh, Blottner, Eucken, Constant Lewis regression test." << std::endl;
182  return_flag = test_evaluator<Antioch::StatMechThermodynamics<libMesh::Real>,
183  Antioch::BlottnerViscosity<libMesh::Real>,
184  Antioch::EuckenThermalConductivity<Antioch::StatMechThermodynamics<libMesh::Real> >,
185  Antioch::ConstantLewisDiffusivity<libMesh::Real> >(input);
186 
187  return return_flag;
188 }
template<typename Thermo , typename Viscosity , typename Conductivity , typename Diffusivity >
int test_D ( const std::vector< libMesh::Real > &  D)
template<typename Thermo , typename Viscosity , typename Conductivity , typename Diffusivity >
int test_evaluator ( const GetPot &  input)

Definition at line 117 of file antioch_mixture_averaged_transport_evaluator_regression.C.

References GRINS::AntiochEvaluator< Thermo >::cp(), GRINS::AntiochMixtureAveragedTransportEvaluator< Thermo, Viscosity, Conductivity, Diffusivity >::mu_and_k_and_D(), GRINS::AntiochEvaluator< Thermo >::R_mix(), and GRINS::AntiochChemistry::species_name().

118 {
120 
122 
123  const libMesh::Real T = 1000;
124 
125  const libMesh::Real rho = 1.0e-3;
126 
127  const unsigned int n_species = 5;
128 
129  std::vector<libMesh::Real> Y(n_species,0.2);
130 
131  libMesh::Real p0 = rho*T*evaluator.R_mix(Y);
132  libMesh::Real mu = 0.0;
133  libMesh::Real k = 0.0;
134  std::vector<libMesh::Real> D(n_species,0.0);
135 
136  evaluator.mu_and_k_and_D( T, rho, evaluator.cp(T,p0,Y), Y, mu, k, D );
137 
138  std::cout << std::scientific << std::setprecision(16)
139  << "mu = " << mu << std::endl;
140 
141  std::cout << std::scientific << std::setprecision(16)
142  << "k = " << k << std::endl;
143 
144  for( unsigned int i = 0; i < n_species; i++ )
145  {
146  std::cout << std::scientific << std::setprecision(16)
147  << "D(" << mixture.species_name(i) << ") = " << D [i] << std::endl;
148  }
149 
150  int return_flag = 0;
151 
152  int return_flag_temp = 0;
153 
154  return_flag_temp = test_mu<Viscosity>( mu );
155  if( return_flag_temp != 0 ) return_flag = 1;
156 
157  return_flag_temp = test_k<Thermo,Conductivity>( k );
158  if( return_flag_temp != 0 ) return_flag = 1;
159 
160  return_flag_temp = test_D<Thermo,Viscosity,Conductivity,Diffusivity>( D );
161  if( return_flag_temp != 0 ) return_flag = 1;
162 
163  return return_flag;
164 }
Wrapper class for storing state for computing Wilke transport properties using Antioch.
Wrapper class for evaluating Wilke transport properties using Antioch.
int test_generic ( const libMesh::Real  value,
const libMesh::Real  value_reg,
const std::string &  name 
)

Definition at line 45 of file antioch_mixture_averaged_transport_evaluator_regression.C.

Referenced by test_mu< Antioch::BlottnerViscosity< libMesh::Real > >().

46 {
47  int return_flag = 0;
48 
49  const double tol = std::numeric_limits<double>::epsilon()*10;
50 
51  const double rel_error = std::fabs( (value - value_reg)/value_reg );
52 
53  if( rel_error > tol )
54  {
55  return_flag = 1;
56  std::cout << "Mismatch in "+name << std::endl
57  << name+" = " << value << std::endl
58  << name+"_reg = " << value_reg << std::endl
59  << "rel_error = " << rel_error << std::endl;
60  }
61 
62  return return_flag;
63 }
template<typename Thermo , typename Conductivity >
int test_k ( const libMesh::Real  k)
template<typename Viscosity >
int test_mu ( const libMesh::Real  mu)
template<>
int test_mu< Antioch::BlottnerViscosity< libMesh::Real > > ( const libMesh::Real  mu)

Definition at line 76 of file antioch_mixture_averaged_transport_evaluator_regression.C.

References test_generic().

77 {
78  double mu_reg = 4.5123309407810213e-05;
79 
80  return test_generic(mu,mu_reg,"mu");
81 }
int test_generic(const libMesh::Real value, const libMesh::Real value_reg, const std::string &name)

Generated on Thu Jun 2 2016 21:52:29 for GRINS-0.7.0 by  doxygen 1.8.10