7#ifndef _PARTICLESPHERICAL_H
8#define _PARTICLESPHERICAL_H
14template <MInt nDim,
class SysEqn>
100 static std::array<MFloat, nDim>
s_Frm;
133 for(
MInt i = 0; i < nDim; i++) {
134 magnitude +=
POW2(velocity1[i] - velocity2[i]);
136 return sqrt(magnitude);
142 for(
MInt i = 0; i < nDim; i++) {
145 return sqrt(magnitude);
150 return density * velocity *
m_diameter / dynamicViscosity;
160 return density * velocity * 0.5 *
m_diameter /
s_backPtr->m_material->spraySurfaceTension(temperature);
167 std::array<MFloat, nDim + 1> result{};
168 std::vector<MFloat> weights;
169 this->
template interpolateAndCalcWeights<0, nDim + 1>(
m_cellId,
m_position.data(), result.data(), weights);
170 for(
MInt i = 0; i < nDim; i++) {
180 MFloat& density, std::vector<MFloat>& weights) {
181 std::array<MFloat, nDim + 1> result{};
182 this->
template interpolateAndCalcWeights<0, nDim + 1>(cellId, position, result.data(), weights);
183 for(
MInt n = 0; n < nDim; n++) {
184 velocity[n] = result[n];
186 density = result[nDim];
191 std::vector<MFloat>& weights) {
192 std::array<MFloat, nDim + 4> result{};
193 this->
template interpolateAndCalcWeights<0, nDim + 4>(cellId, position, result.data(), weights);
194 for(
MInt n = 0; n < nDim; n++) {
195 velocity[n] = result[n];
197 density = result[nDim];
198 pressure = result[nDim + 1];
199 temperature = result[nDim + 2];
200 species = result[nDim + 3];
204 std::vector<MFloat>& weights) {
205 std::array<MFloat, nDim + 3> result{};
206 this->
template interpolateAndCalcWeights<0, nDim + 3>(cellId, position, result.data(), weights);
207 for(
MInt n = 0; n < nDim; n++) {
208 velocity[n] = result[n];
210 density = result[nDim];
211 pressure = result[nDim + 1];
212 temperature = result[nDim + 2];
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 fullyEvaporated()
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
static constexpr MInt s_intElements
MFloat m_shedDiam
shedding diameter
void motionEquation() override
std::array< MFloat, nDim > m_oldFluidVel
fluid velocity of the last time step
MFloat fParticleRelTime(const MFloat dynamicViscosity)
Calculate the reciprocal of the particle relaxation time.
LPTSpherical & operator=(const LPTSpherical &)=default
MFloat WeberNumber(const MFloat density, const MFloat velocity, const MFloat temperature)
Calculate the particle Weber-number (radius based)
static std::array< MFloat, nDim > s_Frm
LPTSpherical()
constructor of spherical particles, used to invalidate values when debugging!
static MFloat s_lengthFactor
std::vector< MFloat > m_redistWeight
MFloat sphericalVolume() const
Calculate the current volume.
MFloat m_temperature
temperature
MFloat m_oldFluidDensity
old fluid density
MFloat m_dM
mass evaporation rate
static constexpr MInt s_floatElements
friend std::ostream & operator<<(std::ostream &os, const LPTSpherical &m)
MFloat sphericalMass() const
Calculate the current mass.
MInt m_noParticles
parceled particles
void coupling() override
single particle coupling terms
MFloat magRelVel(const MFloat *const velocity1, const MFloat *const velocity2) const
Calculate the magnitude of the relative velocity of the two given velocity vectors.
std::array< MFloat, nDim > m_oldAccel
particle acceleration of the last time step
MFloat particleRe(const MFloat velocity, const MFloat density, const MFloat dynamicViscosity)
Calculate the particle reynoldsnumber.
MFloat magVel() const
Calculate the magnitude of the relative velocity of the two given velocity vectors.
void interpolateAllFluidVariables(const MInt cellId, const MFloat *const position, MFloat *const velocity, MFloat &density, MFloat &pressure, MFloat &temperature, MFloat &species, std::vector< MFloat > &weights)
MFloat m_diameter
particle diameter
MFloat effectiveWallCollisionRadius() const override
Returns the relevant particle radius for the wall collision.
MFloat m_heatFlux
heat flux to cell
MFloat m_breakUpTime
time since last breakUp
void momentumCoupling()
add the momentum flux from the particle to the cell/all surrounding cells
void advanceParticle() override
advance to new timeStep
void heatCoupling()
add the heat flux from the particle to the cell/all surrounding cells
MFloat m_fluidVelMag
fluid velocity magnitude
MFloat m_fluidDensity
fluid density
void initVelocityAndDensity()
void interpolateAllFluidVariables(const MInt cellId, const MFloat *const position, MFloat *const velocity, MFloat &density, MFloat &pressure, MFloat &temperature, std::vector< MFloat > &weights)
LPTSpherical(const LPTSpherical &)=default
void energyEquation() override
std::array< MFloat, nDim > m_fluidVel
fluid velocity
MFloat dragFactor(const MFloat partRe)
Calculate drag factor of the current particle for the given particle Reynolds number....
~LPTSpherical() override=default
void interpolateVelocityAndDensity(const MInt cellId, const MFloat *const position, MFloat *const velocity, MFloat &density, std::vector< MFloat > &weights)
void resetWeights() override
void massCoupling()
add the mass flux from the particle to the cell/all surrounding cells
constexpr Real POW3(const Real x)
constexpr Real POW2(const Real x)
std::ostream & operator<<(std::ostream &os, const LPTSpherical< nDim > &m)