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
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,
152  Array<OneD, Array<OneD, NekDouble> > &physarray);
153 
154  void WallBoundary(
155  int bcRegion,
156  int cnt,
158  Array<OneD, Array<OneD, NekDouble> > &physarray);
159 
160  void AddCoriolis(
161  const Array<OneD, const Array<OneD, NekDouble> > &physarray,
162  Array<OneD, Array<OneD, NekDouble> > &outarray);
163 
164  void AddVariableDepth(
165  const Array<OneD, const Array<OneD, NekDouble> > &physarray,
166  Array<OneD, Array<OneD, NekDouble> > &outarray);
167 
169  const Array<OneD, const Array<OneD, NekDouble> >&physin,
170  Array<OneD, Array<OneD, NekDouble> >&physout);
171 
173  const Array<OneD, const Array<OneD, NekDouble> >&physin,
174  Array<OneD, Array<OneD, NekDouble> >&physout);
175 
176  void GetVelocityVector(
177  const Array<OneD, Array<OneD, NekDouble> > &physfield,
178  Array<OneD, Array<OneD, NekDouble> > &velocity);
179 
180  // Dispersive parts
181  void WCESolve(Array<OneD, NekDouble> &fce, NekDouble lambda);
182 
184  const Array<OneD, const Array<OneD, NekDouble> > &inarray,
185  Array<OneD, NekDouble> &numfluxX,
186  Array<OneD, NekDouble> &numfluxY);
187 
189  Array<OneD, Array<OneD, NekDouble> > &inarray, NekDouble time);
190 
191  void WallBoundaryForcing(
192  int bcRegion,
193  int cnt,
194  Array<OneD, Array<OneD, NekDouble> >&inarray);
195 
197  Array<OneD, NekDouble> &inarray,
198  NekDouble time);
199 
201  int bcRegion,
202  int cnt,
203  Array<OneD, NekDouble>&inarray);
204 
206  Array<OneD, NekDouble> &physfield,
208  Array<OneD, NekDouble> &outY);
209 
210 };
211 
212 }
213 
214 #endif
215 
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:251
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:51
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.
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.
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 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 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.
ProblemType
Definition: EulerADCFE.h:44
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