GRINS-0.6.0
Functions
antioch_transport_values.C File Reference
#include "grins_config.h"
#include <iomanip>
#include <vector>
#include <fstream>
#include "libmesh/getpot.h"
#include "grins/antioch_wilke_transport_evaluator.h"
Include dependency graph for antioch_transport_values.C:

Go to the source code of this file.

Functions

template<typename Thermo , typename Viscosity , typename Conductivity , typename Diffusivity >
int do_transport_eval (const GetPot &input)
 
int main (int argc, char *argv[])
 

Function Documentation

template<typename Thermo , typename Viscosity , typename Conductivity , typename Diffusivity >
int do_transport_eval ( const GetPot &  input)

Definition at line 43 of file antioch_transport_values.C.

References GRINS::AntiochEvaluator< Thermo >::cp(), GRINS::AntiochWilkeTransportEvaluator< Thermo, Viscosity, Conductivity, Diffusivity >::D(), GRINS::AntiochWilkeTransportEvaluator< Thermo, Viscosity, Conductivity, Diffusivity >::k(), GRINS::AntiochWilkeTransportEvaluator< Thermo, Viscosity, Conductivity, Diffusivity >::mu(), GRINS::AntiochChemistry::n_species(), and GRINS::AntiochChemistry::species_name().

44 {
46 
48 
49  libMesh::Real T0 = input( "Conditions/T0", 300.0 );
50  libMesh::Real T1 = input( "Conditions/T1", 300.0 );
51  libMesh::Real T_inc = input( "Conditions/T_increment", 100.0 );
52 
53  libMesh::Real rho = input( "Conditions/density", 1.0e-3 );
54 
55  const unsigned int n_species = mixture.n_species();
56 
57  std::vector<libMesh::Real> Y(n_species);
58  if( input.vector_variable_size( "Conditions/mass_fractions" ) != n_species )
59  {
60  std::cerr << "Error: mass fractions size not consistent with n_species"
61  << std::endl;
62  libmesh_error();
63  }
64 
65  for( unsigned int s = 0; s < n_species; s++ )
66  {
67  Y[s] = input( "Conditions/mass_fractions", 0.0, s );
68  }
69 
70  libMesh::Real T = T0;
71 
72  std::ofstream output;
73  output.open( "transport.dat", std::ios::trunc );
74 
75  output << "# Species names" << std::endl;
76  for( unsigned int s = 0; s < n_species; s++ )
77  {
78  output << mixture.species_name( s ) << " ";
79  }
80  output << std::endl;
81  output << "# T [K] mu k D[s]" << std::endl;
82 
83  output.close();
84 
85  while( T < T1 )
86  {
87  output.open( "transport.dat", std::ios::app );
88  output << std::scientific << std::setprecision(16);
89  output << T << " ";
90 
91  libMesh::Real mu = evaluator.mu(T,Y);
92  libMesh::Real k = evaluator.k(T,Y);
93 
94  output << mu << " ";
95  output << k << " ";
96 
97  std::vector<libMesh::Real> D(n_species);
98  for( unsigned int s = 0; s< n_species; s++ )
99  {
100  evaluator.D(rho, evaluator.cp(T,Y), k, D);
101 
102  output << D[s] << " ";
103  }
104  output << std::endl;
105  output.close();
106 
107  T += T_inc;
108  }
109 
110  return 0;
111 }
Wrapper class for storing state for computing Wilke transport properties using Antioch.
Wrapper class for evaluating Wilke transport properties using Antioch.
int main ( int  argc,
char *  argv[] 
)

Definition at line 113 of file antioch_transport_values.C.

114 {
115  // Check command line count.
116  if( argc < 2 )
117  {
118  // TODO: Need more consistent error handling.
119  std::cerr << "Error: Must specify input file." << std::endl;
120  exit(1);
121  }
122 
123  GetPot input( argv[1] );
124 
125  std::string mixing_model = input( "Physics/Antioch/mixing_model", "wilke");
126  std::string thermo_model = input( "Physics/Antioch/thermo_model", "stat_mech");
127  std::string viscosity_model = input( "Physics/Antioch/viscosity_model", "sutherland");
128  std::string conductivity_model = input( "Physics/Antioch/conductivity_model", "eucken");
129  std::string diffusivity_model = input( "Physics/Antioch/diffusivity_model", "constant_lewis");
130 
131  int return_flag = 0;
132 
133  if( mixing_model == std::string("wilke") )
134  {
135  if( thermo_model == std::string("stat_mech") )
136  {
137  if( diffusivity_model == std::string("constant_lewis") )
138  {
139  if( conductivity_model == std::string("eucken") )
140  {
141  if( viscosity_model == std::string("sutherland") )
142  {
143  return_flag = do_transport_eval<Antioch::StatMechThermodynamics<libMesh::Real>,
144  Antioch::MixtureViscosity<Antioch::SutherlandViscosity<libMesh::Real> >,
145  Antioch::EuckenThermalConductivity<Antioch::StatMechThermodynamics<libMesh::Real> >,
146  Antioch::ConstantLewisDiffusivity<libMesh::Real> >(input);
147  }
148  else if( viscosity_model == std::string("blottner") )
149  {
150  return_flag = do_transport_eval<Antioch::StatMechThermodynamics<libMesh::Real>,
151  Antioch::MixtureViscosity<Antioch::BlottnerViscosity<libMesh::Real> >,
152  Antioch::EuckenThermalConductivity<Antioch::StatMechThermodynamics<libMesh::Real> >,
153  Antioch::ConstantLewisDiffusivity<libMesh::Real> >(input);
154  }
155  else
156  {
157  std::cerr << "Error: Unknown viscosity_model "
158  << viscosity_model << "!" << std::endl;
159  return_flag = 1;
160  }
161  }
162  else
163  {
164  std::cerr << "Error: Unknown conductivity_model "
165  << conductivity_model << "!" << std::endl;
166  return_flag = 1;
167  }
168  }
169  else
170  {
171  std::cerr << "Error: Unknown diffusivity_model "
172  << diffusivity_model << "!" << std::endl;
173  return_flag = 1;
174  }
175  }
176  else
177  {
178  std::cerr << "Error: Unknown thermo_model "
179  << thermo_model << "!" << std::endl;
180  return_flag = 1;
181  }
182  }
183  else
184  {
185  std::cerr << "Error: Unknown mixing_model "
186  << mixing_model << "!" << std::endl;
187  return_flag = 1;
188  }
189 
190  return return_flag;
191 }

Generated on Mon Jun 22 2015 21:32:20 for GRINS-0.6.0 by  doxygen 1.8.9.1