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,
78  const TiXmlElement *pForce) override;
79 
80  virtual void v_Apply(
82  const Array<OneD, Array<OneD, NekDouble>> &inarray,
83  Array<OneD, Array<OneD, NekDouble>> &outarray,
84  const NekDouble &time) override;
85 
86 private:
89  const std::weak_ptr<SolverUtils::EquationSystem> &pEquation);
90 
91  void CheckIsFromFile(const TiXmlElement *pForce);
92 
96 
97  void InitialiseFilter(
100  const TiXmlElement *pForce);
101 
102  void Newmark_betaSolver(
104  Array<OneD, NekDouble> &FcePhysinArray,
105  Array<OneD, NekDouble> &MotPhysinArray);
106 
109  Array<OneD, NekDouble> &Hydroforces, NekDouble time);
110 
111  void SetDynEqCoeffMatrix(
113 
114  void RollOver(Array<OneD, Array<OneD, NekDouble>> &input);
115 
116  size_t m_movingBodyCalls; ///< number of times the movbody have been called
117  size_t m_np; ///< number of planes per processors
118  size_t m_vdim; ///< vibration dimension
119 
120  NekDouble m_structrho; ///< mass of the cable per unit length
121  NekDouble m_structdamp; ///< damping ratio of the cable
122  NekDouble m_lhom; ///< length ratio of the cable
123  NekDouble m_kinvis; ///< fluid viscous
124  NekDouble m_timestep; ///< time step
125  ///
127  ///
129  /// storage for the cable's force(x,y) variables
131  /// storage for the cable's motion(x,y) variables
133  /// fictitious velocity storage
135  /// fictitious acceleration storage
137  /// matrices in Newmart-beta method
139  /// matrices in Newmart-beta method
141  /// [0] is displacements, [1] is velocities, [2] is accelerations
143  /// motion direction: [0] is 'x' and [1] is 'y'
145  /// do determine if the the body motion come from an extern file
147  /// Store the derivatives of motion variables in x-direction
149  /// Store the derivatives of motion variables in y-direction
151  ///
152  unsigned int m_outputFrequency;
154  std::string m_outputFile_fce;
155  std::string m_outputFile_mot;
156 };
157 
158 } // namespace Nektar
159 
160 #endif
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
size_t m_np
number of planes per processors
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
size_t m_vdim
vibration dimension
NekDouble m_timestep
time step
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
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) override
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)
void RollOver(Array< OneD, Array< OneD, NekDouble >> &input)
size_t m_movingBodyCalls
number of times the movbody have been called
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.
virtual void v_InitObject(const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const unsigned int &pNumForcingFields, const TiXmlElement *pForce) override
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:2
std::shared_ptr< FilterMovingBody > FilterMovingBodySharedPtr
double NekDouble