phasicFlow/src/MotionModel/fixedWall/fixedWall.hpp

207 lines
4.0 KiB
C++
Raw Normal View History

2022-09-04 21:26:29 +00:00
/*------------------------------- phasicFlow ---------------------------------
O C enter of
O O E ngineering and
O O M ultiscale modeling of
OOOOOOO F luid flow
------------------------------------------------------------------------------
Copyright (C): www.cemf.ir
email: hamid.r.norouzi AT gmail.com
------------------------------------------------------------------------------
Licence:
This file is part of phasicFlow code. It is a free software for simulating
granular and multiphase flows. You can redistribute it and/or modify it under
the terms of GNU General Public License v3 or any other later versions.
phasicFlow is distributed to help others in their research in the field of
granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-----------------------------------------------------------------------------*/
2022-12-09 22:02:54 +00:00
#ifndef __fixedWall_hpp__
#define __fixedWall_hpp__
2022-09-04 21:26:29 +00:00
2022-12-09 22:02:54 +00:00
#include "types.hpp"
#include "typeInfo.hpp"
#include "Vectors.hpp"
#include "uniquePtr.hpp"
2022-09-04 21:26:29 +00:00
namespace pFlow
{
class dictionary;
2023-04-02 16:17:16 +00:00
/**
* Fixed wall motion model for walls
*
* This class is used for geometries that are fixed during simulation.
*
*
\verbatim
// In geometryDict file, this will defines fixed walls during simulation
...
motionModel fixedWall;
...
\endverbatim
*/
2022-09-04 21:26:29 +00:00
class fixedWall
{
public:
2023-04-02 16:17:16 +00:00
/** Motion model class to be passed to computational units/kernels for
* transfing points and returning velocities at various positions
*/
2022-09-04 21:26:29 +00:00
class Model
{
public:
INLINE_FUNCTION_HD
Model(){}
INLINE_FUNCTION_HD
Model(const Model&) = default;
INLINE_FUNCTION_HD
Model& operator=(const Model&) = default;
INLINE_FUNCTION_HD
realx3 pointVelocity(int32 n, const realx3 p)const
{
return 0.0;
}
INLINE_FUNCTION_HD
realx3 operator()(int32 n, const realx3& p)const
{
return 0.0;
}
INLINE_FUNCTION_HD
realx3 transferPoint(int32 n, const realx3 p, real dt)const
{
return p;
}
INLINE_FUNCTION_HD int32 numComponents()const
{
return 0;
}
};
protected:
2023-04-02 16:17:16 +00:00
/// Name
2022-09-04 21:26:29 +00:00
const word name_ = "none";
2023-04-02 16:17:16 +00:00
/// Read from a dictionary
2022-09-04 21:26:29 +00:00
bool readDictionary(const dictionary& dict);
2023-04-02 16:17:16 +00:00
/// write to a dictionary
2022-09-04 21:26:29 +00:00
bool writeDictionary(dictionary& dict)const;
public:
2023-04-02 16:17:16 +00:00
/// Type info
2022-12-09 22:02:54 +00:00
TypeInfoNV("fixedWall");
2022-09-04 21:26:29 +00:00
2023-04-02 16:17:16 +00:00
// - Constructors
2022-09-04 21:26:29 +00:00
2023-04-02 16:17:16 +00:00
/// Empty
fixedWall();
2022-09-04 21:26:29 +00:00
2023-04-02 16:17:16 +00:00
/// Constructor with dictionary
fixedWall(const dictionary& dict);
2022-09-04 21:26:29 +00:00
2023-04-02 16:17:16 +00:00
/// Copy constructor
fixedWall(const fixedWall&) = default;
2022-09-04 21:26:29 +00:00
2023-04-02 16:17:16 +00:00
/// Move constructor
fixedWall(fixedWall&&) = default;
2022-09-04 21:26:29 +00:00
2023-04-02 16:17:16 +00:00
/// Copy assignment
fixedWall& operator=(const fixedWall&) = default;
2022-09-04 21:26:29 +00:00
2023-04-02 16:17:16 +00:00
/// Move assignment
fixedWall& operator=(fixedWall&&) = default;
2022-09-04 21:26:29 +00:00
2023-04-02 16:17:16 +00:00
/// Destructor
~fixedWall() = default;
2022-09-04 21:26:29 +00:00
2023-04-02 16:17:16 +00:00
// - Methods
2022-09-04 21:26:29 +00:00
2023-04-02 16:17:16 +00:00
/// Return motion model
/// t is the current simulation time
Model getModel(real t)const
{
return Model();
}
2022-09-04 21:26:29 +00:00
2023-04-02 16:17:16 +00:00
/// Name of the motion component to index
int32 nameToIndex(const word& name)const
{
return 0;
}
2022-09-04 21:26:29 +00:00
2023-04-02 16:17:16 +00:00
/// Index of motion component to name
word indexToName(label i)const
{
return name_;
}
2022-09-04 21:26:29 +00:00
2023-04-02 16:17:16 +00:00
/// Velocity at point p
INLINE_FUNCTION_HD
realx3 pointVelocity(label n, const realx3& p)const
{
return zero3;
}
2022-09-04 21:26:29 +00:00
2023-04-02 16:17:16 +00:00
/// Transfer point p for dt seconds according to motion component n
INLINE_FUNCTION_HD
realx3 transferPoint(label n, const realx3 p, real dt)const
{
return p;
}
2022-09-04 21:26:29 +00:00
2023-04-02 16:17:16 +00:00
/// Transfer a vector of point pVec for dt seconds according to motion
/// component n
INLINE_FUNCTION_HD
bool transferPoint(label n, realx3* pVec, size_t numP, real dt)
{
return true;
}
2022-09-04 21:26:29 +00:00
2023-04-02 16:17:16 +00:00
/// Are walls moving
INLINE_FUNCTION_HD
bool isMoving()const
{
return false;
}
2022-09-04 21:26:29 +00:00
2023-04-02 16:17:16 +00:00
/// Move points
bool move(real t, real dt)
{
return true;
}
2022-09-04 21:26:29 +00:00
2023-04-02 16:17:16 +00:00
// - IO operations
2022-09-04 21:26:29 +00:00
2023-04-02 16:17:16 +00:00
/// Read from input stream is
FUNCTION_H
bool read(iIstream& is);
2022-09-04 21:26:29 +00:00
2023-04-02 16:17:16 +00:00
/// Write to output stream os
FUNCTION_H
bool write(iOstream& os)const;
2022-09-04 21:26:29 +00:00
};
} // pFlow
2022-12-09 22:02:54 +00:00
#endif //__fixed_hpp__