Skip to content

Conversation

@zbt78
Copy link
Contributor

@zbt78 zbt78 commented Nov 3, 2023

PR types

Others

PR changes

Others

Describe

#571
No.9 cylinder2d_unsteady
1、使用第三方库 hydra适配 cylinder2d_unsteady案例
2、cylinder2d_unsteady案例代码重构,添加评估函数 evaluate,及其训练/评估命令和预训练模型、指标

@paddle-bot
Copy link

paddle-bot bot commented Nov 3, 2023

Thanks for your contribution!

@paddle-bot
Copy link

paddle-bot bot commented Nov 3, 2023

❌ The PR is not created using PR's template. You can refer to this Demo.
Please use PR's template, it helps save our maintainers' time so that more developers get helped.

@luotao1 luotao1 changed the title 【hydra No.9】cylinder2d_unsteady 【hydra No.6】cylinder2d_unsteady Nov 3, 2023
@luotao1 luotao1 added the HappyOpenSource 快乐开源活动issue与PR label Nov 3, 2023
Comment on lines 10 to 13
=== "模型评估命令"

``` sh
```
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

评估命令可以先删除


=== "模型训练命令"

``` sh
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

# linux
wget https://paddle-org.bj.bcebos.com/paddlescience/datasets/cylinder2d_unsteady_Re100/cylinder2d_unsteady_Re100_dataset.tar
# windows
# curl https://paddle-org.bj.bcebos.com/paddlescience/datasets/cylinder2d_unsteady_Re100/cylinder2d_unsteady_Re100_dataset.tar --output cylinder2d_unsteady_Re100_dataset.tar
# unzip it
tar -xvf bracket_dataset.tar
python cylinder2d_unsteady_Re100.py

# set equation
equation = {"NavierStokes": ppsci.equation.NavierStokes(0.02, 1.0, 2, True)}
equation = {
"NavierStokes": ppsci.equation.NavierStokes(cfg.viscosity, cfg.density, 2, True)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

==> cfg.VISCOSITY, cfg.DENSITY

NPOINT_PDE, NTIME_PDE = 9420, len(train_timestamps)
NPOINT_INLET_CYLINDER = 161
NPOINT_OUTLET = 81
NPOINT_PDE = cfg.NPOINT_PDE
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

直接使用cfg.NPOINT_PDE代替NPOINT_PDE

Comment on lines 85 to 86
NPOINT_INLET_CYLINDER = cfg.NPOINT_INLET_CYLINDER
NPOINT_OUTLET = cfg.NPOINT_OUTLET
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上

Comment on lines 263 to 277
"time_rect": ppsci.geometry.TimeXGeometry(
ppsci.geometry.TimeDomain(
cfg.TIME_START,
cfg.TIME_END,
timestamps=np.concatenate((t0, train_timestamps), axis=0),
),
ppsci.geometry.PointCloud(
reader.load_csv_file(
"./datasets/domain_train.csv",
("x", "y"),
alias_dict={"x": "Points:0", "y": "Points:1"},
),
("x", "y"),
),
),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

time_rect这个几何在评估函数中没有使用,可以删除

),
"time_rect_eval": ppsci.geometry.PointCloud(
reader.load_csv_file(
"./datasets/domain_eval.csv",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

该路径使用cfg.DOMAIN_EVAL_PATH控制

DOMAIN_OUTLET_PATH: ./datasets/domain_outlet.csv
IC0_1_PATH: ./datasets/initial/ic0.1.csv
PROBE1_50_PATH: ./datasets/probe/probe1_50.csv

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

新增 # set validator data path,存放DOMAIN_EVAL_PATH

OUTPUT_DIR,
equation=equation,
geom=geom,
output_dir=cfg.output_dir,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

加回geom=geom,

Comment on lines 330 to 332
# evaluate after finished training
solver.eval()
# visualize prediction from pretrained_model_path(optional)
# visualize prediction after finished training
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

删除 after finished training

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All Done.

Copy link
Collaborator

@HydrogenSulfate HydrogenSulfate left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@HydrogenSulfate HydrogenSulfate merged commit 5d1cb04 into PaddlePaddle:develop Nov 6, 2023
huohuohuohuohuo123 pushed a commit to huohuohuohuohuo123/PaddleScience that referenced this pull request Aug 12, 2024
* hydra No.6

* hydra 6

* hydra 6

* hydra 6

* Update docs/zh/examples/cylinder2d_unsteady.md

---------

Co-authored-by: HydrogenSulfate <490868991@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor HappyOpenSource 快乐开源活动issue与PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants