Skip to content
Merged
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
2 changes: 1 addition & 1 deletion docs/zh/examples/bubble.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ $$\frac{\partial \phi}{\partial t}+\mathbf{u} \cdot \nabla \phi=\gamma \nabla \c
![bubble.png](https://paddle-org.bj.bcebos.com/paddlescience/docs/BubbleNet/bubble.jpeg){ loading=lazy style="height:80%;width:80%" align="center" }
</figure>

本文我们主要考虑单气泡流(图 A ),当然对于多气泡流问题同样适用。对于单气泡情况,气泡初始直径设置为 $d = 4~μmm$,微通道长度为 $15~μm$,宽度为 $5~μm$。沿轴向施加压力差 $\Delta p = 10~Pa$ 来驱动气泡流动,通道末端的压力保持为恒定压力 $p_0 = 799.932~Pa(6~mmHg)$,对应于人脑和淋巴液流动中间质液的压力。初始条件 (IC) 即设置为 $p=p_0$,室温为 $293.15~K$,如图 A 所示。该数值设置旨在模拟脑血管中的气泡传输,以研究血脑屏障。同时我们设 $\gamma=1$ 和 $\epsilon_{l s}=0.430$。
本文我们主要考虑单气泡流(图 A ),当然对于多气泡流问题同样适用。对于单气泡情况,气泡初始直径设置为 $d = 4~μm$,微通道长度为 $15~μm$,宽度为 $5~μm$。沿轴向施加压力差 $\Delta p = 10~Pa$ 来驱动气泡流动,通道末端的压力保持为恒定压力 $p_0 = 799.932~Pa(6~mmHg)$,对应于人脑和淋巴液流动中间质液的压力。初始条件 (IC) 即设置为 $p=p_0$,室温为 $293.15~K$,如图 A 所示。该数值设置旨在模拟脑血管中的气泡传输,以研究血脑屏障。同时我们设 $\gamma=1$ 和 $\epsilon_{l s}=0.430$。

本文的算法 BubbleNet 的主要内容如下:

Expand Down
18 changes: 17 additions & 1 deletion ppsci/visualize/vtu.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,30 @@ def save_vtu_from_dict(
value_keys: Tuple[str, ...],
num_timestamps: int = 1,
):
"""Save dict data to '*.vtu' file.
"""
Save dict data to '*.vtu' file.

Args:
filename (str): Output filename.
data_dict (Dict[str, np.ndarray]): Data in dict.
coord_keys (Tuple[str, ...]): Tuple of coord key. such as ("x", "y").
value_keys (Tuple[str, ...]): Tuple of value key. such as ("u", "v").
num_timestamps (int, optional): Number of timestamp in data_dict. Defaults to 1.

Examples:
>>> import ppsci
>>> import numpy as np
>>> filename = "path/to/file.vtu"
>>> data_dict = {
... "x": np.array([[1], [2], [3],[4]]),
... "y": np.array([[2], [3], [4],[4]]),
... "z": np.array([[3], [4], [5],[4]]),
... "u": np.array([[4], [5], [6],[4]]),
... "v": np.array([[5], [6], [7],[4]]),
... }
>>> coord_keys = ("x","y","z")
>>> value_keys = ("u","v")
>>> ppsci.visualize.save_vtu_from_dict(filename, data_dict, coord_keys, value_keys) # doctest: +SKIP
"""
if len(coord_keys) not in [2, 3, 4]:
raise ValueError(f"ndim of coord ({len(coord_keys)}) should be 2, 3 or 4")
Expand Down