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
17 changes: 0 additions & 17 deletions SU2_CFD/include/output/filewriter/CParallelDataSorter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ class CParallelDataSorter{
nRecvs; //!< Number of receives

vector<string> fieldNames; //!< Vector with names of all the output fields
vector<string> requiredFieldNames; //!< Vector with names of the required output fields that we write to file

unsigned short nDim; //!< Spatial dimension of the data

Expand Down Expand Up @@ -341,22 +340,6 @@ class CParallelDataSorter{
return fieldNames;
}

/*!
* \brief Get the vector containing the names of the required output fields
* \return Vector of strings containing the required field names
*/
const vector<string>& GetRequiredFieldNames() const{
return requiredFieldNames;
}

/*!
* \brief Set the vector of required output fields.
* \return None.
*/
void SetRequiredFieldNames(const vector<string>& req_field_names) {
requiredFieldNames = req_field_names;
}

/*!
* \brief Get the spatial dimension
* \return The spatial dimension
Expand Down
10 changes: 2 additions & 8 deletions SU2_CFD/src/output/COutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -411,10 +411,6 @@ void COutput::WriteToFile(CConfig *config, CGeometry *geometry, OUTPUT_TYPE form
if (!config->GetWrt_Surface_Overwrite())
filename_iter = config->GetFilename_Iter(fileName, curInnerIter, curOuterIter);

/*--- If we have compact restarts, we use only the required fields. ---*/
if (config->GetWrt_Restart_Compact())
surfaceDataSorter->SetRequiredFieldNames(requiredVolumeFieldNames);

surfaceDataSorter->SortConnectivity(config, geometry);
surfaceDataSorter->SortOutputData();

Expand All @@ -435,9 +431,8 @@ void COutput::WriteToFile(CConfig *config, CGeometry *geometry, OUTPUT_TYPE form

LogOutputFiles("SU2 ASCII restart");

/*--- If we have compact restarts, we use only the required fields. ---*/
if (config->GetWrt_Restart_Compact()) {
/*--- If we have compact restarts, we use only the required fields. ---*/
volumeDataSorterCompact->SetRequiredFieldNames(requiredVolumeFieldNames);
fileWriter = new CSU2FileWriter(volumeDataSorterCompact);
} else {
fileWriter = new CSU2FileWriter(volumeDataSorter);
Expand All @@ -456,9 +451,8 @@ void COutput::WriteToFile(CConfig *config, CGeometry *geometry, OUTPUT_TYPE form
filename_iter = config->GetFilename_Iter(fileName, curInnerIter, curOuterIter);

LogOutputFiles("SU2 binary restart");
/*--- If we have compact restarts, we use only the required fields. ---*/
if (config->GetWrt_Restart_Compact()) {
/*--- If we have compact restarts, we use only the required fields. ---*/
volumeDataSorterCompact->SetRequiredFieldNames(requiredVolumeFieldNames);
fileWriter = new CSU2BinaryFileWriter(volumeDataSorterCompact);
} else {
fileWriter = new CSU2BinaryFileWriter(volumeDataSorter);
Expand Down
3 changes: 1 addition & 2 deletions SU2_CFD/src/output/filewriter/CParallelDataSorter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@
CParallelDataSorter::CParallelDataSorter(CConfig *config, const vector<string> &valFieldNames) :
rank(SU2_MPI::GetRank()),
size(SU2_MPI::GetSize()),
fieldNames(valFieldNames),
requiredFieldNames(valFieldNames) {
fieldNames(valFieldNames) {

GlobalField_Counter = fieldNames.size();

Expand Down
2 changes: 1 addition & 1 deletion SU2_CFD/src/output/filewriter/CSU2BinaryFileWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void CSU2BinaryFileWriter::WriteData(string val_filename){

unsigned short iVar;

const vector<string>& fieldNames = dataSorter->GetRequiredFieldNames();
const vector<string>& fieldNames = dataSorter->GetFieldNames();
unsigned short nVar = fieldNames.size();
unsigned long nParallel_Poin = dataSorter->GetnPoints();
unsigned long nPoint_Global = dataSorter->GetnPointsGlobal();
Expand Down
2 changes: 1 addition & 1 deletion SU2_CFD/src/output/filewriter/CSU2FileWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ CSU2FileWriter::CSU2FileWriter(CParallelDataSorter *valDataSorter) :
void CSU2FileWriter::WriteData(string val_filename){

ofstream restart_file;
const vector<string> fieldNames = dataSorter->GetRequiredFieldNames();
const vector<string>& fieldNames = dataSorter->GetFieldNames();

/*--- We append the pre-defined suffix (extension) to the filename (prefix) ---*/
val_filename.append(fileExt);
Expand Down
17 changes: 17 additions & 0 deletions TestCases/parallel_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -1750,6 +1750,23 @@ def main():
species2_primitiveVenturi.test_vals = [-5.470699, -4.435379, -4.486544, -5.327925, -0.866369, -5.623281, 5.000000, -0.557915, 5.000000, -2.599732, 5.000000, -0.536608, 0.000037, 0.000037, 0.000000, 0.000000]
test_list.append(species2_primitiveVenturi)

# Compact restart check. The case above writes a compact ASCII and binary restart file at
# iteration 49, holding the solution that enters iteration 50. The first iteration of these
# restarted runs must therefore reproduce its iteration 50, so they share its test values.
species2_compact_restart_ascii = TestCase('species2_primitiveVenturi_compact_restart_read_ascii')
species2_compact_restart_ascii.cfg_dir = "species_transport/venturi_primitive_3species"
species2_compact_restart_ascii.cfg_file = "species2_primitiveVenturi_compact_restart_read_ascii.cfg"
species2_compact_restart_ascii.test_iter = 0
species2_compact_restart_ascii.test_vals = species2_primitiveVenturi.test_vals
test_list.append(species2_compact_restart_ascii)

species2_compact_restart_binary = TestCase('species2_primitiveVenturi_compact_restart_read_binary')
species2_compact_restart_binary.cfg_dir = "species_transport/venturi_primitive_3species"
species2_compact_restart_binary.cfg_file = "species2_primitiveVenturi_compact_restart_read_binary.cfg"
species2_compact_restart_binary.test_iter = 0
species2_compact_restart_binary.test_vals = species2_primitiveVenturi.test_vals
test_list.append(species2_compact_restart_binary)

# 2 species (1 eq) primitive venturi mixing with bounded scalar transport
species_primitiveVenturi_boundedscalar = TestCase('species2_primitiveVenturi_bounded_scalar')
species_primitiveVenturi_boundedscalar.cfg_dir = "species_transport/venturi_primitive_3species"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ t
4. Adjoint simulation with 1 timestep, using the primal restart file from simulation in 2nd step. The printed direct residuals are taken for comparison


- `species2_primitiveVenturi_compact_restart_read_ascii.cfg` and `species2_primitiveVenturi_compact_restart_read_binary.cfg` check that compact restart files (`WRT_RESTART_COMPACT= YES`) are written and read correctly.
They restart from the files that `species2_venturiPrimitive.cfg` writes at iteration 49 (`WRT_RESTART_OVERWRITE= NO` with `OUTPUT_WRT_FREQ= 49, 49, 1000`), which hold the solution that enters iteration 50.
Their first iteration must therefore reproduce the residuals of iteration 50 of that case, and the regression test uses its values for all three cases.
`VOLUME_OUTPUT` contains fields outside the compact set, which is the situation in which the compact writers can shift the restart columns.


- `species3_venturiPrimitive_inletFile.cfg` With the `test_inlet_files.sh` a simple sanity check for inlet files is performed.
SU2 writes an `example_inlet_file.dat` when the specified inlet file is not available, with the values of the specified `MARKER_INLET` content.
Therefore comparing a simulation with this example inlet file and without inlet files should result in exactly the same results.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,15 @@ SCREEN_WRT_FREQ_INNER= 10
HISTORY_OUTPUT= RMS_RES FLOW_COEFF LINSOL SPECIES_COEFF SPECIES_COEFF_SURF
MARKER_ANALYZE= outlet gas_inlet air_axial_inlet
%
OUTPUT_FILES= RESTART_ASCII, PARAVIEW_MULTIBLOCK
% The restart files written at iteration 49 hold the solution that enters
% iteration 50 and are the starting point of the compact restart checks in
% species2_primitiveVenturi_compact_restart_read_ascii.cfg and
% species2_primitiveVenturi_compact_restart_read_binary.cfg.
OUTPUT_FILES= RESTART_ASCII, RESTART, PARAVIEW_MULTIBLOCK
VOLUME_OUTPUT= RESIDUAL, PRIMITIVE
OUTPUT_WRT_FREQ= 1000
WRT_RESTART_COMPACT= YES
WRT_RESTART_OVERWRITE= NO
OUTPUT_WRT_FREQ= 49, 49, 1000
%
RESTART_SOL= NO
SOLUTION_FILENAME= solution
Expand Down

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use python to modify the original restart on the fly, as I have done in other tests.
No duplication, means no duplication, everywhere.

Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% SU2 configuration file %
% Case description: Species mixing with 2 species, i.e. 1 transport equations %
% restarted from the compact ASCII restart file of %
% species2_primitiveVenturi.cfg %
% Author: N. Beishuizen %
% Institution: TU Eindhoven %
% Date: 13-09-2026 %
% File Version 8.5.0 "Harrier" %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% This run restarts from the solution that entered iteration 50 of
% species2_primitiveVenturi.cfg, so its first iteration must reproduce the
% residuals printed at iteration 50 of that case. VOLUME_OUTPUT there holds
% fields outside the compact set, which is what the compact writers can get
% wrong.

% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------%
%
SOLVER= INC_RANS
KIND_TURB_MODEL= SST
%
% ---------------- INCOMPRESSIBLE FLOW CONDITION DEFINITION -------------------%
%
INC_DENSITY_MODEL= CONSTANT
INC_DENSITY_INIT= 1.1766
%
INC_VELOCITY_INIT= ( 1.00, 0.0, 0.0 )
%
INC_ENERGY_EQUATION= YES
INC_TEMPERATURE_INIT= 300.0
%
INC_NONDIM= DIMENSIONAL
%
% -------------------- FLUID PROPERTIES ------------------------------------- %
%
FLUID_MODEL= CONSTANT_DENSITY
%
CONDUCTIVITY_MODEL= CONSTANT_CONDUCTIVITY
THERMAL_CONDUCTIVITY_CONSTANT= 0.0357
%
PRANDTL_LAM= 0.72
TURBULENT_CONDUCTIVITY_MODEL= NONE
PRANDTL_TURB= 0.90
%
VISCOSITY_MODEL= CONSTANT_VISCOSITY
MU_CONSTANT= 1.716E-5
%
% -------------------- BOUNDARY CONDITION DEFINITION --------------------------%
%
MARKER_HEATFLUX= ( wall, 0.0 )
MARKER_SYM= ( axis )
%
INC_INLET_TYPE= VELOCITY_INLET VELOCITY_INLET
MARKER_INLET= ( gas_inlet, 300, 1.0, 1.0, 0.0, 0.0,\
air_axial_inlet, 300, 1.0, 0.0, -1.0, 0.0 )
MARKER_INLET_SPECIES= (gas_inlet, 1.0,\
air_axial_inlet, 0.6 )
%
INC_OUTLET_TYPE= PRESSURE_OUTLET
MARKER_OUTLET= ( outlet, 0.0)
%
% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------%
%
NUM_METHOD_GRAD= WEIGHTED_LEAST_SQUARES
%
CFL_NUMBER= 2000
CFL_REDUCTION_SPECIES= 1.0
CFL_REDUCTION_TURB= 1.0
%
ITER= 1
%
% ------------------------ LINEAR SOLVER DEFINITION ---------------------------%
%
LINEAR_SOLVER= FGMRES
LINEAR_SOLVER_PREC= ILU
LINEAR_SOLVER_ERROR= 1E-8
LINEAR_SOLVER_ITER= 5
%
% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------%
%
CONV_NUM_METHOD_FLOW= FDS
MUSCL_FLOW= YES
SLOPE_LIMITER_FLOW = NONE
TIME_DISCRE_FLOW= EULER_IMPLICIT
%
% -------------------- SCALAR TRANSPORT ---------------------------------------%
%
KIND_SCALAR_MODEL= SPECIES_TRANSPORT
DIFFUSIVITY_MODEL= CONSTANT_DIFFUSIVITY
DIFFUSIVITY_CONSTANT= 0.001
%
CONV_NUM_METHOD_SPECIES= SCALAR_UPWIND
MUSCL_SPECIES= NO
SLOPE_LIMITER_SPECIES = NONE
%
TIME_DISCRE_SPECIES= EULER_IMPLICIT
%
SPECIES_INIT= 1.0
SPECIES_CLIPPING= YES
SPECIES_CLIPPING_MIN= 0.0
SPECIES_CLIPPING_MAX= 1.0
%
% -------------------- TURBULENT TRANSPORT ---------------------------------------%
%
CONV_NUM_METHOD_TURB= SCALAR_UPWIND
MUSCL_TURB= NO
%
% --------------------------- CONVERGENCE PARAMETERS --------------------------%
%
CONV_FIELD= RMS_PRESSURE, RMS_VELOCITY-X, RMS_VELOCITY-Y, RMS_TKE, RMS_SPECIES
CONV_RESIDUAL_MINVAL= -18
CONV_STARTITER= 10
%
% ------------------------- INPUT/OUTPUT INFORMATION --------------------------%
%
MESH_FILENAME= primitiveVenturi.su2
SCREEN_OUTPUT= INNER_ITER WALL_TIME \
RMS_PRESSURE RMS_VELOCITY-X RMS_VELOCITY-Y RMS_TKE RMS_DISSIPATION RMS_SPECIES_0 \
LINSOL_ITER LINSOL_RESIDUAL \
LINSOL_ITER_TURB LINSOL_RESIDUAL_TURB \
LINSOL_ITER_SPECIES LINSOL_RESIDUAL_SPECIES SURFACE_SPECIES_VARIANCE
SCREEN_WRT_FREQ_INNER= 10
%
HISTORY_OUTPUT= RMS_RES FLOW_COEFF LINSOL SPECIES_COEFF SPECIES_COEFF_SURF
MARKER_ANALYZE= outlet gas_inlet air_axial_inlet
%
OUTPUT_FILES= RESTART_ASCII
VOLUME_OUTPUT= RESIDUAL, PRIMITIVE
WRT_RESTART_COMPACT= YES
OUTPUT_WRT_FREQ= 1000
%
RESTART_SOL= YES
READ_BINARY_RESTART= NO
SOLUTION_FILENAME= restart_000049
RESTART_FILENAME= restart_compact_read_ascii
%
WRT_PERFORMANCE= YES
Loading
Loading