Nektar++
APE.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File APE.h
4 //
5 // For more information, please see: http://www.nektar.info
6 //
7 // The MIT License
8 //
9 // Copyright (c) 2015 Kilian Lackhove
10 // Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
11 // Department of Aeronautics, Imperial College London (UK), and Scientific
12 // Computing and Imaging Institute, University of Utah (USA).
13 //
14 // License for the specific language governing rights and limitations under
15 // Permission is hereby granted, free of charge, to any person obtaining a
16 // copy of this software and associated documentation files (the "Software"),
17 // to deal in the Software without restriction, including without limitation
18 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
19 // and/or sell copies of the Software, and to permit persons to whom the
20 // Software is furnished to do so, subject to the following conditions:
21 //
22 // The above copyright notice and this permission notice shall be included
23 // in all copies or substantial portions of the Software.
24 //
25 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
26 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
27 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
28 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
29 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
30 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
31 // DEALINGS IN THE SOFTWARE.
32 //
33 // Description: APE1/APE4 (Acoustic Perturbation Equations)
34 //
35 ///////////////////////////////////////////////////////////////////////////////
36 
37 #ifndef NEKTAR_SOLVERS_APESOLVER_EQUATIONSYSTEMS_APE_H
38 #define NEKTAR_SOLVERS_APESOLVER_EQUATIONSYSTEMS_APE_H
39 
43 
44 using namespace Nektar::SolverUtils;
45 
46 namespace Nektar
47 {
48 
49 class APE : public UnsteadySystem
50 {
51  public:
52 
53  friend class MemoryManager<APE>;
54 
55  /// Creates an instance of this class
58  {
60  p->InitObject();
61  return p;
62  }
63  /// Name of class
64  static std::string className;
65 
66  /// Destructor
67  virtual ~APE();
68 
69 
70  protected:
71 
76  /// Isentropic coefficient, Ratio of specific heats (APE)
80  std::vector<std::string> m_basefield_names;
81 
82  /// Initialises UnsteadySystem class members.
84 
85  virtual void v_InitObject();
86 
87  /// Sets up initial conditions.
88  virtual void v_DoInitialise();
89 
90  void DoOdeRhs(const Array<OneD, const Array<OneD, NekDouble> > &inarray,
91  Array<OneD, Array<OneD, NekDouble> > &outarray,
92  const NekDouble time);
93 
94  void DoOdeProjection(const Array<OneD, const Array<OneD, NekDouble> > &inarray,
95  Array<OneD, Array<OneD, NekDouble> > &outarray,
96  const NekDouble time);
97 
98  void GetFluxVector(
99  const Array<OneD, Array<OneD, NekDouble> > &physfield,
101 
102  void AddSource(Array< OneD, Array< OneD, NekDouble > >& outarray);
103 
104  virtual void v_ExtraFldOutput(std::vector<Array<OneD, NekDouble> > &fieldcoeffs,
105  std::vector<std::string> &variables);
106 
107  const Array<OneD, const Array<OneD, NekDouble> > &GetNormals();
108 
109  const Array<OneD, const Array<OneD, NekDouble> > &GetVecLocs();
110 
111  const Array<OneD, const Array<OneD, NekDouble> > &GetBasefield();
112 
113  NekDouble GetGamma();
114 
115  void UpdateBasefield();
116  void UpdateSourceTerms();
117 
118  private:
119 
120  void SetBoundaryConditions(Array<OneD, Array<OneD, NekDouble> > &physarray, NekDouble time);
121 
122  void WallBC(int bcRegion, int cnt, Array<OneD, Array<OneD, NekDouble> > &physarray);
123 };
124 }
125 
126 #endif
127 
SolverUtils::AdvectionSharedPtr m_advection
Definition: APE.h:72
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
std::vector< std::string > m_basefield_names
Definition: APE.h:80
Array< OneD, Array< OneD, NekDouble > > m_basefield
Definition: APE.h:78
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
Array< OneD, Array< OneD, NekDouble > > m_vecLocs
Definition: APE.h:75
static EquationSystemSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession)
Creates an instance of this class.
Definition: APE.h:56
boost::shared_ptr< Advection > AdvectionSharedPtr
A shared pointer to an Advection object.
Definition: Advection.h:158
boost::shared_ptr< RiemannSolver > RiemannSolverSharedPtr
A shared pointer to an EquationSystem object.
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
Definition: MeshPartition.h:50
Array< OneD, NekDouble > m_sourceTerms
Definition: APE.h:79
boost::shared_ptr< EquationSystem > EquationSystemSharedPtr
A shared pointer to an EquationSystem object.
Array< OneD, Array< OneD, NekDouble > > m_traceBasefield
Definition: APE.h:74
Base class for unsteady solvers.
static std::string className
Name of class.
Definition: APE.h:64
double NekDouble
NekDouble m_gamma
Isentropic coefficient, Ratio of specific heats (APE)
Definition: APE.h:77
SolverUtils::RiemannSolverSharedPtr m_riemannSolver
Definition: APE.h:73