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 // 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 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);
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
183  /// Mapping from BCs to Elmt Edge IDs
185  /// RHS Factor for Radiation Condition
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,
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
EquationType m_equationType
equation type;
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:135
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 m_subSteppingScheme
bool to identify if using a substepping scheme
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< TimeIntegrationWrapper > TimeIntegrationWrapperSharedPtr
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:50
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()
boost::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
Definition: ExpList.h:1340
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< 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[]
LibUtilities::TimeIntegrationWrapperSharedPtr m_subStepIntegrationScheme
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.