Skip to content

Commit 77a9075

Browse files
authored
Merge pull request #81 from su2code/feature_NICFD
Feature nicfd
2 parents 1c9a1fb + 806340c commit 77a9075

4 files changed

Lines changed: 20 additions & 58 deletions

File tree

compressible_flow/NICFD_nozzle/PhysicsInformed/0:generate_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
# Generate configuration for defining a physics-informed neural network for modeling the |
2121
# fluid properties of siloxane MM in NICFD with the data-driven fluid model in SU2. |
2222
# |
23-
# Version: 2.0.0 |
23+
# Version: 3.0.0 |
2424
# |
2525
#=============================================================================================#
2626

compressible_flow/NICFD_nozzle/PhysicsInformed/2:train_PINN.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
# Initate physics-informed machine learning process for training the neural network used to |
2121
# model the fluid properties of siloxane MM in NICFD with the SU2 data-driven fluid model. |
2222
# |
23-
# Version: 2.0.0 |
23+
# Version: 3.0.0 |
2424
# |
2525
#=============================================================================================#
2626

compressible_flow/NICFD_nozzle/PhysicsInformed/3:run_SU2.py renamed to compressible_flow/NICFD_nozzle/PhysicsInformed/3:prepare_simulation.py

Lines changed: 11 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## \file 3:run_SU2.py
44
# \brief NICFD simulation of supersonic expansion of siloxane MM.
5-
# \version 8.1.0 "Harrier"
5+
# \version 8.3.0 "Harrier"
66
#
77
# SU2 Project Website: https://su2code.github.io
88
#
@@ -26,9 +26,7 @@
2626

2727
import numpy as np
2828
import gmsh
29-
import pysu2
3029
import CoolProp.CoolProp as CP
31-
from mpi4py import MPI
3230
from su2dataminer.config import Config_NICFD
3331

3432

@@ -54,18 +52,6 @@ def WriteSU2Config(Config:Config_NICFD):
5452

5553
# SU2 config options for NICFD nozzle simulation.
5654
su2_options = """
57-
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
58-
% %
59-
% SU2 configuration file, automatically generated with "3:run_SU2.py" %
60-
% Case description: Non-ideal compressible fluid flow in a converging- %
61-
% diverging supersonic nozzle using a PINN for thermodynamic %
62-
% state calculations. %
63-
% Author: Evert Bunschoten %
64-
% Institution: Delft University of Technology %
65-
% Date: 2025.3.26 %
66-
% File Version 8.1.0 "Harrier" %
67-
% %
68-
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6955
SOLVER= RANS
7056
KIND_TURB_MODEL= SA
7157
SA_OPTIONS= NONE
@@ -243,26 +229,16 @@ def GenerateMesh():
243229

244230
return mesh_filename
245231

246-
comm = MPI.COMM_WORLD
247-
rank = comm.Get_rank()
232+
# Load SU2 DataMiner configuration.
233+
Config = Config_NICFD("SU2DataMiner_MM.cfg")
248234

249-
if rank == 0:
250-
# Load SU2 DataMiner configuration.
251-
Config = Config_NICFD("SU2DataMiner_MM.cfg")
235+
# Write SU2 configuration options.
236+
su2_options = WriteSU2Config(Config)
252237

253-
# Write SU2 configuration options.
254-
su2_options = WriteSU2Config(Config)
238+
# Generate computational mesh.
239+
mesh_filename = GenerateMesh()
240+
su2_options = su2_options.replace("__MESH_FILENAME__", mesh_filename)
255241

256-
# Generate computational mesh.
257-
mesh_filename = GenerateMesh()
258-
su2_options = su2_options.replace("__MESH_FILENAME__", mesh_filename)
259-
260-
# Write SU2 configuration file.
261-
with open("config_NICFD_PINN.cfg", "w") as fid:
262-
fid.write(su2_options)
263-
comm.Barrier()
264-
265-
# Initialize NICFD simulation.
266-
driver = pysu2.CSinglezoneDriver("config_NICFD_PINN.cfg",1, comm)
267-
driver.StartSolver()
268-
driver.Finalize()
242+
# Write SU2 configuration file.
243+
with open("config_NICFD_PINN.cfg", "w") as fid:
244+
fid.write(su2_options)

compressible_flow/NICFD_nozzle/PhysicsInformed/config_NICFD_PINN.cfg

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,15 @@
1-
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2-
% %
3-
% SU2 configuration file, automatically generated with "3:run_SU2.py" %
4-
% Case description: Non-ideal compressible fluid flow in a converging- %
5-
% diverging supersonic nozzle using a PINN for thermodynamic %
6-
% state calculations. %
7-
% Author: Evert Bunschoten %
8-
% Institution: Delft University of Technology %
9-
% Date: 2025.3.26 %
10-
% File Version 8.1.0 "Harrier" %
11-
% %
12-
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
13-
141

152
SOLVER= RANS
163
KIND_TURB_MODEL= SA
174
SA_OPTIONS= NONE
5+
MATH_PROBLEM= DIRECT
186
RESTART_SOL=NO
197
MACH_NUMBER= 0.05
208
AoA= 0.0
219

22-
FREESTREAM_PRESSURE= 1.809444e+06
10+
FREESTREAM_PRESSURE= 1.802104e+06
2311

24-
FREESTREAM_TEMPERATURE= 5.229862e+02
12+
FREESTREAM_TEMPERATURE= 5.229359e+02
2513

2614
FREESTREAM_TURBULENCEINTENSITY = 0.1
2715

@@ -49,17 +37,15 @@ PRANDTL_TURB=8.25e-01
4937

5038
MARKER_HEATFLUX= (wall, 0.0)
5139

52-
MARKER_MONITORING=(wall)
5340

5441
MARKER_EULER=(symmetry)
5542

56-
MARKER_GILES= (inflow, TOTAL_CONDITIONS_PT, 1.809444e+06, 5.229862e+02, 1.0, 0.0, 0.0, 0.8, 0.8,\
57-
outflow, STATIC_PRESSURE,1.809444e+05, 0.0, 0.0, 0.0, 0.0, 0.8, 0.8)
43+
MARKER_GILES= (inflow, TOTAL_CONDITIONS_PT, 1.802104e+06, 5.229359e+02, 1.0, 0.0, 0.0, 0.8, 0.8, outflow, STATIC_PRESSURE,1.802104e+05, 0.0, 0.0, 0.0, 0.0, 0.8, 0.8)
5844
SPATIAL_FOURIER=NO
5945
TURBOMACHINERY_KIND= AXIAL
6046
TURBO_PERF_KIND=TURBINE
61-
RAMP_OUTLET=NO
62-
RAMP_OUTLET_COEFF= (1.809444e+06, 10, 200)
47+
RAMP_OUTLET=YES
48+
RAMP_OUTLET_COEFF= (1.802104e+06, 10, 200)
6349
AVERAGE_PROCESS_KIND= AREA
6450
MIXEDOUT_COEFF=(0.1, 1e-5, 15.0)
6551
MARKER_TURBOMACHINERY= (inflow, outflow)
@@ -93,7 +79,7 @@ CONV_RESIDUAL_MINVAL= -16
9379
CONV_STARTITER= 10
9480
CONV_CAUCHY_ELEMS= 100
9581
CONV_CAUCHY_EPS= 1E-6
96-
CONV_FILENAME=history_adjoint.csv
82+
9783
MESH_FILENAME= nozzle_mesh.su2
9884

9985
OUTPUT_WRT_FREQ= 20

0 commit comments

Comments
 (0)