Domain operations: defining domains; free flow boundary conditions & clipping for DSMC steps.
PRNG required to sample molecular velocities implies monadic interface
for most of operations. We use functions specifically typed for
- data Domain = Domain !Double !Double !Double !Double !Double !Double
- getDimensions :: Domain -> (Double, Double, Double)
- getCenter :: Domain -> Point
- makeDomain :: Point -> Double -> Double -> Double -> Domain
- initializeParticles :: Domain -> Flow -> Body -> Seed -> (Ensemble, Seed)
- openBoundaryInjection :: DomainSeeds -> Domain -> Double -> Flow -> Ensemble -> (Ensemble, DomainSeeds)
- type DomainSeeds = (Seed, Seed, Seed, Seed, Seed, Seed)
- clipToDomain :: Domain -> Ensemble -> Ensemble
- freeVolume :: Domain -> Body -> Int -> GenST s -> ST s Double
- freeVolumes :: Body -> Int -> GenST s -> Vector Domain -> ST s (Vector Double)
Domain in which particles are spawned or system evolution is simulated.
|Domain !Double !Double !Double !Double !Double !Double|
Rectangular volume, given by min/max value on every dimension.
Calculate width, length and height of a domain, which are dimensions measured by x, y and z axes, respectively.
Create a rectangular domain with center in the given point and dimensions.
Fill the domain with particles for given flow parameters. Particles inside the body are removed.
Interface domain extrusion length.
|-> (Ensemble, DomainSeeds)|
Sample new particles in 6 interface domains along each side of rectangular simulation domain and add them to existing ensemble.
This function implements open boundary condition for three-dimensional simulation domain.
Interface domains are built on faces of simulation domain using extrusion along the outward normal of the face.
In 2D projection:
+-----------------+ | Interface1 | +--+-----------------+--+ |I3| Simulation |I4| | | domain | | +--+-----------------+--+ | I2 | +-----------------+
Particles in every interface domain are spawned in parallel using Strategies.
PRNG seeds used by particle generators.
Filter out particles which are outside of the domain.
Free volume calculation
Use that many points to approximate the body volume.
|-> GenST s|
|-> ST s Double|
Volume of a domain unoccupied by a given body, in m^3.
We use Monte Carlo method to calculate the approximate body volume and then subtract it from the overall domain volume.