Nektar++
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 // Permission is hereby granted, free of charge, to any person obtaining a
14 // copy of this software and associated documentation files (the "Software"),
15 // to deal in the Software without restriction, including without limitation
16 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
17 // and/or sell copies of the Software, and to permit persons to whom the
18 // Software is furnished to do so, subject to the following conditions:
19 //
20 // The above copyright notice and this permission notice shall be included
21 // in all copies or substantial portions of the Software.
22 //
23 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29 // DEALINGS IN THE SOFTWARE.
30 //
31 // Description: Nonlinear Boussinesq equations of Peregrine in conservative
32 // variables
33 //
34 ///////////////////////////////////////////////////////////////////////////////
35 
36 #ifndef NEKTAR_SOLVERS_SHALLOWWATERSOLVER_EQUATIONSYSTEMS_NONLINEARPEREGRINE_H
37 #define NEKTAR_SOLVERS_SHALLOWWATERSOLVER_EQUATIONSYSTEMS_NONLINEARPEREGRINE_H
38 
40 
41 namespace Nektar
42 {
43 
45 {
46  eGeneral, ///< No problem defined - Default Inital data
47  eSolitaryWave, ///< First order Laitone solitary wave
48  SIZE_ProblemType ///< Length of enum list
49 };
50 
51 const char* const ProblemTypeMap[] = { "General", "SolitaryWave" };
52 
53 /**
54  *
55  *
56  **/
57 
59 {
60 public:
62 
63  /// Creates an instance of this class
67  {
69  NonlinearPeregrine>::AllocateSharedPtr(pSession, pGraph);
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 
86 
87  virtual void v_InitObject();
88 
89  /// Still water depth traces
92 
93  void DoOdeRhs(
94  const Array<OneD, const Array<OneD, NekDouble> > &inarray,
95  Array<OneD, Array<OneD, NekDouble> > &outarray,
96  const NekDouble time);
97 
98  void DoOdeProjection(
99  const Array<OneD, const Array<OneD, NekDouble> > &inarray,
100  Array<OneD, Array<OneD, NekDouble> > &outarray,
101  const NekDouble time);
102 
103  void GetFluxVector(
104  const Array<OneD, const Array<OneD, NekDouble> > &physfield,
106 
108 
109  virtual void v_PrimitiveToConservative();
110 
111  virtual void v_ConservativeToPrimitive();
112 
113  virtual void v_SetInitialConditions(
114  NekDouble initialtime = 0.0,
115  bool dumpInitialConditions = true,
116  const int domain = 0);
117 
119  {
120  return m_dFwd;
121  }
123  {
124  return m_dBwd;
125  }
126 
127 private:
129 
130  void NumericalFlux1D(
131  Array<OneD, Array<OneD, NekDouble> > &physfield,
132  Array<OneD, Array<OneD, NekDouble> > &numfluxX);
133 
134  void NumericalFlux2D(
135  Array<OneD, Array<OneD, NekDouble> > &physfield,
136  Array<OneD, Array<OneD, NekDouble> > &numfluxX,
137  Array<OneD, Array<OneD, NekDouble> > &numfluxY);
138 
139  void LaitoneSolitaryWave(
140  NekDouble amp,
141  NekDouble d,
142  NekDouble time,
143  NekDouble x_offset);
144 
146  Array<OneD, Array<OneD, NekDouble> > &physarray,
147  NekDouble time);
148 
149  void WallBoundary2D(
150  int bcRegion,
151  int cnt,
153  Array<OneD, Array<OneD, NekDouble> > &physarray);
154 
155  void WallBoundary(
156  int bcRegion,
157  int cnt,
159  Array<OneD, Array<OneD, NekDouble> > &physarray);
160 
161  void AddCoriolis(
162  const Array<OneD, const Array<OneD, NekDouble> > &physarray,
163  Array<OneD, Array<OneD, NekDouble> > &outarray);
164 
165  void AddVariableDepth(
166  const Array<OneD, const Array<OneD, NekDouble> > &physarray,
167  Array<OneD, Array<OneD, NekDouble> > &outarray);
168 
170  const Array<OneD, const Array<OneD, NekDouble> >&physin,
171  Array<OneD, Array<OneD, NekDouble> >&physout);
172 
174  const Array<OneD, const Array<OneD, NekDouble> >&physin,
175  Array<OneD, Array<OneD, NekDouble> >&physout);
176 
177  void GetVelocityVector(
178  const Array<OneD, Array<OneD, NekDouble> > &physfield,
179  Array<OneD, Array<OneD, NekDouble> > &velocity);
180 
181  // Dispersive parts
182  void WCESolve(Array<OneD, NekDouble> &fce, NekDouble lambda);
183 
185  const Array<OneD, const Array<OneD, NekDouble> > &inarray,
186  Array<OneD, NekDouble> &numfluxX,
187  Array<OneD, NekDouble> &numfluxY);
188 
190  Array<OneD, Array<OneD, NekDouble> > &inarray, NekDouble time);
191 
192  void WallBoundaryForcing(
193  int bcRegion,
194  int cnt,
195  Array<OneD, Array<OneD, NekDouble> >&inarray);
196 
198  Array<OneD, NekDouble> &inarray,
199  NekDouble time);
200 
202  int bcRegion,
203  int cnt,
204  Array<OneD, NekDouble>&inarray);
205 
207  Array<OneD, NekDouble> &physfield,
209  Array<OneD, NekDouble> &outY);
210 
211 };
212 
213 }
214 
215 #endif
216 
void NumericalFlux2D(Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, Array< OneD, NekDouble > > &numfluxX, Array< OneD, Array< OneD, NekDouble > > &numfluxY)
void SetBoundaryConditionsContVariables(Array< OneD, NekDouble > &inarray, NekDouble time)
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
Definition: MeshGraph.h:163
void NumericalFluxForcing(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, NekDouble > &numfluxX, Array< OneD, NekDouble > &numfluxY)
Base class for unsteady solvers.
void GetFluxVector(const Array< OneD, const Array< OneD, NekDouble > > &physfield, Array< OneD, Array< OneD, Array< OneD, NekDouble > > > &flux)
void WallBoundaryForcing(int bcRegion, int cnt, Array< OneD, Array< OneD, NekDouble > > &inarray)
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
void NumericalFlux1D(Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, Array< OneD, NekDouble > > &numfluxX)
Array< OneD, NekDouble > m_dFwd
Still water depth traces.
std::vector< std::pair< std::string, std::string > > SummaryList
Definition: Misc.h:46
Length of enum list.
std::map< ConstFactorType, NekDouble > ConstFactorMap
Definition: StdRegions.hpp:294
void DoOdeProjection(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)
void SetBoundaryConditions(Array< OneD, Array< OneD, NekDouble > > &physarray, NekDouble time)
Array< OneD, NekDouble > m_dBwd
No problem defined - Default Inital data.
NonlinearPeregrine(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
StdRegions::ConstFactorMap m_factors
virtual void v_SetInitialConditions(NekDouble initialtime=0.0, bool dumpInitialConditions=true, const int domain=0)
Set the initial conditions.
void NumericalFluxConsVariables(Array< OneD, NekDouble > &physfield, Array< OneD, NekDouble > &outX, Array< OneD, NekDouble > &outY)
virtual void v_GenerateSummary(SolverUtils::SummaryList &s)
Print a summary of time stepping parameters.
virtual ~NonlinearPeregrine()
problem type selector
virtual void v_InitObject()
Init object for UnsteadySystem class.
void WallBoundary(int bcRegion, int cnt, Array< OneD, Array< OneD, NekDouble > > &Fwd, Array< OneD, Array< OneD, NekDouble > > &physarray)
Wall boundary condition.
static std::string className
Name of class.
const char *const ProblemTypeMap[]
void WCESolve(Array< OneD, NekDouble > &fce, NekDouble lambda)
void DoOdeRhs(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)
double NekDouble
void SetBoundaryConditionsForcing(Array< OneD, Array< OneD, NekDouble > > &inarray, NekDouble time)
static SolverUtils::EquationSystemSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Creates an instance of this class.
void AddVariableDepth(const Array< OneD, const Array< OneD, NekDouble > > &physarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
const Array< OneD, NekDouble > & GetDepthBwd()
const Array< OneD, NekDouble > & GetDepthFwd()
void WallBoundary2D(int bcRegion, int cnt, Array< OneD, Array< OneD, NekDouble > > &Fwd, Array< OneD, Array< OneD, NekDouble > > &physarray)
void GetVelocityVector(const Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, Array< OneD, NekDouble > > &velocity)
Compute the velocity field given the momentum .
First order Laitone solitary wave.
void WallBoundaryContVariables(int bcRegion, int cnt, Array< OneD, NekDouble > &inarray)
void AddCoriolis(const Array< OneD, const Array< OneD, NekDouble > > &physarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::shared_ptr< EquationSystem > EquationSystemSharedPtr
A shared pointer to an EquationSystem object.
void LaitoneSolitaryWave(NekDouble amp, NekDouble d, NekDouble time, NekDouble x_offset)