A craft of Airfoil-CNN

£神魔★判官ぃ 2022-09-10 10:14 78阅读 0赞

Airfoil CNN

This code is personal version network of paper Prediction of Aerodynamic Flow Fields Using Convolutional Neural Networks.

watermark_type_ZHJvaWRzYW5zZmFsbGJhY2s_shadow_50_text_Q1NETiBAQ29mZmVjaG8_size_20_color_FFFFFF_t_70_g_se_x_16

Mapping the airfoil to aerodynamic flow fields use the network in the paper.

Environment

Conda: 4.10.3
Python: 3.9.6
PyTorch: 1.9.0
torchvision: 0.10.0

Dataset

The dataset is in file folder data.

  • test.txt: a txt record the type of aircraft, angle of attack, Reynolds Number as for test dataset
  • train.txt: a txt record the type of aircraft, angle of attack, Reynolds Number as for train dataset
  • image: a image file folder
  • input: the Signed Distance Function(SFD) of airfoil
  • output: the aerodynamic flow fields(p,u,v)
  • predict: the predict image generated by the trained model

Model

model_train.pt: save the parameters of model after training.
Structures such as the checkpoint code.

  1. def checkpoint(model_path, model, lr, optimizer, epoch):
  2. # model_path = '../model/model_epoch_{}.pt'.format(epoch)
  3. state = { 'model': model.state_dict(), 'optimizer': optimizer.state_dict(), 'epoch': epoch, 'lr': lr}
  4. torch.save(state, model_path)
  5. print('Checkpoint saved at epoch {}'.format(epoch))

Code

All the code in file folder src. The function of the code like the name.

Run

  1. cd src
  2. python train.py --image_path='../data/image/' --train_path='../data/train.txt' --lr=5e-3 --batch_size=64 --epochs=50 --rate=0.5

TensorBoard

  1. tensorboard --logdir=runs

GitHub

You can see my code in there https://github.com/Zongziyu/Airfoil-CNN/

发表评论

表情:
评论列表 (有 0 条评论,78人围观)

还没有评论,来说两句吧...

相关阅读