GRINS-0.7.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 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 45 of file antioch_transport_values.C.

References GRINS::AntiochEvaluator< Thermo >::cp(), GRINS::MaterialsParsing::material_name(), GRINS::AntiochMixtureAveragedTransportEvaluator< Thermo, Viscosity, Conductivity, Diffusivity >::mu_and_k_and_D(), GRINS::AntiochChemistry::n_species(), GRINS::AntiochEvaluator< 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 
134  int return_flag = 0;
135 
136  if( mixing_model == std::string("wilke") )
137  {
138  if( thermo_model == std::string("stat_mech") )
139  {
140  if( diffusivity_model == std::string("constant_lewis") )
141  {
142  if( conductivity_model == std::string("eucken") )
143  {
144  if( viscosity_model == std::string("sutherland") )
145  {
146  return_flag = do_transport_eval<Antioch::StatMechThermodynamics<libMesh::Real>,
147  Antioch::SutherlandViscosity<libMesh::Real>,
148  Antioch::EuckenThermalConductivity<Antioch::StatMechThermodynamics<libMesh::Real> >,
149  Antioch::ConstantLewisDiffusivity<libMesh::Real> >(input);
150  }
151  else if( viscosity_model == std::string("blottner") )
152  {
153  return_flag = do_transport_eval<Antioch::StatMechThermodynamics<libMesh::Real>,
154  Antioch::BlottnerViscosity<libMesh::Real>,
155  Antioch::EuckenThermalConductivity<Antioch::StatMechThermodynamics<libMesh::Real> >,
156  Antioch::ConstantLewisDiffusivity<libMesh::Real> >(input);
157  }
158  else
159  {
160  std::cerr << "Error: Unknown viscosity_model "
161  << viscosity_model << "!" << std::endl;
162  return_flag = 1;
163  }
164  }
165  else
166  {
167  std::cerr << "Error: Unknown conductivity_model "
168  << conductivity_model << "!" << std::endl;
169  return_flag = 1;
170  }
171  }
172  else
173  {
174  std::cerr << "Error: Unknown diffusivity_model "
175  << diffusivity_model << "!" << std::endl;
176  return_flag = 1;
177  }
178  }
179  else
180  {
181  std::cerr << "Error: Unknown thermo_model "
182  << thermo_model << "!" << std::endl;
183  return_flag = 1;
184  }
185  }
186  else
187  {
188  std::cerr << "Error: Unknown mixing_model "
189  << mixing_model << "!" << std::endl;
190  return_flag = 1;
191  }
192 
193  return return_flag;
194 }

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