GRINS-0.8.0
absorption_coeff.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------bl-
2 //--------------------------------------------------------------------------
3 //
4 // GRINS - General Reacting Incompressible Navier-Stokes
5 //
6 // Copyright (C) 2014-2017 Paul T. Bauman, Roy H. Stogner
7 // Copyright (C) 2010-2013 The PECOS Development Team
8 //
9 // This library is free software; you can redistribute it and/or
10 // modify it under the terms of the Version 2.1 GNU Lesser General
11 // Public License as published by the Free Software Foundation.
12 //
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Lesser General Public License for more details.
17 //
18 // You should have received a copy of the GNU Lesser General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc. 51 Franklin Street, Fifth Floor,
21 // Boston, MA 02110-1301 USA
22 //
23 //-----------------------------------------------------------------------el-
24 
25 
26 #ifndef GRINS_ABSORPTION_COEFF_H
27 #define GRINS_ABSORPTION_COEFF_H
28 
29 // libMesh
30 #include "libmesh/fem_function_base.h"
31 #include "libmesh/auto_ptr.h"
32 
33 // GRINS
34 #include "grins/assembly_context.h"
35 #include "grins/hitran.h"
36 #include "grins/single_variable.h"
40 
41 namespace GRINS
42 {
62  template<typename Chemistry>
63  class AbsorptionCoeff : public FEMFunctionAndDerivativeBase<libMesh::Real>
64  {
65  public:
66 
76  AbsorptionCoeff(SharedPtr<Chemistry> & chem, SharedPtr<HITRAN> & hitran,
77  libMesh::Real nu_min, libMesh::Real nu_max,
78  libMesh::Real desired_nu, const std::string & species,
79  libMesh::Real thermo_pressure);
80 
82  virtual libMesh::Real operator()(const libMesh::FEMContext & context, const libMesh::Point & qp_xyz, const libMesh::Real t);
83 
85  virtual void operator()( const libMesh::FEMContext & context,
86  const libMesh::Point & p,
87  const libMesh::Real time,
88  libMesh::DenseVector<libMesh::Real> & output);
89 
91  virtual void derivatives( libMesh::FEMContext & context,
92  const libMesh::Point & qp_xyz,
93  const libMesh::Real & JxW,
94  const unsigned int qoi_index,
95  const libMesh::Real time);
96 
98  virtual libMesh::UniquePtr<libMesh::FEMFunctionBase<libMesh::Real> > clone() const;
99 
100  protected:
102  SharedPtr<Chemistry> _chemistry;
103 
105  SharedPtr<HITRAN> _hitran;
106 
108  libMesh::Real _nu;
109 
113 
115  libMesh::Real _T0;
116 
118  libMesh::Real _Pref;
119 
121  libMesh::Real _rad_coeff;
122 
124  unsigned int _min_index;
125 
127  unsigned int _max_index;
128 
130  libMesh::Real _thermo_pressure;
131 
134 
136  unsigned int _species_idx;
137 
139  std::vector<std::vector<libMesh::Real> > _voigt_coeffs;
140 
142  libMesh::Real kv(libMesh::Real T, libMesh::Real P, std::vector<libMesh::Real> Y, unsigned int i);
143 
145  libMesh::Real d_kv_dT(libMesh::Real T, libMesh::Real P, std::vector<libMesh::Real> Y, unsigned int i);
146 
148  libMesh::Real d_kv_dP(libMesh::Real T, libMesh::Real P, std::vector<libMesh::Real> Y, unsigned int i);
149 
151  libMesh::Real d_kv_dY(libMesh::Real T, libMesh::Real P, std::vector<libMesh::Real> Y, unsigned int i);
152 
154  libMesh::Real Sw(libMesh::Real T, libMesh::Real P, unsigned int i);
155 
157  libMesh::Real dS_dT(libMesh::Real T, libMesh::Real P, unsigned int i);
158 
160  libMesh::Real dS_dP(libMesh::Real T, libMesh::Real P, unsigned int i);
161 
163  libMesh::Real nu_D(libMesh::Real T, libMesh::Real P, unsigned int i);
164 
166  libMesh::Real d_nuD_dT(libMesh::Real T, libMesh::Real P, unsigned int i);
167 
169  libMesh::Real d_nuD_dP(libMesh::Real T, unsigned int i);
170 
172  libMesh::Real nu_C(libMesh::Real T, libMesh::Real P, std::vector<libMesh::Real> Y, unsigned int i);
173 
175  libMesh::Real d_nuC_dT(libMesh::Real T, libMesh::Real P, std::vector<libMesh::Real> Y, unsigned int i);
176 
178  libMesh::Real d_nuC_dP(libMesh::Real T, std::vector<libMesh::Real> Y, unsigned int i);
179 
181  libMesh::Real d_nuC_dY(libMesh::Real T, libMesh::Real P, std::vector<libMesh::Real> Y, unsigned int i);
182 
184 
191  libMesh::Real voigt(libMesh::Real T, libMesh::Real P, std::vector<libMesh::Real> Y, unsigned int i);
192 
194  libMesh::Real d_voigt_dT(libMesh::Real T, libMesh::Real P, std::vector<libMesh::Real> Y, unsigned int i);
195 
197  libMesh::Real d_voigt_dP(libMesh::Real T, libMesh::Real P, std::vector<libMesh::Real> Y, unsigned int i);
198 
200  libMesh::Real d_voigt_dY(libMesh::Real T, libMesh::Real P, std::vector<libMesh::Real> Y, unsigned int i);
201 
203  void init_voigt();
204 
206  libMesh::Real voigt_a(libMesh::Real T, libMesh::Real P, std::vector<libMesh::Real> Y, unsigned int i);
207 
209  libMesh::Real d_voigt_a_dT(libMesh::Real T, libMesh::Real P, std::vector<libMesh::Real> Y, unsigned int i);
210 
212  libMesh::Real d_voigt_a_dP(libMesh::Real T, libMesh::Real P, std::vector<libMesh::Real> Y, unsigned int i);
213 
215  libMesh::Real d_voigt_a_dY(libMesh::Real T, libMesh::Real P, std::vector<libMesh::Real> Y, unsigned int i);
216 
218  libMesh::Real voigt_w(libMesh::Real T, libMesh::Real P, unsigned int i);
219 
221  libMesh::Real d_voigt_w_dT(libMesh::Real T, libMesh::Real P, unsigned int i);
222 
224  libMesh::Real d_voigt_w_dP(libMesh::Real T, libMesh::Real P, unsigned int i);
225 
227  libMesh::Real get_nu(libMesh::Real P, unsigned int i);
228 
230  libMesh::Real d_nu_dP(unsigned int i);
231 
233  libMesh::Real dX_dY(std::vector<libMesh::Real> Y);
234 
236  libMesh::Real dQ_dT(libMesh::Real T, unsigned int iso);
237 
239  AbsorptionCoeff();
240  };
241 
242 }
243 #endif //GRINS_ABSORPTION_COEFF_H
PressureFEVariable & _P_var
SpeciesMassFractionsVariable & _Y_var
libMesh::Real d_voigt_a_dP(libMesh::Real T, libMesh::Real P, std::vector< libMesh::Real > Y, unsigned int i)
Voigt a parameter pressure derivative.
libMesh::Real d_voigt_dY(libMesh::Real T, libMesh::Real P, std::vector< libMesh::Real > Y, unsigned int i)
Voigt profile mass fraction derivative.
libMesh::Real d_nuC_dY(libMesh::Real T, libMesh::Real P, std::vector< libMesh::Real > Y, unsigned int i)
Collisional broadening mass fraction derivative.
Extends libMesh::FEMFunctionBase by adding a function for computing derivatives.
libMesh::Real _nu
Desired wavenumber [cm^-1].
virtual libMesh::Real operator()(const libMesh::FEMContext &context, const libMesh::Point &qp_xyz, const libMesh::Real t)
Calculate the absorption coefficient at a quadratue point.
virtual void derivatives(libMesh::FEMContext &context, const libMesh::Point &qp_xyz, const libMesh::Real &JxW, const unsigned int qoi_index, const libMesh::Real time)
Calculate the derivative of the absorption coefficient at a QP with respect to all state variables...
libMesh::Real d_nuD_dT(libMesh::Real T, libMesh::Real P, unsigned int i)
Doppler broadening temperature derivative.
std::vector< std::vector< libMesh::Real > > _voigt_coeffs
2D coefficient matrix for approximating the Voigt profile
unsigned int _species_idx
Index for the species of interest.
libMesh::Real d_voigt_w_dP(libMesh::Real T, libMesh::Real P, unsigned int i)
Voigt w parameter pressure derivative.
libMesh::Real Sw(libMesh::Real T, libMesh::Real P, unsigned int i)
Linestrength [cm^-2 atm^-1].
libMesh::Real voigt(libMesh::Real T, libMesh::Real P, std::vector< libMesh::Real > Y, unsigned int i)
Calculate the Voigt profile [cm^-1].
PrimitiveTempFEVariables & _T_var
libMesh::Real voigt_a(libMesh::Real T, libMesh::Real P, std::vector< libMesh::Real > Y, unsigned int i)
Voigt a parameter.
libMesh::Real _thermo_pressure
Thermodynamic Pressure [atm].
libMesh::Real get_nu(libMesh::Real P, unsigned int i)
Pressure shift of linecenter wavenumber.
libMesh::Real d_kv_dP(libMesh::Real T, libMesh::Real P, std::vector< libMesh::Real > Y, unsigned int i)
Absorption coefficient pressure derivative.
libMesh::Real d_kv_dY(libMesh::Real T, libMesh::Real P, std::vector< libMesh::Real > Y, unsigned int i)
Absorption coefficient mass fraction derivative.
libMesh::Real dS_dT(libMesh::Real T, libMesh::Real P, unsigned int i)
Linestrength temperature derivative.
GRINS namespace.
libMesh::Real kv(libMesh::Real T, libMesh::Real P, std::vector< libMesh::Real > Y, unsigned int i)
Absorption coefficient [cm^-1].
libMesh::Real d_voigt_w_dT(libMesh::Real T, libMesh::Real P, unsigned int i)
Voigt w parameter temperature derivative.
libMesh::Real d_nuC_dP(libMesh::Real T, std::vector< libMesh::Real > Y, unsigned int i)
Collisional broadening pressure derivative.
libMesh::Real d_nuD_dP(libMesh::Real T, unsigned int i)
Doppler broadening pressure derivative.
libMesh::Real d_nu_dP(unsigned int i)
Derivative of pressure-shifted linecenter wavenumber.
unsigned int _max_index
Index of maximum wavenumber.
bool _calc_thermo_pressure
Flag for whether Thermodynamic Pressure is calculated or constant.
libMesh::Real _rad_coeff
Second radiation coefficient [cm K].
libMesh::Real dX_dY(std::vector< libMesh::Real > Y)
Mole fraction derivative with respect to mass fraction.
Evaluates the Beer-Lambert Law at a given point in space.
libMesh::Real d_nuC_dT(libMesh::Real T, libMesh::Real P, std::vector< libMesh::Real > Y, unsigned int i)
Collisional broadening temperature derivative.
SharedPtr< Chemistry > _chemistry
Antioch/Cantera object.
libMesh::Real nu_C(libMesh::Real T, libMesh::Real P, std::vector< libMesh::Real > Y, unsigned int i)
Collisional broadening [cm^-1].
libMesh::Real d_voigt_dP(libMesh::Real T, libMesh::Real P, std::vector< libMesh::Real > Y, unsigned int i)
Voigt profile pressure derivative.
libMesh::Real d_voigt_dT(libMesh::Real T, libMesh::Real P, std::vector< libMesh::Real > Y, unsigned int i)
Voigt profile temperature derivative.
libMesh::Real dQ_dT(libMesh::Real T, unsigned int iso)
Partition Function derivative (finite difference)
libMesh::Real _Pref
Reference pressure [atm].
libMesh::Real _T0
Reference temperature [K].
SharedPtr< HITRAN > _hitran
HITRAN.
libMesh::Real voigt_w(libMesh::Real T, libMesh::Real P, unsigned int i)
Voigt w parameter.
libMesh::Real d_voigt_a_dY(libMesh::Real T, libMesh::Real P, std::vector< libMesh::Real > Y, unsigned int i)
Voigt a parameter mass fraction derivative.
void init_voigt()
Initialize the coeff matrix for calculating the Voigt profile.
AbsorptionCoeff()
User should not call empty constructor.
libMesh::Real d_voigt_a_dT(libMesh::Real T, libMesh::Real P, std::vector< libMesh::Real > Y, unsigned int i)
Voigt a parameter temperature derivative.
libMesh::Real dS_dP(libMesh::Real T, libMesh::Real P, unsigned int i)
Linestrength pressure derivative.
libMesh::Real d_kv_dT(libMesh::Real T, libMesh::Real P, std::vector< libMesh::Real > Y, unsigned int i)
Absorption coefficient temperature derivative.
virtual libMesh::UniquePtr< libMesh::FEMFunctionBase< libMesh::Real > > clone() const
Not used.
unsigned int _min_index
Index of minimum wavenumber.
libMesh::Real nu_D(libMesh::Real T, libMesh::Real P, unsigned int i)
Doppler broadening [cm^-1].

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