Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ src/
├── PreProcess.jl # Load inputs and allocate arrays
├── ProduceHDFVTK.jl # Write simulation data in HDF5/VTK format
├── SPHCellList.jl # Custom neighbour search and time stepping
├── SPHCUDA.jl # Optional CUDA interaction path
├── SPHDensityDiffusionModels.jl # Density diffusion implementations
├── SPHExample.jl # Glue module re-exporting all functions
├── SPHKernels.jl # SPH kernel definitions
Expand Down Expand Up @@ -91,6 +92,20 @@ one plus the particles in its neighbor stencil.
Neighbor rebuilds use a per-cell ordering buffer without reordering particle
storage.

### CUDA Acceleration (Optional)

The solver can offload the particle interaction loops to a CUDA GPU when
`CUDA.jl` is available in your Julia environment. The helper `CUDAAvailable()`
reports whether CUDA is functional, and the `RunSimulationCUDA` entry point
mirrors `RunSimulation` while delegating the interaction loops to the GPU.
Currently, the CUDA path supports the `NoShifting` and `NoKernelOutput`
configurations with `LinearDensityDiffusion` or `ZeroDensityDiffusion` plus
`ArtificialViscosity` or `ZeroViscosity`.

To try the GPU workflow, install CUDA.jl in your environment and run
`example/StillWedgeMDBC.jl`, which will automatically pick `RunSimulationCUDA`
when CUDA is available.

## Help

Questions or issues can be posted on the GitHub issue tracker. Response times may vary but all feedback is welcome.
Expand Down
39 changes: 26 additions & 13 deletions example/StillWedgeMDBC.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ let
SimConstantsWedge = SimulationConstants{FloatType}(dx=0.02,c₀=42.48576250492629, δᵩ = 0.1, CFL=0.5)
# SimConstantsWedge = SimulationConstants{FloatType}(dx=0.01,c₀=43.4, δᵩ = 0.1, CFL=0.2)
#
SimMetaDataWedge = SimulationMetaData{Dimensions,FloatType,NoShifting,NoKernelOutput,NoMDBC,StoreLog}(
SimMetaDataWedge = SimulationMetaData{Dimensions,FloatType,NoShifting,NoKernelOutput,SimpleMDBC,StoreLog}(
SimulationName="StillWedge",
SaveLocation="W:/Simulations/StillWedge2D_MDBC",
SimulationTime=4.0,
Expand Down Expand Up @@ -49,17 +49,31 @@ let

SimKernel = SPHKernelInstance{Dimensions, FloatType}(WendlandC2(); dx = SimConstantsWedge.dx)

@profview RunSimulation(
SimGeometry = SimulationGeometry,
SimMetaData = SimMetaDataWedge,
SimConstants = SimConstantsWedge,
SimKernel = SimKernel,
SimLogger = SimLogger,
SimParticles = SimParticles,
SimViscosity = ArtificialViscosity(),
SimDensityDiffusion = LinearDensityDiffusion(),
ParticleNormalsPath = "./input/still_wedge_mdbc/StillWedge_Dp$(SimConstantsWedge.dx)_GhostNodes_Correct.csv"
)
if CUDAAvailable()
@profview RunSimulationCUDA(
SimGeometry = SimulationGeometry,
SimMetaData = SimMetaDataWedge,
SimConstants = SimConstantsWedge,
SimKernel = SimKernel,
SimLogger = SimLogger,
SimParticles = SimParticles,
SimViscosity = ArtificialViscosity(),
SimDensityDiffusion = LinearDensityDiffusion(),
ParticleNormalsPath = "./input/still_wedge_mdbc/StillWedge_Dp$(SimConstantsWedge.dx)_GhostNodes_Correct.csv"
)
else
@profview RunSimulation(
SimGeometry = SimulationGeometry,
SimMetaData = SimMetaDataWedge,
SimConstants = SimConstantsWedge,
SimKernel = SimKernel,
SimLogger = SimLogger,
SimParticles = SimParticles,
SimViscosity = ArtificialViscosity(),
SimDensityDiffusion = LinearDensityDiffusion(),
ParticleNormalsPath = "./input/still_wedge_mdbc/StillWedge_Dp$(SimConstantsWedge.dx)_GhostNodes_Correct.csv"
)
end

# This can be used to plot pressure profile results after simulation
# using Plots
Expand Down Expand Up @@ -97,4 +111,3 @@ let
# display(plt)
end


Loading