Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
IncNavierStokes.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File IncNavierStokes.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: Basic Advection Diffusion Reaction Field definition in two-dimensions
33 //
34 ///////////////////////////////////////////////////////////////////////////////
35 
36 #ifndef NEKTAR_SOLVERS_INCNAVIERSTOKES_H
37 #define NEKTAR_SOLVERS_INCNAVIERSTOKES_H
38 
45 
46 namespace Nektar
47 {
48 
50  {
60  };
61 
62  // Keep this consistent with the enums in EquationType.
63  const std::string kEquationTypeStr[] =
64  {
65  "NoType",
66  "SteadyStokes",
67  "SteadyOseen",
68  "SteadyLinearisedNS",
69  "UnsteadyStokes",
70  "UnsteadyLinearisedNS",
71  "UnsteadyNavierStokes",
72  "SteadyNavierStokes",
73  };
74 
75 
77  {
86  };
87 
88  // Keep this consistent with the enums in EquationType.
89  const std::string kAdvectionFormStr[] =
90  {
91  "NoType",
92  "Convective",
93  "NonConservative",
94  "Linearised",
95  "Adjoint",
96  "SkewSymmetric"
97  "NoAdvection"
98  };
99 
100  /**
101  * \brief This class is the base class for Navier Stokes problems
102  *
103  */
105  {
106  public:
107  // Destructor
108  virtual ~IncNavierStokes();
109 
110  virtual void v_InitObject();
111 
112 
113  virtual void v_GetFluxVector(
114  const int i,
115  Array<OneD, Array<OneD, NekDouble> > &physfield,
116  Array<OneD, Array<OneD, NekDouble> > &flux);
117 
118  virtual void v_NumericalFlux(
119  Array<OneD, Array<OneD, NekDouble> > &physfield,
120  Array<OneD, Array<OneD, NekDouble> > &numflux);
121 
123  {
124  return m_advObject;
125  }
126 
127 
129  {
130  return m_nConvectiveFields;
131  }
132 
133  Array<OneD, int> &GetVelocity(void)
134  {
135  return m_velocity;
136  }
137 
138 
139  Array<OneD, NekDouble> GetElmtCFLVals(void);
140 
141  NekDouble GetCFLEstimate(int &elmtid);
142 
143  void AddForcing(const SolverUtils::ForcingSharedPtr& pForce);
144 
145  protected:
146 
147  // pointer to the extrapolation class for sub-stepping and HOPBS
148 
150 
151  /// modal energy file
152  std::ofstream m_mdlFile;
153 
154  /// bool to identify if using a substepping scheme
156  /// bool to identify if advection term smoothing is requested
158 
160 
161  /// Advection term
163 
164  /// Forcing terms
165  std::vector<SolverUtils::ForcingSharedPtr> m_forcing;
166 
167  /// Number of fields to be convected;
169 
170  /// int which identifies which components of m_fields contains the
171  /// velocity (u,v,w);
172  Array<OneD, int> m_velocity;
173 
174  /// Pointer to field holding pressure field
176  /// Kinematic viscosity
178  /// dump energy to file at steps time
180  /// dump cfl estimate
182  /// Check for steady state at step interval
184  /// Tolerance to which steady state should be evaluated at
186 
187  /// equation type;
189 
190  /// Mapping from BCs to Elmt IDs
191  Array<OneD, Array<OneD, int> > m_fieldsBCToElmtID;
192  /// Mapping from BCs to Elmt Edge IDs
193  Array<OneD, Array<OneD, int> > m_fieldsBCToTraceID;
194  /// RHS Factor for Radiation Condition
195  Array<OneD, Array<OneD, NekDouble> > m_fieldsRadiationFactor;
196 
197  /// Number of time integration steps AND Order of extrapolation for
198  /// pressure boundary conditions.
200 
201  /// Constructor.
203 
205  {
206  return m_equationType;
207  }
208 
209  void EvaluateAdvectionTerms(const Array<OneD, const Array<OneD, NekDouble> > &inarray,
210  Array<OneD, Array<OneD, NekDouble> > &outarray,
211  Array<OneD, NekDouble> &wk = NullNekDouble1DArray);
212 
213  void WriteModalEnergy(void);
214 
215  /// time dependent boundary conditions updating
216  void SetBoundaryConditions(NekDouble time);
217 
218  /// Set Radiation forcing term
219  void SetRadiationBoundaryForcing(int fieldid);
220 
221  /// evaluate steady state
222  bool CalcSteadyState(void);
223 
225  {
226  return m_pressure;
227  }
228 
229  virtual void v_TransCoeffToPhys(void)
230  {
231  ASSERTL0(false,"This method is not defined in this class");
232  }
233 
234  virtual void v_TransPhysToCoeff(void)
235  {
236  ASSERTL0(false,"This method is not defined in this class");
237  }
238 
239  virtual int v_GetForceDimension()=0;
240 
241  virtual bool v_PreIntegrate(int step);
242  virtual bool v_PostIntegrate(int step);
243 
244  private:
245 
246  };
247 
248  typedef boost::shared_ptr<IncNavierStokes> IncNavierStokesSharedPtr;
249 
250 } //end of namespace
251 
252 #endif //NEKTAR_SOLVERS_INCNAVIERSTOKES_H