Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
UnsteadySystem.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File UnsteadySystem.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: Generic timestepping for Unsteady solvers
33 //
34 ///////////////////////////////////////////////////////////////////////////////
35 
36 #ifndef NEKTAR_SOLVERUTILS_UNSTEADYSYSTEM_H
37 #define NEKTAR_SOLVERUTILS_UNSTEADYSYSTEM_H
38 
42 
43 namespace Nektar
44 {
45  namespace SolverUtils
46  {
47  /// Base class for unsteady solvers.
49  {
50  public:
51  /// Destructor
53 
54  /// Calculate the larger time-step mantaining the problem stable.
56  const Array<OneD, const Array<OneD, NekDouble> > &inarray);
57 
58  /// CFL safety factor (comprise between 0 to 1).
60 
61  protected:
62  /// Number of time steps between outputting status information.
64  /// Wrapper to the time integration scheme
66  /// The time integration scheme operators to use.
68  ///
70  ///
72  /// Indicates if explicit or implicit treatment of diffusion is used.
74  /// Indicates if explicit or implicit treatment of advection is used.
76  /// Indicates if explicit or implicit treatment of reaction is used.
78  /// Flag to determine if simulation should start in homogeneous
79  /// forward transformed state.
81 
82  std::vector<int> m_intVariables;
83 
84  std::vector<FilterSharedPtr> m_filters;
85 
86  /// Initialises UnsteadySystem class members.
88  const LibUtilities::SessionReaderSharedPtr& pSession);
89 
90  /// Init object for UnsteadySystem class.
91  SOLVER_UTILS_EXPORT virtual void v_InitObject();
92 
93  /// Get the maximum timestep estimator for cfl control.
95 
96  /// Solves an unsteady problem.
97  SOLVER_UTILS_EXPORT virtual void v_DoSolve();
98 
99  /// Sets up initial conditions.
100  SOLVER_UTILS_EXPORT virtual void v_DoInitialise();
101 
102  /// Print a summary of time stepping parameters.
104 
105  /// Print the solution at each solution point in a txt file
107  Array<OneD, Array<OneD, NekDouble> > &solution1D);
108 
109  ///
111  Array<OneD, Array<OneD, NekDouble> > &physfield,
112  Array<OneD, Array<OneD, NekDouble> > &numflux);
113 
114  ///
116  Array<OneD, Array<OneD, NekDouble> > &physfield,
117  Array<OneD, Array<OneD, NekDouble> > &numfluxX,
118  Array<OneD, Array<OneD, NekDouble> > &numfluxY );
119 
120  ///
122  const Array<OneD, Array<OneD, NekDouble> > &ufield,
123  Array<OneD, Array<OneD, Array<OneD, NekDouble> > > &uflux);
124 
125  ///
127  const Array<OneD, Array<OneD, NekDouble> > &ufield,
128  Array<OneD, Array<OneD, Array<OneD, NekDouble> > > &qfield,
129  Array<OneD, Array<OneD, NekDouble> > &qflux);
130 
132  const Array<OneD, const Array<OneD, NekDouble> > &inarray);
133 
134  SOLVER_UTILS_EXPORT virtual bool v_PreIntegrate(int step);
135  SOLVER_UTILS_EXPORT virtual bool v_PostIntegrate(int step);
136 
138 
139 
140  private:
141  ///
143  const int var,
144  const Array<OneD, const NekDouble> &physfield,
145  Array<OneD, NekDouble> &penaltyflux,
146  NekDouble time=0.0);
147 
148  ///
150  const int var,
151  const int dir,
152  const Array<OneD, const NekDouble> &physfield,
153  Array<OneD, NekDouble> &penaltyflux,
154  NekDouble C11,
155  NekDouble time=0.0);
156  };
157  }
158 }
159 
160 #endif