Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 // 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: Moving Body (Wavyness and acceleration)
33 //
34 ///////////////////////////////////////////////////////////////////////////////
35 
36 #ifndef NEKTAR_SOLVERUTILS_FORCINGMOVINGBODY
37 #define NEKTAR_SOLVERUTILS_FORCINGMOVINGBODY
38 
45 #include <GlobalMapping/Mapping.h>
46 
47 namespace Nektar
48 {
49 
51 {
52  public:
53 
55 
56  /// Creates an instance of this class
60  const unsigned int& pNumForcingFields,
61  const TiXmlElement* pForce)
62  {
65  AllocateSharedPtr(pSession);
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 
91  const LibUtilities::SessionReaderSharedPtr& pSession);
92 
93  void CheckIsFromFile(const TiXmlElement* pForce);
94 
98 
99  void InitialiseFilter(
100  const LibUtilities::SessionReaderSharedPtr& pSession,
102  const TiXmlElement* pForce);
103 
104  void Newmark_betaSolver(
106  Array<OneD, NekDouble> &FcePhysinArray,
107  Array<OneD, NekDouble> &MotPhysinArray);
108 
111  Array<OneD, NekDouble> &Hydroforces,
112  NekDouble time );
113 
114  void SetDynEqCoeffMatrix(
116 
117  void RollOver(Array<OneD, Array<OneD, NekDouble> > &input);
118 
119  int m_movingBodyCalls; ///< number of times the movbody have been called
120  int m_np; ///< number of planes per processors
121  int m_vdim; ///< vibration dimension
122 
123  NekDouble m_structrho; ///< mass of the cable per unit length
124  NekDouble m_structdamp; ///< damping ratio of the cable
125  NekDouble m_lhom; ///< length ratio of the cable
126  NekDouble m_kinvis; ///< fluid viscous
127  NekDouble m_timestep; ///< time step
128  ///
130  ///
132  /// storage for the cable's force(x,y) variables
134  /// storage for the cable's motion(x,y) variables
136  /// fictitious velocity storage
138  /// fictitious acceleration storage
140  /// matrices in Newmart-beta method
142  /// matrices in Newmart-beta method
144  /// [0] is displacements, [1] is velocities, [2] is accelerations
146  /// motion direction: [0] is 'x' and [1] is 'y'
148  /// do determine if the the body motion come from an extern file
150  /// Store the derivatives of motion variables in x-direction
152  /// Store the derivatives of motion variables in y-direction
154  ///
155  unsigned int m_outputFrequency;
157  std::string m_outputFile_fce;
158  std::string m_outputFile_mot;
159 };
160 
161 }
162 
163 #endif
Array< OneD, DNekMatSharedPtr > m_CoeffMat_B
matrices in Newmart-beta method
NekDouble m_structrho
mass of the cable per unit length
void CheckIsFromFile(const TiXmlElement *pForce)
NekDouble m_structdamp
damping ratio of the cable
Array< OneD, std::ofstream > m_outputStream
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
Array< OneD, Array< OneD, NekDouble > > m_MotionVars
storage for the cable'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
SOLVER_UTILS_EXPORT typedef boost::shared_ptr< Forcing > ForcingSharedPtr
A shared pointer to an EquationSystem object.
Definition: Forcing.h:51
Array< OneD, NekDouble > m_Aeroforces
storage for the cable'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)
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
Definition: MeshPartition.h:51
boost::shared_ptr< FilterMovingBody > FilterMovingBodySharedPtr
ForcingMovingBody(const LibUtilities::SessionReaderSharedPtr &pSession)
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 'x' and [1] is 'y'
int m_vdim
vibration dimension
LibUtilities::NektarFFTSharedPtr m_FFT
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)
double NekDouble
GLOBAL_MAPPING_EXPORT typedef boost::shared_ptr< Mapping > MappingSharedPtr
A shared pointer to a Mapping object.
Definition: Mapping.h:51
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:70
Array< OneD, Array< OneD, Array< OneD, NekDouble > > > m_fA
fictitious acceleration storage
void RollOver(Array< OneD, Array< OneD, NekDouble > > &input)
static SolverUtils::ForcingSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const unsigned int &pNumForcingFields, const TiXmlElement *pForce)
Creates an instance of this class.
Array< OneD, Array< OneD, NekDouble > > m_zta
Store the derivatives of motion variables in x-direction.
boost::shared_ptr< NektarFFT > NektarFFTSharedPtr
Definition: NektarFFT.h:56