7#ifndef _MAIAPARTICLEELLIPSOIDAL_H
8#define _MAIAPARTICLEELLIPSOIDAL_H
14template <MInt nDim,
class SysEqn>
89 std::array<MFloat, 4>
m_shapeParams{std::numeric_limits<MFloat>::quiet_NaN()};
112 static std::array<MFloat, nDim>
s_Frm;
169 for(
MInt i = 0; i < nDim; i++) {
170 magnitude +=
POW2(velocity1[i] - velocity2[i]);
172 return sqrt(magnitude);
177 return density * velocity *
m_eqDiameter / dynamicViscosity;
196 std::array<MFloat, nDim + 1> result{};
197 std::vector<MFloat> weights;
198 this->
template interpolateAndCalcWeights<0, nDim + 1>(
m_cellId,
m_position.data(), result.data(), weights);
199 for(
MInt i = 0; i < nDim; i++) {
215 MFloat& density, std::vector<MFloat>& weights) {
216 std::array<MFloat, nDim + 1> result{};
217 this->
template interpolateAndCalcWeights<0, nDim + 1>(cellId, position, result.data(), weights);
218 for(
MInt n = 0; n < nDim; n++) {
219 velocity[n] = result[n];
221 density = result[nDim];
225 MFloat*
const velocityGradient, std::vector<MFloat>& weights) {
226 std::array<MFloat, nDim> result{};
227 std::array<MFloat, nDim * nDim> gradientResult{};
228 this->
template interpolateAndCalcWeights<0, nDim>(cellId, position, result.data(), weights, gradientResult.data());
229 for(
MInt n = 0; n < nDim; n++) {
230 velocity[n] = result[n];
232 for(
MInt n = 0; n < nDim * nDim; n++) {
233 velocityGradient[n] = gradientResult[n];
BitsetType::reference toBeRespawn()
virtual void particleWallCollision()
particle-wall collision step
static LPT< nDim > * s_backPtr
std::vector< MInt > m_neighborList
void interpolateAndCalcWeights(const MInt cellId, const MFloat *const x, MFloat *const result, std::vector< MFloat > &weight, MFloat *const gradientResult=nullptr)
MFloat m_creationTime
creation time modifier
std::array< MFloat, nDim > m_position
void getNghbrList(std::vector< MInt > &, const MInt)
std::array< MFloat, nDim > m_velocity
BitsetType::reference firstStep()
std::array< MFloat, nDim > m_oldPos
particle position of the last time step
BitsetType::reference wasSend()
virtual void wallParticleCollision()
wall-particle collision step
BitsetType::reference hadWallColl()
void updateProperties(const MBool init=true)
Update particle properties.
BitsetType::reference isWindow()
std::array< MFloat, nDim > m_oldVel
particle velocity of the last time step
BitsetType::reference hasCollided()
BitsetType::reference toBeDeleted()
BitsetType::reference reqBroadcast()
BitsetType::reference reqSend()
BitsetType::reference isInvalid()
void checkCellChange(const MFloat *oldPosition, const MBool allowHaloNonLeaf=false)
Checks whether position is within cell with number cellId if not, cellId is updated.
std::array< MFloat, nDim > m_accel
MFloat liftFactor(const MFloat partRe, const MFloat beta, const MFloat inclinationAngle, const MFloat K0, const MFloat K2)
Calculates the lift factor for current particle with given Re number, aspect ratio,...
static MFloat s_lengthFactor
std::array< MFloat, 4 > m_oldQuaternion
MFloat fParticleRelTime(const MFloat dynamicViscosity)
Calculates the reciprocal of the particle relaxation time.
MFloat m_eqDiameter
equivalent particle diameter
void resetWeights() override
LPTEllipsoidal(const LPTEllipsoidal &)=default
MFloat maxParticleRadius() const
Returns the largest radius.
LPTEllipsoidal()
constructor of ellipsoidal particles
MFloat torqueFactor(const MFloat partRe, const MFloat beta, const MFloat inclinationAngle)
Calculates the torque factor for current particle with given Re number, aspect ratio and inclination ...
MFloat effectiveWallCollisionRadius() const override
Returns the relevant particle radius for the wall collision.
friend std::ostream & operator<<(std::ostream &os, const LPTEllipsoidal &m)
std::array< MFloat, nDim > m_oldAccel
particle acceleration of the last time step
void interpolateVelocityAndVelocitySlopes(const MInt cellId, const MFloat *const position, MFloat *const velocity, MFloat *const velocityGradient, std::vector< MFloat > &weights)
MFloat particleVolume() const
Calculates the current volume.
static std::array< MFloat, nDim > s_Frm
void calculateMajorAxisOrientation(MFloat *majorAxis)
Calculate the orientation of the major axis in the world coordinate system.
void initVelocityAndDensity()
MFloat m_fluidVelMag
fluid velocity magnitude
void motionEquation() override
void interpolateVelocityAndDensity(const MInt cellId, const MFloat *const position, MFloat *const velocity, MFloat &density, std::vector< MFloat > &weights)
std::array< MFloat, nDim > m_oldAngularAccel
particle angular acceleration of the last time step
void heatCoupling()
add the heat flux from the particle to the cell/all surrounding cells
~LPTEllipsoidal() override=default
void initShapeParams()
Calcultes shape parameters for current particle (see Siewert, 2014)
static constexpr MInt s_intElements
MFloat m_oldFluidDensity
old fluid density
MFloat equivalentDiameter() const
Returns the equivalent diameter.
std::array< MFloat, nDim > m_fluidVel
fluid velocity
std::vector< MFloat > m_redistWeight
void coupling() override
single particle coupling terms
void momentumCoupling()
add the momentum flux from the particle to the cell/all surrounding cells
MFloat particleRe(const MFloat velocity, const MFloat density, const MFloat dynamicViscosity)
Calculates the particle Reynolds number.
MFloat minParticleRadius() const
Returns the smallest radius.
std::array< MFloat, nDim > m_angularAccel
particle angular acceleration
MFloat m_temperature
temperature
LPTEllipsoidal & operator=(const LPTEllipsoidal &)=default
std::array< MFloat, nDim > m_oldFluidVel
fluid velocity of the last time step
MFloat magRelVel(const MFloat *const velocity1, const MFloat *const velocity2) const
Calculates the magnitude of the relative velocity of the two given velocity vectors.
MFloat m_aspectRatio
aspect ratio a/c of ellipsoidal: 0 < oblate < 1, =1 spherical, >1 prolate
MFloat particleRadius(MInt direction) const
Returns the radius in direction d.
MFloat equivalentRadius() const
Returns the equivalent radius.
void advanceParticle() override
advance to new timeStep
static constexpr MInt s_floatElements
void energyEquation() override
std::array< MFloat, 4 > m_shapeParams
Shape parameters for ellipsoid.
MFloat particleMass() const
Calculates the current mass.
MFloat dragFactor(const MFloat partRe, const MFloat beta=1, const MFloat inclinationAngle=0, const MFloat K0=0, const MFloat K2=0)
Calculates the drag factor for current particle with given Re number, aspect ratio and inclination an...
std::array< MFloat, nDim > m_oldAngularVel
particle angular velocity of the last time step
void massCoupling()
add the mass flux from the particle to the cell/all surrounding cells
std::array< MFloat, nDim *nDim > m_velocityGradientFluid
gradient of fluid velocity in the particle fixed coordinate system
std::array< MFloat, nDim > m_angularVel
particle angular velocity
std::array< MFloat, 4 > m_quaternion
void initEllipsoialProperties()
MFloat m_fluidDensity
fluid density
MFloat m_heatFlux
heat flux to cell
MFloat m_semiMinorAxis
semi minor axis a
void setParticleFluidVelocities(MInt cellId, MFloat *position, MFloat *quaternions, MFloat *fluidVel, MFloat *fluidVelGrad)
constexpr Real POW3(const Real x)
constexpr Real POW2(const Real x)
std::ostream & operator<<(std::ostream &os, const LPTEllipsoidal< nDim > &m)