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 // 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
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,
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 
118  {
119  return m_dFwd;
120  }
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,
206  Array<OneD, NekDouble> &outY);
207 
208 };
209 
210 }
211 
212 #endif
213 
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)
void NumericalFluxForcing(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, NekDouble > &numfluxX, Array< OneD, NekDouble > &numfluxY)
No problem defined - Default Inital data.
Definition: EulerADCFE.h:46
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:47
std::map< ConstFactorType, NekDouble > ConstFactorMap
Definition: StdRegions.hpp:248
void DoOdeProjection(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)
NonlinearPeregrine(const LibUtilities::SessionReaderSharedPtr &pSession)
void SetBoundaryConditions(Array< OneD, Array< OneD, NekDouble > > &physarray, NekDouble time)
Array< OneD, NekDouble > m_dBwd
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
Definition: MeshPartition.h:50
StdRegions::ConstFactorMap m_factors
virtual void v_SetInitialConditions(NekDouble initialtime=0.0, bool dumpInitialConditions=true, const int domain=0)
Set the initial conditions.
boost::shared_ptr< EquationSystem > EquationSystemSharedPtr
A shared pointer to an EquationSystem object.
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.
static std::string className
Name of class.
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
Length of enum list.
Definition: EulerADCFE.h:47
void WallBoundary(int bcRegion, int cnt, Array< OneD, Array< OneD, NekDouble > > &physarray)
Wall boundary condition.
void SetBoundaryConditionsForcing(Array< OneD, Array< OneD, NekDouble > > &inarray, NekDouble time)
static SolverUtils::EquationSystemSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession)
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 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.
ProblemType
Definition: EulerADCFE.h:44
void WallBoundary2D(int bcRegion, int cnt, Array< OneD, Array< OneD, NekDouble > > &physarray)
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)
void LaitoneSolitaryWave(NekDouble amp, NekDouble d, NekDouble time, NekDouble x_offset)
const char *const ProblemTypeMap[]
Definition: EulerADCFE.h:50