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 // 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 {
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 
101  {
103  {
106  };
107 
109  {};
110 
111  /// Real and imaginary velocity comp. of wom
112  std::vector<NekDouble> m_wom_vel_r;
113  std::vector<NekDouble> m_wom_vel_i;
114 
115  /// Womersley BC constants
119  // currently this needs to be the point in the middle of the
120  // axis but shoudl be generalised to be any point on the axis
122 
123  };
124  typedef boost::shared_ptr<WomersleyParams> WomersleyParamsSharedPtr;
125 
126  /**
127  * \brief This class is the base class for Navier Stokes problems
128  *
129  */
131  {
132  public:
133  // Destructor
134  virtual ~IncNavierStokes();
135 
136  virtual void v_InitObject();
137 
138 
139  virtual void v_GetFluxVector(
140  const int i,
141  Array<OneD, Array<OneD, NekDouble> > &physfield,
143 
144  virtual void v_NumericalFlux(
145  Array<OneD, Array<OneD, NekDouble> > &physfield,
146  Array<OneD, Array<OneD, NekDouble> > &numflux);
147 
149  {
150  return m_nConvectiveFields;
151  }
152 
154  {
155  return m_velocity;
156  }
157 
158 
160 
161  NekDouble GetCFLEstimate(int &elmtid);
162 
163  void AddForcing(const SolverUtils::ForcingSharedPtr& pForce);
164 
165  protected:
166 
167  // pointer to the extrapolation class for sub-stepping and HOPBS
168 
170 
171  /// modal energy file
172  std::ofstream m_mdlFile;
173 
174  /// bool to identify if advection term smoothing is requested
176 
177  /// Forcing terms
178  std::vector<SolverUtils::ForcingSharedPtr> m_forcing;
179 
180  /// Number of fields to be convected;
182 
183  /// int which identifies which components of m_fields contains the
184  /// velocity (u,v,w);
186 
187  /// Pointer to field holding pressure field
189  /// Kinematic viscosity
191  /// dump energy to file at steps time
193  /// dump cfl estimate
195  /// Check for steady state at step interval
197  /// Tolerance to which steady state should be evaluated at
199 
200  /// equation type;
202 
203  /// Mapping from BCs to Elmt IDs
205  /// Mapping from BCs to Elmt Edge IDs
207  /// RHS Factor for Radiation Condition
209 
210  /// Number of time integration steps AND Order of extrapolation for
211  /// pressure boundary conditions.
213 
214  /// Constructor.
216 
218  {
219  return m_equationType;
220  }
221 
222  void EvaluateAdvectionTerms(const Array<OneD, const Array<OneD, NekDouble> > &inarray,
223  Array<OneD, Array<OneD, NekDouble> > &outarray);
224 
225  void WriteModalEnergy(void);
226 
227  /// time dependent boundary conditions updating
228  void SetBoundaryConditions(NekDouble time);
229 
230  /// Set Radiation forcing term
231  void SetRadiationBoundaryForcing(int fieldid);
232 
233  /// Set Normal Velocity Component to Zero
234  void SetZeroNormalVelocity();
235 
236  /// Set Womersley Profile if specified
237  void SetWomersleyBoundary(const int fldid, const int bndid);
238 
239  /// Set Up Womersley details
240  void SetUpWomersley(const int bndid, std::string womstr);
241 
242  /// evaluate steady state
243  bool CalcSteadyState(void);
244 
245  /// Womersley parameters if required
246  std::map<int,WomersleyParamsSharedPtr> m_womersleyParams;
247 
249  {
250  return m_pressure;
251  }
252 
253  virtual void v_TransCoeffToPhys(void)
254  {
255  ASSERTL0(false,"This method is not defined in this class");
256  }
257 
258  virtual void v_TransPhysToCoeff(void)
259  {
260  ASSERTL0(false,"This method is not defined in this class");
261  }
262 
263  virtual int v_GetForceDimension()=0;
264 
265  virtual bool v_PreIntegrate(int step);
266  virtual bool v_PostIntegrate(int step);
267 
268  private:
269 
270  };
271 
272  typedef boost::shared_ptr<IncNavierStokes> IncNavierStokesSharedPtr;
273 
274 } //end of namespace
275 
276 #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:198
void SetBoundaryConditions(NekDouble time)
time dependent boundary conditions updating
Array< OneD, Array< OneD, int > > m_fieldsBCToTraceID
Mapping from BCs to Elmt Edge IDs.
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
NekDouble m_radius
Womersley BC constants.
void EvaluateAdvectionTerms(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
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
std::vector< NekDouble > m_wom_vel_i
EquationType GetEquationType(void)
Array< OneD, Array< OneD, NekDouble > > m_fieldsRadiationFactor
RHS Factor for Radiation Condition.
void SetUpWomersley(const int bndid, std::string womstr)
Set Up Womersley details.
int m_cflsteps
dump cfl estimate
std::map< int, WomersleyParamsSharedPtr > m_womersleyParams
Womersley parameters if required.
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
boost::shared_ptr< WomersleyParams > WomersleyParamsSharedPtr
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:60
Array< OneD, NekDouble > m_axispoint
double NekDouble
virtual void v_NumericalFlux(Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, Array< OneD, NekDouble > > &numflux)
Array< OneD, int > & GetVelocity(void)
std::vector< NekDouble > m_wom_vel_r
Real and imaginary velocity comp. of wom.
Array< OneD, Array< OneD, int > > m_fieldsBCToElmtID
Mapping from BCs to Elmt IDs.
void AddForcing(const SolverUtils::ForcingSharedPtr &pForce)
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[]
NekDouble m_steadyStateTol
Tolerance to which steady state should be evaluated at.
virtual void v_TransPhysToCoeff(void)
Virtual function for transformation to coefficient space.
void SetWomersleyBoundary(const int fldid, const int bndid)
Set Womersley Profile if specified.
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.