mirror of
https://github.com/PhasicFlow/phasicFlow.git
synced 2025-07-08 03:07:03 +00:00
motion model docs are added
This commit is contained in:
@ -34,14 +34,44 @@ Licence:
|
||||
namespace pFlow
|
||||
{
|
||||
|
||||
// forward
|
||||
class dictionary;
|
||||
|
||||
/**
|
||||
* Vibrating motion model for walls
|
||||
*
|
||||
* This class is used for simulaiton that at least one wall components
|
||||
* are moving according to a sinoidal viration defined in class vibrating.
|
||||
* One or more than one motion components can be defined in
|
||||
* vibratingMotionInfo dictionary
|
||||
*
|
||||
\verbatim
|
||||
// In geometryDict file, this will defines vibrating walls during simulation
|
||||
...
|
||||
motionModel vibratingMotion;
|
||||
|
||||
vibratingMotionInfo
|
||||
{
|
||||
vibComponent1
|
||||
{
|
||||
// the definition based on class vibrating
|
||||
}
|
||||
vibComponent2
|
||||
{
|
||||
// the definition based on calss vibrating
|
||||
}
|
||||
}
|
||||
...
|
||||
\endverbatim
|
||||
*
|
||||
*/
|
||||
class vibratingMotion
|
||||
{
|
||||
public:
|
||||
|
||||
// - this class shuold be decleared in every motion model with
|
||||
// exact methods
|
||||
/** Motion model class to be passed to computational units/kernels for
|
||||
* transfing points and returning velocities at various positions
|
||||
*/
|
||||
class Model
|
||||
{
|
||||
protected:
|
||||
@ -93,43 +123,53 @@ protected:
|
||||
|
||||
using axisVector_HD = VectorDual<vibrating>;
|
||||
|
||||
/// Vibrating motion components
|
||||
axisVector_HD components_;
|
||||
|
||||
/// Names of components
|
||||
wordList componentName_;
|
||||
|
||||
/// Number of components
|
||||
label numComponents_= 0;
|
||||
|
||||
/// Read from a dictionary
|
||||
bool readDictionary(const dictionary& dict);
|
||||
|
||||
/// Write to a dictionary
|
||||
bool writeDictionary(dictionary& dict)const;
|
||||
|
||||
public:
|
||||
|
||||
/// Type info
|
||||
TypeInfoNV("vibratingMotion");
|
||||
|
||||
// empty
|
||||
/// Empty
|
||||
FUNCTION_H
|
||||
vibratingMotion();
|
||||
|
||||
// construct with dictionary
|
||||
/// Construct with dictionary
|
||||
FUNCTION_H
|
||||
vibratingMotion(const dictionary& dict);
|
||||
|
||||
// copy
|
||||
/// Copy constructor
|
||||
FUNCTION_H
|
||||
vibratingMotion(const vibratingMotion&) = default;
|
||||
|
||||
/// No move
|
||||
vibratingMotion(vibratingMotion&&) = delete;
|
||||
|
||||
/// Copy assignment
|
||||
FUNCTION_H
|
||||
vibratingMotion& operator=(const vibratingMotion&) = default;
|
||||
|
||||
/// No Move assignment
|
||||
vibratingMotion& operator=(vibratingMotion&&) = delete;
|
||||
|
||||
/// Destructor
|
||||
FUNCTION_H
|
||||
~vibratingMotion() = default;
|
||||
|
||||
|
||||
/// Return motion model at time t
|
||||
Model getModel(real t)
|
||||
{
|
||||
for(int32 i= 0; i<numComponents_; i++ )
|
||||
@ -142,6 +182,7 @@ public:
|
||||
return Model(components_.deviceVectorAll(), numComponents_);
|
||||
}
|
||||
|
||||
/// Name to component index
|
||||
INLINE_FUNCTION_H
|
||||
int32 nameToIndex(const word& name)const
|
||||
{
|
||||
@ -159,6 +200,7 @@ public:
|
||||
|
||||
}
|
||||
|
||||
/// Index to name
|
||||
INLINE_FUNCTION_H
|
||||
word indexToName(label i)const
|
||||
{
|
||||
@ -174,41 +216,42 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// velocity at point p according to motion component n
|
||||
INLINE_FUNCTION_H
|
||||
realx3 pointVelocity(label n, const realx3& p)const
|
||||
{
|
||||
return components_.hostVectorAll()[n].linTangentialVelocityPoint(p);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// Transfer point p for dt seconds based on motion component n
|
||||
INLINE_FUNCTION_H
|
||||
realx3 transferPoint(label n, const realx3 p, real dt)const
|
||||
{
|
||||
return components_.hostVectorAll()[n].transferPoint(p, dt);
|
||||
}
|
||||
|
||||
|
||||
/// Is moving
|
||||
INLINE_FUNCTION_HD
|
||||
bool isMoving()const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/// Move ponits at time t for dt seconds
|
||||
INLINE_FUNCTION_H
|
||||
bool move(real t, real dt)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/// Read from input stream is
|
||||
FUNCTION_H
|
||||
bool read(iIstream& is);
|
||||
|
||||
/// Write to output stream os
|
||||
FUNCTION_H
|
||||
bool write(iOstream& os)const;
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // pFlow
|
||||
|
Reference in New Issue
Block a user