GRINS-0.8.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 "grins/antioch_mixture_averaged_transport_mixture_builder.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 KineticsThermo , 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 176 of file antioch_mixture_averaged_transport_evaluator_regression.C.

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

Definition at line 118 of file antioch_mixture_averaged_transport_evaluator_regression.C.

References GRINS::AntiochMixtureAveragedTransportMixtureBuilder::build_mixture(), GRINS::AntiochEvaluator< Antioch::CEACurveFit< libMesh::Real >, Thermo >::cp(), GRINS::AntiochMixtureAveragedTransportEvaluator< KineticsThermoCurveFit, Thermo, Viscosity, Conductivity, Diffusivity >::mu_and_k_and_D(), and GRINS::AntiochEvaluator< Antioch::CEACurveFit< libMesh::Real >, Thermo >::R_mix().

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

Definition at line 46 of file antioch_mixture_averaged_transport_evaluator_regression.C.

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

47 {
48  int return_flag = 0;
49 
50  const double tol = std::numeric_limits<double>::epsilon()*10;
51 
52  const double rel_error = std::fabs( (value - value_reg)/value_reg );
53 
54  if( rel_error > tol )
55  {
56  return_flag = 1;
57  std::cout << "Mismatch in "+name << std::endl
58  << name+" = " << value << std::endl
59  << name+"_reg = " << value_reg << std::endl
60  << "rel_error = " << rel_error << std::endl;
61  }
62 
63  return return_flag;
64 }
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 77 of file antioch_mixture_averaged_transport_evaluator_regression.C.

References test_generic().

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

Generated on Tue Dec 19 2017 12:47:29 for GRINS-0.8.0 by  doxygen 1.8.9.1