Skip to content

Commit f313cf9

Browse files
removed python wrapper functionality
1 parent 09ba395 commit f313cf9

1 file changed

Lines changed: 11 additions & 35 deletions

File tree

compressible_flow/NICFD_nozzle/PhysicsInformed/3:run_SU2.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)

0 commit comments

Comments
 (0)