# 光滑粒子法

## 简介

![](/files/-MCzqYp3Zc7bqhBF_Qmg)

* 不需要Mesh，适合描述自由表面流体（水，烟不是自由表面流体）

## WCSPH

![](/files/-MCzqYp4PydUpqI6aX87)

用于描述不可压缩的流体。

这里有个神奇的公式：

![](/files/-MCzqYp5WYFGec01MbuB)

严格来说这个公式是不对的，但是这个公式能保证动量守恒，否则有各种奇怪问题。

![](/files/-MCzqYp6o_KsrJYBMeSK)

所以SPH的写法就是：

第一个公式（左）是欧拉方程，或者说是无粘流体的纳维-斯托克斯方程。右边是压强的计算公式。

1. 计算每个粒子的密度，主要取决于周边粒子的数量
2. 用那个恶心的一批的公式计算压强的梯度
3. 和弹簧质点模型一样，计算新的v和位置

## 一些变种

![](/files/-MCzqYp72kMkUD37H0K3)

第一个PCI-SPH，类似隐式时间积分，能得到更好的速度场（接近无散场），也就是更加的“不可压缩”。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://blog.tsingjyujing.com/game201/sph.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
