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 // 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 
46 namespace Nektar
47 {
48 
50 {
51  public:
52 
54 
55  /// Creates an instance of this class
59  const unsigned int& pNumForcingFields,
60  const TiXmlElement* pForce)
61  {
64  AllocateSharedPtr(pSession);
65  p->InitObject(pFields, pNumForcingFields, pForce);
66  return p;
67  }
68 
69  ///Name of the class
70  static std::string className;
71 
72  protected:
73  virtual void v_InitObject(
75  const unsigned int& pNumForcingFields,
76  const TiXmlElement* pForce);
77 
78  virtual void v_Apply(
80  const Array<OneD, Array<OneD, NekDouble> >& inarray,
81  Array<OneD, Array<OneD, NekDouble> >& outarray,
82  const NekDouble& time);
83 
84  private:
86  const LibUtilities::SessionReaderSharedPtr& pSession);
87 
88  void CheckIsFromFile(const TiXmlElement* pForce);
89 
93 
94  void InitialiseFilter(
97  const TiXmlElement* pForce);
98 
99  void UpdateMotion(
101  const Array<OneD, Array<OneD, NekDouble> > & fields,
102  NekDouble time );
103 
104  void TensionedCableModel(
106  Array<OneD, NekDouble> &FcePhysinArray,
107  Array<OneD, NekDouble> &MotPhysinArray);
108 
111  NekDouble time );
112 
113  void CalculateForcing(
115 
118  const Array<OneD, Array<OneD, NekDouble> > & fields,
119  NekDouble time );
120 
122  const Array<OneD, NekDouble> &input,
123  Array<OneD, NekDouble> &output,
124  int npoints);
125 
126  void SetDynEqCoeffMatrix(
128 
129  void RollOver(Array<OneD, Array<OneD, NekDouble> > &input);
130 
131  int m_movingBodyCalls; ///< number of times the movbody have been called
132  int m_np; ///< number of planes per processors
133  int m_vdim; ///< vibration dimension
134 
135  NekDouble m_structrho; ///< mass of the cable per unit length
136  NekDouble m_structdamp; ///< damping ratio of the cable
137  NekDouble m_lhom; ///< length ratio of the cable
138  NekDouble m_kinvis; ///< fluid viscous
139  NekDouble m_timestep; ///< time step
140  ///
142  ///
144  /// storage for the cable's force(x,y) variables
146  /// storage for the cable's motion(x,y) variables
148  /// srorage for the velocity in z-direction
150  /// fictitious velocity storage
152  /// fictitious acceleration storage
154  /// matrices in Newmart-beta method
156  /// matrices in Newmart-beta method
158  /// [0] is displacements, [1] is velocities, [2] is accelerations
160  /// motion direction: [0] is 'x' and [1] is 'y'
162  /// do determine if the the body motion come from an extern file
164  /// Store the derivatives of motion variables in x-direction
166  /// Store the derivatives of motion variables in y-direction
168  ///
170 };
171 
172 }
173 
174 #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
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
void EvaluateStructDynModel(const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, NekDouble time)
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, Array< OneD, NekDouble > > m_W
srorage for the velocity in z-direction
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)
void CalculateForcing(const Array< OneD, MultiRegions::ExpListSharedPtr > &fields)
void InitialiseFilter(const LibUtilities::SessionReaderSharedPtr &pSession, const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const TiXmlElement *pForce)
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
Definition: MeshPartition.h:50
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'
void EvaluateAccelaration(const Array< OneD, NekDouble > &input, Array< OneD, NekDouble > &output, int npoints)
Array< OneD, NekDouble > m_MotionVars
storage for the cable's motion(x,y) variables
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)
void TensionedCableModel(const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, Array< OneD, NekDouble > &FcePhysinArray, Array< OneD, NekDouble > &MotPhysinArray)
double NekDouble
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, Array< OneD, NekDouble > > m_forcing
void MappingBndConditions(const Array< OneD, MultiRegions::ExpListSharedPtr > &pfields, const Array< OneD, Array< OneD, NekDouble > > &fields, NekDouble time)
void UpdateMotion(const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const Array< OneD, Array< OneD, NekDouble > > &fields, NekDouble time)
Array< OneD, std::string > m_funcName
[0] is displacements, [1] is velocities, [2] is accelerations
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