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_nConvectiveFields;
125  }
126 
127  Array<OneD, int> &GetVelocity(void)
128  {
129  return m_velocity;
130  }
131 
132 
133  Array<OneD, NekDouble> GetElmtCFLVals(void);
134 
135  NekDouble GetCFLEstimate(int &elmtid);
136 
137  void AddForcing(const SolverUtils::ForcingSharedPtr& pForce);
138 
139  protected:
140 
141  // pointer to the extrapolation class for sub-stepping and HOPBS
142 
144 
145  /// modal energy file
146  std::ofstream m_mdlFile;
147 
148  /// bool to identify if using a substepping scheme
150  /// bool to identify if advection term smoothing is requested
152 
154 
155  /// Forcing terms
156  std::vector<SolverUtils::ForcingSharedPtr> m_forcing;
157 
158  /// Number of fields to be convected;
160 
161  /// int which identifies which components of m_fields contains the
162  /// velocity (u,v,w);
163  Array<OneD, int> m_velocity;
164 
165  /// Pointer to field holding pressure field
167  /// Kinematic viscosity
169  /// dump energy to file at steps time
171  /// dump cfl estimate
173  /// Check for steady state at step interval
175  /// Tolerance to which steady state should be evaluated at
177 
178  /// equation type;
180 
181  /// Mapping from BCs to Elmt IDs
182  Array<OneD, Array<OneD, int> > m_fieldsBCToElmtID;
183  /// Mapping from BCs to Elmt Edge IDs
184  Array<OneD, Array<OneD, int> > m_fieldsBCToTraceID;
185  /// RHS Factor for Radiation Condition
186  Array<OneD, Array<OneD, NekDouble> > m_fieldsRadiationFactor;
187 
188  /// Number of time integration steps AND Order of extrapolation for
189  /// pressure boundary conditions.
191 
192  /// Constructor.
194 
196  {
197  return m_equationType;
198  }
199 
200  void EvaluateAdvectionTerms(const Array<OneD, const Array<OneD, NekDouble> > &inarray,
201  Array<OneD, Array<OneD, NekDouble> > &outarray,
202  Array<OneD, NekDouble> &wk = NullNekDouble1DArray);
203 
204  void WriteModalEnergy(void);
205 
206  /// time dependent boundary conditions updating
207  void SetBoundaryConditions(NekDouble time);
208 
209  /// Set Radiation forcing term
210  void SetRadiationBoundaryForcing(int fieldid);
211 
212  /// evaluate steady state
213  bool CalcSteadyState(void);
214 
216  {
217  return m_pressure;
218  }
219 
220  virtual void v_TransCoeffToPhys(void)
221  {
222  ASSERTL0(false,"This method is not defined in this class");
223  }
224 
225  virtual void v_TransPhysToCoeff(void)
226  {
227  ASSERTL0(false,"This method is not defined in this class");
228  }
229 
230  virtual int v_GetForceDimension()=0;
231 
232  virtual bool v_PreIntegrate(int step);
233  virtual bool v_PostIntegrate(int step);
234 
235  private:
236 
237  };
238 
239  typedef boost::shared_ptr<IncNavierStokes> IncNavierStokesSharedPtr;
240 
241 } //end of namespace
242 
243 #endif //NEKTAR_SOLVERS_INCNAVIERSTOKES_H