Nektar++
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties 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 // 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 
44 #include <complex>
45 
46 namespace Nektar
47 {
49  {
59  };
60 
61  // Keep this consistent with the enums in EquationType.
62  const std::string kEquationTypeStr[] =
63  {
64  "NoType",
65  "SteadyStokes",
66  "SteadyOseen",
67  "SteadyLinearisedNS",
68  "UnsteadyStokes",
69  "UnsteadyLinearisedNS",
70  "UnsteadyNavierStokes",
71  "SteadyNavierStokes",
72  };
73 
74 
76  {
85  };
86 
87  // Keep this consistent with the enums in EquationType.
88  const std::string kAdvectionFormStr[] =
89  {
90  "NoType",
91  "Convective",
92  "NonConservative",
93  "Linearised",
94  "Adjoint",
95  "SkewSymmetric"
96  "NoAdvection"
97  };
98 
99 
100  typedef std::complex<double> NekComplexDouble;
101 
103  {
105  {
108  };
109 
111  {};
112 
113  // Real and imaginary velocity comp. of wom
114  std::vector<NekComplexDouble> m_wom_vel;
115 
116  // Womersley BC constants
120  // currently this needs to be the point in the middle of the
121  // axis but should be generalised to be any point on the axis
123 
124  // poiseuille flow and fourier coefficients
127 
128  };
129  typedef std::shared_ptr<WomersleyParams> WomersleyParamsSharedPtr;
130 
131  /**
132  * \brief This class is the base class for Navier Stokes problems
133  *
134  */
137  {
138  public:
139  // Destructor
140  virtual ~IncNavierStokes();
141 
142  virtual void v_InitObject();
143 
145  {
146  return m_nConvectiveFields;
147  }
148 
150  {
151  return m_velocity;
152  }
153 
154  void AddForcing(const SolverUtils::ForcingSharedPtr& pForce);
155 
156  virtual void GetPressure(
157  const Array<OneD, const Array<OneD, NekDouble> > &physfield,
159 
160  virtual void GetDensity(
161  const Array<OneD, const Array<OneD, NekDouble> > &physfield,
162  Array<OneD, NekDouble> &density);
163 
164  virtual bool HasConstantDensity()
165  {
166  return true;
167  }
168 
169  virtual void GetVelocity(
170  const Array<OneD, const Array<OneD, NekDouble> > &physfield,
171  Array<OneD, Array<OneD, NekDouble> > &velocity);
172 
173  protected:
174 
175  // pointer to the extrapolation class for sub-stepping and HOPBS
176 
178 
179  /// modal energy file
180  std::ofstream m_mdlFile;
181 
182  /// bool to identify if advection term smoothing is requested
184 
185  /// Forcing terms
186  std::vector<SolverUtils::ForcingSharedPtr> m_forcing;
187 
188  /// Number of fields to be convected;
190 
191  /// int which identifies which components of m_fields contains the
192  /// velocity (u,v,w);
194 
195  /// Pointer to field holding pressure field
197  /// Kinematic viscosity
199  /// dump energy to file at steps time
201 
202  /// equation type;
204 
205  /// Mapping from BCs to Elmt IDs
207  /// Mapping from BCs to Elmt Edge IDs
209  /// RHS Factor for Radiation Condition
211 
212  /// Number of time integration steps AND Order of extrapolation for
213  /// pressure boundary conditions.
215 
216  /// Constructor.
218  const SpatialDomains::MeshGraphSharedPtr &pGraph);
219 
221  {
222  return m_equationType;
223  }
224 
225  void EvaluateAdvectionTerms(const Array<OneD, const Array<OneD, NekDouble> > &inarray,
226  Array<OneD, Array<OneD, NekDouble> > &outarray,
227  const NekDouble time);
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 
267  const NekDouble SpeedSoundFactor);
268 
269  virtual bool v_PreIntegrate(int step);
270 
271  private:
272 
273  };
274 
275  typedef std::shared_ptr<IncNavierStokes> IncNavierStokesSharedPtr;
276 
277 } //end of namespace
278 
279 #endif //NEKTAR_SOLVERS_INCNAVIERSTOKES_H
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:216
This class is the base class for Navier Stokes problems.
virtual Array< OneD, NekDouble > v_GetMaxStdVelocity(const NekDouble SpeedSoundFactor)
Array< OneD, int > & GetVelocity(void)
std::ofstream m_mdlFile
modal energy file
Array< OneD, Array< OneD, int > > m_fieldsBCToTraceID
Mapping from BCs to Elmt Edge IDs.
virtual MultiRegions::ExpListSharedPtr v_GetPressure()
virtual void v_InitObject()
Init object for UnsteadySystem class.
virtual int v_GetForceDimension()=0
void SetWomersleyBoundary(const int fldid, const int bndid)
Set Womersley Profile if specified.
void SetZeroNormalVelocity()
Set Normal Velocity Component to Zero.
void SetBoundaryConditions(NekDouble time)
time dependent boundary conditions updating
virtual bool v_PreIntegrate(int step)
MultiRegions::ExpListSharedPtr m_pressure
Pointer to field holding pressure field.
NekDouble m_kinvis
Kinematic viscosity.
bool m_SmoothAdvection
bool to identify if advection term smoothing is requested
virtual void GetDensity(const Array< OneD, const Array< OneD, NekDouble > > &physfield, Array< OneD, NekDouble > &density)
Extract array with density from physfield.
void SetRadiationBoundaryForcing(int fieldid)
Set Radiation forcing term.
Array< OneD, Array< OneD, NekDouble > > m_fieldsRadiationFactor
RHS Factor for Radiation Condition.
void SetUpWomersley(const int fldid, const int bndid, std::string womstr)
Set Up Womersley details.
ExtrapolateSharedPtr m_extrapolation
Array< OneD, int > m_velocity
int which identifies which components of m_fields contains the velocity (u,v,w);
virtual void v_TransPhysToCoeff(void)
Virtual function for transformation to coefficient space.
std::map< int, std::map< int, WomersleyParamsSharedPtr > > m_womersleyParams
Womersley parameters if required.
Array< OneD, Array< OneD, int > > m_fieldsBCToElmtID
Mapping from BCs to Elmt IDs.
int m_energysteps
dump energy to file at steps time
EquationType m_equationType
equation type;
EquationType GetEquationType(void)
int m_intSteps
Number of time integration steps AND Order of extrapolation for pressure boundary conditions.
virtual void v_TransCoeffToPhys(void)
Virtual function for transformation to physical space.
int m_nConvectiveFields
Number of fields to be convected;.
void AddForcing(const SolverUtils::ForcingSharedPtr &pForce)
std::vector< SolverUtils::ForcingSharedPtr > m_forcing
Forcing terms.
virtual bool HasConstantDensity()
void EvaluateAdvectionTerms(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)
IncNavierStokes(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Constructor.
A base class for PDEs which include an advection component.
SOLVER_UTILS_EXPORT MultiRegions::ExpListSharedPtr GetPressure()
Get pressure field if available.
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
SOLVER_UTILS_EXPORT typedef std::shared_ptr< Forcing > ForcingSharedPtr
A shared pointer to an EquationSystem object.
Definition: Forcing.h:52
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
Definition: MeshGraph.h:174
The above copyright notice and this permission notice shall be included.
Definition: CoupledSolver.h:1
const std::string kAdvectionFormStr[]
std::complex< double > NekComplexDouble
@ eSteadyNavierStokes
@ eUnsteadyStokes
@ eUnsteadyNavierStokes
@ eSteadyLinearisedNS
@ eUnsteadyLinearisedNS
@ eEquationTypeSize
@ eNoEquationType
@ eAdvectionFormSize
@ eSkewSymmetric
@ eNonConservative
@ eNoAdvectionForm
std::shared_ptr< Extrapolate > ExtrapolateSharedPtr
Definition: Extrapolate.h:60
std::shared_ptr< IncNavierStokes > IncNavierStokesSharedPtr
std::shared_ptr< WomersleyParams > WomersleyParamsSharedPtr
const std::string kEquationTypeStr[]
double NekDouble
Array< OneD, NekDouble > m_axisnormal
std::vector< NekComplexDouble > m_wom_vel
Array< OneD, Array< OneD, NekDouble > > m_poiseuille
Array< OneD, NekDouble > m_axispoint
Array< OneD, Array< OneD, Array< OneD, NekComplexDouble > > > m_zvel