12#ifndef MFEM_NAVIER_PARTICLES_HPP
13#define MFEM_NAVIER_PARTICLES_HPP
113 using BCVariant = std::variant<ReflectionBC_2D, RecirculationBC_2D>;
116 std::vector<BCVariant>
bcs;
281 real_t e,
bool invert_normal)
298 bool invert_inlet_normal,
299 const Vector &outlet_start,
301 bool invert_outlet_normal)
308 return abs(inlet_dist-outlet_dist)/inlet_dist < 1e-12;
310 }(),
"Inlet + outlet must be same length.");
312 invert_inlet_normal, outlet_start,
313 outlet_end, invert_outlet_normal});
FindPointsGSLIB can robustly evaluate a GridFunction on an arbitrary collection of points....
Class for parallel grid function.
ParticleSet initializes and manages data associated with particles.
ParticleVector & Coords()
Get a reference to the coordinates ParticleVector.
ParticleVector & Field(int f)
Get a reference to field f 's ParticleVector.
Array< int > & Tag(int t)
Get a reference to tag t 's Array<int>.
ParticleVector carries vector data (of a given vector dimension) for an arbitrary number of particles...
real_t DistanceTo(const real_t *p) const
Compute the Euclidean distance to another vector.
Transient Navier-Stokes fluid-particles solver.
Array< real_t > dthist
Timestep history.
void SetTimeIntegrationCoefficients()
Update beta_k and alpha_k using current dthist.
ParticleVector & V(int nm=0)
Get reference to the particle velocity ParticleVector at time n - nm .
ParticleSet inactive_fluid_particles
ParticleVector & W(int nm=0)
Get reference to the fluid vorticity-interpolated ParticleVector at time n - nm .
static constexpr int N_HIST
Number of timesteps to store (includes current)
struct mfem::navier::NavierParticles::FluidParticleIndices fp_idx
void InterpolateUW(const ParGridFunction &u_gf, const ParGridFunction &w_gf)
Interpolate fluid velocity and vorticity onto current particles' location.
Array< int > & Order()
Get reference to the order Array<int>.
ParticleVector & U(int nm=0)
Get reference to the fluid velocity-interpolated ParticleVector at time n - nm .
ParticleSet & GetInactiveParticles()
Get reference to the inactive ParticleSet.
void ParticleStep2D(const real_t &dt, int p)
2D particle step for particle at index p
static bool Get2DSegmentIntersection(const Vector &s1_start, const Vector &s1_end, const Vector &s2_start, const Vector &s2_end, Vector &x_int, real_t *t1_ptr=nullptr, real_t *t2_ptr=nullptr)
Given two 2D segments, get the intersection point if it exists.
ParticleSet & GetParticles()
Get reference to the active ParticleSet.
ParticleVector & X(int nm=0)
Get reference to the position ParticleVector at time n - nm .
void Setup(const real_t dt)
Set initial timestep in time history array.
void Add2DReflectionBC(const Vector &line_start, const Vector &line_end, real_t e, bool invert_normal)
Add a 2D wall reflective boundary condition.
void ApplyBCs()
Apply all BCs in bcs.
void Add2DRecirculationBC(const Vector &inlet_start, const Vector &inlet_end, bool invert_inlet_normal, const Vector &outlet_start, const Vector &outlet_end, bool invert_outlet_normal)
Add a 2D recirculation / one-way periodic boundary condition.
std::variant< ReflectionBC_2D, RecirculationBC_2D > BCVariant
ParticleVector & Gamma()
Get reference to the γ ParticleVector.
void DeactivateLostParticles(bool findpts)
Move any particles that have left the domain to the inactive ParticleSet.
void Step(const real_t dt, const ParGridFunction &u_gf, const ParGridFunction &w_gf)
Step the particles in time.
void Apply2DReflectionBC(const ReflectionBC_2D &bc)
Apply 2D reflection BCs to update particle positions and velocities.
std::array< Array< real_t >, 3 > beta_k
BDFk coefficients, k=1,2,3.
ParticleVector & Kappa()
Get reference to the κ ParticleVector.
void Apply2DRecirculationBC(const RecirculationBC_2D &bc)
Apply 2D recirculation BCs.
NavierParticles(MPI_Comm comm, int num_particles, Mesh &m)
Initialize NavierParticles with num_particles using fluid mesh m .
static void Get2DNormal(const Vector &p1, const Vector &p2, bool inv_normal, Vector &normal)
Given two 2D points, get the unit normal to the line connecting them.
ParticleSet fluid_particles
Active fluid particle set.
std::array< Array< real_t >, 3 > alpha_k
EXTk coefficients, k=1,2,3.
ParticleVector & Zeta()
Get reference to the ζ ParticleVector.
std::vector< BCVariant > bcs
std::vector of all boundary condition structs
real_t p(const Vector &x, real_t t)
MFEM_HOST_DEVICE real_t abs(const Complex &z)
struct mfem::navier::NavierParticles::FluidParticleIndices::FieldIndices field
struct mfem::navier::NavierParticles::FluidParticleIndices::TagIndices tag
2D recirculation boundary condition struct
const bool invert_outlet_normal
const bool invert_inlet_normal
const Vector outlet_start
2D wall reflection boundary condition struct