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,
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 
128  {
129  return m_velocity;
130  }
131 
132 
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 advection term smoothing is requested
150 
151  /// Forcing terms
152  std::vector<SolverUtils::ForcingSharedPtr> m_forcing;
153 
154  /// Number of fields to be convected;
156 
157  /// int which identifies which components of m_fields contains the
158  /// velocity (u,v,w);
160 
161  /// Pointer to field holding pressure field
163  /// Kinematic viscosity
165  /// dump energy to file at steps time
167  /// dump cfl estimate
169  /// Check for steady state at step interval
171  /// Tolerance to which steady state should be evaluated at
173 
174  /// equation type;
176 
177  /// Mapping from BCs to Elmt IDs
179  /// Mapping from BCs to Elmt Edge IDs
181  /// RHS Factor for Radiation Condition
183 
184  /// Number of time integration steps AND Order of extrapolation for
185  /// pressure boundary conditions.
187 
188  /// Constructor.
190 
192  {
193  return m_equationType;
194  }
195 
196  void EvaluateAdvectionTerms(const Array<OneD, const Array<OneD, NekDouble> > &inarray,
197  Array<OneD, Array<OneD, NekDouble> > &outarray,
199 
200  void WriteModalEnergy(void);
201 
202  /// time dependent boundary conditions updating
203  void SetBoundaryConditions(NekDouble time);
204 
205  /// Set Radiation forcing term
206  void SetRadiationBoundaryForcing(int fieldid);
207 
208  /// Set Normal Velocity Component to Zero
209  void SetZeroNormalVelocity();
210 
211  /// evaluate steady state
212  bool CalcSteadyState(void);
213 
215  {
216  return m_pressure;
217  }
218 
219  virtual void v_TransCoeffToPhys(void)
220  {
221  ASSERTL0(false,"This method is not defined in this class");
222  }
223 
224  virtual void v_TransPhysToCoeff(void)
225  {
226  ASSERTL0(false,"This method is not defined in this class");
227  }
228 
229  virtual int v_GetForceDimension()=0;
230 
231  virtual bool v_PreIntegrate(int step);
232  virtual bool v_PostIntegrate(int step);
233 
234  private:
235 
236  };
237 
238  typedef boost::shared_ptr<IncNavierStokes> IncNavierStokesSharedPtr;
239 
240 } //end of namespace
241 
242 #endif //NEKTAR_SOLVERS_INCNAVIERSTOKES_H
EquationType m_equationType
equation type;
void SetZeroNormalVelocity()
Set Normal Velocity Component to Zero.
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:188
void SetBoundaryConditions(NekDouble time)
time dependent boundary conditions updating
Array< OneD, Array< OneD, int > > m_fieldsBCToTraceID
Mapping from BCs to Elmt Edge IDs.
static Array< OneD, NekDouble > NullNekDouble1DArray
virtual bool v_PreIntegrate(int step)
void SetRadiationBoundaryForcing(int fieldid)
Set Radiation forcing term.
NekDouble m_kinvis
Kinematic viscosity.
bool CalcSteadyState(void)
evaluate steady state
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.
boost::shared_ptr< IncNavierStokes > IncNavierStokesSharedPtr
ExtrapolateSharedPtr m_extrapolation
SOLVER_UTILS_EXPORT typedef boost::shared_ptr< Forcing > ForcingSharedPtr
A shared pointer to an EquationSystem object.
Definition: Forcing.h:51
virtual bool v_PostIntegrate(int step)
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;.
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
Definition: MeshPartition.h:51
const std::string kAdvectionFormStr[]
int m_energysteps
dump energy to file at steps time
EquationType GetEquationType(void)
Array< OneD, Array< OneD, NekDouble > > m_fieldsRadiationFactor
RHS Factor for Radiation Condition.
int m_cflsteps
dump cfl estimate
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
int m_steadyStateSteps
Check for steady state at step interval.
boost::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
boost::shared_ptr< Extrapolate > ExtrapolateSharedPtr
Definition: Extrapolate.h:72
double NekDouble
virtual void v_NumericalFlux(Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, Array< OneD, NekDouble > > &numflux)
Array< OneD, int > & GetVelocity(void)
void EvaluateAdvectionTerms(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, Array< OneD, NekDouble > &wk=NullNekDouble1DArray)
Array< OneD, Array< OneD, int > > m_fieldsBCToElmtID
Mapping from BCs to Elmt IDs.
void AddForcing(const SolverUtils::ForcingSharedPtr &pForce)
std::ofstream m_mdlFile
modal energy file
This class is the base class for Navier Stokes problems.
const std::string kEquationTypeStr[]
NekDouble m_steadyStateTol
Tolerance to which steady state should be evaluated at.
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.
virtual void v_GetFluxVector(const int i, Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, Array< OneD, NekDouble > > &flux)
virtual void v_InitObject()
Init object for UnsteadySystem class.
virtual int v_GetForceDimension()=0
NekDouble GetCFLEstimate(int &elmtid)
Array< OneD, NekDouble > GetElmtCFLVals(void)
IncNavierStokes(const LibUtilities::SessionReaderSharedPtr &pSession)
Constructor.