Skip to content

Commit d7991cb

Browse files
authored
Merge pull request #62 from su2code/develop
update master
2 parents e8d5cdb + 28b3a8a commit d7991cb

27 files changed

+660122
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
###############################################################################################
2+
# # _____ __ _____ ____ __ __ ____ # #
3+
# # / ___// / / /__ \ / __ \____ _/ /_____ _/ |/ (_)___ ___ _____ # #
4+
# # \__ \/ / / /__/ / / / / / __ `/ __/ __ `/ /|_/ / / __ \/ _ \/ ___/ # #
5+
# # ___/ / /_/ // __/ / /_/ / /_/ / /_/ /_/ / / / / / / / / __/ / # #
6+
# # /____/\____//____/ /_____/\__,_/\__/\__,_/_/ /_/_/_/ /_/\___/_/ # #
7+
# # # #
8+
###############################################################################################
9+
10+
############################# FILE NAME: 0:generate_config.py #################################
11+
#=============================================================================================#
12+
# author: Evert Bunschoten |
13+
# :PhD Candidate , |
14+
# :Flight Power and Propulsion |
15+
# :TU Delft, |
16+
# :The Netherlands |
17+
# |
18+
# |
19+
# Description: |
20+
# Generate configuration for defining a physics-informed neural network for modeling the |
21+
# fluid properties of siloxane MM in NICFD with the data-driven fluid model in SU2. |
22+
# |
23+
# Version: 2.0.0 |
24+
# |
25+
#=============================================================================================#
26+
27+
from su2dataminer.config import Config_NICFD
28+
29+
# The fluid data for siloxane MM are generated with the CoolProp module using the Helmoltz
30+
# equation of state.
31+
fluid_name = "MM"
32+
EoS_type = "HEOS"
33+
34+
Config = Config_NICFD()
35+
Config.SetFluid(fluid_name)
36+
Config.SetEquationOfState(EoS_type)
37+
38+
# Fluid data are generated on a density-energy grid rather than pressure-temperature.
39+
Config.UsePTGrid(False)
40+
41+
# Display configuration settings and save config object.
42+
Config.SetConfigName("SU2DataMiner_MM")
43+
Config.PrintBanner()
44+
Config.SaveConfig()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
###############################################################################################
2+
# # _____ __ _____ ____ __ __ ____ # #
3+
# # / ___// / / /__ \ / __ \____ _/ /_____ _/ |/ (_)___ ___ _____ # #
4+
# # \__ \/ / / /__/ / / / / / __ `/ __/ __ `/ /|_/ / / __ \/ _ \/ ___/ # #
5+
# # ___/ / /_/ // __/ / /_/ / /_/ / /_/ /_/ / / / / / / / / __/ / # #
6+
# # /____/\____//____/ /_____/\__,_/\__/\__,_/_/ /_/_/_/ /_/\___/_/ # #
7+
# # # #
8+
###############################################################################################
9+
10+
########################### FILE NAME: 1:generate_fluid_data.py ###############################
11+
#=============================================================================================#
12+
# author: Evert Bunschoten |
13+
# :PhD Candidate , |
14+
# :Flight Power and Propulsion |
15+
# :TU Delft, |
16+
# :The Netherlands |
17+
# |
18+
# |
19+
# Description: |
20+
# Generate the single-phase fluid data for siloxane MM which is used to train the |
21+
# physics-informed neural network. |
22+
# |
23+
# Version: 2.0.0 |
24+
# |
25+
#=============================================================================================#
26+
27+
from su2dataminer.config import Config_NICFD
28+
from su2dataminer.generate_data import DataGenerator_CoolProp
29+
30+
# Load SU2 DataMiner configuration.
31+
Config = Config_NICFD("SU2DataMiner_MM.cfg")
32+
33+
# Initiate data generator.
34+
DG = DataGenerator_CoolProp(Config)
35+
DG.PreprocessData()
36+
DG.ComputeData()
37+
38+
# Visualize and save fluid data.
39+
DG.VisualizeFluidData()
40+
DG.SaveData()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
###############################################################################################
2+
# # _____ __ _____ ____ __ __ ____ # #
3+
# # / ___// / / /__ \ / __ \____ _/ /_____ _/ |/ (_)___ ___ _____ # #
4+
# # \__ \/ / / /__/ / / / / / __ `/ __/ __ `/ /|_/ / / __ \/ _ \/ ___/ # #
5+
# # ___/ / /_/ // __/ / /_/ / /_/ / /_/ /_/ / / / / / / / / __/ / # #
6+
# # /____/\____//____/ /_____/\__,_/\__/\__,_/_/ /_/_/_/ /_/\___/_/ # #
7+
# # # #
8+
###############################################################################################
9+
10+
################################ FILE NAME: 2:train_PINN.py ###################################
11+
#=============================================================================================#
12+
# author: Evert Bunschoten |
13+
# :PhD Candidate , |
14+
# :Flight Power and Propulsion |
15+
# :TU Delft, |
16+
# :The Netherlands |
17+
# |
18+
# |
19+
# Description: |
20+
# Initate physics-informed machine learning process for training the neural network used to |
21+
# model the fluid properties of siloxane MM in NICFD with the SU2 data-driven fluid model. |
22+
# |
23+
# Version: 2.0.0 |
24+
# |
25+
#=============================================================================================#
26+
27+
from su2dataminer.config import Config_NICFD
28+
from su2dataminer.manifold import TrainMLP_NICFD
29+
30+
# Load SU2 DataMiner configuration.
31+
Config = Config_NICFD("SU2DataMiner_MM.cfg")
32+
33+
# Set learning rate parameters and define network architecture.
34+
Eval = TrainMLP_NICFD(Config)
35+
36+
# Initial learning rate: 10^-3, learning rate decay parameter: 9.8787, mini-batch size: 2^6.
37+
Eval.SetAlphaExpo(-3.0)
38+
Eval.SetLRDecay(+9.8787e-01)
39+
Eval.SetBatchExpo(6)
40+
41+
# Network architecture: two hidden layers with 12 nodes.
42+
Eval.SetHiddenLayers([12,12])
43+
# Hidden layer activation function: exp(x)
44+
Eval.SetActivationFunction("exponential")
45+
# Display training progress in the terminal.
46+
Eval.SetVerbose(1)
47+
48+
# Initiate training process.
49+
Eval.CommenceTraining()
50+
Eval.TrainPostprocessing()
51+
52+
Config.UpdateMLPHyperParams(Eval)
53+
Config.SaveConfig()

0 commit comments

Comments
 (0)