Nektar++
ForcingMovingBody.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File: ForcingMovingBody.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: Moving Body (Wavyness and acceleration)
32 //
33 ///////////////////////////////////////////////////////////////////////////////
34 
35 #ifndef NEKTAR_SOLVERUTILS_FORCINGMOVINGBODY
36 #define NEKTAR_SOLVERUTILS_FORCINGMOVINGBODY
37 
44 #include <GlobalMapping/Mapping.h>
45 
46 namespace Nektar
47 {
48 
50 {
51  public:
52 
54 
55  /// Creates an instance of this class
58  const std::weak_ptr<SolverUtils::EquationSystem> &pEquation,
60  const unsigned int& pNumForcingFields,
61  const TiXmlElement* pForce)
62  {
65  AllocateSharedPtr(pSession, pEquation);
66  p->InitObject(pFields, pNumForcingFields, pForce);
67  return p;
68  }
69 
70  ///Name of the class
71  static std::string className;
72 
73  protected:
74  // Mapping object
76 
77  virtual void v_InitObject(
79  const unsigned int& pNumForcingFields,
80  const TiXmlElement* pForce);
81 
82  virtual void v_Apply(
84  const Array<OneD, Array<OneD, NekDouble> >& inarray,
85  Array<OneD, Array<OneD, NekDouble> >& outarray,
86  const NekDouble& time);
87 
88  private:
89 
92  const std::weak_ptr<SolverUtils::EquationSystem> &pEquation);
93 
94  void CheckIsFromFile(const TiXmlElement* pForce);
95 
99 
100  void InitialiseFilter(
101  const LibUtilities::SessionReaderSharedPtr& pSession,
103  const TiXmlElement* pForce);
104 
105  void Newmark_betaSolver(
107  Array<OneD, NekDouble> &FcePhysinArray,
108  Array<OneD, NekDouble> &MotPhysinArray);
109 
112  Array<OneD, NekDouble> &Hydroforces,
113  NekDouble time );
114 
115  void SetDynEqCoeffMatrix(
117 
118  void RollOver(Array<OneD, Array<OneD, NekDouble> > &input);
119 
120  int m_movingBodyCalls; ///< number of times the movbody have been called
121  int m_np; ///< number of planes per processors
122  int m_vdim; ///< vibration dimension
123 
124  NekDouble m_structrho; ///< mass of the cable per unit length
125  NekDouble m_structdamp; ///< damping ratio of the cable
126  NekDouble m_lhom; ///< length ratio of the cable
127  NekDouble m_kinvis; ///< fluid viscous
128  NekDouble m_timestep; ///< time step
129  ///
131  ///
133  /// storage for the cable's force(x,y) variables
135  /// storage for the cable's motion(x,y) variables
137  /// fictitious velocity storage
139  /// fictitious acceleration storage
141  /// matrices in Newmart-beta method
143  /// matrices in Newmart-beta method
145  /// [0] is displacements, [1] is velocities, [2] is accelerations
147  /// motion direction: [0] is 'x' and [1] is 'y'
149  /// do determine if the the body motion come from an extern file
151  /// Store the derivatives of motion variables in x-direction
153  /// Store the derivatives of motion variables in y-direction
155  ///
156  unsigned int m_outputFrequency;
158  std::string m_outputFile_fce;
159  std::string m_outputFile_mot;
160 };
161 
162 }
163 
164 #endif
Array< OneD, DNekMatSharedPtr > m_CoeffMat_B
matrices in Newmart-beta method
NekDouble m_structrho
mass of the cable per unit length
SOLVER_UTILS_EXPORT typedef std::shared_ptr< Forcing > ForcingSharedPtr
A shared pointer to an EquationSystem object.
Definition: Forcing.h:52
void CheckIsFromFile(const TiXmlElement *pForce)
NekDouble m_structdamp
damping ratio of the cable
Array< OneD, std::ofstream > m_outputStream
Array< OneD, Array< OneD, NekDouble > > m_MotionVars
storage for the cable&#39;s motion(x,y) variables
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
void SetDynEqCoeffMatrix(const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields)
Array< OneD, DNekMatSharedPtr > m_CoeffMat_A
matrices in Newmart-beta method
Array< OneD, NekDouble > m_Aeroforces
storage for the cable&#39;s force(x,y) variables
virtual void v_InitObject(const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const unsigned int &pNumForcingFields, const TiXmlElement *pForce)
GlobalMapping::MappingSharedPtr m_mapping
void Newmark_betaSolver(const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, Array< OneD, NekDouble > &FcePhysinArray, Array< OneD, NekDouble > &MotPhysinArray)
void InitialiseFilter(const LibUtilities::SessionReaderSharedPtr &pSession, const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const TiXmlElement *pForce)
int m_movingBodyCalls
number of times the movbody have been called
NekDouble m_kinvis
fluid viscous
Array< OneD, std::string > m_motion
motion direction: [0] is &#39;x&#39; and [1] is &#39;y&#39;
int m_vdim
vibration dimension
LibUtilities::NektarFFTSharedPtr m_FFT
static SolverUtils::ForcingSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const std::weak_ptr< SolverUtils::EquationSystem > &pEquation, const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const unsigned int &pNumForcingFields, const TiXmlElement *pForce)
Creates an instance of this class.
std::shared_ptr< FilterMovingBody > FilterMovingBodySharedPtr
virtual void v_Apply(const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble &time)
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
double NekDouble
ForcingMovingBody(const LibUtilities::SessionReaderSharedPtr &pSession, const std::weak_ptr< SolverUtils::EquationSystem > &pEquation)
NekDouble m_timestep
time step
void InitialiseCableModel(const LibUtilities::SessionReaderSharedPtr &pSession, const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields)
Array< OneD, bool > m_IsFromFile
do determine if the the body motion come from an extern file
Array< OneD, Array< OneD, NekDouble > > m_eta
Store the derivatives of motion variables in y-direction.
FilterMovingBodySharedPtr m_MovBodyfilter
NekDouble m_lhom
length ratio of the cable
Array< OneD, Array< OneD, Array< OneD, NekDouble > > > m_fV
fictitious velocity storage
static std::string className
Name of the class.
int m_np
number of planes per processors
Array< OneD, std::string > m_funcName
[0] is displacements, [1] is velocities, [2] is accelerations
void EvaluateStructDynModel(const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, Array< OneD, NekDouble > &Hydroforces, NekDouble time)
Defines a forcing term to be explicitly applied.
Definition: Forcing.h:72
GLOBAL_MAPPING_EXPORT typedef std::shared_ptr< Mapping > MappingSharedPtr
A shared pointer to a Mapping object.
Definition: Mapping.h:50
std::shared_ptr< NektarFFT > NektarFFTSharedPtr
Definition: NektarFFT.h:55
Array< OneD, Array< OneD, Array< OneD, NekDouble > > > m_fA
fictitious acceleration storage
void RollOver(Array< OneD, Array< OneD, NekDouble > > &input)
Array< OneD, Array< OneD, NekDouble > > m_zta
Store the derivatives of motion variables in x-direction.
std::shared_ptr< SessionReader > SessionReaderSharedPtr