Nektar++
StandardExtrapolate.cpp
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File: StandardExtrapolate.cpp
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: Abstract base class for StandardExtrapolate.
32 //
33 ///////////////////////////////////////////////////////////////////////////////
34 
37 
38 namespace Nektar
39 {
40  /**
41  * Registers the class with the Factory.
42  */
44  "Standard",
46  "Standard");
47 
52  const Array<OneD, int> pVel,
53  const SolverUtils::AdvectionSharedPtr advObject)
54  : Extrapolate(pSession,pFields,pPressure,pVel,advObject)
55  {
56  }
57 
59  {
60  }
61 
62 
63 
64  /**
65  * Function to extrapolate the new pressure boundary condition.
66  * Based on the velocity field and on the advection term.
67  * Acceleration term is also computed.
68  * This routine is a general one for 2d and 3D application and it can be called
69  * directly from velocity correction scheme. Specialisation on dimensionality is
70  * redirected to the CalcNeumannPressureBCs method.
71  */
73  const Array<OneD, const Array<OneD, NekDouble> > &fields,
74  const Array<OneD, const Array<OneD, NekDouble> > &N,
75  NekDouble kinvis)
76  {
78  if(m_HBCnumber>0)
79  {
80  // Calculate non-linear and viscous BCs at current level
81  // and put in m_pressureHBCs[0]
82  CalcNeumannPressureBCs(fields,N,kinvis);
83 
84  // Extrapolate to n+1
86 
87  // Add (phi,Du/Dt) term to m_presureHBC
88  AddDuDt();
89 
90  // Copy m_pressureHBCs to m_PbndExp
92  }
93 
94  CalcOutflowBCs(fields, kinvis);
95  }
96 
97 
98  /**
99  *
100  */
102  int intMethod,
103  const LibUtilities::TimeIntegrationWrapperSharedPtr &IntegrationScheme)
104  {
105  switch(intMethod)
106  {
108  {
109  m_intSteps = 1;
110  }
111  break;
114  {
115  m_intSteps = 2;
116  }
117  break;
119  {
120  m_intSteps = 3;
121  }
122  break;
124  {
125  m_intSteps = 4;
126  }
127  break;
128  }
129  }
130 
131  /**
132  *
133  */
135  const Array<OneD, const Array<OneD, NekDouble> > &inarray,
136  NekDouble Aii_DT,
137  NekDouble kinvis)
138  {
139  }
140 
141 
142  /**
143  *
144  */
146  const LibUtilities::TimeIntegrationSolutionSharedPtr &integrationSoln,
147  int nstep,
148  NekDouble time)
149  {
150  }
151 
152 
153  /**
154  *
155  */
157  int nstep)
158  {
159  }
160 
161  /**
162  *
163  */
165  int HBCdata,
166  NekDouble kinvis,
169  {
170  Vmath::Svtvp(HBCdata,-kinvis,Q,1,Advection,1,Q,1);
171  }
172 }
173 
void ExtrapolateArray(Array< OneD, Array< OneD, NekDouble > > &array)
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
ExtrapolateFactory & GetExtrapolateFactory()
Definition: Extrapolate.cpp:49
virtual void v_MountHOPBCs(int HBCdata, NekDouble kinvis, Array< OneD, NekDouble > &Q, Array< OneD, const NekDouble > &Advection)
std::shared_ptr< Advection > AdvectionSharedPtr
A shared pointer to an Advection object.
Definition: Advection.h:170
void Svtvp(int n, const T alpha, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
svtvp (scalar times vector plus vector): z = alpha*x + y
Definition: Vmath.cpp:488
virtual void v_SubStepAdvance(const LibUtilities::TimeIntegrationSolutionSharedPtr &integrationSoln, int nstep, NekDouble time)
StandardExtrapolate(const LibUtilities::SessionReaderSharedPtr pSession, Array< OneD, MultiRegions::ExpListSharedPtr > pFields, MultiRegions::ExpListSharedPtr pPressure, const Array< OneD, int > pVel, const SolverUtils::AdvectionSharedPtr advObject)
void CopyPressureHBCsToPbndExp(void)
virtual void v_SubStepSetPressureBCs(const Array< OneD, const Array< OneD, NekDouble > > &inarray, NekDouble Aii_DT, NekDouble kinvis)
IMEX 2nd order scheme using Backward Different Formula & Extrapolation.
std::shared_ptr< TimeIntegrationWrapper > TimeIntegrationWrapperSharedPtr
int m_intSteps
Maximum points used in pressure BC evaluation.
Definition: Extrapolate.h:253
double NekDouble
virtual void v_SubStepSaveFields(int nstep)
int m_pressureCalls
number of times the high-order pressure BCs have been called
Definition: Extrapolate.h:244
static ExtrapolateSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, MultiRegions::ExpListSharedPtr &pPressure, const Array< OneD, int > &pVel, const SolverUtils::AdvectionSharedPtr &advObject)
Creates an instance of this class.
IMEX 3rd order scheme using Backward Different Formula & Extrapolation.
Array< OneD, Array< OneD, NekDouble > > m_pressureHBCs
Storage for current and previous levels of high order pressure boundary conditions.
Definition: Extrapolate.h:258
static std::string className
Name of class.
virtual void v_EvaluatePressureBCs(const Array< OneD, const Array< OneD, NekDouble > > &fields, const Array< OneD, const Array< OneD, NekDouble > > &N, NekDouble kinvis)
IMEX 4th order scheme using Backward Different Formula & Extrapolation.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
Definition: NekFactory.hpp:199
IMEX 1st order scheme using Euler Backwards/Euler Forwards.
void CalcOutflowBCs(const Array< OneD, const Array< OneD, NekDouble > > &fields, NekDouble kinvis)
virtual void v_SubSteppingTimeIntegration(int intMethod, const LibUtilities::TimeIntegrationWrapperSharedPtr &IntegrationScheme)
std::shared_ptr< TimeIntegrationSolution > TimeIntegrationSolutionSharedPtr
std::shared_ptr< SessionReader > SessionReaderSharedPtr
An abstract base class encapsulating the concept of advection of a vector field.
Definition: Advection.h:69
void CalcNeumannPressureBCs(const Array< OneD, const Array< OneD, NekDouble > > &fields, const Array< OneD, const Array< OneD, NekDouble > > &N, NekDouble kinvis)
Definition: Extrapolate.h:187