GRINS-0.8.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_mixture_averaged_transport_evaluator.h"
#include "grins/materials_parsing.h"
#include "grins/physics_naming.h"
Include dependency graph for antioch_transport_values.C:

Go to the source code of this file.

Functions

template<typename KineticsThermo , 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 KineticsThermo , typename Thermo , typename Viscosity , typename Conductivity , typename Diffusivity >
int do_transport_eval ( const GetPot &  input)

Definition at line 45 of file antioch_transport_values.C.

References GRINS::AntiochEvaluator< Antioch::CEACurveFit< libMesh::Real >, Thermo >::cp(), GRINS::MaterialsParsing::material_name(), GRINS::AntiochMixtureAveragedTransportEvaluator< KineticsThermoCurveFit, Thermo, Viscosity, Conductivity, Diffusivity >::mu_and_k_and_D(), GRINS::AntiochChemistry::n_species(), GRINS::AntiochEvaluator< Antioch::CEACurveFit< libMesh::Real >, Thermo >::R_mix(), GRINS::PhysicsNaming::reacting_low_mach_navier_stokes(), and GRINS::AntiochChemistry::species_name().

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

Definition at line 116 of file antioch_transport_values.C.

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

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