Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
NonlinearPeregrine.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File NonlinearPeregrine.h
4 //
5 // For more information, please see: http://www.nektar.info
6 //
7 // The MIT License
8 //
9 // Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
10 // Department of Aeronautics, Imperial College London (UK), and Scientific
11 // Computing and Imaging Institute, University of Utah (USA).
12 //
13 // License for the specific language governing rights and limitations under
14 // Permission is hereby granted, free of charge, to any person obtaining a
15 // copy of this software and associated documentation files (the "Software"),
16 // to deal in the Software without restriction, including without limitation
17 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
18 // and/or sell copies of the Software, and to permit persons to whom the
19 // Software is furnished to do so, subject to the following conditions:
20 //
21 // The above copyright notice and this permission notice shall be included
22 // in all copies or substantial portions of the Software.
23 //
24 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
25 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
27 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
29 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
30 // DEALINGS IN THE SOFTWARE.
31 //
32 // Description: Nonlinear Boussinesq equations of Peregrine in conservative
33 // variables
34 //
35 ///////////////////////////////////////////////////////////////////////////////
36 
37 #ifndef NEKTAR_SOLVERS_SHALLOWWATERSOLVER_EQUATIONSYSTEMS_NONLINEARPEREGRINE_H
38 #define NEKTAR_SOLVERS_SHALLOWWATERSOLVER_EQUATIONSYSTEMS_NONLINEARPEREGRINE_H
39 
41 
42 namespace Nektar
43 {
44 
46 {
47  eGeneral, ///< No problem defined - Default Inital data
48  eSolitaryWave, ///< First order Laitone solitary wave
49  SIZE_ProblemType ///< Length of enum list
50 };
51 
52 const char* const ProblemTypeMap[] = { "General", "SolitaryWave" };
53 
54 /**
55  *
56  *
57  **/
58 
60 {
61 public:
63 
64  /// Creates an instance of this class
67  {
69  NonlinearPeregrine>::AllocateSharedPtr(pSession);
70  p->InitObject();
71  return p;
72  }
73  /// Name of class
74  static std::string className;
75 
76  virtual ~NonlinearPeregrine();
77 
78  ///< problem type selector
80 
81 protected:
83 
85 
86  virtual void v_InitObject();
87 
88  /// Still water depth traces
89  Array<OneD, NekDouble> m_dFwd;
90  Array<OneD, NekDouble> m_dBwd;
91 
92  void DoOdeRhs(
93  const Array<OneD, const Array<OneD, NekDouble> > &inarray,
94  Array<OneD, Array<OneD, NekDouble> > &outarray,
95  const NekDouble time);
96 
97  void DoOdeProjection(
98  const Array<OneD, const Array<OneD, NekDouble> > &inarray,
99  Array<OneD, Array<OneD, NekDouble> > &outarray,
100  const NekDouble time);
101 
102  void GetFluxVector(
103  const Array<OneD, const Array<OneD, NekDouble> > &physfield,
104  Array<OneD, Array<OneD, Array<OneD, NekDouble> > > &flux);
105 
107 
108  virtual void v_PrimitiveToConservative();
109 
110  virtual void v_ConservativeToPrimitive();
111 
112  virtual void v_SetInitialConditions(
113  NekDouble initialtime = 0.0,
114  bool dumpInitialConditions = true,
115  const int domain = 0);
116 
117  const Array<OneD, NekDouble> &GetDepthFwd()
118  {
119  return m_dFwd;
120  }
121  const Array<OneD, NekDouble> &GetDepthBwd()
122  {
123  return m_dBwd;
124  }
125 
126 private:
128 
129  void NumericalFlux1D(
130  Array<OneD, Array<OneD, NekDouble> > &physfield,
131  Array<OneD, Array<OneD, NekDouble> > &numfluxX);
132 
133  void NumericalFlux2D(
134  Array<OneD, Array<OneD, NekDouble> > &physfield,
135  Array<OneD, Array<OneD, NekDouble> > &numfluxX,
136  Array<OneD, Array<OneD, NekDouble> > &numfluxY);
137 
138  void LaitoneSolitaryWave(
139  NekDouble amp,
140  NekDouble d,
141  NekDouble time,
142  NekDouble x_offset);
143 
145  Array<OneD, Array<OneD, NekDouble> > &physarray,
146  NekDouble time);
147 
148  void WallBoundary2D(
149  int bcRegion,
150  int cnt,
151  Array<OneD, Array<OneD, NekDouble> > &physarray);
152 
153  void WallBoundary(
154  int bcRegion,
155  int cnt,
156  Array<OneD, Array<OneD, NekDouble> > &physarray);
157 
158  void AddCoriolis(
159  const Array<OneD, const Array<OneD, NekDouble> > &physarray,
160  Array<OneD, Array<OneD, NekDouble> > &outarray);
161 
162  void AddVariableDepth(
163  const Array<OneD, const Array<OneD, NekDouble> > &physarray,
164  Array<OneD, Array<OneD, NekDouble> > &outarray);
165 
167  const Array<OneD, const Array<OneD, NekDouble> >&physin,
168  Array<OneD, Array<OneD, NekDouble> >&physout);
169 
171  const Array<OneD, const Array<OneD, NekDouble> >&physin,
172  Array<OneD, Array<OneD, NekDouble> >&physout);
173 
174  void GetVelocityVector(
175  const Array<OneD, Array<OneD, NekDouble> > &physfield,
176  Array<OneD, Array<OneD, NekDouble> > &velocity);
177 
178  // Dispersive parts
179  void WCESolve(Array<OneD, NekDouble> &fce, NekDouble lambda);
180 
182  const Array<OneD, const Array<OneD, NekDouble> > &inarray,
183  Array<OneD, NekDouble> &numfluxX,
184  Array<OneD, NekDouble> &numfluxY);
185 
187  Array<OneD, Array<OneD, NekDouble> > &inarray, NekDouble time);
188 
189  void WallBoundaryForcing(
190  int bcRegion,
191  int cnt,
192  Array<OneD, Array<OneD, NekDouble> >&inarray);
193 
195  Array<OneD, NekDouble> &inarray,
196  NekDouble time);
197 
199  int bcRegion,
200  int cnt,
201  Array<OneD, NekDouble>&inarray);
202 
204  Array<OneD, NekDouble> &physfield,
205  Array<OneD, NekDouble> &outX,
206  Array<OneD, NekDouble> &outY);
207 
208 };
209 
210 }
211 
212 #endif
213