GRINS-0.8.0
spectroscopic_absorption.C
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 // This class
28 #include "grins/absorption_coeff.h"
30 
31 // GRINS
32 #include "grins/multiphysics_sys.h"
33 #include "grins/assembly_context.h"
35 #include "grins/single_variable.h"
36 
37 // libMesh
38 #include "libmesh/getpot.h"
39 #include "libmesh/fem_system.h"
40 #include "libmesh/quadrature.h"
41 #include "libmesh/fem_function_base.h"
42 
43 namespace GRINS
44 {
45  SpectroscopicAbsorption::SpectroscopicAbsorption(const GetPot & input,const std::string & qoi_name,SharedPtr<FEMFunctionAndDerivativeBase<libMesh::Real> > absorb)
46  : IntegratedFunction<FEMFunctionAndDerivativeBase<libMesh::Real> >(input,2 /* QGauss order */,absorb,"SpectroscopicAbsorption",qoi_name)
47  {}
48 
50  {
51  return new SpectroscopicAbsorption( *this );
52  }
53 
54  void SpectroscopicAbsorption::parallel_op( const libMesh::Parallel::Communicator & communicator,
55  libMesh::Number & sys_qoi,
56  libMesh::Number & local_qoi )
57  {
58  QoIBase::parallel_op(communicator,sys_qoi,local_qoi);
59 
60  // absorption coefficient is calculated in [cm^-1], but path length is given in [m]
61  // 100.0 factor converts pathlength to [cm]
62  sys_qoi = std::exp( -sys_qoi * 100.0 );
63  QoIBase::_qoi_value = sys_qoi;
64  }
65 
66 } //namespace GRINS
libMesh::Number _qoi_value
Definition: qoi_base.h:132
virtual QoIBase * clone() const
Required to provide clone (deep-copy) for adding QoI object to libMesh objects.
GRINS namespace.
virtual void parallel_op(const libMesh::Parallel::Communicator &communicator, libMesh::Number &sys_qoi, libMesh::Number &local_qoi)
Call the parallel operation for this QoI and cache the value.
Definition: qoi_base.C:45
virtual void parallel_op(const libMesh::Parallel::Communicator &communicator, libMesh::Number &sys_qoi, libMesh::Number &local_qoi)
Override the QoIBase implementation to perform exp(-kv*L)

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