Skip to content

Commit a5321b6

Browse files
committed
Small changes to unitquad test
1 parent 8eae4bd commit a5321b6

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

UnitTests/UnitQuadTestCase.hpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,10 @@
3131

3232
#include "../Common/include/geometry/CPhysicalGeometry.hpp"
3333
#include "../SU2_CFD/include/solvers/CSolverFactory.hpp"
34+
#include "../SU2_CFD/include/solvers/CNSSolver.hpp"
3435

3536
struct UnitQuadTestCase {
36-
const std::string config_options =
37+
std::string config_options =
3738
"SOLVER= NAVIER_STOKES\n"
3839
"KIND_VERIFICATION_SOLUTION=MMS_NS_UNIT_QUAD\n"
3940
"MESH_FORMAT= BOX\n"
@@ -42,31 +43,30 @@ struct UnitQuadTestCase {
4243
"MARKER_HEATFLUX= (y_minus, 0.0, y_plus, 0.0)\n"
4344
"MARKER_CUSTOM= ( x_minus, x_plus, z_plus, z_minus)\n"
4445
"VISCOSITY_MODEL= CONSTANT_VISCOSITY\n"
45-
"CONV_FIELD=RMS_DENSITY\n"
4646
"MESH_BOX_SIZE=5,5,5\n"
4747
"MESH_BOX_LENGTH=1,1,1\n"
4848
"MESH_BOX_OFFSET=0,0,0\n"
4949
"REF_ORIGIN_MOMENT_X=0.0\n"
5050
"REF_ORIGIN_MOMENT_Y=0.0\n"
5151
"REF_ORIGIN_MOMENT_Z=0.0\n";
52-
std::stringstream ss;
5352
std::unique_ptr<CConfig> config;
5453
std::unique_ptr<CGeometry> geometry;
5554
CSolver** solver{nullptr};
5655
streambuf* orig_buf{nullptr};
57-
UnitQuadTestCase() : ss(config_options), orig_buf(cout.rdbuf()) {}
56+
UnitQuadTestCase() : orig_buf(cout.rdbuf()) {}
5857

5958
/*!
6059
* \brief Add a line to the base config string stream
6160
* \param[in] optionLine - String containing the option(s)
6261
*/
63-
void AddOption(const std::string& optionLine) { ss << optionLine << "\n"; }
62+
void AddOption(const std::string& optionLine) { config_options += optionLine + "\n"; }
6463

6564
/*!
6665
* \brief Initialize the config structure
6766
*/
6867
void InitConfig() {
6968
cout.rdbuf(nullptr);
69+
stringstream ss(config_options);
7070
config = std::unique_ptr<CConfig>(new CConfig(ss, SU2_CFD, false));
7171
cout.rdbuf(orig_buf);
7272
}
@@ -112,7 +112,8 @@ struct UnitQuadTestCase {
112112
* \brief Desctructor
113113
*/
114114
~UnitQuadTestCase() {
115-
delete solver;
115+
if (solver != nullptr)
116+
delete solver[FLOW_SOL];
116117
delete[] solver;
117118
}
118119
};

0 commit comments

Comments
 (0)