Files
thejinchao.github.io/assets/SPH004.html-DWIh0x1l.js
T

2 lines
2.1 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import{_ as i,c as t,a as l,o as a}from"./app-DRp0Qaqg.js";const o="/images/2014/08/sph_45.jpg",r={};function n(h,e){return a(),t("div",null,e[0]||(e[0]=[l('<p>上几节,我们推导出一大推复杂无比的公式,似乎有点纸上谈兵,这节来点真的,写一个可以运行的SPH系统,下面就是SPH基本的运算流程</p><ol><li>初始化粒子,为每个粒子赋上初始位置</li><li>根据公式3.7计算每个粒子的密度</li><li>根据公式3.10计算每个粒子的压强</li><li>根据公式3.18计算每个粒子的加速度</li><li>根据临界条件调整加速度</li><li>根据加速度计算每个粒子的速度变化</li><li>根据速度计算粒子位置的变化</li><li>绘制粒子</li><li>回到步骤2 下面有个简单的示例程序,运行效果如下</li></ol><figure><img src="'+o+'" alt="" tabindex="0" loading="lazy"><figcaption></figcaption></figure><p>这个程序基本上没有怎么考虑效率,只是让系统跑起来,所以比较适合拿来对照公式学习,按照惯例,放出源代码和可执行程序<br> Github:<a href="https://github.com/thejinchao/fluid" target="_blank" rel="noopener noreferrer">https://github.com/thejinchao/fluid</a><br> 可执行程序下载: <a href="https://github.com/thejinchao/fluid/releases/download/v1.0/fluid_relase_x64.zip" target="_blank" rel="noopener noreferrer">fluid_relase_x64.zip</a>(132KB)<br> SPH还有很多细节值得讨论,比如表面张力、并行计算、构建网格、真实材质的水渲染等,这些部分我会抽时间再写一些东西出来介绍。</p>',4)]))}const s=i(r,[["render",n],["__file","SPH004.html.vue"]]),m=JSON.parse('{"path":"/blog/2025/02/SPH004.html","title":" SPH算法简介(四): 算法实现","lang":"zh-CN","frontmatter":{"title":" SPH算法简介(四): 算法实现","tags":"数学 流体 程序 算法"},"headers":[],"git":{"updatedTime":1740225290000,"contributors":[{"name":"thejinchao","username":"thejinchao","email":"thejinchao@gmail.com","commits":1,"url":"https://github.com/thejinchao"}]},"filePathRelative":"blog/2025/02/SPH004.md"}');export{s as comp,m as data};