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 
38 #include <GlobalMapping/Mapping.h>
45 
46 namespace Nektar
47 {
48 
50 {
51 public:
52  friend class MemoryManager<ForcingMovingBody>;
53 
54  /// Creates an instance of this class
57  const std::weak_ptr<SolverUtils::EquationSystem> &pEquation,
59  const unsigned int &pNumForcingFields, const TiXmlElement *pForce)
60  {
63  pEquation);
64  p->InitObject(pFields, pNumForcingFields, pForce);
65  return p;
66  }
67 
68  /// Name of the class
69  static std::string className;
70 
71 protected:
72  // Mapping object
74 
75  virtual void v_InitObject(
77  const unsigned int &pNumForcingFields, const TiXmlElement *pForce);
78 
79  virtual void v_Apply(
81  const Array<OneD, Array<OneD, NekDouble>> &inarray,
82  Array<OneD, Array<OneD, NekDouble>> &outarray, const NekDouble &time);
83 
84 private:
87  const std::weak_ptr<SolverUtils::EquationSystem> &pEquation);
88 
89  void CheckIsFromFile(const TiXmlElement *pForce);
90 
94 
95  void InitialiseFilter(
98  const TiXmlElement *pForce);
99 
100  void Newmark_betaSolver(
102  Array<OneD, NekDouble> &FcePhysinArray,
103  Array<OneD, NekDouble> &MotPhysinArray);
104 
107  Array<OneD, NekDouble> &Hydroforces, NekDouble time);
108 
109  void SetDynEqCoeffMatrix(
111 
112  void RollOver(Array<OneD, Array<OneD, NekDouble>> &input);
113 
114  int m_movingBodyCalls; ///< number of times the movbody have been called
115  int m_np; ///< number of planes per processors
116  int m_vdim; ///< vibration dimension
117 
118  NekDouble m_structrho; ///< mass of the cable per unit length
119  NekDouble m_structdamp; ///< damping ratio of the cable
120  NekDouble m_lhom; ///< length ratio of the cable
121  NekDouble m_kinvis; ///< fluid viscous
122  NekDouble m_timestep; ///< time step
123  ///
125  ///
127  /// storage for the cable's force(x,y) variables
129  /// storage for the cable's motion(x,y) variables
131  /// fictitious velocity storage
133  /// fictitious acceleration storage
135  /// matrices in Newmart-beta method
137  /// matrices in Newmart-beta method
139  /// [0] is displacements, [1] is velocities, [2] is accelerations
141  /// motion direction: [0] is 'x' and [1] is 'y'
143  /// do determine if the the body motion come from an extern file
145  /// Store the derivatives of motion variables in x-direction
147  /// Store the derivatives of motion variables in y-direction
149  ///
150  unsigned int m_outputFrequency;
152  std::string m_outputFile_fce;
153  std::string m_outputFile_mot;
154 };
155 
156 } // namespace Nektar
157 
158 #endif
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)
GlobalMapping::MappingSharedPtr m_mapping
Array< OneD, std::string > m_funcName
[0] is displacements, [1] is velocities, [2] is accelerations
ForcingMovingBody(const LibUtilities::SessionReaderSharedPtr &pSession, const std::weak_ptr< SolverUtils::EquationSystem > &pEquation)
Array< OneD, Array< OneD, NekDouble > > m_zta
Store the derivatives of motion variables in x-direction.
NekDouble m_lhom
length ratio of the cable
NekDouble m_kinvis
fluid viscous
Array< OneD, DNekMatSharedPtr > m_CoeffMat_A
matrices in Newmart-beta method
Array< OneD, Array< OneD, NekDouble > > m_eta
Store the derivatives of motion variables in y-direction.
void CheckIsFromFile(const TiXmlElement *pForce)
Array< OneD, Array< OneD, Array< OneD, NekDouble > > > m_fV
fictitious velocity storage
Array< OneD, Array< OneD, Array< OneD, NekDouble > > > m_fA
fictitious acceleration storage
void SetDynEqCoeffMatrix(const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields)
void InitialiseCableModel(const LibUtilities::SessionReaderSharedPtr &pSession, const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields)
NekDouble m_structrho
mass of the cable per unit length
NekDouble m_timestep
time step
virtual void v_InitObject(const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const unsigned int &pNumForcingFields, const TiXmlElement *pForce)
int m_np
number of planes per processors
int m_vdim
vibration dimension
Array< OneD, NekDouble > m_Aeroforces
storage for the cable's force(x,y) variables
Array< OneD, bool > m_IsFromFile
do determine if the the body motion come from an extern file
FilterMovingBodySharedPtr m_MovBodyfilter
Array< OneD, std::ofstream > m_outputStream
Array< OneD, Array< OneD, NekDouble > > m_MotionVars
storage for the cable's motion(x,y) variables
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.
Array< OneD, DNekMatSharedPtr > m_CoeffMat_B
matrices in Newmart-beta method
void EvaluateStructDynModel(const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, Array< OneD, NekDouble > &Hydroforces, NekDouble time)
int m_movingBodyCalls
number of times the movbody have been called
void RollOver(Array< OneD, Array< OneD, NekDouble >> &input)
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)
Array< OneD, std::string > m_motion
motion direction: [0] is 'x' and [1] is 'y'
LibUtilities::NektarFFTSharedPtr m_FFT
static std::string className
Name of the class.
NekDouble m_structdamp
damping ratio of the cable
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
Defines a forcing term to be explicitly applied.
Definition: Forcing.h:73
GLOBAL_MAPPING_EXPORT typedef std::shared_ptr< Mapping > MappingSharedPtr
A shared pointer to a Mapping object.
Definition: Mapping.h:50
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::shared_ptr< NektarFFT > NektarFFTSharedPtr
Definition: NektarFFT.h:55
SOLVER_UTILS_EXPORT typedef std::shared_ptr< Forcing > ForcingSharedPtr
A shared pointer to an EquationSystem object.
Definition: Forcing.h:52
The above copyright notice and this permission notice shall be included.
Definition: CoupledSolver.h:1
std::shared_ptr< FilterMovingBody > FilterMovingBodySharedPtr
double NekDouble