Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
# |
#=============================================================================================#

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
# |
#=============================================================================================#

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
#
Expand All @@ -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


Expand All @@ -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
Expand Down Expand Up @@ -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()
# Write SU2 configuration file.
with open("config_NICFD_PINN.cfg", "w") as fid:
fid.write(su2_options)
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
119 changes: 119 additions & 0 deletions incompressible_flow/Inc_Urban_City/amsterdam.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% SU2 configuration file %
% Case description: Wind velocity through the streets of Amsterdam %
% Author: N. Beishuizen %
% Institution: TU Eindhoven %
% Date: 2026.01.01 %
% File Version 8.3.0 "Harrier" %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------%
%
SOLVER = INC_RANS
KIND_TURB_MODEL= SST
SST_OPTIONS= V2003m
RESTART_SOL= YES
%
% ---------------- INCOMPRESSIBLE FLOW CONDITION DEFINITION -------------------%
%
% For the mean flow it is only inmportant to ensure a velocity (1,0,0) everywhere.
INC_DENSITY_MODEL = CONSTANT
INC_ENERGY_EQUATION = NO
INC_DENSITY_INIT = 1.2

%# wind speed on 01-01-2026 at 12:00 in Amsterdam (262 degrees 6.81 m/s)
INC_VELOCITY_INIT = (6.74, 0.95, 0.0 )

INC_NONDIM = DIMENSIONAL
%
% --------------------------- VISCOSITY MODEL ---------------------------------%
%
VISCOSITY_MODEL= CONSTANT_VISCOSITY
MU_CONSTANT= 1.716E-5
%
% -------------------- SPECIES TRANSPORT ---------------------------------------%
%
KIND_SCALAR_MODEL= NONE
%
DIFFUSIVITY_MODEL = CONSTANT_DIFFUSIVITY
DIFFUSIVITY_CONSTANT = 0.002
%
CONV_NUM_METHOD_SPECIES= SCALAR_UPWIND
MUSCL_SPECIES= NO
SLOPE_LIMITER_SPECIES= NONE
%
TIME_DISCRE_SPECIES= EULER_IMPLICIT
%
SPECIES_INIT = 0
SPECIES_CLIPPING= YES
SPECIES_CLIPPING_MIN= 0.0
SPECIES_CLIPPING_MAX= 1.0

% -------------------- TURBULENT TRANSPORT ---------------------------------------%
%
CONV_NUM_METHOD_TURB= BOUNDED_SCALAR
MUSCL_TURB= NO
%
%
% -------------------- BOUNDARY CONDITION DEFINITION --------------------------%
%
MARKER_FAR= farfield
MARKER_HEATFLUX= wall_buildings
MARKER_INLET_TURBULENT = (farfield, 0.05, 10)
MARKER_ANALYZE= ( farfield )


% ------------------------ WALL FUNCTION DEFINITION --------------------------%
%
%MARKER_WALL_FUNCTIONS= ( wall_buildings, STANDARD_WALL_FUNCTION )
%WALLMODEL_KAPPA= 0.41
%WALLMODEL_B= 5.5
%WALLMODEL_MINYPLUS= 5.0
%WALLMODEL_MAXITER= 500
%WALLMODEL_RELFAC= 0.4

%
% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------%
%
NUM_METHOD_GRAD= GREEN_GAUSS
CFL_NUMBER = 10
CFL_ADAPT= YES
CFL_ADAPT_PARAM= ( 0.9, 1.1, 1, 1000, 1e-2 )
ITER= 5000
%
CFL_REDUCTION_SPECIES = 1.0
%
% ------------------------ LINEAR SOLVER DEFINITION ---------------------------%
%
LINEAR_SOLVER= FGMRES
LINEAR_SOLVER_PREC= ILU
LINEAR_SOLVER_ERROR= 1E-06
LINEAR_SOLVER_ITER= 10
%
% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------%
%
CONV_NUM_METHOD_FLOW= FDS
MUSCL_FLOW= NO
SLOPE_LIMITER_FLOW = NONE
TIME_DISCRE_FLOW= EULER_IMPLICIT
%
% --------------------------- CONVERGENCE PARAMETERS --------------------------%
%
CONV_FIELD = RMS_PRESSURE, RMS_VELOCITY-X, RMS_VELOCITY-Y, RMS_SPECIES
CONV_RESIDUAL_MINVAL = -17
CONV_STARTITER= 10
%
% ------------------------- INPUT/OUTPUT INFORMATION --------------------------%
%
MESH_FILENAME = amsterdam_fine.su2
%
SCREEN_OUTPUT = INNER_ITER WALL_TIME RMS_RES LINSOL CUSTOM AVG_CFL
SCREEN_WRT_FREQ_INNER= 10
%
HISTORY_OUTPUT = RMS_RES MAX_RES FLOW_COEFF
%
OUTPUT_FILES = RESTART, PARAVIEW_MULTIBLOCK
OUTPUT_WRT_FREQ= 100
VOLUME_OUTPUT = PRIMITIVE, RESIDUAL
Loading