Nektar++
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 // 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: Basic Advection Diffusion Reaction Field definition in two-dimensions
32 //
33 ///////////////////////////////////////////////////////////////////////////////
34 
35 #ifndef NEKTAR_SOLVERS_INCNAVIERSTOKES_H
36 #define NEKTAR_SOLVERS_INCNAVIERSTOKES_H
37 
45 #include <complex>
46 
47 namespace Nektar
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  typedef std::complex<double> NekComplexDouble;
102 
104  {
106  {
109  };
110 
112  {};
113 
114  // Real and imaginary velocity comp. of wom
115  std::vector<NekComplexDouble> m_wom_vel;
116 
117  // Womersley BC constants
121  // currently this needs to be the point in the middle of the
122  // axis but should be generalised to be any point on the axis
124 
125  // poiseuille flow and fourier coefficients
128 
129  };
130  typedef std::shared_ptr<WomersleyParams> WomersleyParamsSharedPtr;
131 
132  /**
133  * \brief This class is the base class for Navier Stokes problems
134  *
135  */
138  {
139  public:
140  // Destructor
141  virtual ~IncNavierStokes();
142 
143  virtual void v_InitObject();
144 
146  {
147  return m_nConvectiveFields;
148  }
149 
151  {
152  return m_velocity;
153  }
154 
155  void AddForcing(const SolverUtils::ForcingSharedPtr& pForce);
156 
157  virtual void GetPressure(
158  const Array<OneD, const Array<OneD, NekDouble> > &physfield,
160 
161  virtual void GetDensity(
162  const Array<OneD, const Array<OneD, NekDouble> > &physfield,
163  Array<OneD, NekDouble> &density);
164 
165  virtual bool HasConstantDensity()
166  {
167  return true;
168  }
169 
170  virtual void GetVelocity(
171  const Array<OneD, const Array<OneD, NekDouble> > &physfield,
172  Array<OneD, Array<OneD, NekDouble> > &velocity);
173 
174  protected:
175 
176  // pointer to the extrapolation class for sub-stepping and HOPBS
177 
179 
180  /// modal energy file
181  std::ofstream m_mdlFile;
182 
183  /// bool to identify if advection term smoothing is requested
185 
186  /// Forcing terms
187  std::vector<SolverUtils::ForcingSharedPtr> m_forcing;
188 
189  /// Number of fields to be convected;
191 
192  /// int which identifies which components of m_fields contains the
193  /// velocity (u,v,w);
195 
196  /// Pointer to field holding pressure field
198  /// Kinematic viscosity
200  /// dump energy to file at steps time
202 
203  /// equation type;
205 
206  /// Mapping from BCs to Elmt IDs
208  /// Mapping from BCs to Elmt Edge IDs
210  /// RHS Factor for Radiation Condition
212 
213  /// Number of time integration steps AND Order of extrapolation for
214  /// pressure boundary conditions.
216 
217  /// Constructor.
219  const SpatialDomains::MeshGraphSharedPtr &pGraph);
220 
222  {
223  return m_equationType;
224  }
225 
226  void EvaluateAdvectionTerms(const Array<OneD, const Array<OneD, NekDouble> > &inarray,
227  Array<OneD, Array<OneD, NekDouble> > &outarray);
228 
229  void WriteModalEnergy(void);
230 
231  /// time dependent boundary conditions updating
232  void SetBoundaryConditions(NekDouble time);
233 
234  /// Set Radiation forcing term
235  void SetRadiationBoundaryForcing(int fieldid);
236 
237  /// Set Normal Velocity Component to Zero
238  void SetZeroNormalVelocity();
239 
240  /// Set Womersley Profile if specified
241  void SetWomersleyBoundary(const int fldid, const int bndid);
242 
243  /// Set Up Womersley details
244  void SetUpWomersley(const int fldid, const int bndid, std::string womstr);
245 
246  /// Womersley parameters if required
247  std::map<int, std::map<int,WomersleyParamsSharedPtr> > m_womersleyParams;
248 
250  {
251  return m_pressure;
252  }
253 
254  virtual void v_TransCoeffToPhys(void)
255  {
256  ASSERTL0(false,"This method is not defined in this class");
257  }
258 
259  virtual void v_TransPhysToCoeff(void)
260  {
261  ASSERTL0(false,"This method is not defined in this class");
262  }
263 
264  virtual int v_GetForceDimension()=0;
265 
266  virtual Array<OneD, NekDouble> v_GetMaxStdVelocity();
267 
268  virtual bool v_PreIntegrate(int step);
269 
270  private:
271 
272  };
273 
274  typedef std::shared_ptr<IncNavierStokes> IncNavierStokesSharedPtr;
275 
276 } //end of namespace
277 
278 #endif //NEKTAR_SOLVERS_INCNAVIERSTOKES_H
EquationType m_equationType
equation type;
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:216
SOLVER_UTILS_EXPORT typedef std::shared_ptr< Forcing > ForcingSharedPtr
A shared pointer to an EquationSystem object.
Definition: Forcing.h:52
std::complex< double > NekComplexDouble
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
Definition: MeshGraph.h:163
Array< OneD, Array< OneD, int > > m_fieldsBCToTraceID
Mapping from BCs to Elmt Edge IDs.
std::map< int, std::map< int, WomersleyParamsSharedPtr > > m_womersleyParams
Womersley parameters if required.
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
NekDouble m_kinvis
Kinematic viscosity.
std::shared_ptr< IncNavierStokes > IncNavierStokesSharedPtr
std::shared_ptr< Extrapolate > ExtrapolateSharedPtr
Definition: Extrapolate.h:59
Array< OneD, int > m_velocity
int which identifies which components of m_fields contains the velocity (u,v,w);
virtual void v_TransCoeffToPhys(void)
Virtual function for transformation to physical space.
ExtrapolateSharedPtr m_extrapolation
Array< OneD, Array< OneD, NekDouble > > m_poiseuille
int m_intSteps
Number of time integration steps AND Order of extrapolation for pressure boundary conditions...
int m_nConvectiveFields
Number of fields to be convected;.
const std::string kAdvectionFormStr[]
int m_energysteps
dump energy to file at steps time
std::vector< NekComplexDouble > m_wom_vel
Array< OneD, Array< OneD, Array< OneD, NekComplexDouble > > > m_zvel
EquationType GetEquationType(void)
Array< OneD, Array< OneD, NekDouble > > m_fieldsRadiationFactor
RHS Factor for Radiation Condition.
std::vector< SolverUtils::ForcingSharedPtr > m_forcing
Forcing terms.
virtual MultiRegions::ExpListSharedPtr v_GetPressure()
bool m_SmoothAdvection
bool to identify if advection term smoothing is requested
Array< OneD, NekDouble > m_axispoint
double NekDouble
Array< OneD, int > & GetVelocity(void)
Array< OneD, Array< OneD, int > > m_fieldsBCToElmtID
Mapping from BCs to Elmt IDs.
virtual bool HasConstantDensity()
Array< OneD, NekDouble > m_axisnormal
std::ofstream m_mdlFile
modal energy file
This class is the base class for Navier Stokes problems.
const std::string kEquationTypeStr[]
virtual void v_TransPhysToCoeff(void)
Virtual function for transformation to coefficient space.
MultiRegions::ExpListSharedPtr m_pressure
Pointer to field holding pressure field.
A base class for PDEs which include an advection component.
std::shared_ptr< WomersleyParams > WomersleyParamsSharedPtr
std::shared_ptr< SessionReader > SessionReaderSharedPtr