Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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) 2014 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: Acoustic perturbation equations in conservative variables
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
56  static EquationSystemSharedPtr create(
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 
74  Array<OneD, Array<OneD, NekDouble> > m_traceBasefield;
75  Array<OneD, Array<OneD, NekDouble> > m_vecLocs;
76  /// Constant incompressible density (APE)
78  /// Isentropic coefficient, Ratio of specific heats (APE)
80  Array<OneD, Array<OneD, NekDouble> > m_basefield;
81  std::vector<std::string> m_basefield_names;
82 
83  /// Initialises UnsteadySystem class members.
85 
86  virtual void v_InitObject();
87 
88  /// Sets up initial conditions.
89  virtual void v_DoInitialise();
90 
91  void DoOdeRhs(const Array<OneD, const Array<OneD, NekDouble> > &inarray,
92  Array<OneD, Array<OneD, NekDouble> > &outarray,
93  const NekDouble time);
94 
95  void DoOdeProjection(const Array<OneD, const Array<OneD, NekDouble> > &inarray,
96  Array<OneD, Array<OneD, NekDouble> > &outarray,
97  const NekDouble time);
98 
99  void GetFluxVector(
100  const Array<OneD, Array<OneD, NekDouble> > &physfield,
101  Array<OneD, Array<OneD, Array<OneD, NekDouble> > > &flux);
102 
103  void AddSource(Array< OneD, Array< OneD, NekDouble > >& outarray);
104 
105  virtual void v_ExtraFldOutput(std::vector<Array<OneD, NekDouble> > &fieldcoeffs,
106  std::vector<std::string> &variables);
107 
108  const Array<OneD, const Array<OneD, NekDouble> > &GetNormals();
109 
110  const Array<OneD, const Array<OneD, NekDouble> > &GetVecLocs();
111 
112  const Array<OneD, const Array<OneD, NekDouble> > &GetBasefield();
113 
114  NekDouble GetGamma();
115 
116  NekDouble GetRho();
117 
118  void UpdateBasefield();
119 
120  private:
121 
122  void SetBoundaryConditions(Array<OneD, Array<OneD, NekDouble> > &physarray, NekDouble time);
123 
124  void WallBC(int bcRegion, int cnt, Array<OneD, Array<OneD, NekDouble> > &physarray);
125 };
126 }
127 
128 #endif
129