Skip to content

Commit 919900a

Browse files
authored
Merge pull request #1290 from su2code/streamwise_spanwise_periodic
CFVMOutput & Streamwise+spanwise periodic
2 parents dc2c9e1 + 1771391 commit 919900a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+299
-282
lines changed

Common/src/CConfig.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -4662,8 +4662,8 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i
46624662
SU2_MPI::Error("Streamwise Periodic Flow currently only implemented for incompressible flow.", CURRENT_FUNCTION);
46634663
if (Kind_Solver == INC_EULER)
46644664
SU2_MPI::Error("Streamwise Periodic Flow + Incompressible Euler: Not tested yet.", CURRENT_FUNCTION);
4665-
if (nMarker_PerBound != 2)
4666-
SU2_MPI::Error("Streamwise Periodic Flow currently only implemented for one Periodic Marker pair. Combining Streamwise and Spanwise periodicity not possible in the moment.", CURRENT_FUNCTION);
4665+
if (nMarker_PerBound == 0)
4666+
SU2_MPI::Error("A MARKER_PERIODIC pair has to be set with KIND_STREAMWISE_PERIODIC != NONE.", CURRENT_FUNCTION);
46674667
if (Energy_Equation && Streamwise_Periodic_Temperature && nMarker_Isothermal != 0)
46684668
SU2_MPI::Error("No MARKER_ISOTHERMAL marker allowed with STREAMWISE_PERIODIC_TEMPERATURE= YES, only MARKER_HEATFLUX & MARKER_SYM.", CURRENT_FUNCTION);
46694669
if (DiscreteAdjoint && Kind_Streamwise_Periodic == ENUM_STREAMWISE_PERIODIC::MASSFLOW)

SU2_CFD/include/interfaces/CInterface.hpp

+1
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ class CInterface {
7070
unsigned short nSpanMaxAllZones = 0;
7171

7272
unsigned short nVar = 0;
73+
static constexpr size_t MAXNDIM = 3; /*!< \brief Max number of space dimensions, used in some static arrays. */
7374

7475
public:
7576
/*!

SU2_CFD/include/output/CAdjHeatOutput.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* \file output_fea_discadj.hpp
2+
* \file CAdjHeatOutput.hpp
33
* \brief Headers of the adjoint heat output.
44
* \author T. Albring
55
* \version 7.1.1 "Blackbird"

SU2_CFD/include/output/CFVMOutput.hpp

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
/*!
2+
* \file CFVMOutput.hpp
3+
* \brief Headers of the Finite Volume Method output.
4+
* \author T. Kattmann
5+
* \version 7.1.1 "Blackbird"
6+
*
7+
* SU2 Project Website: https://su2code.github.io
8+
*
9+
* The SU2 Project is maintained by the SU2 Foundation
10+
* (http://su2foundation.org)
11+
*
12+
* Copyright 2012-2021, SU2 Contributors (cf. AUTHORS.md)
13+
*
14+
* SU2 is free software; you can redistribute it and/or
15+
* modify it under the terms of the GNU Lesser General Public
16+
* License as published by the Free Software Foundation; either
17+
* version 2.1 of the License, or (at your option) any later version.
18+
*
19+
* SU2 is distributed in the hope that it will be useful,
20+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
21+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22+
* Lesser General Public License for more details.
23+
*
24+
* You should have received a copy of the GNU Lesser General Public
25+
* License along with SU2. If not, see <http://www.gnu.org/licenses/>.
26+
*/
27+
28+
#pragma once
29+
30+
#include "COutput.hpp"
31+
32+
class CFVMOutput : public COutput{
33+
protected:
34+
/*!
35+
* \brief Constructor of the class
36+
*/
37+
CFVMOutput(CConfig *config, unsigned short nDim, bool femOutput);
38+
39+
/*!
40+
* \brief Destructor of the class.
41+
*/
42+
~CFVMOutput(void) = default;
43+
44+
/*!
45+
* \brief Add Coordinates to output.
46+
*/
47+
void AddCoordinates();
48+
49+
/*!
50+
* \brief Load the coordinates.
51+
*/
52+
template<class T>
53+
inline void LoadCoordinates(const T& Coord, const unsigned long iPoint) {
54+
SetVolumeOutputValue("COORD-X", iPoint, Coord[0]);
55+
SetVolumeOutputValue("COORD-Y", iPoint, Coord[1]);
56+
if (nDim == 3)
57+
SetVolumeOutputValue("COORD-Z", iPoint, Coord[2]);
58+
}
59+
60+
/*!
61+
* \brief Add common FVM outputs.
62+
*/
63+
void AddCommonFVMOutputs(const CConfig* config);
64+
65+
/*!
66+
* \brief Load common FVM outputs.
67+
*/
68+
void LoadCommonFVMOutputs(const CConfig* config, const CGeometry* geometry, unsigned long iPoint);
69+
};

SU2_CFD/include/output/CFlowIncOutput.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
/*!
2-
* \file CFlowIncCompOutput.hpp
1+
/*!
2+
* \file CFlowIncOutput.hpp
33
* \brief Headers of the incompressible flow output.
44
* \author T. Albring, R. Sanchez
55
* \version 7.1.1 "Blackbird"

SU2_CFD/include/output/CFlowOutput.hpp

+2-12
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@
2727

2828
#pragma once
2929

30-
#include "COutput.hpp"
30+
#include "CFVMOutput.hpp"
3131
#include "../variables/CVariable.hpp"
3232

33-
class CFlowOutput : public COutput{
33+
class CFlowOutput : public CFVMOutput{
3434
public:
3535
/*!
3636
* \brief Constructor of the class
@@ -142,14 +142,4 @@ class CFlowOutput : public COutput{
142142
*/
143143
void LoadTimeAveragedData(unsigned long iPoint, CVariable *node_flow);
144144

145-
/*!
146-
* \brief Add common FVM outputs.
147-
*/
148-
void AddCommonFVMOutputs(const CConfig* config);
149-
150-
/*!
151-
* \brief Load common FVM outputs.
152-
*/
153-
void LoadCommonFVMOutputs(const CConfig* config, const CGeometry* geometry, unsigned long iPoint);
154-
155145
};

SU2_CFD/include/output/CHeatOutput.hpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*!
22
* \file CHeatOutput.hpp
3-
* \brief Headers of the heat output.
3+
* \brief Headers of the heat output.
44
* \author R. Sanchez, T. Albring.
55
* \version 7.1.1 "Blackbird"
66
*
@@ -27,15 +27,15 @@
2727

2828
#pragma once
2929

30-
#include "COutput.hpp"
30+
#include "CFVMOutput.hpp"
3131

3232

3333
/*! \class CHeatOutput
3434
* \brief Output class for heat problems.
3535
* \author R. Sanchez, T. Albring.
3636
* \date June 5, 2018.
3737
*/
38-
class CHeatOutput final: public COutput {
38+
class CHeatOutput final: public CFVMOutput {
3939
public:
4040

4141
/*!

SU2_CFD/include/output/CMeshOutput.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*!
22
* \file CMeshOutput.hpp
3-
* \brief Headers of the mesh output.
3+
* \brief Headers of the mesh output.
44
* \author R. Sanchez, T. Albring.
55
* \version 7.1.1 "Blackbird"
66
*

SU2_CFD/include/output/CMultizoneOutput.hpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* \file CDriverOutput.hpp
2+
* \file CMultizoneOutput.hpp
33
* \brief Headers of the main subroutines for screen and history output in multizone problems.
44
* \author R. Sanchez, T. Albring
55
* \version 7.1.1 "Blackbird"
@@ -44,7 +44,7 @@
4444
using namespace std;
4545

4646
/*!
47-
* \class CDriverOutput
47+
* \class CMultizoneOutput
4848
* \brief Class for writing the multizone output.
4949
* \author R. Sanchez, T. Albring.
5050
*/
@@ -53,7 +53,7 @@ class CMultizoneOutput final: public COutput {
5353
protected:
5454
unsigned short nZone; //!< Number of zones
5555

56-
string bgs_res_name; //!< Block-Gauss seidel residual name
56+
string bgs_res_name; //!< Block-Gauss Seidel residual name
5757
bool write_zone; //!< Boolean indicating whether the individual zones write to screen
5858

5959
public:

SU2_CFD/include/output/COutputFactory.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* \file COutput.hpp
2+
* \file COutputFactory.hpp
33
* \brief Headers of the output class.
44
* \author T.Albring
55
* \version 7.1.1 "Blackbird"

SU2_CFD/include/output/COutputLegacy.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*!
2-
* \file output.hpp
2+
* \file COutputLegacy.hpp
33
* \brief Headers of the main subroutines for generating the file outputs.
4-
* The subroutines and functions are in the <i>output_structure.cpp</i> file.
4+
* The subroutines and functions are in the <i>output_structure_legacy.cpp</i> file.
55
* \author F. Palacios, T. Economon, M. Colonno
66
* \version 7.1.1 "Blackbird"
77
*

SU2_CFD/include/variables/CVariable.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class CVariable {
7878
MatrixType Solution_Min; /*!< \brief Min solution for limiter computation. */
7979

8080
MatrixType AuxVar; /*!< \brief Auxiliary variable for gradient computation. */
81-
CVectorOfMatrix Grad_AuxVar; /*!< \brief Gradient of the auxiliary variables of the problem. */
81+
CVectorOfMatrix Grad_AuxVar; /*!< \brief Gradient of the auxiliary variables of the problem. */
8282

8383
VectorType Max_Lambda_Inv; /*!< \brief Maximun inviscid eingenvalue. */
8484
VectorType Max_Lambda_Visc; /*!< \brief Maximun viscous eingenvalue. */

SU2_CFD/obj/Makefile.am

+1
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ libSU2Core_sources = ../src/definition_structure.cpp \
136136
../src/output/output_physics.cpp \
137137
../src/output/CMeshOutput.cpp \
138138
../src/output/CElasticityOutput.cpp \
139+
../src/output/CFVMOutput.cpp \
139140
../src/output/CFlowOutput.cpp \
140141
../src/output/CFlowCompOutput.cpp \
141142
../src/output/CFlowCompFEMOutput.cpp \

SU2_CFD/src/drivers/CDiscAdjSinglezoneDriver.cpp

-12
Original file line numberDiff line numberDiff line change
@@ -345,18 +345,6 @@ void CDiscAdjSinglezoneDriver::SetObjFunction(){
345345

346346
solver[FLOW_SOL]->SetTotal_ComboObj(0.0);
347347

348-
// if (config->GetnMarker_Analyze() != 0)
349-
// output->SpecialOutput_AnalyzeSurface(solver[FLOW_SOL], geometry, config, false);
350-
351-
// if ((config->GetnMarker_Analyze() != 0) && compressible)
352-
// output->SpecialOutput_Distortion(solver[FLOW_SOL], geometry, config, false);
353-
354-
// if (config->GetnMarker_NearFieldBound() != 0)
355-
// output->SpecialOutput_SonicBoom(solver[FLOW_SOL], geometry, config, false);
356-
357-
// if (config->GetPlot_Section_Forces())
358-
// output->SpecialOutput_SpanLoad(solver[FLOW_SOL], geometry, config, false);
359-
360348
/*--- Surface based obj. function ---*/
361349

362350
solver[FLOW_SOL]->Evaluate_ObjFunc(config);

SU2_CFD/src/drivers/CMultizoneDriver.cpp

+4-7
Original file line numberDiff line numberDiff line change
@@ -139,14 +139,11 @@ CMultizoneDriver::~CMultizoneDriver(void) {
139139
void CMultizoneDriver::StartSolver() {
140140

141141
/*--- Find out the minimum of all references times and then set each zone to this (same) value.
142-
* (To ensure that all zones run synchronously in time, be it a dimensional or non-dimensionalized one.) ---*/
142+
To ensure that all zones run synchronously in time, be it a dimensional or non-dimensionalized one. ---*/
143143

144-
su2double Time_Ref = config_container[ZONE_0]->GetTime_Ref();
145-
146-
for (iZone = 1; iZone < nZone; iZone++) {
147-
if (config_container[iZone]->GetTime_Ref() < Time_Ref)
148-
Time_Ref = config_container[iZone]->GetTime_Ref();
149-
}
144+
su2double Time_Ref = std::numeric_limits<su2double>::max();
145+
for (iZone = 0; iZone < nZone; iZone++)
146+
Time_Ref = min(Time_Ref, config_container[iZone]->GetTime_Ref());
150147

151148
for (iZone = 0; iZone < nZone; iZone++) {
152149

0 commit comments

Comments
 (0)