Skip to content

Commit 7c261d4

Browse files
update darcy filename
2 parents a6d08ca + fb664aa commit 7c261d4

File tree

297 files changed

+1712
-24077
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

297 files changed

+1712
-24077
lines changed

README.md

Lines changed: 48 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,77 @@
1-
*Current version of PaddleScience is v1.0 Beta.*
1+
# PaddleScience
22

3-
# Introduction
3+
> *Developed with [PaddlePaddle](https://www.paddlepaddle.org.cn/)*
44
5-
PaddleScience extends the PaddlePaddle framework with reusable
6-
software components for developing novel scientific computing applications. Such new
7-
applications include Physics-informed Machine Learning, neural network based PDE solvers,
8-
machine learning for CFD, and so on. PaddleScience is currently under active development.
9-
Its design is evolving and its APIs are subject to change.
5+
[![Doc](https://img.shields.io/readthedocs/paddlescience-docs/latest)](https://paddlescience-docs.readthedocs.io/zh/latest/)
6+
[![License](https://img.shields.io/github/license/PaddlePaddle/PaddleScience)](./LICENSE)
107

11-
# Core features and organization
8+
[**PaddleScience使用文档**](https://paddlescience-docs.readthedocs.io/zh/latest/)
129

13-
PaddleScience currently focuses on the PINNs model. The core components are as follows.
10+
## 简介
1411

15-
- PDE, delineating partial differential equations in symbolic forms. Specific PDEs derive the
16-
the base PDE class.
12+
PaddleScience 是一个基于深度学习框架 PaddlePaddle 开发的科学计算套件,利用深度神经网络的学习能力和 PaddlePaddle 框架的自动(高阶)微分机制,解决物理、化学、气象等领域的问题。支持物理机理驱动、数据驱动、数理融合三种求解方式,并提供了基础 API 和详尽文档供用户使用与二次开发。
1713

18-
- Geometry, a declarative interface for defining the geometric domain. Automatic
19-
discretization is supported
14+
<div align="center">
15+
<img src="./docs/images/overview/panorama.png" width="80%" height="80%">
16+
</div>
2017

21-
- Neural net, currently supporting fully connected layers with customizable size and depth.
18+
## 特性
2219

23-
- Loss, defining what exact penalties are enforced during the training process. By default,
24-
the L2 loss is applied. In the current design, the total loss is a weighted sum of
25-
four parts, the equation loss, the boundary condition loss, the initial condition loss and the data loss.
20+
- 支持简单几何和复杂 STL 几何的采样与布尔运算。
21+
- 支持包括 Dirichlet、Neumann、Robin 以及自定义边界条件。
22+
- 支持物理机理驱动、数据驱动、数理融合三种问题求解方式。涵盖流体、结构、气象等领域 8+ 案例。
23+
- 支持结果可视化输出与日志结构化保存。
24+
- 完善的 type hints,用户使用和代码贡献全流程文档,经典案例 AI studio 快速体验,降低使用门槛,提高开发效率。
25+
- 更多特性正在开发中...
2626

27-
- Optimizer, specifying which optimizer to use for training. Adam is the default option. More
28-
optimizers, such as BFGS, will be available in the future.
27+
## 安装使用
2928

30-
- Solver, managing the training process given the training data in a batchly fashion.
29+
1. 执行以下命令,从 github 上克隆 PaddleScience 项目,进入 PaddleScience 目录,并将该目录添加到系统环境变量中
3130

32-
- Visualization, an easy access to the graph drawing utilities.
31+
``` shell
32+
git clone https://github.com/PaddlePaddle/PaddleScience.git
33+
cd PaddleScience
34+
export PYTHONPATH=$PWD:$PYTHONPATH
35+
```
3336

34-
# Getting started
37+
2. 安装必要的依赖包
3538

36-
## Prerequisites
39+
``` shell
40+
pip install -r requirements.txt
41+
```
3742

38-
Hardware requirements: NVIDIA GPU V100, NVIDIA GPU A100
43+
3. 验证安装
3944

40-
Package dependencies: paddle, cuda (11.0 or higher), numpy, scipy, sympy, matplotlib, vtk, pyevtk, wget.
45+
``` py
46+
python -c "import ppsci; ppsci.utils.run_check()"
47+
```
4148

42-
PaddleScience currently relies on new features of the Paddle framework so please be advised to download the latest version of Paddle on GitHub or on Gitee.
49+
4. 开始使用
4350

44-
For more details on installation, please refer to the offical [PaddlePaddle repository on GitHub](https://github.com/PaddlePaddle/Paddle) or [PaddlePaddle repository on Gitee](https://gitee.com/paddlepaddle/Paddle).
51+
``` py
52+
import ppsci
4553
46-
## Download and environment setup
54+
# write your code here...
55+
```
4756

48-
``` shell
49-
Download from GitHub: git clone https://github.com/PaddlePaddle/PaddleScience.git
50-
Download from Gitee: git clone https://gitee.com/PaddlePaddle/PaddleScience.git
57+
更多安装方式请参考 [**安装与使用**](https://paddlescience-docs.readthedocs.io/zh/latest/zh/install_setup/)
5158

52-
cd PaddleScience
53-
export PYTHONPATH=$PWD:$PYTHONPATH
59+
## 快速开始
5460

55-
pip install -r requirements.txt
56-
```
61+
参考 [**快速开始**](https://paddlescience-docs.readthedocs.io/zh/latest/zh/quickstart/)
5762

58-
## Run examples
63+
## 经典案例
5964

60-
Some examples are baked in for quick demonstration. Please find them in the `examples` directory. To run an example, just enter the subdirectory and run the demo code in Python commandline.
65+
请参考 [**经典案例**](https://paddlescience-docs.readthedocs.io/zh/latest/zh/examples/viv/)
6166

62-
``` shell
63-
# Darcy flow (Poisson equation)
64-
cd examples/darcy
65-
python darcy2d.py
67+
## 支持
6668

67-
# LDC steady (Steady Navier-Stokes eqution)
68-
cd examples/ldc
69-
python ldc2d_steady_train.py
69+
如使用过程中遇到问题或想提出开发建议,欢迎在 [**Issue**](https://github.com/PaddlePaddle/PaddleScience/issues/new) 页面新建 issue。
7070

71-
# Lid Driven Cavity unsteady with continue-time method (Unsteady Navier-Stokes equation)
72-
cd examples/ldc
73-
python ldc2d_unsteady_t.py
71+
## 贡献代码
7472

75-
# Flow around a circular cylinder with discrete-time method (Unsteady Navier-Stokes equation)
76-
cd examples/cylinder/3d_unsteady_discrete/baseline
77-
python cylinder3d_unsteady.py
73+
PaddleScience 项目欢迎并依赖开发人员和开源社区中的用户,请参阅 [**贡献指南**](https://paddlescience-docs.readthedocs.io/zh/latest/zh/contribute/)。
7874

79-
```
75+
## 证书
8076

81-
## Short tutorials on how to construct and solve a PINN model
82-
83-
[A tutorial on Lid Driven Cavity flow](./examples/ldc/README.md)
84-
85-
[A tutorial on Darcy flow in porous medium](./examples/darcy/README.md)
77+
[Apache License 2.0](https://github.com/PaddlePaddle/PaddleScience/blob/develop/LICENSE)
Loading

docs/index.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
55
PaddleScience 是一个基于深度学习框架 PaddlePaddle 开发的科学计算套件,利用深度神经网络的学习能力和 PaddlePaddle 框架的自动(高阶)微分机制,解决物理、化学、气象等领域的问题。支持物理机理驱动、数据驱动、数理融合三种求解方式,并提供了基础 API 和详尽文档供用户使用与二次开发。
66

7+
![panorama](./images/overview/panorama.png)
8+
79
## 特性
810

911
- 支持简单几何和复杂 STL 几何的采样与布尔运算。
@@ -15,11 +17,11 @@ PaddleScience 是一个基于深度学习框架 PaddlePaddle 开发的科学计
1517

1618
## 支持
1719

18-
- 如使用过程中遇到问题或想提出开发建议,欢迎在 [Issue](https://github.com/PaddlePaddle/PaddleScience/issues/new) 页面新建 issue。
20+
- 如使用过程中遇到问题或想提出开发建议,欢迎在 [**Issue**](https://github.com/PaddlePaddle/PaddleScience/issues/new) 页面新建 issue。
1921

2022
## 贡献代码
2123

22-
PaddleScience 项目欢迎并依赖开发人员和开源社区中的用户,请参阅 [贡献指南](https://paddlescience-docs.readthedocs.io/zh/latest/zh/contribute/)
24+
PaddleScience 项目欢迎并依赖开发人员和开源社区中的用户,请参阅 [**贡献指南**](https://paddlescience-docs.readthedocs.io/zh/latest/zh/contribute/)
2325

2426
## 证书
2527

docs/zh/examples/cylinder2d_unsteady.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# 2D-Cylinder(2D Flow Around a Cylinder)
22

3+
<a href="https://aistudio.baidu.com/aistudio/projectdetail/6160381?contributionType=1&sUid=438690&shared=1&ts=1683961158552" class="md-button md-button--primary" style>AI Studio快速体验</a>
4+
35
## 1. 问题简介
46

57
2D Flow Around a Cylinder,中文名称可译作“2维圆柱绕流”,是指二维圆柱低速定常绕流的流型只与 $Re$ 数有关。在 $Re \le 1$ 时,流场中的惯性力与粘性力相比居次要地位,圆柱上下游的流线前后对称,阻力系数近似与 $Re$ 成反比(阻力系数为 10~60),此 $Re$ 数范围的绕流称为斯托克斯区;随着 $Re$ 的增大,圆柱上下游的流线逐渐失去对称性。
@@ -130,19 +132,19 @@ examples/cylinder/2d_unsteady/cylinder2d_unsteady_Re100.py:36:37
130132

131133
``` py linenums="39"
132134
# set timestamps
133-
time_start, time_end = 1, 50
134-
num_timestamps = 50
135-
train_num_timestamps = 30
135+
TIME_START, TIME_END = 1, 50
136+
NUM_TIMESTAMPS = 50
137+
TRAIN_NUM_TIMESTAMPS = 30
136138

137139
train_timestamps = np.linspace(
138-
time_start, time_end, num_timestamps, endpoint=True
140+
TIME_START, TIME_END, NUM_TIMESTAMPS, endpoint=True
139141
).astype("float32")
140-
train_timestamps = np.random.choice(train_timestamps, train_num_timestamps)
142+
train_timestamps = np.random.choice(train_timestamps, TRAIN_NUM_TIMESTAMPS)
141143
train_timestamps.sort()
142-
t0 = np.array([time_start], dtype="float32")
144+
t0 = np.array([TIME_START], dtype="float32")
143145

144146
val_timestamps = np.linspace(
145-
time_start, time_end, num_timestamps, endpoint=True
147+
TIME_START, TIME_END, NUM_TIMESTAMPS, endpoint=True
146148
).astype("float32")
147149

148150
logger.info(f"train_timestamps: {train_timestamps.tolist()}")
@@ -152,8 +154,8 @@ logger.info(f"val_timestamps: {val_timestamps.tolist()}")
152154
geom = {
153155
"time_rect": ppsci.geometry.TimeXGeometry(
154156
ppsci.geometry.TimeDomain(
155-
time_start,
156-
time_end,
157+
TIME_START,
158+
TIME_END,
157159
timestamps=np.concatenate((t0, train_timestamps), axis=0),
158160
),
159161
ppsci.geometry.PointCloud(
@@ -393,7 +395,7 @@ examples/cylinder/2d_unsteady/cylinder2d_unsteady_Re100.py
393395
本案例只作为demo展示,尚未进行充分调优,下方部分展示结果可能与 OpenFOAM 存在一定差别。
394396

395397
<figure markdown>
396-
![u_pred.gif](https://kefu.cckefu1.com/app/upload/temp/202304_p/06/06_168079163055700009257b95d.gif){ loading=lazy }
398+
![u_pred.gif](../../images/cylinder2d_unsteady/cylinder_2d_unsteady_Re100.gif){ loading=lazy }
397399
<figcaption>模型预测结果 u</figcaption>
398400
</figure>
399401
</figure>

0 commit comments

Comments
 (0)