diff --git a/compressible_flow/NICFD_nozzle/PhysicsInformed/0:generate_config.py b/compressible_flow/NICFD_nozzle/PhysicsInformed/0:generate_config.py index 0fabee8..e459c10 100644 --- a/compressible_flow/NICFD_nozzle/PhysicsInformed/0:generate_config.py +++ b/compressible_flow/NICFD_nozzle/PhysicsInformed/0:generate_config.py @@ -20,7 +20,7 @@ # Generate configuration for defining a physics-informed neural network for modeling the | # fluid properties of siloxane MM in NICFD with the data-driven fluid model in SU2. | # | -# Version: 2.0.0 | +# Version: 3.0.0 | # | #=============================================================================================# diff --git a/compressible_flow/NICFD_nozzle/PhysicsInformed/2:train_PINN.py b/compressible_flow/NICFD_nozzle/PhysicsInformed/2:train_PINN.py index 86a7111..aab3ff1 100644 --- a/compressible_flow/NICFD_nozzle/PhysicsInformed/2:train_PINN.py +++ b/compressible_flow/NICFD_nozzle/PhysicsInformed/2:train_PINN.py @@ -20,7 +20,7 @@ # Initate physics-informed machine learning process for training the neural network used to | # model the fluid properties of siloxane MM in NICFD with the SU2 data-driven fluid model. | # | -# Version: 2.0.0 | +# Version: 3.0.0 | # | #=============================================================================================# diff --git a/compressible_flow/NICFD_nozzle/PhysicsInformed/3:run_SU2.py b/compressible_flow/NICFD_nozzle/PhysicsInformed/3:prepare_simulation.py similarity index 81% rename from compressible_flow/NICFD_nozzle/PhysicsInformed/3:run_SU2.py rename to compressible_flow/NICFD_nozzle/PhysicsInformed/3:prepare_simulation.py index ceb07d4..515ccba 100644 --- a/compressible_flow/NICFD_nozzle/PhysicsInformed/3:run_SU2.py +++ b/compressible_flow/NICFD_nozzle/PhysicsInformed/3:prepare_simulation.py @@ -2,7 +2,7 @@ ## \file 3:run_SU2.py # \brief NICFD simulation of supersonic expansion of siloxane MM. -# \version 8.1.0 "Harrier" +# \version 8.3.0 "Harrier" # # SU2 Project Website: https://su2code.github.io # @@ -26,9 +26,7 @@ import numpy as np import gmsh -import pysu2 import CoolProp.CoolProp as CP -from mpi4py import MPI from su2dataminer.config import Config_NICFD @@ -54,18 +52,6 @@ def WriteSU2Config(Config:Config_NICFD): # SU2 config options for NICFD nozzle simulation. su2_options = """ - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - % % - % SU2 configuration file, automatically generated with "3:run_SU2.py" % - % Case description: Non-ideal compressible fluid flow in a converging- % - % diverging supersonic nozzle using a PINN for thermodynamic % - % state calculations. % - % Author: Evert Bunschoten % - % Institution: Delft University of Technology % - % Date: 2025.3.26 % - % File Version 8.1.0 "Harrier" % - % % - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SOLVER= RANS KIND_TURB_MODEL= SA SA_OPTIONS= NONE @@ -243,26 +229,16 @@ def GenerateMesh(): return mesh_filename -comm = MPI.COMM_WORLD -rank = comm.Get_rank() +# Load SU2 DataMiner configuration. +Config = Config_NICFD("SU2DataMiner_MM.cfg") -if rank == 0: - # Load SU2 DataMiner configuration. - Config = Config_NICFD("SU2DataMiner_MM.cfg") +# Write SU2 configuration options. +su2_options = WriteSU2Config(Config) - # Write SU2 configuration options. - su2_options = WriteSU2Config(Config) +# Generate computational mesh. +mesh_filename = GenerateMesh() +su2_options = su2_options.replace("__MESH_FILENAME__", mesh_filename) - # Generate computational mesh. - mesh_filename = GenerateMesh() - su2_options = su2_options.replace("__MESH_FILENAME__", mesh_filename) - - # Write SU2 configuration file. - with open("config_NICFD_PINN.cfg", "w") as fid: - fid.write(su2_options) -comm.Barrier() - -# Initialize NICFD simulation. -driver = pysu2.CSinglezoneDriver("config_NICFD_PINN.cfg",1, comm) -driver.StartSolver() -driver.Finalize() \ No newline at end of file +# Write SU2 configuration file. +with open("config_NICFD_PINN.cfg", "w") as fid: + fid.write(su2_options) \ No newline at end of file diff --git a/compressible_flow/NICFD_nozzle/PhysicsInformed/config_NICFD_PINN.cfg b/compressible_flow/NICFD_nozzle/PhysicsInformed/config_NICFD_PINN.cfg index 1884a2a..4024496 100644 --- a/compressible_flow/NICFD_nozzle/PhysicsInformed/config_NICFD_PINN.cfg +++ b/compressible_flow/NICFD_nozzle/PhysicsInformed/config_NICFD_PINN.cfg @@ -1,27 +1,15 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% SU2 configuration file, automatically generated with "3:run_SU2.py" % -% Case description: Non-ideal compressible fluid flow in a converging- % -% diverging supersonic nozzle using a PINN for thermodynamic % -% state calculations. % -% Author: Evert Bunschoten % -% Institution: Delft University of Technology % -% Date: 2025.3.26 % -% File Version 8.1.0 "Harrier" % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - SOLVER= RANS KIND_TURB_MODEL= SA SA_OPTIONS= NONE +MATH_PROBLEM= DIRECT RESTART_SOL=NO MACH_NUMBER= 0.05 AoA= 0.0 -FREESTREAM_PRESSURE= 1.809444e+06 +FREESTREAM_PRESSURE= 1.802104e+06 -FREESTREAM_TEMPERATURE= 5.229862e+02 +FREESTREAM_TEMPERATURE= 5.229359e+02 FREESTREAM_TURBULENCEINTENSITY = 0.1 @@ -49,17 +37,15 @@ PRANDTL_TURB=8.25e-01 MARKER_HEATFLUX= (wall, 0.0) -MARKER_MONITORING=(wall) MARKER_EULER=(symmetry) -MARKER_GILES= (inflow, TOTAL_CONDITIONS_PT, 1.809444e+06, 5.229862e+02, 1.0, 0.0, 0.0, 0.8, 0.8,\ - outflow, STATIC_PRESSURE,1.809444e+05, 0.0, 0.0, 0.0, 0.0, 0.8, 0.8) +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) SPATIAL_FOURIER=NO TURBOMACHINERY_KIND= AXIAL TURBO_PERF_KIND=TURBINE -RAMP_OUTLET=NO -RAMP_OUTLET_COEFF= (1.809444e+06, 10, 200) +RAMP_OUTLET=YES +RAMP_OUTLET_COEFF= (1.802104e+06, 10, 200) AVERAGE_PROCESS_KIND= AREA MIXEDOUT_COEFF=(0.1, 1e-5, 15.0) MARKER_TURBOMACHINERY= (inflow, outflow) @@ -93,7 +79,7 @@ CONV_RESIDUAL_MINVAL= -16 CONV_STARTITER= 10 CONV_CAUCHY_ELEMS= 100 CONV_CAUCHY_EPS= 1E-6 -CONV_FILENAME=history_adjoint.csv + MESH_FILENAME= nozzle_mesh.su2 OUTPUT_WRT_FREQ= 20