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
45
46namespace Nektar
47{
48
50{
51public:
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
71protected:
72 // Mapping object
74
75 void v_InitObject(
77 const unsigned int &pNumForcingFields,
78 const TiXmlElement *pForce) override;
79
81 const Array<OneD, Array<OneD, NekDouble>> &inarray,
83 const NekDouble &time) override;
84
85private:
88 const std::weak_ptr<SolverUtils::EquationSystem> &pEquation);
89
90 void CheckIsFromFile(const TiXmlElement *pForce);
91
95
99 const TiXmlElement *pForce);
100
103 Array<OneD, NekDouble> &FcePhysinArray,
104 Array<OneD, NekDouble> &MotPhysinArray);
105
108 Array<OneD, NekDouble> &Hydroforces, NekDouble time);
109
112
114
115 size_t m_movingBodyCalls; ///< number of times the movbody have been called
116 size_t m_np; ///< number of planes per processors
117 size_t m_vdim; ///< vibration dimension
118
119 NekDouble m_structrho; ///< mass of the cable per unit length
120 NekDouble m_structdamp; ///< damping ratio of the cable
121 NekDouble m_lhom; ///< length ratio of the cable
122 NekDouble m_kinvis; ///< fluid viscous
123 NekDouble m_timestep; ///< time step
124 ///
126 ///
128 /// storage for the cable's force(x,y) variables
130 /// storage for the cable's motion(x,y) variables
132 /// fictitious velocity storage
134 /// fictitious acceleration storage
136 /// matrices in Newmart-beta method
138 /// matrices in Newmart-beta method
140 /// [0] is displacements, [1] is velocities, [2] is accelerations
142 /// motion direction: [0] is 'x' and [1] is 'y'
144 /// do determine if the the body motion come from an extern file
146 /// Store the derivatives of motion variables in x-direction
148 /// Store the derivatives of motion variables in y-direction
150 ///
151 unsigned int m_outputFrequency;
152};
153
154} // namespace Nektar
155
156#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 RollOver(Array< OneD, Array< OneD, NekDouble > > &input)
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
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, 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, 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)
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.
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:71
GLOBAL_MAPPING_EXPORT typedef std::shared_ptr< Mapping > MappingSharedPtr
A shared pointer to a Mapping object.
Definition: Mapping.h:51
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::shared_ptr< NektarFFT > NektarFFTSharedPtr
Definition: NektarFFT.h:58
SOLVER_UTILS_EXPORT typedef std::shared_ptr< Forcing > ForcingSharedPtr
A shared pointer to an EquationSystem object.
Definition: Forcing.h:53
std::shared_ptr< FilterMovingBody > FilterMovingBodySharedPtr
double NekDouble