From b5d0ed11786ca12a7671fd94836996b9fcef5d5f Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Wed, 19 May 2021 13:53:16 +0200 Subject: [PATCH 01/24] Debugging streamwise x spanwise periodicty. --- Common/src/CConfig.cpp | 4 +++- Common/src/geometry/CPhysicalGeometry.cpp | 4 ++-- SU2_CFD/src/SU2_CFD.cpp | 4 ++-- SU2_CFD/src/numerics/flow/flow_sources.cpp | 2 +- SU2_CFD/src/solvers/CIncNSSolver.cpp | 17 +++++++++++++---- SU2_CFD/src/solvers/CTurbSSTSolver.cpp | 1 + 6 files changed, 22 insertions(+), 10 deletions(-) diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index 8a51da7a7286..08ed394ad357 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -4662,7 +4662,9 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i SU2_MPI::Error("Streamwise Periodic Flow currently only implemented for incompressible flow.", CURRENT_FUNCTION); if (Kind_Solver == INC_EULER) SU2_MPI::Error("Streamwise Periodic Flow + Incompressible Euler: Not tested yet.", CURRENT_FUNCTION); - if (nMarker_PerBound != 2) + if (nMarker_PerBound == 0) + SU2_MPI::Error("A MARKER_PERIODIC pair has to be set with KIND_STREAMWISE_PERIODIC != NONE.", CURRENT_FUNCTION); + if (nMarker_PerBound != 2 && false) 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); if (Energy_Equation && Streamwise_Periodic_Temperature && nMarker_Isothermal != 0) SU2_MPI::Error("No MARKER_ISOTHERMAL marker allowed with STREAMWISE_PERIODIC_TEMPERATURE= YES, only MARKER_HEATFLUX & MARKER_SYM.", CURRENT_FUNCTION); diff --git a/Common/src/geometry/CPhysicalGeometry.cpp b/Common/src/geometry/CPhysicalGeometry.cpp index 75db70bc9099..1f8d300002fb 100644 --- a/Common/src/geometry/CPhysicalGeometry.cpp +++ b/Common/src/geometry/CPhysicalGeometry.cpp @@ -8399,11 +8399,11 @@ void CPhysicalGeometry::ComputeMeshQualityStatistics(const CConfig *config) { are close to 90 degress, poor values are typically below 20 degress. ---*/ if (nodes->GetDomain(iPoint)) { - Orthogonality[iPoint] += area*(90.0 - acos(dotProduct)*180.0/PI_NUMBER); + //Orthogonality[iPoint] += area*(90.0 - acos(dotProduct)*180.0/PI_NUMBER); SurfaceArea[iPoint] += area; } if (nodes->GetDomain(jPoint)) { - Orthogonality[jPoint] += area*(90.0 - acos(dotProduct)*180.0/PI_NUMBER); + //Orthogonality[jPoint] += area*(90.0 - acos(dotProduct)*180.0/PI_NUMBER); SurfaceArea[jPoint] += area; } diff --git a/SU2_CFD/src/SU2_CFD.cpp b/SU2_CFD/src/SU2_CFD.cpp index 99f7003d048c..49050f4b346b 100644 --- a/SU2_CFD/src/SU2_CFD.cpp +++ b/SU2_CFD/src/SU2_CFD.cpp @@ -33,7 +33,7 @@ #endif /* Include file, needed for the runtime NaN catching. You also have to include feenableexcept(...) below. */ -//#include +#include using namespace std; @@ -79,7 +79,7 @@ int main(int argc, char *argv[]) { #endif /*--- Uncomment the following line if runtime NaN catching is desired. ---*/ - // feenableexcept(FE_INVALID | FE_OVERFLOW | FE_DIVBYZERO ); + feenableexcept(FE_INVALID | FE_OVERFLOW | FE_DIVBYZERO ); /*--- Initialize libxsmm, if supported. ---*/ #ifdef HAVE_LIBXSMM diff --git a/SU2_CFD/src/numerics/flow/flow_sources.cpp b/SU2_CFD/src/numerics/flow/flow_sources.cpp index b7e583757d47..da7512418d23 100644 --- a/SU2_CFD/src/numerics/flow/flow_sources.cpp +++ b/SU2_CFD/src/numerics/flow/flow_sources.cpp @@ -713,7 +713,7 @@ CNumerics::ResidualType<> CSourceIncStreamwise_Periodic::ComputeResidual(const C residual[nDim+1] = Volume * scalar_factor * dot_product; - /*--- If a RANS turbulence model ias used an additional source term, based on the eddy viscosity gradient is added. ---*/ + /*--- If a RANS turbulence model is used, an additional source term, based on the eddy viscosity gradient is added. ---*/ if(turbulent) { /*--- Compute a scalar factor ---*/ diff --git a/SU2_CFD/src/solvers/CIncNSSolver.cpp b/SU2_CFD/src/solvers/CIncNSSolver.cpp index f1d6d54963e9..be92ed0ab35b 100644 --- a/SU2_CFD/src/solvers/CIncNSSolver.cpp +++ b/SU2_CFD/src/solvers/CIncNSSolver.cpp @@ -130,10 +130,19 @@ void CIncNSSolver::GetStreamwise_Periodic_Properties(const CGeometry *geometry, Temperature_Local = 0.0; for (auto iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - - /*--- Only "outlet"/donor periodic marker ---*/ + if (false) { + cout << "iMarker: " << iMarker << endl; + cout << "Marker Name: " << config->GetMarker_All_TagBound(iMarker) << endl; + cout << "Is Periodic: " << (config->GetMarker_All_KindBC(iMarker) == PERIODIC_BOUNDARY) << endl; + cout << "Global index for periodic bc: " << config->GetMarker_All_PerBound(iMarker) << endl; + if (iMarker < 4) cout << "GetMarker_PerBound: " << config->GetMarker_PerBound(iMarker) << endl; + cout << endl; + } + /*--- Only "outlet"/donor periodic marker. GetnMarker_Periodic counts from 1: First all the inlet marker from + the periodic marker pairs and then the all the outlets. I.e. in order to get the outlet of the first pair + we need to divide the number of periodic markers by 2 and add 1 (because count starts at 1). ---*/ if (config->GetMarker_All_KindBC(iMarker) == PERIODIC_BOUNDARY && - config->GetMarker_All_PerBound(iMarker) == 2) { + config->GetMarker_All_PerBound(iMarker) == (config->GetnMarker_Periodic()/2 + 1)) { for (auto iVertex = 0ul; iVertex < geometry->nVertex[iMarker]; iVertex++) { @@ -154,7 +163,7 @@ void CIncNSSolver::GetStreamwise_Periodic_Properties(const CGeometry *geometry, Average_Density_Local += FaceArea * nodes->GetDensity(iPoint); - /*--- Due to periodicty, temperatures are equal one the inlet(1) and outlet(2) ---*/ + /*--- Due to periodicity, temperatures are equal one the inlet(1) and outlet(2) ---*/ Temperature_Local += FaceArea * nodes->GetTemperature(iPoint); } // if domain diff --git a/SU2_CFD/src/solvers/CTurbSSTSolver.cpp b/SU2_CFD/src/solvers/CTurbSSTSolver.cpp index 6c06747d7fa4..5a5c71284859 100644 --- a/SU2_CFD/src/solvers/CTurbSSTSolver.cpp +++ b/SU2_CFD/src/solvers/CTurbSSTSolver.cpp @@ -267,6 +267,7 @@ void CTurbSSTSolver::Postprocessing(CGeometry *geometry, CSolver **solver_contai su2double kine = nodes->GetSolution(iPoint,0); su2double omega = nodes->GetSolution(iPoint,1); + if ((VorticityMag*F2==0)) {VorticityMag=1;F2=1;} su2double zeta = min(1.0/omega, a1/(VorticityMag*F2)); su2double muT = max(rho*kine*zeta,0.0); From c08535ec1e049b026058927397f87fb4c32d07c6 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Thu, 20 May 2021 20:57:20 +0200 Subject: [PATCH 02/24] small cleanup CHeatSolver --- SU2_CFD/src/solvers/CHeatSolver.cpp | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/SU2_CFD/src/solvers/CHeatSolver.cpp b/SU2_CFD/src/solvers/CHeatSolver.cpp index c845fa0e8f11..27a6941cdf69 100644 --- a/SU2_CFD/src/solvers/CHeatSolver.cpp +++ b/SU2_CFD/src/solvers/CHeatSolver.cpp @@ -1264,9 +1264,6 @@ void CHeatSolver::ExplicitEuler_Iteration(CGeometry *geometry, CSolver **solver_ void CHeatSolver::ImplicitEuler_Iteration(CGeometry *geometry, CSolver **solver_container, CConfig *config) { - unsigned long total_index; - su2double Delta, Vol, *local_Res_TruncError; - /*--- Set maximum residual to zero ---*/ SetResToZero(); @@ -1277,29 +1274,20 @@ void CHeatSolver::ImplicitEuler_Iteration(CGeometry *geometry, CSolver **solver_ /*--- Read the residual ---*/ - local_Res_TruncError = nodes->GetResTruncError(iPoint); - - /*--- Read the volume ---*/ - - Vol = geometry->nodes->GetVolume(iPoint); + su2double* local_Res_TruncError = nodes->GetResTruncError(iPoint); /*--- Modify matrix diagonal to assure diagonal dominance ---*/ if (nodes->GetDelta_Time(iPoint) != 0.0) { - if(flow) { - Delta = Vol / nodes->GetDelta_Time(iPoint); - Jacobian.AddVal2Diag(iPoint, Delta); - } - else if (heat_equation) { - Delta = Vol / nodes->GetDelta_Time(iPoint); - Jacobian.AddVal2Diag(iPoint, Delta); - } + // Identical for flow and heat + const auto Delta = geometry->nodes->GetVolume(iPoint) / nodes->GetDelta_Time(iPoint); + Jacobian.AddVal2Diag(iPoint, Delta); } else { Jacobian.SetVal2Diag(iPoint, 1.0); for (auto iVar = 0u; iVar < nVar; iVar++) { - total_index = iPoint*nVar + iVar; + const auto total_index = iPoint*nVar + iVar; LinSysRes[total_index] = 0.0; local_Res_TruncError[iVar] = 0.0; } @@ -1308,7 +1296,7 @@ void CHeatSolver::ImplicitEuler_Iteration(CGeometry *geometry, CSolver **solver_ /*--- Right hand side of the system (-Residual) and initial guess (x = 0) ---*/ for (auto iVar = 0; iVar < nVar; iVar++) { - total_index = iPoint*nVar+iVar; + const auto total_index = iPoint*nVar+iVar; LinSysRes[total_index] = - (LinSysRes[total_index] + local_Res_TruncError[iVar]); LinSysSol[total_index] = 0.0; Residual_RMS[iVar] += LinSysRes[total_index]*LinSysRes[total_index]; @@ -1320,7 +1308,7 @@ void CHeatSolver::ImplicitEuler_Iteration(CGeometry *geometry, CSolver **solver_ for (auto iPoint = nPointDomain; iPoint < nPoint; iPoint++) { for (auto iVar = 0u; iVar < nVar; iVar++) { - total_index = iPoint*nVar + iVar; + const auto total_index = iPoint*nVar + iVar; LinSysRes[total_index] = 0.0; LinSysSol[total_index] = 0.0; } From 41d1f9c65230fa6372ee06eab3ffdb53392dd407 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Thu, 20 May 2021 21:16:23 +0200 Subject: [PATCH 03/24] remove fenv debugging stuff --- Common/src/geometry/CPhysicalGeometry.cpp | 4 ++-- SU2_CFD/src/SU2_CFD.cpp | 4 ++-- SU2_CFD/src/solvers/CTurbSSTSolver.cpp | 1 - 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Common/src/geometry/CPhysicalGeometry.cpp b/Common/src/geometry/CPhysicalGeometry.cpp index 1f8d300002fb..75db70bc9099 100644 --- a/Common/src/geometry/CPhysicalGeometry.cpp +++ b/Common/src/geometry/CPhysicalGeometry.cpp @@ -8399,11 +8399,11 @@ void CPhysicalGeometry::ComputeMeshQualityStatistics(const CConfig *config) { are close to 90 degress, poor values are typically below 20 degress. ---*/ if (nodes->GetDomain(iPoint)) { - //Orthogonality[iPoint] += area*(90.0 - acos(dotProduct)*180.0/PI_NUMBER); + Orthogonality[iPoint] += area*(90.0 - acos(dotProduct)*180.0/PI_NUMBER); SurfaceArea[iPoint] += area; } if (nodes->GetDomain(jPoint)) { - //Orthogonality[jPoint] += area*(90.0 - acos(dotProduct)*180.0/PI_NUMBER); + Orthogonality[jPoint] += area*(90.0 - acos(dotProduct)*180.0/PI_NUMBER); SurfaceArea[jPoint] += area; } diff --git a/SU2_CFD/src/SU2_CFD.cpp b/SU2_CFD/src/SU2_CFD.cpp index 49050f4b346b..0eac518b5c25 100644 --- a/SU2_CFD/src/SU2_CFD.cpp +++ b/SU2_CFD/src/SU2_CFD.cpp @@ -33,7 +33,7 @@ #endif /* Include file, needed for the runtime NaN catching. You also have to include feenableexcept(...) below. */ -#include +// #include using namespace std; @@ -79,7 +79,7 @@ int main(int argc, char *argv[]) { #endif /*--- Uncomment the following line if runtime NaN catching is desired. ---*/ - feenableexcept(FE_INVALID | FE_OVERFLOW | FE_DIVBYZERO ); + // feenableexcept(FE_INVALID | FE_OVERFLOW | FE_DIVBYZERO ); /*--- Initialize libxsmm, if supported. ---*/ #ifdef HAVE_LIBXSMM diff --git a/SU2_CFD/src/solvers/CTurbSSTSolver.cpp b/SU2_CFD/src/solvers/CTurbSSTSolver.cpp index 5a5c71284859..6c06747d7fa4 100644 --- a/SU2_CFD/src/solvers/CTurbSSTSolver.cpp +++ b/SU2_CFD/src/solvers/CTurbSSTSolver.cpp @@ -267,7 +267,6 @@ void CTurbSSTSolver::Postprocessing(CGeometry *geometry, CSolver **solver_contai su2double kine = nodes->GetSolution(iPoint,0); su2double omega = nodes->GetSolution(iPoint,1); - if ((VorticityMag*F2==0)) {VorticityMag=1;F2=1;} su2double zeta = min(1.0/omega, a1/(VorticityMag*F2)); su2double muT = max(rho*kine*zeta,0.0); From ee3400834dd432a7dcb10f14e0ea1a4af04717b2 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Thu, 20 May 2021 21:57:25 +0200 Subject: [PATCH 04/24] lil'cleanup CConjugateHeatInterface --- SU2_CFD/include/interfaces/CInterface.hpp | 1 + SU2_CFD/include/variables/CVariable.hpp | 2 +- .../src/drivers/CDiscAdjSinglezoneDriver.cpp | 12 --- SU2_CFD/src/drivers/CMultizoneDriver.cpp | 2 +- .../cht/CConjugateHeatInterface.cpp | 89 +++++++------------ 5 files changed, 35 insertions(+), 71 deletions(-) diff --git a/SU2_CFD/include/interfaces/CInterface.hpp b/SU2_CFD/include/interfaces/CInterface.hpp index 0bd9e4f70fe2..ea4b487cbfb4 100644 --- a/SU2_CFD/include/interfaces/CInterface.hpp +++ b/SU2_CFD/include/interfaces/CInterface.hpp @@ -70,6 +70,7 @@ class CInterface { unsigned short nSpanMaxAllZones = 0; unsigned short nVar = 0; + static constexpr size_t MAXNDIM = 3; /*!< \brief Max number of space dimensions, used in some static arrays. */ public: /*! diff --git a/SU2_CFD/include/variables/CVariable.hpp b/SU2_CFD/include/variables/CVariable.hpp index 8f049516587a..4a3b6131511b 100644 --- a/SU2_CFD/include/variables/CVariable.hpp +++ b/SU2_CFD/include/variables/CVariable.hpp @@ -78,7 +78,7 @@ class CVariable { MatrixType Solution_Min; /*!< \brief Min solution for limiter computation. */ MatrixType AuxVar; /*!< \brief Auxiliary variable for gradient computation. */ - CVectorOfMatrix Grad_AuxVar; /*!< \brief Gradient of the auxiliary variables of the problem. */ + CVectorOfMatrix Grad_AuxVar; /*!< \brief Gradient of the auxiliary variables of the problem. */ VectorType Max_Lambda_Inv; /*!< \brief Maximun inviscid eingenvalue. */ VectorType Max_Lambda_Visc; /*!< \brief Maximun viscous eingenvalue. */ diff --git a/SU2_CFD/src/drivers/CDiscAdjSinglezoneDriver.cpp b/SU2_CFD/src/drivers/CDiscAdjSinglezoneDriver.cpp index 885d155fb2b7..657785783e85 100644 --- a/SU2_CFD/src/drivers/CDiscAdjSinglezoneDriver.cpp +++ b/SU2_CFD/src/drivers/CDiscAdjSinglezoneDriver.cpp @@ -345,18 +345,6 @@ void CDiscAdjSinglezoneDriver::SetObjFunction(){ solver[FLOW_SOL]->SetTotal_ComboObj(0.0); -// if (config->GetnMarker_Analyze() != 0) -// output->SpecialOutput_AnalyzeSurface(solver[FLOW_SOL], geometry, config, false); - -// if ((config->GetnMarker_Analyze() != 0) && compressible) -// output->SpecialOutput_Distortion(solver[FLOW_SOL], geometry, config, false); - -// if (config->GetnMarker_NearFieldBound() != 0) -// output->SpecialOutput_SonicBoom(solver[FLOW_SOL], geometry, config, false); - -// if (config->GetPlot_Section_Forces()) -// output->SpecialOutput_SpanLoad(solver[FLOW_SOL], geometry, config, false); - /*--- Surface based obj. function ---*/ solver[FLOW_SOL]->Evaluate_ObjFunc(config); diff --git a/SU2_CFD/src/drivers/CMultizoneDriver.cpp b/SU2_CFD/src/drivers/CMultizoneDriver.cpp index 707f5bf264d6..c103a577272e 100644 --- a/SU2_CFD/src/drivers/CMultizoneDriver.cpp +++ b/SU2_CFD/src/drivers/CMultizoneDriver.cpp @@ -145,7 +145,7 @@ void CMultizoneDriver::StartSolver() { for (iZone = 1; iZone < nZone; iZone++) { if (config_container[iZone]->GetTime_Ref() < Time_Ref) - Time_Ref = config_container[iZone]->GetTime_Ref(); + Time_Ref = config_container[iZone]->GetTime_Ref(); // TK:: last TimeRef is used } for (iZone = 0; iZone < nZone; iZone++) { diff --git a/SU2_CFD/src/interfaces/cht/CConjugateHeatInterface.cpp b/SU2_CFD/src/interfaces/cht/CConjugateHeatInterface.cpp index 50baa8b386de..52a10dfca43a 100644 --- a/SU2_CFD/src/interfaces/cht/CConjugateHeatInterface.cpp +++ b/SU2_CFD/src/interfaces/cht/CConjugateHeatInterface.cpp @@ -42,88 +42,62 @@ void CConjugateHeatInterface::GetDonor_Variable(CSolver *donor_solution, CGeomet const auto nDim = donor_geometry->GetnDim(); - su2double Twall, Tnormal, dTdn, rho_cp_solid, Prandtl_Lam, laminar_viscosity, - thermal_diffusivity, thermal_conductivity=0.0, thermal_conductivityND, - heat_flux_density=0.0, conductivity_over_dist=0.0; - /*--- Check whether the current zone is a solid zone or a fluid zone ---*/ - const bool compressible_flow = (donor_config->GetKind_Regime() == ENUM_REGIME::COMPRESSIBLE); const bool incompressible_flow = (donor_config->GetKind_Regime() == ENUM_REGIME::INCOMPRESSIBLE) && donor_config->GetEnergy_Equation(); - const bool heat_equation = (donor_config->GetKind_Solver() == HEAT_EQUATION) || - (donor_config->GetKind_Solver() == DISC_ADJ_HEAT); + su2double thermal_conductivity; + su2double heat_flux_density; + su2double conductivity_over_dist; + + /*--- Compute distance of donor point to PointNormal for T-gradient/heatflux computation ---*/ const auto Coord = donor_geometry->nodes->GetCoord(Point_Donor); const auto PointNormal = donor_geometry->vertex[Marker_Donor][Vertex_Donor]->GetNormal_Neighbor(); const auto Coord_Normal = donor_geometry->nodes->GetCoord(PointNormal); - Twall = 0.0; Tnormal = 0.0; dTdn = 0.0; - - su2double Edge_Vector[3] = {0.0}; + su2double Edge_Vector[MAXNDIM] = {0.0}; GeometryToolbox::Distance(nDim, Coord_Normal, Coord, Edge_Vector); - su2double dist = GeometryToolbox::Norm(nDim, Edge_Vector); + const auto dist = GeometryToolbox::Norm(nDim, Edge_Vector); /*--- Retrieve temperature solution and its gradient ---*/ - if (compressible_flow) { - - Twall = donor_solution->GetNodes()->GetPrimitive(Point_Donor,0); - Tnormal = donor_solution->GetNodes()->GetPrimitive(PointNormal,0); - - dTdn = (Twall - Tnormal)/dist; - } - else if (incompressible_flow) { - - Twall = donor_solution->GetNodes()->GetTemperature(Point_Donor); - Tnormal = donor_solution->GetNodes()->GetTemperature(PointNormal); - - dTdn = (Twall - Tnormal)/dist; - } - else if (heat_equation) { - Twall = donor_solution->GetNodes()->GetSolution(Point_Donor,0); - Tnormal = donor_solution->GetNodes()->GetSolution(PointNormal,0); - - // TODO: Check if these improve accuracy, if needed at all - // const auto Normal = donor_geometry->vertex[Marker_Donor][Vertex_Donor]->GetNormal(); - // su2double Area = GeometryToolbox::Norm(nDim, Normal); - // for (iDim = 0; iDim < nDim; iDim++) { - // dTdn += (Twall - Tnormal)/dist * (Edge_Vector[iDim]/dist) * (Normal[iDim]/Area); - // } - - dTdn = (Twall - Tnormal)/dist; - } - else { + const auto Twall = donor_solution->GetNodes()->GetTemperature(Point_Donor); + const auto Tnormal = donor_solution->GetNodes()->GetTemperature(PointNormal); - SU2_MPI::Error("Transfer of conjugate heat variables failed (non-supported donor solver).", CURRENT_FUNCTION); - } + const auto dTdn = (Twall - Tnormal)/dist; + // TODO: Check if these improve accuracy, if needed at all + // const auto Normal = donor_geometry->vertex[Marker_Donor][Vertex_Donor]->GetNormal(); + // su2double Area = GeometryToolbox::Norm(nDim, Normal); + // for (iDim = 0; iDim < nDim; iDim++) { + // dTdn += (Twall - Tnormal)/dist * (Edge_Vector[iDim]/dist) * (Normal[iDim]/Area); + // } /*--- Calculate the heat flux density (temperature gradient times thermal conductivity) ---*/ if (compressible_flow) { - su2double Gamma = donor_config->GetGamma(); - su2double Gas_Constant = donor_config->GetGas_ConstantND(); - su2double Cp = (Gamma / (Gamma - 1.0)) * Gas_Constant; + const auto Gamma = donor_config->GetGamma(); + const auto Gas_Constant = donor_config->GetGas_ConstantND(); + const auto Cp = (Gamma / (Gamma - 1.0)) * Gas_Constant; - Prandtl_Lam = donor_config->GetPrandtl_Lam(); - laminar_viscosity = donor_solution->GetNodes()->GetLaminarViscosity(Point_Donor); // TDE check for consistency - Cp = (Gamma / (Gamma - 1.0)) * Gas_Constant; + const auto Prandtl_Lam = donor_config->GetPrandtl_Lam(); + const auto laminar_viscosity = donor_solution->GetNodes()->GetLaminarViscosity(Point_Donor); // TDE check for consistency - thermal_conductivityND = Cp*(laminar_viscosity/Prandtl_Lam); - heat_flux_density = thermal_conductivityND*dTdn; + const auto thermal_conductivityND = Cp*(laminar_viscosity/Prandtl_Lam); + heat_flux_density = thermal_conductivityND*dTdn; if ((donor_config->GetKind_CHT_Coupling() == CHT_COUPLING::DIRECT_TEMPERATURE_ROBIN_HEATFLUX) || (donor_config->GetKind_CHT_Coupling() == CHT_COUPLING::AVERAGED_TEMPERATURE_ROBIN_HEATFLUX)) { - thermal_conductivity = thermal_conductivityND*donor_config->GetViscosity_Ref(); - conductivity_over_dist = thermal_conductivity/dist; + thermal_conductivity = thermal_conductivityND*donor_config->GetViscosity_Ref(); + conductivity_over_dist = thermal_conductivity/dist; } } else if (incompressible_flow) { const auto iPoint = donor_geometry->vertex[Marker_Donor][Vertex_Donor]->GetNode(); - thermal_conductivityND = donor_solution->GetNodes()->GetThermalConductivity(iPoint); + const auto thermal_conductivityND = donor_solution->GetNodes()->GetThermalConductivity(iPoint); heat_flux_density = thermal_conductivityND*dTdn; if ((donor_config->GetKind_CHT_Coupling() == CHT_COUPLING::DIRECT_TEMPERATURE_ROBIN_HEATFLUX) || @@ -140,24 +114,25 @@ void CConjugateHeatInterface::GetDonor_Variable(CSolver *donor_solution, CGeomet *donor_config->GetViscosity_Ref(); break; - default: + case CONDUCTIVITYMODEL::POLYNOMIAL: + SU2_MPI::Error("Polynomial Conductivity model not implemented for CHT interface.", CURRENT_FUNCTION); break; } conductivity_over_dist = thermal_conductivity/dist; } } - else if (heat_equation) { + else if (donor_config->GetHeatProblem()) { /*--- Heat solver stand-alone case ---*/ - thermal_diffusivity = donor_config->GetThermalDiffusivity_Solid(); - heat_flux_density = thermal_diffusivity*dTdn; + const auto thermal_diffusivity = donor_config->GetThermalDiffusivity_Solid(); + heat_flux_density = thermal_diffusivity*dTdn; if ((donor_config->GetKind_CHT_Coupling() == CHT_COUPLING::DIRECT_TEMPERATURE_ROBIN_HEATFLUX) || (donor_config->GetKind_CHT_Coupling() == CHT_COUPLING::AVERAGED_TEMPERATURE_ROBIN_HEATFLUX)) { - rho_cp_solid = donor_config->GetSpecific_Heat_Cp()*donor_config->GetDensity_Solid(); + const auto rho_cp_solid = donor_config->GetSpecific_Heat_Cp()*donor_config->GetDensity_Solid(); conductivity_over_dist = thermal_diffusivity*rho_cp_solid/dist; } } From 97455a1e100db776ebe9b111b1f1d2951ecb17a7 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Thu, 20 May 2021 21:59:54 +0200 Subject: [PATCH 05/24] remove debug output --- SU2_CFD/src/solvers/CIncNSSolver.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/SU2_CFD/src/solvers/CIncNSSolver.cpp b/SU2_CFD/src/solvers/CIncNSSolver.cpp index be92ed0ab35b..c085b8b629da 100644 --- a/SU2_CFD/src/solvers/CIncNSSolver.cpp +++ b/SU2_CFD/src/solvers/CIncNSSolver.cpp @@ -130,17 +130,10 @@ void CIncNSSolver::GetStreamwise_Periodic_Properties(const CGeometry *geometry, Temperature_Local = 0.0; for (auto iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - if (false) { - cout << "iMarker: " << iMarker << endl; - cout << "Marker Name: " << config->GetMarker_All_TagBound(iMarker) << endl; - cout << "Is Periodic: " << (config->GetMarker_All_KindBC(iMarker) == PERIODIC_BOUNDARY) << endl; - cout << "Global index for periodic bc: " << config->GetMarker_All_PerBound(iMarker) << endl; - if (iMarker < 4) cout << "GetMarker_PerBound: " << config->GetMarker_PerBound(iMarker) << endl; - cout << endl; - } + /*--- Only "outlet"/donor periodic marker. GetnMarker_Periodic counts from 1: First all the inlet marker from - the periodic marker pairs and then the all the outlets. I.e. in order to get the outlet of the first pair - we need to divide the number of periodic markers by 2 and add 1 (because count starts at 1). ---*/ + the periodic marker pairs and then the all the outlets. I.e. in order to get the outlet of the first pair + we need to divide the number of periodic markers by 2 and add 1 (because count starts at 1). ---*/ if (config->GetMarker_All_KindBC(iMarker) == PERIODIC_BOUNDARY && config->GetMarker_All_PerBound(iMarker) == (config->GetnMarker_Periodic()/2 + 1)) { From 465a75a8a244eab77d3f8f7e65242579d166a453 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Thu, 20 May 2021 22:10:00 +0200 Subject: [PATCH 06/24] Maybe uninitialized fix --- SU2_CFD/src/interfaces/cht/CConjugateHeatInterface.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SU2_CFD/src/interfaces/cht/CConjugateHeatInterface.cpp b/SU2_CFD/src/interfaces/cht/CConjugateHeatInterface.cpp index 52a10dfca43a..22309bab59f5 100644 --- a/SU2_CFD/src/interfaces/cht/CConjugateHeatInterface.cpp +++ b/SU2_CFD/src/interfaces/cht/CConjugateHeatInterface.cpp @@ -47,8 +47,8 @@ void CConjugateHeatInterface::GetDonor_Variable(CSolver *donor_solution, CGeomet const bool incompressible_flow = (donor_config->GetKind_Regime() == ENUM_REGIME::INCOMPRESSIBLE) && donor_config->GetEnergy_Equation(); su2double thermal_conductivity; - su2double heat_flux_density; - su2double conductivity_over_dist; + su2double heat_flux_density = 0.0; + su2double conductivity_over_dist 0.0; /*--- Compute distance of donor point to PointNormal for T-gradient/heatflux computation ---*/ const auto Coord = donor_geometry->nodes->GetCoord(Point_Donor); From 953508f66b9b1b224572188f6f99939a071f5eaa Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Thu, 20 May 2021 22:21:30 +0200 Subject: [PATCH 07/24] I should build locally before I push... --- SU2_CFD/src/interfaces/cht/CConjugateHeatInterface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SU2_CFD/src/interfaces/cht/CConjugateHeatInterface.cpp b/SU2_CFD/src/interfaces/cht/CConjugateHeatInterface.cpp index 22309bab59f5..b5cb6eee3a8b 100644 --- a/SU2_CFD/src/interfaces/cht/CConjugateHeatInterface.cpp +++ b/SU2_CFD/src/interfaces/cht/CConjugateHeatInterface.cpp @@ -48,7 +48,7 @@ void CConjugateHeatInterface::GetDonor_Variable(CSolver *donor_solution, CGeomet su2double thermal_conductivity; su2double heat_flux_density = 0.0; - su2double conductivity_over_dist 0.0; + su2double conductivity_over_dist = 0.0; /*--- Compute distance of donor point to PointNormal for T-gradient/heatflux computation ---*/ const auto Coord = donor_geometry->nodes->GetCoord(Point_Donor); From 8968a1bceda672c7e7c32da91a4a136bbbda849e Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Fri, 21 May 2021 00:10:33 +0200 Subject: [PATCH 08/24] fml --- SU2_CFD/src/interfaces/cht/CConjugateHeatInterface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SU2_CFD/src/interfaces/cht/CConjugateHeatInterface.cpp b/SU2_CFD/src/interfaces/cht/CConjugateHeatInterface.cpp index b5cb6eee3a8b..2ce47ae1933f 100644 --- a/SU2_CFD/src/interfaces/cht/CConjugateHeatInterface.cpp +++ b/SU2_CFD/src/interfaces/cht/CConjugateHeatInterface.cpp @@ -46,7 +46,7 @@ void CConjugateHeatInterface::GetDonor_Variable(CSolver *donor_solution, CGeomet const bool compressible_flow = (donor_config->GetKind_Regime() == ENUM_REGIME::COMPRESSIBLE); const bool incompressible_flow = (donor_config->GetKind_Regime() == ENUM_REGIME::INCOMPRESSIBLE) && donor_config->GetEnergy_Equation(); - su2double thermal_conductivity; + su2double thermal_conductivity = 0.0; su2double heat_flux_density = 0.0; su2double conductivity_over_dist = 0.0; From 02442b6d2e0d59edf9b87dd30a69dafec76a1ffa Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Mon, 31 May 2021 16:11:36 +0200 Subject: [PATCH 09/24] Replace auto-type with su2double for introduced changes --- Common/src/CConfig.cpp | 2 -- SU2_CFD/src/SU2_CFD.cpp | 2 +- .../cht/CConjugateHeatInterface.cpp | 26 +++++++++---------- 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index 08ed394ad357..3ad89a515039 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -4664,8 +4664,6 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i SU2_MPI::Error("Streamwise Periodic Flow + Incompressible Euler: Not tested yet.", CURRENT_FUNCTION); if (nMarker_PerBound == 0) SU2_MPI::Error("A MARKER_PERIODIC pair has to be set with KIND_STREAMWISE_PERIODIC != NONE.", CURRENT_FUNCTION); - if (nMarker_PerBound != 2 && false) - 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); if (Energy_Equation && Streamwise_Periodic_Temperature && nMarker_Isothermal != 0) SU2_MPI::Error("No MARKER_ISOTHERMAL marker allowed with STREAMWISE_PERIODIC_TEMPERATURE= YES, only MARKER_HEATFLUX & MARKER_SYM.", CURRENT_FUNCTION); if (DiscreteAdjoint && Kind_Streamwise_Periodic == ENUM_STREAMWISE_PERIODIC::MASSFLOW) diff --git a/SU2_CFD/src/SU2_CFD.cpp b/SU2_CFD/src/SU2_CFD.cpp index 0eac518b5c25..99f7003d048c 100644 --- a/SU2_CFD/src/SU2_CFD.cpp +++ b/SU2_CFD/src/SU2_CFD.cpp @@ -33,7 +33,7 @@ #endif /* Include file, needed for the runtime NaN catching. You also have to include feenableexcept(...) below. */ -// #include +//#include using namespace std; diff --git a/SU2_CFD/src/interfaces/cht/CConjugateHeatInterface.cpp b/SU2_CFD/src/interfaces/cht/CConjugateHeatInterface.cpp index 2ce47ae1933f..bcd03bfa17bb 100644 --- a/SU2_CFD/src/interfaces/cht/CConjugateHeatInterface.cpp +++ b/SU2_CFD/src/interfaces/cht/CConjugateHeatInterface.cpp @@ -57,14 +57,14 @@ void CConjugateHeatInterface::GetDonor_Variable(CSolver *donor_solution, CGeomet su2double Edge_Vector[MAXNDIM] = {0.0}; GeometryToolbox::Distance(nDim, Coord_Normal, Coord, Edge_Vector); - const auto dist = GeometryToolbox::Norm(nDim, Edge_Vector); + const su2double dist = GeometryToolbox::Norm(nDim, Edge_Vector); /*--- Retrieve temperature solution and its gradient ---*/ - const auto Twall = donor_solution->GetNodes()->GetTemperature(Point_Donor); - const auto Tnormal = donor_solution->GetNodes()->GetTemperature(PointNormal); + const su2double Twall = donor_solution->GetNodes()->GetTemperature(Point_Donor); + const su2double Tnormal = donor_solution->GetNodes()->GetTemperature(PointNormal); - const auto dTdn = (Twall - Tnormal)/dist; + const su2double dTdn = (Twall - Tnormal)/dist; // TODO: Check if these improve accuracy, if needed at all // const auto Normal = donor_geometry->vertex[Marker_Donor][Vertex_Donor]->GetNormal(); // su2double Area = GeometryToolbox::Norm(nDim, Normal); @@ -76,14 +76,14 @@ void CConjugateHeatInterface::GetDonor_Variable(CSolver *donor_solution, CGeomet if (compressible_flow) { - const auto Gamma = donor_config->GetGamma(); - const auto Gas_Constant = donor_config->GetGas_ConstantND(); - const auto Cp = (Gamma / (Gamma - 1.0)) * Gas_Constant; + const su2double Gamma = donor_config->GetGamma(); + const su2double Gas_Constant = donor_config->GetGas_ConstantND(); + const su2double Cp = (Gamma / (Gamma - 1.0)) * Gas_Constant; - const auto Prandtl_Lam = donor_config->GetPrandtl_Lam(); - const auto laminar_viscosity = donor_solution->GetNodes()->GetLaminarViscosity(Point_Donor); // TDE check for consistency + const su2double Prandtl_Lam = donor_config->GetPrandtl_Lam(); + const su2double laminar_viscosity = donor_solution->GetNodes()->GetLaminarViscosity(Point_Donor); // TDE check for consistency - const auto thermal_conductivityND = Cp*(laminar_viscosity/Prandtl_Lam); + const su2double thermal_conductivityND = Cp*(laminar_viscosity/Prandtl_Lam); heat_flux_density = thermal_conductivityND*dTdn; if ((donor_config->GetKind_CHT_Coupling() == CHT_COUPLING::DIRECT_TEMPERATURE_ROBIN_HEATFLUX) || @@ -97,7 +97,7 @@ void CConjugateHeatInterface::GetDonor_Variable(CSolver *donor_solution, CGeomet const auto iPoint = donor_geometry->vertex[Marker_Donor][Vertex_Donor]->GetNode(); - const auto thermal_conductivityND = donor_solution->GetNodes()->GetThermalConductivity(iPoint); + const su2double thermal_conductivityND = donor_solution->GetNodes()->GetThermalConductivity(iPoint); heat_flux_density = thermal_conductivityND*dTdn; if ((donor_config->GetKind_CHT_Coupling() == CHT_COUPLING::DIRECT_TEMPERATURE_ROBIN_HEATFLUX) || @@ -126,13 +126,13 @@ void CConjugateHeatInterface::GetDonor_Variable(CSolver *donor_solution, CGeomet /*--- Heat solver stand-alone case ---*/ - const auto thermal_diffusivity = donor_config->GetThermalDiffusivity_Solid(); + const su2double thermal_diffusivity = donor_config->GetThermalDiffusivity_Solid(); heat_flux_density = thermal_diffusivity*dTdn; if ((donor_config->GetKind_CHT_Coupling() == CHT_COUPLING::DIRECT_TEMPERATURE_ROBIN_HEATFLUX) || (donor_config->GetKind_CHT_Coupling() == CHT_COUPLING::AVERAGED_TEMPERATURE_ROBIN_HEATFLUX)) { - const auto rho_cp_solid = donor_config->GetSpecific_Heat_Cp()*donor_config->GetDensity_Solid(); + const su2double rho_cp_solid = donor_config->GetSpecific_Heat_Cp()*donor_config->GetDensity_Solid(); conductivity_over_dist = thermal_diffusivity*rho_cp_solid/dist; } } From 0e1e58ff16caae92916e2d850f3186df998a6bc1 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Wed, 2 Jun 2021 14:12:57 +0200 Subject: [PATCH 10/24] Change Multizone TimeRef. Tiny changes in CHTinterface. --- SU2_CFD/src/drivers/CMultizoneDriver.cpp | 2 +- .../cht/CConjugateHeatInterface.cpp | 20 +++++++++---------- .../chtMaster.cfg | 2 +- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/SU2_CFD/src/drivers/CMultizoneDriver.cpp b/SU2_CFD/src/drivers/CMultizoneDriver.cpp index b591a75fbd03..421a75dc344e 100644 --- a/SU2_CFD/src/drivers/CMultizoneDriver.cpp +++ b/SU2_CFD/src/drivers/CMultizoneDriver.cpp @@ -145,7 +145,7 @@ void CMultizoneDriver::StartSolver() { for (iZone = 1; iZone < nZone; iZone++) { if (config_container[iZone]->GetTime_Ref() < Time_Ref) - Time_Ref = config_container[iZone]->GetTime_Ref(); // TK:: last TimeRef is used + Time_Ref = min(Time_Ref, config_container[iZone]->GetTime_Ref()); } for (iZone = 0; iZone < nZone; iZone++) { diff --git a/SU2_CFD/src/interfaces/cht/CConjugateHeatInterface.cpp b/SU2_CFD/src/interfaces/cht/CConjugateHeatInterface.cpp index bcd03bfa17bb..9996f85c410f 100644 --- a/SU2_CFD/src/interfaces/cht/CConjugateHeatInterface.cpp +++ b/SU2_CFD/src/interfaces/cht/CConjugateHeatInterface.cpp @@ -40,17 +40,8 @@ void CConjugateHeatInterface::GetDonor_Variable(CSolver *donor_solution, CGeomet const CConfig *donor_config, unsigned long Marker_Donor, unsigned long Vertex_Donor, unsigned long Point_Donor) { - const auto nDim = donor_geometry->GetnDim(); - - /*--- Check whether the current zone is a solid zone or a fluid zone ---*/ - const bool compressible_flow = (donor_config->GetKind_Regime() == ENUM_REGIME::COMPRESSIBLE); - const bool incompressible_flow = (donor_config->GetKind_Regime() == ENUM_REGIME::INCOMPRESSIBLE) && donor_config->GetEnergy_Equation(); - - su2double thermal_conductivity = 0.0; - su2double heat_flux_density = 0.0; - su2double conductivity_over_dist = 0.0; - /*--- Compute distance of donor point to PointNormal for T-gradient/heatflux computation ---*/ + const auto nDim = donor_geometry->GetnDim(); const auto Coord = donor_geometry->nodes->GetCoord(Point_Donor); const auto PointNormal = donor_geometry->vertex[Marker_Donor][Vertex_Donor]->GetNormal_Neighbor(); const auto Coord_Normal = donor_geometry->nodes->GetCoord(PointNormal); @@ -72,7 +63,14 @@ void CConjugateHeatInterface::GetDonor_Variable(CSolver *donor_solution, CGeomet // dTdn += (Twall - Tnormal)/dist * (Edge_Vector[iDim]/dist) * (Normal[iDim]/Area); // } - /*--- Calculate the heat flux density (temperature gradient times thermal conductivity) ---*/ + /*--- Calculate the heat flux density (temperature gradient times thermal conductivity) and + thermal conductivity divided by distance. ---*/ + su2double thermal_conductivity = 0.0; + su2double heat_flux_density = 0.0; + su2double conductivity_over_dist = 0.0; + + const bool compressible_flow = (donor_config->GetKind_Regime() == ENUM_REGIME::COMPRESSIBLE); + const bool incompressible_flow = (donor_config->GetKind_Regime() == ENUM_REGIME::INCOMPRESSIBLE) && donor_config->GetEnergy_Equation(); if (compressible_flow) { diff --git a/TestCases/coupled_cht/disc_adj_unsteadyCHT_cylinder/chtMaster.cfg b/TestCases/coupled_cht/disc_adj_unsteadyCHT_cylinder/chtMaster.cfg index 6821416134a5..a32ece5723b8 100644 --- a/TestCases/coupled_cht/disc_adj_unsteadyCHT_cylinder/chtMaster.cfg +++ b/TestCases/coupled_cht/disc_adj_unsteadyCHT_cylinder/chtMaster.cfg @@ -44,7 +44,7 @@ SCREEN_WRT_FREQ_OUTER= 50 % HISTORY_OUTPUT= ( ITER, BGS_RES[0], RMS_RES[0], BGS_RES[1], RMS_RES[1],\ FLOW_COEFF[0], HEAT[0], AERO_COEFF[0], HEAT[1],\ - LINSOL[0], LINSOL[1]) + LINSOL[0], LINSOL[1], TAVG_HEAT[1]) % OUTPUT_FILES= (RESTART, PARAVIEW) OUTPUT_WRT_FREQ= 1 From cae07a649ee9d66368cba4d37b7ceaf762f05166 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Wed, 2 Jun 2021 15:54:03 +0200 Subject: [PATCH 11/24] Add CFVMOutput and move CommonOutput there. --- SU2_CFD/include/output/CFVMOutput.hpp | 55 ++++++++++++++++++ SU2_CFD/include/output/CFlowOutput.hpp | 14 +---- SU2_CFD/include/output/CHeatOutput.hpp | 4 +- SU2_CFD/src/drivers/CMultizoneDriver.cpp | 2 +- SU2_CFD/src/meson.build | 1 + SU2_CFD/src/output/CFVMOutput.cpp | 71 ++++++++++++++++++++++++ SU2_CFD/src/output/CFlowOutput.cpp | 38 +------------ SU2_CFD/src/output/CHeatOutput.cpp | 20 +------ 8 files changed, 136 insertions(+), 69 deletions(-) create mode 100644 SU2_CFD/include/output/CFVMOutput.hpp create mode 100644 SU2_CFD/src/output/CFVMOutput.cpp diff --git a/SU2_CFD/include/output/CFVMOutput.hpp b/SU2_CFD/include/output/CFVMOutput.hpp new file mode 100644 index 000000000000..6b9c4c39380e --- /dev/null +++ b/SU2_CFD/include/output/CFVMOutput.hpp @@ -0,0 +1,55 @@ +/*! + * \file CFlowOutput.hpp + * \brief Headers of the Finite Volume Method output. + * \author T. Kattmann + * \version 7.1.1 "Blackbird" + * + * SU2 Project Website: https://su2code.github.io + * + * The SU2 Project is maintained by the SU2 Foundation + * (http://su2foundation.org) + * + * Copyright 2012-2021, SU2 Contributors (cf. AUTHORS.md) + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ + +#pragma once + +#include "COutput.hpp" + +class CFVMOutput : public COutput{ +public: + /*! + * \brief Constructor of the class + */ + CFVMOutput(CConfig *config, unsigned short nDim, bool femOutput); + + /*! + * \brief Destructor of the class. + */ + ~CFVMOutput(void) override; + +protected: + + /*! + * \brief Add common FVM outputs. + */ + void AddCommonFVMOutputs(const CConfig* config); + + /*! + * \brief Load common FVM outputs. + */ + void LoadCommonFVMOutputs(const CConfig* config, const CGeometry* geometry, unsigned long iPoint); +}; diff --git a/SU2_CFD/include/output/CFlowOutput.hpp b/SU2_CFD/include/output/CFlowOutput.hpp index 8e15d607ae1d..b5665420442c 100644 --- a/SU2_CFD/include/output/CFlowOutput.hpp +++ b/SU2_CFD/include/output/CFlowOutput.hpp @@ -27,10 +27,10 @@ #pragma once -#include "COutput.hpp" +#include "CFVMOutput.hpp" #include "../variables/CVariable.hpp" -class CFlowOutput : public COutput{ +class CFlowOutput : public CFVMOutput{ public: /*! * \brief Constructor of the class @@ -142,14 +142,4 @@ class CFlowOutput : public COutput{ */ void LoadTimeAveragedData(unsigned long iPoint, CVariable *node_flow); - /*! - * \brief Add common FVM outputs. - */ - void AddCommonFVMOutputs(const CConfig* config); - - /*! - * \brief Load common FVM outputs. - */ - void LoadCommonFVMOutputs(const CConfig* config, const CGeometry* geometry, unsigned long iPoint); - }; diff --git a/SU2_CFD/include/output/CHeatOutput.hpp b/SU2_CFD/include/output/CHeatOutput.hpp index cb9b2b1b0f4e..279d5658ad87 100644 --- a/SU2_CFD/include/output/CHeatOutput.hpp +++ b/SU2_CFD/include/output/CHeatOutput.hpp @@ -27,7 +27,7 @@ #pragma once -#include "COutput.hpp" +#include "CFVMOutput.hpp" /*! \class CHeatOutput @@ -35,7 +35,7 @@ * \author R. Sanchez, T. Albring. * \date June 5, 2018. */ -class CHeatOutput final: public COutput { +class CHeatOutput final: public CFVMOutput { public: /*! diff --git a/SU2_CFD/src/drivers/CMultizoneDriver.cpp b/SU2_CFD/src/drivers/CMultizoneDriver.cpp index 421a75dc344e..cb904f1a143a 100644 --- a/SU2_CFD/src/drivers/CMultizoneDriver.cpp +++ b/SU2_CFD/src/drivers/CMultizoneDriver.cpp @@ -139,7 +139,7 @@ CMultizoneDriver::~CMultizoneDriver(void) { void CMultizoneDriver::StartSolver() { /*--- Find out the minimum of all references times and then set each zone to this (same) value. - * (To ensure that all zones run synchronously in time, be it a dimensional or non-dimensionalized one.) ---*/ + To ensure that all zones run synchronously in time, be it a dimensional or non-dimensionalized one. ---*/ su2double Time_Ref = config_container[ZONE_0]->GetTime_Ref(); diff --git a/SU2_CFD/src/meson.build b/SU2_CFD/src/meson.build index ee288818ef4e..736100a1b812 100644 --- a/SU2_CFD/src/meson.build +++ b/SU2_CFD/src/meson.build @@ -21,6 +21,7 @@ su2_cfd_src += files(['output/COutputFactory.cpp', 'output/CElasticityOutput.cpp', 'output/CFlowCompOutput.cpp', 'output/CFlowCompFEMOutput.cpp', + 'output/CFVMOutput.cpp', 'output/CFlowOutput.cpp', 'output/CFlowIncOutput.cpp', 'output/CHeatOutput.cpp', diff --git a/SU2_CFD/src/output/CFVMOutput.cpp b/SU2_CFD/src/output/CFVMOutput.cpp new file mode 100644 index 000000000000..91ce6cb1afac --- /dev/null +++ b/SU2_CFD/src/output/CFVMOutput.cpp @@ -0,0 +1,71 @@ +/*! + * \file output_flow.cpp + * \brief Main subroutines for Finite Volume Method output + * \author T. Kattmann + * \version 7.1.1 "Blackbird" + * + * SU2 Project Website: https://su2code.github.io + * + * The SU2 Project is maintained by the SU2 Foundation + * (http://su2foundation.org) + * + * Copyright 2012-2021, SU2 Contributors (cf. AUTHORS.md) + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ + +#include "../../include/output/CFVMOutput.hpp" +#include "../../../Common/include/geometry/CGeometry.hpp" + + +CFVMOutput::CFVMOutput(CConfig *config, unsigned short nDim, bool fem_output) : COutput (config, nDim, fem_output){ } + +CFVMOutput::~CFVMOutput(void){ } + +void CFVMOutput::AddCommonFVMOutputs(const CConfig *config) { + + // Mesh quality metrics + AddVolumeOutput("ORTHOGONALITY", "Orthogonality", "MESH_QUALITY", "Orthogonality Angle (deg.)"); + AddVolumeOutput("ASPECT_RATIO", "Aspect_Ratio", "MESH_QUALITY", "CV Face Area Aspect Ratio"); + AddVolumeOutput("VOLUME_RATIO", "Volume_Ratio", "MESH_QUALITY", "CV Sub-Volume Ratio"); + + AddVolumeOutput("RANK", "rank", "MPI", "Rank of the MPI-partition"); + + for (auto iMesh = 1u; iMesh <= config->GetnMGLevels(); ++iMesh) { + stringstream key, name; + key << "MG_" << iMesh; + name << "Coarse_Grid_" << iMesh; + AddVolumeOutput(key.str(), name.str(), "MULTIGRID", "Coarse mesh"); + } +} + +void CFVMOutput::LoadCommonFVMOutputs(const CConfig* config, const CGeometry* geometry, unsigned long iPoint) { + + // Mesh quality metrics, computed in CPhysicalGeometry::ComputeMeshQualityStatistics. + if (config->GetWrt_MeshQuality()) { + SetVolumeOutputValue("ORTHOGONALITY", iPoint, geometry->Orthogonality[iPoint]); + SetVolumeOutputValue("ASPECT_RATIO", iPoint, geometry->Aspect_Ratio[iPoint]); + SetVolumeOutputValue("VOLUME_RATIO", iPoint, geometry->Volume_Ratio[iPoint]); + } + + SetVolumeOutputValue("RANK", iPoint, rank); + + if (config->GetWrt_MultiGrid()) { + for (auto iMesh = 1u; iMesh <= config->GetnMGLevels(); ++iMesh) { + stringstream key; + key << "MG_" << iMesh; + SetVolumeOutputValue(key.str(), iPoint, geometry->CoarseGridColor(iPoint,iMesh-1)); + } + } +} diff --git a/SU2_CFD/src/output/CFlowOutput.cpp b/SU2_CFD/src/output/CFlowOutput.cpp index 815b400b13a4..57967e29df0c 100644 --- a/SU2_CFD/src/output/CFlowOutput.cpp +++ b/SU2_CFD/src/output/CFlowOutput.cpp @@ -30,11 +30,10 @@ #include "../../../Common/include/toolboxes/geometry_toolbox.hpp" #include "../../include/solvers/CSolver.hpp" -CFlowOutput::CFlowOutput(CConfig *config, unsigned short nDim, bool fem_output) : COutput (config, nDim, fem_output){ +CFlowOutput::CFlowOutput(CConfig *config, unsigned short nDim, bool fem_output) : CFVMOutput (config, nDim, fem_output){ } - CFlowOutput::~CFlowOutput(void){} void CFlowOutput::AddAnalyzeSurfaceOutput(CConfig *config){ @@ -2735,41 +2734,6 @@ bool CFlowOutput::WriteVolume_Output(CConfig *config, unsigned long Iter, bool f return false || force_writing; } -void CFlowOutput::AddCommonFVMOutputs(const CConfig *config) { - - AddVolumeOutput("ORTHOGONALITY", "Orthogonality", "MESH_QUALITY", "Orthogonality Angle (deg.)"); - AddVolumeOutput("ASPECT_RATIO", "Aspect_Ratio", "MESH_QUALITY", "CV Face Area Aspect Ratio"); - AddVolumeOutput("VOLUME_RATIO", "Volume_Ratio", "MESH_QUALITY", "CV Sub-Volume Ratio"); - - AddVolumeOutput("RANK", "rank", "MPI", "Rank of the MPI-partition"); - - for (auto iMesh = 1u; iMesh <= config->GetnMGLevels(); ++iMesh) { - stringstream key, name; - key << "MG_" << iMesh; - name << "Coarse_Grid_" << iMesh; - AddVolumeOutput(key.str(), name.str(), "MULTIGRID", "Coarse mesh"); - } -} - -void CFlowOutput::LoadCommonFVMOutputs(const CConfig* config, const CGeometry* geometry, unsigned long iPoint) { - - if (config->GetWrt_MeshQuality()) { - SetVolumeOutputValue("ORTHOGONALITY", iPoint, geometry->Orthogonality[iPoint]); - SetVolumeOutputValue("ASPECT_RATIO", iPoint, geometry->Aspect_Ratio[iPoint]); - SetVolumeOutputValue("VOLUME_RATIO", iPoint, geometry->Volume_Ratio[iPoint]); - } - - SetVolumeOutputValue("RANK", iPoint, rank); - - if (config->GetWrt_MultiGrid()) { - for (auto iMesh = 1u; iMesh <= config->GetnMGLevels(); ++iMesh) { - stringstream key; - key << "MG_" << iMesh; - SetVolumeOutputValue(key.str(), iPoint, geometry->CoarseGridColor(iPoint,iMesh-1)); - } - } -} - void CFlowOutput::SetTimeAveragedFields(){ AddVolumeOutput("MEAN_DENSITY", "MeanDensity", "TIME_AVERAGE", "Mean density"); AddVolumeOutput("MEAN_VELOCITY-X", "MeanVelocity_x", "TIME_AVERAGE", "Mean velocity x-component"); diff --git a/SU2_CFD/src/output/CHeatOutput.cpp b/SU2_CFD/src/output/CHeatOutput.cpp index 831c2afa98b1..41b782b06f08 100644 --- a/SU2_CFD/src/output/CHeatOutput.cpp +++ b/SU2_CFD/src/output/CHeatOutput.cpp @@ -30,7 +30,7 @@ #include "../../../Common/include/geometry/CGeometry.hpp" #include "../../include/solvers/CSolver.hpp" -CHeatOutput::CHeatOutput(CConfig *config, unsigned short nDim) : COutput(config, nDim, false) { +CHeatOutput::CHeatOutput(CConfig *config, unsigned short nDim) : CFVMOutput(config, nDim, false) { multiZone = config->GetMultizone_Problem(); @@ -131,13 +131,7 @@ void CHeatOutput::SetVolumeOutputFields(CConfig *config){ // Residuals AddVolumeOutput("RES_TEMPERATURE", "Residual_Temperature", "RESIDUAL", "Residual of the temperature"); - // Mesh quality metrics, computed in CPhysicalGeometry::ComputeMeshQualityStatistics. - AddVolumeOutput("ORTHOGONALITY", "Orthogonality", "MESH_QUALITY", "Orthogonality Angle (deg.)"); - AddVolumeOutput("ASPECT_RATIO", "Aspect_Ratio", "MESH_QUALITY", "CV Face Area Aspect Ratio"); - AddVolumeOutput("VOLUME_RATIO", "Volume_Ratio", "MESH_QUALITY", "CV Sub-Volume Ratio"); - - // MPI-Rank - AddVolumeOutput("RANK", "rank", "MPI", "Rank of the MPI-partition"); + AddCommonFVMOutputs(config); } @@ -158,15 +152,7 @@ void CHeatOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolver * // Residuals SetVolumeOutputValue("RES_TEMPERATURE", iPoint, solver[HEAT_SOL]->LinSysRes(iPoint, 0)); - // Mesh quality metrics - if (config->GetWrt_MeshQuality()) { - SetVolumeOutputValue("ORTHOGONALITY", iPoint, geometry->Orthogonality[iPoint]); - SetVolumeOutputValue("ASPECT_RATIO", iPoint, geometry->Aspect_Ratio[iPoint]); - SetVolumeOutputValue("VOLUME_RATIO", iPoint, geometry->Volume_Ratio[iPoint]); - } - - // MPI-Rank - SetVolumeOutputValue("RANK", iPoint, rank); + LoadCommonFVMOutputs(config, geometry, iPoint); } void CHeatOutput::LoadSurfaceData(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned long iPoint, unsigned short iMarker, unsigned long iVertex){ From 43e369083ef778805b7533ea82158f59b6a8fe7f Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Wed, 2 Jun 2021 18:06:12 +0200 Subject: [PATCH 12/24] Add Coord-XYZ to fresh CFVMOutput and therefore remove that from individual FVM outputs. --- SU2_CFD/src/output/CFVMOutput.cpp | 14 ++++++++++++++ SU2_CFD/src/output/CFlowCompOutput.cpp | 20 +++++--------------- SU2_CFD/src/output/CFlowIncOutput.cpp | 19 +++++-------------- SU2_CFD/src/output/CHeatOutput.cpp | 23 ++++++----------------- SU2_CFD/src/output/CNEMOCompOutput.cpp | 20 +++++--------------- 5 files changed, 35 insertions(+), 61 deletions(-) diff --git a/SU2_CFD/src/output/CFVMOutput.cpp b/SU2_CFD/src/output/CFVMOutput.cpp index 91ce6cb1afac..05062753bf8a 100644 --- a/SU2_CFD/src/output/CFVMOutput.cpp +++ b/SU2_CFD/src/output/CFVMOutput.cpp @@ -35,6 +35,12 @@ CFVMOutput::~CFVMOutput(void){ } void CFVMOutput::AddCommonFVMOutputs(const CConfig *config) { + // Grid coordinates + AddVolumeOutput("COORD-X", "x", "COORDINATES", "x-component of the coordinate vector"); + AddVolumeOutput("COORD-Y", "y", "COORDINATES", "y-component of the coordinate vector"); + if (nDim == 3) + AddVolumeOutput("COORD-Z", "z", "COORDINATES","z-component of the coordinate vector"); + // Mesh quality metrics AddVolumeOutput("ORTHOGONALITY", "Orthogonality", "MESH_QUALITY", "Orthogonality Angle (deg.)"); AddVolumeOutput("ASPECT_RATIO", "Aspect_Ratio", "MESH_QUALITY", "CV Face Area Aspect Ratio"); @@ -52,6 +58,14 @@ void CFVMOutput::AddCommonFVMOutputs(const CConfig *config) { void CFVMOutput::LoadCommonFVMOutputs(const CConfig* config, const CGeometry* geometry, unsigned long iPoint) { + CPoint* Node_Geo = geometry->nodes; + + // Grid coordinates + SetVolumeOutputValue("COORD-X", iPoint, Node_Geo->GetCoord(iPoint, 0)); + SetVolumeOutputValue("COORD-Y", iPoint, Node_Geo->GetCoord(iPoint, 1)); + if (nDim == 3) + SetVolumeOutputValue("COORD-Z", iPoint, Node_Geo->GetCoord(iPoint, 2)); + // Mesh quality metrics, computed in CPhysicalGeometry::ComputeMeshQualityStatistics. if (config->GetWrt_MeshQuality()) { SetVolumeOutputValue("ORTHOGONALITY", iPoint, geometry->Orthogonality[iPoint]); diff --git a/SU2_CFD/src/output/CFlowCompOutput.cpp b/SU2_CFD/src/output/CFlowCompOutput.cpp index 5f053a80275f..ea1774488fb5 100644 --- a/SU2_CFD/src/output/CFlowCompOutput.cpp +++ b/SU2_CFD/src/output/CFlowCompOutput.cpp @@ -290,11 +290,8 @@ void CFlowCompOutput::SetHistoryOutputFields(CConfig *config){ void CFlowCompOutput::SetVolumeOutputFields(CConfig *config){ - // Grid coordinates - AddVolumeOutput("COORD-X", "x", "COORDINATES", "x-component of the coordinate vector"); - AddVolumeOutput("COORD-Y", "y", "COORDINATES", "y-component of the coordinate vector"); - if (nDim == 3) - AddVolumeOutput("COORD-Z", "z", "COORDINATES", "z-component of the coordinate vector"); + // Coordinates, Mesh quality metrics + AddCommonFVMOutputs(config); // Solution variables AddVolumeOutput("DENSITY", "Density", "SOLUTION", "Density"); @@ -422,8 +419,6 @@ void CFlowCompOutput::SetVolumeOutputFields(CConfig *config){ AddVolumeOutput("Q_CRITERION", "Q_Criterion", "VORTEX_IDENTIFICATION", "Value of the Q-Criterion"); } - AddCommonFVMOutputs(config); - if (config->GetTime_Domain()){ SetTimeAveragedFields(); } @@ -433,17 +428,14 @@ void CFlowCompOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolv CVariable* Node_Flow = solver[FLOW_SOL]->GetNodes(); CVariable* Node_Turb = nullptr; + CPoint* Node_Geo = geometry->nodes; if (config->GetKind_Turb_Model() != NONE){ Node_Turb = solver[TURB_SOL]->GetNodes(); } - CPoint* Node_Geo = geometry->nodes; - - SetVolumeOutputValue("COORD-X", iPoint, Node_Geo->GetCoord(iPoint, 0)); - SetVolumeOutputValue("COORD-Y", iPoint, Node_Geo->GetCoord(iPoint, 1)); - if (nDim == 3) - SetVolumeOutputValue("COORD-Z", iPoint, Node_Geo->GetCoord(iPoint, 2)); + // Coordinates, Mesh quality metrics + LoadCommonFVMOutputs(config, geometry, iPoint); SetVolumeOutputValue("DENSITY", iPoint, Node_Flow->GetSolution(iPoint, 0)); SetVolumeOutputValue("MOMENTUM-X", iPoint, Node_Flow->GetSolution(iPoint, 1)); @@ -568,8 +560,6 @@ void CFlowCompOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolv SetVolumeOutputValue("Q_CRITERION", iPoint, GetQ_Criterion(&(Node_Flow->GetGradient_Primitive(iPoint)[1]))); } - LoadCommonFVMOutputs(config, geometry, iPoint); - if (config->GetTime_Domain()){ LoadTimeAveragedData(iPoint, Node_Flow); } diff --git a/SU2_CFD/src/output/CFlowIncOutput.cpp b/SU2_CFD/src/output/CFlowIncOutput.cpp index 229d61f866c5..27ed587dfbb4 100644 --- a/SU2_CFD/src/output/CFlowIncOutput.cpp +++ b/SU2_CFD/src/output/CFlowIncOutput.cpp @@ -372,11 +372,8 @@ void CFlowIncOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSolv void CFlowIncOutput::SetVolumeOutputFields(CConfig *config){ - // Grid coordinates - AddVolumeOutput("COORD-X", "x", "COORDINATES", "x-component of the coordinate vector"); - AddVolumeOutput("COORD-Y", "y", "COORDINATES", "y-component of the coordinate vector"); - if (nDim == 3) - AddVolumeOutput("COORD-Z", "z", "COORDINATES", "z-component of the coordinate vector"); + // Coordinates, Mesh quality metrics + AddCommonFVMOutputs(config); // SOLUTION variables AddVolumeOutput("PRESSURE", "Pressure", "SOLUTION", "Pressure"); @@ -512,7 +509,6 @@ void CFlowIncOutput::SetVolumeOutputFields(CConfig *config){ AddVolumeOutput("RECOVERED_TEMPERATURE", "Recovered_Temperature", "SOLUTION", "Recovered physical temperature"); } - AddCommonFVMOutputs(config); } void CFlowIncOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned long iPoint){ @@ -521,6 +517,7 @@ void CFlowIncOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolve CVariable* Node_Heat = nullptr; CVariable* Node_Turb = nullptr; CVariable* Node_Rad = nullptr; + CPoint* Node_Geo = geometry->nodes; if (config->GetKind_Turb_Model() != NONE){ Node_Turb = solver[TURB_SOL]->GetNodes(); @@ -529,12 +526,8 @@ void CFlowIncOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolve Node_Heat = solver[HEAT_SOL]->GetNodes(); } - CPoint* Node_Geo = geometry->nodes; - - SetVolumeOutputValue("COORD-X", iPoint, Node_Geo->GetCoord(iPoint, 0)); - SetVolumeOutputValue("COORD-Y", iPoint, Node_Geo->GetCoord(iPoint, 1)); - if (nDim == 3) - SetVolumeOutputValue("COORD-Z", iPoint, Node_Geo->GetCoord(iPoint, 2)); + // Coordinates, Mesh quality metrics + LoadCommonFVMOutputs(config, geometry, iPoint); SetVolumeOutputValue("PRESSURE", iPoint, Node_Flow->GetSolution(iPoint, 0)); SetVolumeOutputValue("VELOCITY-X", iPoint, Node_Flow->GetSolution(iPoint, 1)); @@ -665,8 +658,6 @@ void CFlowIncOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolve if (heat && streamwisePeriodic_temperature) SetVolumeOutputValue("RECOVERED_TEMPERATURE", iPoint, Node_Flow->GetStreamwise_Periodic_RecoveredTemperature(iPoint)); } - - LoadCommonFVMOutputs(config, geometry, iPoint); } void CFlowIncOutput::LoadSurfaceData(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned long iPoint, unsigned short iMarker, unsigned long iVertex){ diff --git a/SU2_CFD/src/output/CHeatOutput.cpp b/SU2_CFD/src/output/CHeatOutput.cpp index 41b782b06f08..beb4a2b9cde0 100644 --- a/SU2_CFD/src/output/CHeatOutput.cpp +++ b/SU2_CFD/src/output/CHeatOutput.cpp @@ -116,13 +116,10 @@ void CHeatOutput::SetHistoryOutputFields(CConfig *config){ void CHeatOutput::SetVolumeOutputFields(CConfig *config){ - // Grid coordinates - AddVolumeOutput("COORD-X", "x", "COORDINATES", "x-component of the coordinate vector"); - AddVolumeOutput("COORD-Y", "y", "COORDINATES", "y-component of the coordinate vector"); - if (nDim == 3) - AddVolumeOutput("COORD-Z", "z", "COORDINATES","z-component of the coordinate vector"); + // Coordinates, Mesh quality metrics + AddCommonFVMOutputs(config); - // SOLUTION + // Solution AddVolumeOutput("TEMPERATURE", "Temperature", "SOLUTION", "Temperature"); // Primitives @@ -130,29 +127,21 @@ void CHeatOutput::SetVolumeOutputFields(CConfig *config){ // Residuals AddVolumeOutput("RES_TEMPERATURE", "Residual_Temperature", "RESIDUAL", "Residual of the temperature"); - - AddCommonFVMOutputs(config); } void CHeatOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned long iPoint){ CVariable* Node_Heat = solver[HEAT_SOL]->GetNodes(); - CPoint* Node_Geo = geometry->nodes; - // Grid coordinates - SetVolumeOutputValue("COORD-X", iPoint, Node_Geo->GetCoord(iPoint, 0)); - SetVolumeOutputValue("COORD-Y", iPoint, Node_Geo->GetCoord(iPoint, 1)); - if (nDim == 3) - SetVolumeOutputValue("COORD-Z", iPoint, Node_Geo->GetCoord(iPoint, 2)); + // Coordinates, Mesh quality metrics + LoadCommonFVMOutputs(config, geometry, iPoint); - // SOLUTION + // Solution SetVolumeOutputValue("TEMPERATURE", iPoint, Node_Heat->GetSolution(iPoint, 0)); // Residuals SetVolumeOutputValue("RES_TEMPERATURE", iPoint, solver[HEAT_SOL]->LinSysRes(iPoint, 0)); - - LoadCommonFVMOutputs(config, geometry, iPoint); } void CHeatOutput::LoadSurfaceData(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned long iPoint, unsigned short iMarker, unsigned long iVertex){ diff --git a/SU2_CFD/src/output/CNEMOCompOutput.cpp b/SU2_CFD/src/output/CNEMOCompOutput.cpp index 291127f4e08b..45b5d183e10f 100644 --- a/SU2_CFD/src/output/CNEMOCompOutput.cpp +++ b/SU2_CFD/src/output/CNEMOCompOutput.cpp @@ -295,11 +295,8 @@ void CNEMOCompOutput::SetVolumeOutputFields(CConfig *config){ unsigned short nSpecies = config->GetnSpecies(); - // Grid coordinates - AddVolumeOutput("COORD-X", "x", "COORDINATES", "x-component of the coordinate vector"); - AddVolumeOutput("COORD-Y", "y", "COORDINATES", "y-component of the coordinate vector"); - if (nDim == 3) - AddVolumeOutput("COORD-Z", "z", "COORDINATES", "z-component of the coordinate vector"); + // Coordinates, Mesh quality metrics + AddCommonFVMOutputs(config); // Solution variables for(iSpecies = 0; iSpecies < nSpecies; iSpecies++) @@ -427,8 +424,6 @@ void CNEMOCompOutput::SetVolumeOutputFields(CConfig *config){ AddVolumeOutput("VORTICITY_Z", "Vorticity_z", "VORTEX_IDENTIFICATION", "z-component of the vorticity vector"); } - AddCommonFVMOutputs(config); - if (config->GetTime_Domain()){ SetTimeAveragedFields(); } @@ -438,18 +433,15 @@ void CNEMOCompOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolv CVariable* Node_Flow = solver[FLOW_SOL]->GetNodes(); CVariable* Node_Turb = NULL; + auto* Node_Geo = geometry->nodes; unsigned short nSpecies = config->GetnSpecies(); if (config->GetKind_Turb_Model() != NONE){ Node_Turb = solver[TURB_SOL]->GetNodes(); } - auto* Node_Geo = geometry->nodes; - - SetVolumeOutputValue("COORD-X", iPoint, Node_Geo->GetCoord(iPoint, 0)); - SetVolumeOutputValue("COORD-Y", iPoint, Node_Geo->GetCoord(iPoint, 1)); - if (nDim == 3) - SetVolumeOutputValue("COORD-Z", iPoint, Node_Geo->GetCoord(iPoint, 2)); + // Coordinates, Mesh quality metrics + LoadCommonFVMOutputs(config, geometry, iPoint); for(iSpecies = 0; iSpecies < nSpecies; iSpecies++) SetVolumeOutputValue("DENSITY_" + std::to_string(iSpecies), iPoint, Node_Flow->GetSolution(iPoint, iSpecies)); @@ -565,8 +557,6 @@ void CNEMOCompOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolv SetVolumeOutputValue("ROE_DISSIPATION", iPoint, Node_Flow->GetRoe_Dissipation(iPoint)); } - LoadCommonFVMOutputs(config, geometry, iPoint); - if (config->GetTime_Domain()){ LoadTimeAveragedData(iPoint, Node_Flow); } From bd952cf26349abc6001ae5fb43a3420e2ea7cb47 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Wed, 2 Jun 2021 18:40:56 +0200 Subject: [PATCH 13/24] Fix doxygen filenames for output folder. --- .../output/{CAdjFlowOutput.hpp => CAdjFlowCompOutput.hpp} | 0 SU2_CFD/include/output/CAdjHeatOutput.hpp | 2 +- SU2_CFD/include/output/CFVMOutput.hpp | 2 +- SU2_CFD/include/output/CFlowIncOutput.hpp | 4 ++-- SU2_CFD/include/output/CMeshOutput.hpp | 2 +- SU2_CFD/include/output/CMultizoneOutput.hpp | 6 +++--- SU2_CFD/include/output/COutputFactory.hpp | 2 +- SU2_CFD/include/output/COutputLegacy.hpp | 4 ++-- SU2_CFD/src/output/CAdjFlowCompOutput.cpp | 4 ++-- SU2_CFD/src/output/CAdjFlowIncOutput.cpp | 2 +- SU2_CFD/src/output/CAdjHeatOutput.cpp | 2 +- SU2_CFD/src/output/CBaselineOutput.cpp | 2 +- SU2_CFD/src/output/CElasticityOutput.cpp | 2 +- SU2_CFD/src/output/CFVMOutput.cpp | 2 +- SU2_CFD/src/output/CFlowCompFEMOutput.cpp | 2 +- SU2_CFD/src/output/CFlowCompOutput.cpp | 2 +- SU2_CFD/src/output/CFlowIncOutput.cpp | 2 +- SU2_CFD/src/output/CFlowOutput.cpp | 2 +- SU2_CFD/src/output/CHeatOutput.cpp | 2 +- SU2_CFD/src/output/CMeshOutput.cpp | 2 +- SU2_CFD/src/output/COutput.cpp | 2 +- SU2_CFD/src/output/COutputFactory.cpp | 2 +- SU2_CFD/src/output/output_structure_legacy.cpp | 2 +- 23 files changed, 27 insertions(+), 27 deletions(-) rename SU2_CFD/include/output/{CAdjFlowOutput.hpp => CAdjFlowCompOutput.hpp} (100%) diff --git a/SU2_CFD/include/output/CAdjFlowOutput.hpp b/SU2_CFD/include/output/CAdjFlowCompOutput.hpp similarity index 100% rename from SU2_CFD/include/output/CAdjFlowOutput.hpp rename to SU2_CFD/include/output/CAdjFlowCompOutput.hpp diff --git a/SU2_CFD/include/output/CAdjHeatOutput.hpp b/SU2_CFD/include/output/CAdjHeatOutput.hpp index 5b5586591ded..2102be9ad849 100644 --- a/SU2_CFD/include/output/CAdjHeatOutput.hpp +++ b/SU2_CFD/include/output/CAdjHeatOutput.hpp @@ -1,5 +1,5 @@ /*! - * \file output_fea_discadj.hpp + * \file CAdjHeatOutput.hpp * \brief Headers of the adjoint heat output. * \author T. Albring * \version 7.1.1 "Blackbird" diff --git a/SU2_CFD/include/output/CFVMOutput.hpp b/SU2_CFD/include/output/CFVMOutput.hpp index 6b9c4c39380e..324e089d3cc8 100644 --- a/SU2_CFD/include/output/CFVMOutput.hpp +++ b/SU2_CFD/include/output/CFVMOutput.hpp @@ -1,5 +1,5 @@ /*! - * \file CFlowOutput.hpp + * \file CFVMOutput.hpp * \brief Headers of the Finite Volume Method output. * \author T. Kattmann * \version 7.1.1 "Blackbird" diff --git a/SU2_CFD/include/output/CFlowIncOutput.hpp b/SU2_CFD/include/output/CFlowIncOutput.hpp index af106a330932..9e1618c697ee 100644 --- a/SU2_CFD/include/output/CFlowIncOutput.hpp +++ b/SU2_CFD/include/output/CFlowIncOutput.hpp @@ -1,5 +1,5 @@ -/*! - * \file CFlowIncCompOutput.hpp +/*! + * \file CFlowIncOutput.hpp * \brief Headers of the incompressible flow output. * \author T. Albring, R. Sanchez * \version 7.1.1 "Blackbird" diff --git a/SU2_CFD/include/output/CMeshOutput.hpp b/SU2_CFD/include/output/CMeshOutput.hpp index 5c736090c4cc..34c01ebc4357 100644 --- a/SU2_CFD/include/output/CMeshOutput.hpp +++ b/SU2_CFD/include/output/CMeshOutput.hpp @@ -1,6 +1,6 @@ /*! * \file CMeshOutput.hpp - * \brief Headers of the mesh output. + * \brief Headers of the mesh output. * \author R. Sanchez, T. Albring. * \version 7.1.1 "Blackbird" * diff --git a/SU2_CFD/include/output/CMultizoneOutput.hpp b/SU2_CFD/include/output/CMultizoneOutput.hpp index 1be5ea3e753c..28ff8d1b5557 100644 --- a/SU2_CFD/include/output/CMultizoneOutput.hpp +++ b/SU2_CFD/include/output/CMultizoneOutput.hpp @@ -1,5 +1,5 @@ /*! - * \file CDriverOutput.hpp + * \file CMultizoneOutput.hpp * \brief Headers of the main subroutines for screen and history output in multizone problems. * \author R. Sanchez, T. Albring * \version 7.1.1 "Blackbird" @@ -44,7 +44,7 @@ using namespace std; /*! - * \class CDriverOutput + * \class CMultizoneOutput * \brief Class for writing the multizone output. * \author R. Sanchez, T. Albring. */ @@ -53,7 +53,7 @@ class CMultizoneOutput final: public COutput { protected: unsigned short nZone; //!< Number of zones - string bgs_res_name; //!< Block-Gauss seidel residual name + string bgs_res_name; //!< Block-Gauss Seidel residual name bool write_zone; //!< Boolean indicating whether the individual zones write to screen public: diff --git a/SU2_CFD/include/output/COutputFactory.hpp b/SU2_CFD/include/output/COutputFactory.hpp index 3e659e979546..0aa2dd25e457 100644 --- a/SU2_CFD/include/output/COutputFactory.hpp +++ b/SU2_CFD/include/output/COutputFactory.hpp @@ -1,5 +1,5 @@ /*! - * \file COutput.hpp + * \file COutputFactory.hpp * \brief Headers of the output class. * \author T.Albring * \version 7.1.1 "Blackbird" diff --git a/SU2_CFD/include/output/COutputLegacy.hpp b/SU2_CFD/include/output/COutputLegacy.hpp index fbf334a66cab..9f34d8e45292 100644 --- a/SU2_CFD/include/output/COutputLegacy.hpp +++ b/SU2_CFD/include/output/COutputLegacy.hpp @@ -1,7 +1,7 @@ /*! - * \file output.hpp + * \file COutputLegacy.hpp * \brief Headers of the main subroutines for generating the file outputs. - * The subroutines and functions are in the output_structure.cpp file. + * The subroutines and functions are in the output_structure_legacy.cpp file. * \author F. Palacios, T. Economon, M. Colonno * \version 7.1.1 "Blackbird" * diff --git a/SU2_CFD/src/output/CAdjFlowCompOutput.cpp b/SU2_CFD/src/output/CAdjFlowCompOutput.cpp index 6d5db2133b20..2cf99b95e396 100644 --- a/SU2_CFD/src/output/CAdjFlowCompOutput.cpp +++ b/SU2_CFD/src/output/CAdjFlowCompOutput.cpp @@ -1,5 +1,5 @@ /*! - * \file output_adj_flow_comp.cpp + * \file CAdjFlowCompOutput.cpp * \brief Main subroutines for flow discrete adjoint output * \author R. Sanchez * \version 7.1.1 "Blackbird" @@ -26,7 +26,7 @@ */ -#include "../../include/output/CAdjFlowOutput.hpp" +#include "../../include/output/CAdjFlowCompOutput.hpp" #include "../../../Common/include/geometry/CGeometry.hpp" #include "../../include/solvers/CSolver.hpp" diff --git a/SU2_CFD/src/output/CAdjFlowIncOutput.cpp b/SU2_CFD/src/output/CAdjFlowIncOutput.cpp index f51f0e6c7959..8bcec5adeb9c 100644 --- a/SU2_CFD/src/output/CAdjFlowIncOutput.cpp +++ b/SU2_CFD/src/output/CAdjFlowIncOutput.cpp @@ -1,5 +1,5 @@ /*! - * \file output_adj_flow_inc.cpp + * \file CAdjFlowIncOutput.cpp * \brief Main subroutines for flow discrete adjoint output * \author R. Sanchez * \version 7.1.1 "Blackbird" diff --git a/SU2_CFD/src/output/CAdjHeatOutput.cpp b/SU2_CFD/src/output/CAdjHeatOutput.cpp index 3c3cbd0cabdf..0570f97ad680 100644 --- a/SU2_CFD/src/output/CAdjHeatOutput.cpp +++ b/SU2_CFD/src/output/CAdjHeatOutput.cpp @@ -1,5 +1,5 @@ /*! - * \file output_adj_heat.cpp + * \file CAdjHeatOutput.cpp * \brief Main subroutines for flow discrete adjoint output * \author R. Sanchez * \version 7.1.1 "Blackbird" diff --git a/SU2_CFD/src/output/CBaselineOutput.cpp b/SU2_CFD/src/output/CBaselineOutput.cpp index a37004c092f8..253ac5d432bc 100644 --- a/SU2_CFD/src/output/CBaselineOutput.cpp +++ b/SU2_CFD/src/output/CBaselineOutput.cpp @@ -1,5 +1,5 @@ /*! - * \file output_baseline.cpp + * \file CBaselineOutput.cpp * \brief Main subroutines for flow discrete adjoint output * \author R. Sanchez * \version 7.1.1 "Blackbird" diff --git a/SU2_CFD/src/output/CElasticityOutput.cpp b/SU2_CFD/src/output/CElasticityOutput.cpp index 55d2f9f84a08..c48dab833dba 100644 --- a/SU2_CFD/src/output/CElasticityOutput.cpp +++ b/SU2_CFD/src/output/CElasticityOutput.cpp @@ -1,5 +1,5 @@ /*! - * \file output_elasticity.cpp + * \file CElasticityOutput.cpp * \brief Main subroutines for FEA output * \author R. Sanchez * \version 7.1.1 "Blackbird" diff --git a/SU2_CFD/src/output/CFVMOutput.cpp b/SU2_CFD/src/output/CFVMOutput.cpp index 05062753bf8a..4b4b2a4c1234 100644 --- a/SU2_CFD/src/output/CFVMOutput.cpp +++ b/SU2_CFD/src/output/CFVMOutput.cpp @@ -1,5 +1,5 @@ /*! - * \file output_flow.cpp + * \file CFVMOutput.cpp * \brief Main subroutines for Finite Volume Method output * \author T. Kattmann * \version 7.1.1 "Blackbird" diff --git a/SU2_CFD/src/output/CFlowCompFEMOutput.cpp b/SU2_CFD/src/output/CFlowCompFEMOutput.cpp index 91cade8a86c9..5eb60cbe660d 100644 --- a/SU2_CFD/src/output/CFlowCompFEMOutput.cpp +++ b/SU2_CFD/src/output/CFlowCompFEMOutput.cpp @@ -1,5 +1,5 @@ /*! - * \file output_flow_comp_fem.cpp + * \file CFlowCompFEMOutput.cpp * \brief Main subroutines for compressible flow output * \author R. Sanchez * \version 7.1.1 "Blackbird" diff --git a/SU2_CFD/src/output/CFlowCompOutput.cpp b/SU2_CFD/src/output/CFlowCompOutput.cpp index ea1774488fb5..25eb63ff145e 100644 --- a/SU2_CFD/src/output/CFlowCompOutput.cpp +++ b/SU2_CFD/src/output/CFlowCompOutput.cpp @@ -1,5 +1,5 @@ /*! - * \file output_flow_comp.cpp + * \file CFlowCompOutput.cpp * \brief Main subroutines for compressible flow output * \author R. Sanchez * \version 7.1.1 "Blackbird" diff --git a/SU2_CFD/src/output/CFlowIncOutput.cpp b/SU2_CFD/src/output/CFlowIncOutput.cpp index 27ed587dfbb4..b5c56efea405 100644 --- a/SU2_CFD/src/output/CFlowIncOutput.cpp +++ b/SU2_CFD/src/output/CFlowIncOutput.cpp @@ -1,5 +1,5 @@ /*! - * \file output_flow_inc.cpp + * \file CFlowIncOutput.cpp * \brief Main subroutines for incompressible flow output * \author R. Sanchez * \version 7.1.1 "Blackbird" diff --git a/SU2_CFD/src/output/CFlowOutput.cpp b/SU2_CFD/src/output/CFlowOutput.cpp index 57967e29df0c..27d5d78fec48 100644 --- a/SU2_CFD/src/output/CFlowOutput.cpp +++ b/SU2_CFD/src/output/CFlowOutput.cpp @@ -1,5 +1,5 @@ /*! - * \file output_flow.cpp + * \file CFlowOutput.cpp * \brief Main subroutines for compressible flow output * \author R. Sanchez * \version 7.1.1 "Blackbird" diff --git a/SU2_CFD/src/output/CHeatOutput.cpp b/SU2_CFD/src/output/CHeatOutput.cpp index beb4a2b9cde0..fd71b45a7752 100644 --- a/SU2_CFD/src/output/CHeatOutput.cpp +++ b/SU2_CFD/src/output/CHeatOutput.cpp @@ -1,5 +1,5 @@ /*! - * \file output_heat.cpp + * \file CHeatOutput.cpp * \brief Main subroutines for the heat solver output * \author R. Sanchez * \version 7.1.1 "Blackbird" diff --git a/SU2_CFD/src/output/CMeshOutput.cpp b/SU2_CFD/src/output/CMeshOutput.cpp index ea2969ecbd29..5b27d3e7bbee 100644 --- a/SU2_CFD/src/output/CMeshOutput.cpp +++ b/SU2_CFD/src/output/CMeshOutput.cpp @@ -1,5 +1,5 @@ /*! - * \file output_mesh.cpp + * \file CMeshOutput.cpp * \brief Main subroutines for the heat solver output * \author R. Sanchez * \version 7.1.1 "Blackbird" diff --git a/SU2_CFD/src/output/COutput.cpp b/SU2_CFD/src/output/COutput.cpp index efc29fe036eb..fe736fbccb99 100644 --- a/SU2_CFD/src/output/COutput.cpp +++ b/SU2_CFD/src/output/COutput.cpp @@ -1,5 +1,5 @@ /*! - * \file output_structure.cpp + * \file COutput.cpp * \brief Main subroutines for output solver information * \author F. Palacios, T. Economon * \version 7.1.1 "Blackbird" diff --git a/SU2_CFD/src/output/COutputFactory.cpp b/SU2_CFD/src/output/COutputFactory.cpp index 2feb4cd3ac3d..5814c85767b6 100644 --- a/SU2_CFD/src/output/COutputFactory.cpp +++ b/SU2_CFD/src/output/COutputFactory.cpp @@ -33,7 +33,7 @@ #include "../../include/output/CAdjElasticityOutput.hpp" #include "../../include/output/CFlowCompOutput.hpp" #include "../../include/output/CNEMOCompOutput.hpp" -#include "../../include/output/CAdjFlowOutput.hpp" +#include "../../include/output/CAdjFlowCompOutput.hpp" #include "../../include/output/CFlowCompFEMOutput.hpp" #include "../../include/output/CFlowIncOutput.hpp" #include "../../include/output/CAdjFlowIncOutput.hpp" diff --git a/SU2_CFD/src/output/output_structure_legacy.cpp b/SU2_CFD/src/output/output_structure_legacy.cpp index acfa5d7f1b5f..fc65caa3aeb6 100644 --- a/SU2_CFD/src/output/output_structure_legacy.cpp +++ b/SU2_CFD/src/output/output_structure_legacy.cpp @@ -1,5 +1,5 @@ /*! - * \file output_structure.cpp + * \file output_structure_legacy.cpp * \brief Main subroutines for output solver information * \author F. Palacios, T. Economon * \version 7.1.1 "Blackbird" From 4ce75faa977cbfc9f200be322602c56c7130bfdc Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Sat, 5 Jun 2021 18:28:38 +0200 Subject: [PATCH 14/24] Revert some autos into su2double, for safety you know --- SU2_CFD/src/solvers/CHeatSolver.cpp | 2 +- SU2_CFD/src/solvers/CIncNSSolver.cpp | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/SU2_CFD/src/solvers/CHeatSolver.cpp b/SU2_CFD/src/solvers/CHeatSolver.cpp index 7c2015de1f40..e31233ae6e46 100644 --- a/SU2_CFD/src/solvers/CHeatSolver.cpp +++ b/SU2_CFD/src/solvers/CHeatSolver.cpp @@ -1281,7 +1281,7 @@ void CHeatSolver::ImplicitEuler_Iteration(CGeometry *geometry, CSolver **solver_ if (nodes->GetDelta_Time(iPoint) != 0.0) { // Identical for flow and heat - const auto Delta = geometry->nodes->GetVolume(iPoint) / nodes->GetDelta_Time(iPoint); + const su2double Delta = geometry->nodes->GetVolume(iPoint) / nodes->GetDelta_Time(iPoint); Jacobian.AddVal2Diag(iPoint, Delta); } else { diff --git a/SU2_CFD/src/solvers/CIncNSSolver.cpp b/SU2_CFD/src/solvers/CIncNSSolver.cpp index c085b8b629da..de5cc3090d77 100644 --- a/SU2_CFD/src/solvers/CIncNSSolver.cpp +++ b/SU2_CFD/src/solvers/CIncNSSolver.cpp @@ -145,9 +145,9 @@ void CIncNSSolver::GetStreamwise_Periodic_Properties(const CGeometry *geometry, /*--- A = dot_prod(n_A*n_A), with n_A beeing the area-normal. ---*/ - const auto AreaNormal = geometry->vertex[iMarker][iVertex]->GetNormal(); + const su2double* AreaNormal = geometry->vertex[iMarker][iVertex]->GetNormal(); - auto FaceArea = GeometryToolbox::Norm(nDim, AreaNormal); + const su2double FaceArea = GeometryToolbox::Norm(nDim, AreaNormal); /*--- m_dot = dot_prod(n*v) * A * rho, with n beeing unit normal. ---*/ MassFlow_Local += nodes->GetProjVel(iPoint, AreaNormal) * nodes->GetDensity(iPoint); @@ -232,7 +232,7 @@ void CIncNSSolver::GetStreamwise_Periodic_Properties(const CGeometry *geometry, /*--- Identify the boundary by string name and retrive heatflux from config ---*/ const auto Marker_StringTag = config->GetMarker_All_TagBound(iMarker); - const auto Wall_HeatFlux = config->GetWall_HeatFlux(Marker_StringTag); + const su2double Wall_HeatFlux = config->GetWall_HeatFlux(Marker_StringTag); for (auto iVertex = 0ul; iVertex < geometry->nVertex[iMarker]; iVertex++) { @@ -240,9 +240,9 @@ void CIncNSSolver::GetStreamwise_Periodic_Properties(const CGeometry *geometry, if (!geometry->nodes->GetDomain(iPoint)) continue; - const auto AreaNormal = geometry->vertex[iMarker][iVertex]->GetNormal(); + const su2double* AreaNormal = geometry->vertex[iMarker][iVertex]->GetNormal(); - auto FaceArea = GeometryToolbox::Norm(nDim, AreaNormal); + const su2double FaceArea = GeometryToolbox::Norm(nDim, AreaNormal); HeatFlow_Local += FaceArea * (-1.0) * Wall_HeatFlux/config->GetHeat_Flux_Ref();; } // loop Vertices @@ -393,7 +393,7 @@ void CIncNSSolver::BC_Wall_Generic(const CGeometry *geometry, const CConfig *con /*--- Compute dual-grid area and boundary normal ---*/ - const auto Normal = geometry->vertex[val_marker][iVertex]->GetNormal(); + const su2double* Normal = geometry->vertex[val_marker][iVertex]->GetNormal(); const su2double Area = GeometryToolbox::Norm(nDim, Normal); @@ -447,12 +447,12 @@ void CIncNSSolver::BC_Wall_Generic(const CGeometry *geometry, const CConfig *con } else { // ISOTHERMAL - auto Point_Normal = geometry->vertex[val_marker][iVertex]->GetNormal_Neighbor(); + const auto Point_Normal = geometry->vertex[val_marker][iVertex]->GetNormal_Neighbor(); /*--- Get coordinates of i & nearest normal and compute distance ---*/ - auto Coord_i = geometry->nodes->GetCoord(iPoint); - auto Coord_j = geometry->nodes->GetCoord(Point_Normal); + const su2double* Coord_i = geometry->nodes->GetCoord(iPoint); + const su2double* Coord_j = geometry->nodes->GetCoord(Point_Normal); su2double Edge_Vector[MAXNDIM]; GeometryToolbox::Distance(nDim, Coord_j, Coord_i, Edge_Vector); su2double dist_ij_2 = GeometryToolbox::SquaredNorm(nDim, Edge_Vector); @@ -557,12 +557,12 @@ void CIncNSSolver::BC_ConjugateHeat_Interface(CGeometry *geometry, CSolver **sol /*--- Compute closest normal neighbor ---*/ - auto Point_Normal = geometry->vertex[val_marker][iVertex]->GetNormal_Neighbor(); + const auto Point_Normal = geometry->vertex[val_marker][iVertex]->GetNormal_Neighbor(); /*--- Get coordinates of i & nearest normal and compute distance ---*/ - auto Coord_i = geometry->nodes->GetCoord(iPoint); - auto Coord_j = geometry->nodes->GetCoord(Point_Normal); + const su2double* Coord_i = geometry->nodes->GetCoord(iPoint); + const su2double* Coord_j = geometry->nodes->GetCoord(Point_Normal); su2double dist_ij = GeometryToolbox::Distance(nDim, Coord_j, Coord_i); /*--- Compute wall temperature from both temperatures ---*/ From 07a1b34d131c9c5f7280ed5426858e9fe679492b Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Sat, 5 Jun 2021 18:31:58 +0200 Subject: [PATCH 15/24] Little changes to unst CHT grad validation files --- .../gradient_validation.py | 6 +++++- .../postprocess.py | 21 +++++++++++++++---- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/TestCases/coupled_cht/disc_adj_unsteadyCHT_cylinder/gradient_validation.py b/TestCases/coupled_cht/disc_adj_unsteadyCHT_cylinder/gradient_validation.py index 003f742ce090..9751520d2be4 100644 --- a/TestCases/coupled_cht/disc_adj_unsteadyCHT_cylinder/gradient_validation.py +++ b/TestCases/coupled_cht/disc_adj_unsteadyCHT_cylinder/gradient_validation.py @@ -80,7 +80,7 @@ adjoint.addExpected("solution_adj_avtp_1_00053.dat") # gradient projection -dot = adjont = ExternalRun("DOT",dot_ad_command,True) +dot = ExternalRun("DOT",dot_ad_command,True) dot.setMaxTries(max_tries) dot.addConfig("chtMaster.cfg") dot.addData("fluid.cfg") # zonal cfg's can be symlinked @@ -106,6 +106,7 @@ # Driver --------------------------------------------------------------- # +# The input variable is the constraint tolerance which is not used for our purpose of finite differences driver = ExteriorPenaltyDriver(0.005) driver.addObjective("min", tavgT) @@ -120,6 +121,7 @@ # Primal simulation for each deformed DV for iLoop in range(0, nDV, 1): + print("Computing deformed primal ", iLoop, "/", nDV-1) x = driver.getInitial() x[iLoop] = 1e-4 # DV_VALUE driver.fun(x) @@ -127,10 +129,12 @@ # Undeformed/initial primal last in order to have the correct solution in # the WorkindDirectory for the following adjoint +print("Computing baseline primal") x = driver.getInitial() driver.fun(x) # baseline evaluation # Compute discrete adjoint gradient +print("Computing discrete adjoint gradient") driver.grad(x) his.close() diff --git a/TestCases/coupled_cht/disc_adj_unsteadyCHT_cylinder/postprocess.py b/TestCases/coupled_cht/disc_adj_unsteadyCHT_cylinder/postprocess.py index 8e59310c1a94..bcbe8a7ba2d0 100644 --- a/TestCases/coupled_cht/disc_adj_unsteadyCHT_cylinder/postprocess.py +++ b/TestCases/coupled_cht/disc_adj_unsteadyCHT_cylinder/postprocess.py @@ -10,17 +10,30 @@ FDvals = pd.read_csv("doe.his") # additional values +nDV = 18 FDstep = 1e-4 FDstring = ' tavgT' DAstring = 'AVG_TEMPERATURE gradient ' # create FD gradient -FDgrad = (FDvals[FDstring].iloc[:18] - FDvals[FDstring].iloc[18]) / FDstep +FDgrad = (FDvals[FDstring].iloc[:nDV] - FDvals[FDstring].iloc[nDV]) / FDstep # absolute difference absoluteDiff = DAgrad[DAstring] - FDgrad -print("DAgrad - FDgrad\n", absoluteDiff) +print("absolute diff = DAgrad - FDgrad") # relative difference in percent -relDiffPercent = abs(DAgrad[DAstring] - FDgrad)/DAgrad[DAstring] * 100 -print("(DAgrad - FDgrad) / DAgrad * 100\n", relDiffPercent) +relDiffPercent = (DAgrad[DAstring] - FDgrad)/abs(DAgrad[DAstring]) * 100 +print("relative diff = (DAgrad - FDgrad) / abs(DAgrad) * 100") + + +print('') +print('+-----------+-------------------+-------------------+-------------------+-------------------+') +print('| DV number | DA gradient | FD gradient | absolute diff | relative diff [%] |') +print('+-----------+-------------------+-------------------+-------------------+-------------------+') + +for i_dv in range(0, nDV,1): + print('|{0:10d} |{1:18.10f} |{2:18.10f} |{3:18.10f} |{4:18.10f} |'.format(i_dv, DAgrad[DAstring].iloc[i_dv], FDgrad[i_dv], absoluteDiff[i_dv], relDiffPercent[i_dv])) + +print('+-----------+-------------------+-------------------+-------------------+-------------------+') +print('') From 41109fe6956e392a31133fc399edc4bbbe569fc0 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Sat, 5 Jun 2021 20:05:00 +0200 Subject: [PATCH 16/24] Adress PR review comments: readding autos and stuff in CFVMOutput. --- SU2_CFD/include/output/CFVMOutput.hpp | 6 ++---- SU2_CFD/obj/Makefile.am | 1 + SU2_CFD/src/output/CFVMOutput.cpp | 2 -- SU2_CFD/src/solvers/CIncNSSolver.cpp | 16 ++++++++-------- 4 files changed, 11 insertions(+), 14 deletions(-) diff --git a/SU2_CFD/include/output/CFVMOutput.hpp b/SU2_CFD/include/output/CFVMOutput.hpp index 324e089d3cc8..7eed4f54b759 100644 --- a/SU2_CFD/include/output/CFVMOutput.hpp +++ b/SU2_CFD/include/output/CFVMOutput.hpp @@ -30,7 +30,7 @@ #include "COutput.hpp" class CFVMOutput : public COutput{ -public: +protected: /*! * \brief Constructor of the class */ @@ -39,9 +39,7 @@ class CFVMOutput : public COutput{ /*! * \brief Destructor of the class. */ - ~CFVMOutput(void) override; - -protected: + ~CFVMOutput(void) = default; /*! * \brief Add common FVM outputs. diff --git a/SU2_CFD/obj/Makefile.am b/SU2_CFD/obj/Makefile.am index 5f7975302eb8..6b7f7854ac9c 100644 --- a/SU2_CFD/obj/Makefile.am +++ b/SU2_CFD/obj/Makefile.am @@ -136,6 +136,7 @@ libSU2Core_sources = ../src/definition_structure.cpp \ ../src/output/output_physics.cpp \ ../src/output/CMeshOutput.cpp \ ../src/output/CElasticityOutput.cpp \ + ../src/output/CFVMOutput.cpp \ ../src/output/CFlowOutput.cpp \ ../src/output/CFlowCompOutput.cpp \ ../src/output/CFlowCompFEMOutput.cpp \ diff --git a/SU2_CFD/src/output/CFVMOutput.cpp b/SU2_CFD/src/output/CFVMOutput.cpp index 4b4b2a4c1234..c1d3101d3567 100644 --- a/SU2_CFD/src/output/CFVMOutput.cpp +++ b/SU2_CFD/src/output/CFVMOutput.cpp @@ -31,8 +31,6 @@ CFVMOutput::CFVMOutput(CConfig *config, unsigned short nDim, bool fem_output) : COutput (config, nDim, fem_output){ } -CFVMOutput::~CFVMOutput(void){ } - void CFVMOutput::AddCommonFVMOutputs(const CConfig *config) { // Grid coordinates diff --git a/SU2_CFD/src/solvers/CIncNSSolver.cpp b/SU2_CFD/src/solvers/CIncNSSolver.cpp index de5cc3090d77..6a564e5f1118 100644 --- a/SU2_CFD/src/solvers/CIncNSSolver.cpp +++ b/SU2_CFD/src/solvers/CIncNSSolver.cpp @@ -145,7 +145,7 @@ void CIncNSSolver::GetStreamwise_Periodic_Properties(const CGeometry *geometry, /*--- A = dot_prod(n_A*n_A), with n_A beeing the area-normal. ---*/ - const su2double* AreaNormal = geometry->vertex[iMarker][iVertex]->GetNormal(); + const auto AreaNormal = geometry->vertex[iMarker][iVertex]->GetNormal(); const su2double FaceArea = GeometryToolbox::Norm(nDim, AreaNormal); @@ -240,7 +240,7 @@ void CIncNSSolver::GetStreamwise_Periodic_Properties(const CGeometry *geometry, if (!geometry->nodes->GetDomain(iPoint)) continue; - const su2double* AreaNormal = geometry->vertex[iMarker][iVertex]->GetNormal(); + const auto AreaNormal = geometry->vertex[iMarker][iVertex]->GetNormal(); const su2double FaceArea = GeometryToolbox::Norm(nDim, AreaNormal); @@ -265,7 +265,7 @@ void CIncNSSolver::Compute_Streamwise_Periodic_Recovered_Values(CConfig *config, const auto InnerIter = config->GetInnerIter(); /*--- Reference node on inlet periodic marker to compute relative distance along periodic translation vector. ---*/ - const su2double* ReferenceNode = geometry->GetStreamwise_Periodic_RefNode(); + const auto ReferenceNode = geometry->GetStreamwise_Periodic_RefNode(); /*--- Compute square of the distance between the 2 periodic surfaces. ---*/ const su2double norm2_translation = GeometryToolbox::SquaredNorm(nDim, config->GetPeriodic_Translation(0)); @@ -393,7 +393,7 @@ void CIncNSSolver::BC_Wall_Generic(const CGeometry *geometry, const CConfig *con /*--- Compute dual-grid area and boundary normal ---*/ - const su2double* Normal = geometry->vertex[val_marker][iVertex]->GetNormal(); + const auto Normal = geometry->vertex[val_marker][iVertex]->GetNormal(); const su2double Area = GeometryToolbox::Norm(nDim, Normal); @@ -451,8 +451,8 @@ void CIncNSSolver::BC_Wall_Generic(const CGeometry *geometry, const CConfig *con /*--- Get coordinates of i & nearest normal and compute distance ---*/ - const su2double* Coord_i = geometry->nodes->GetCoord(iPoint); - const su2double* Coord_j = geometry->nodes->GetCoord(Point_Normal); + const auto Coord_i = geometry->nodes->GetCoord(iPoint); + const auto Coord_j = geometry->nodes->GetCoord(Point_Normal); su2double Edge_Vector[MAXNDIM]; GeometryToolbox::Distance(nDim, Coord_j, Coord_i, Edge_Vector); su2double dist_ij_2 = GeometryToolbox::SquaredNorm(nDim, Edge_Vector); @@ -561,8 +561,8 @@ void CIncNSSolver::BC_ConjugateHeat_Interface(CGeometry *geometry, CSolver **sol /*--- Get coordinates of i & nearest normal and compute distance ---*/ - const su2double* Coord_i = geometry->nodes->GetCoord(iPoint); - const su2double* Coord_j = geometry->nodes->GetCoord(Point_Normal); + const auto Coord_i = geometry->nodes->GetCoord(iPoint); + const auto Coord_j = geometry->nodes->GetCoord(Point_Normal); su2double dist_ij = GeometryToolbox::Distance(nDim, Coord_j, Coord_i); /*--- Compute wall temperature from both temperatures ---*/ From 9b6ae985471cc0f4e39e2bf1411bca4967255e6f Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Sat, 5 Jun 2021 20:06:19 +0200 Subject: [PATCH 17/24] Revert "Add Coord-XYZ to fresh CFVMOutput and therefore remove that from individual FVM outputs." This reverts commit 43e369083ef778805b7533ea82158f59b6a8fe7f. --- SU2_CFD/src/output/CFVMOutput.cpp | 14 -------------- SU2_CFD/src/output/CFlowCompOutput.cpp | 20 +++++++++++++++----- SU2_CFD/src/output/CFlowIncOutput.cpp | 19 ++++++++++++++----- SU2_CFD/src/output/CHeatOutput.cpp | 23 +++++++++++++++++------ SU2_CFD/src/output/CNEMOCompOutput.cpp | 20 +++++++++++++++----- 5 files changed, 61 insertions(+), 35 deletions(-) diff --git a/SU2_CFD/src/output/CFVMOutput.cpp b/SU2_CFD/src/output/CFVMOutput.cpp index c1d3101d3567..831a26d5d971 100644 --- a/SU2_CFD/src/output/CFVMOutput.cpp +++ b/SU2_CFD/src/output/CFVMOutput.cpp @@ -33,12 +33,6 @@ CFVMOutput::CFVMOutput(CConfig *config, unsigned short nDim, bool fem_output) : void CFVMOutput::AddCommonFVMOutputs(const CConfig *config) { - // Grid coordinates - AddVolumeOutput("COORD-X", "x", "COORDINATES", "x-component of the coordinate vector"); - AddVolumeOutput("COORD-Y", "y", "COORDINATES", "y-component of the coordinate vector"); - if (nDim == 3) - AddVolumeOutput("COORD-Z", "z", "COORDINATES","z-component of the coordinate vector"); - // Mesh quality metrics AddVolumeOutput("ORTHOGONALITY", "Orthogonality", "MESH_QUALITY", "Orthogonality Angle (deg.)"); AddVolumeOutput("ASPECT_RATIO", "Aspect_Ratio", "MESH_QUALITY", "CV Face Area Aspect Ratio"); @@ -56,14 +50,6 @@ void CFVMOutput::AddCommonFVMOutputs(const CConfig *config) { void CFVMOutput::LoadCommonFVMOutputs(const CConfig* config, const CGeometry* geometry, unsigned long iPoint) { - CPoint* Node_Geo = geometry->nodes; - - // Grid coordinates - SetVolumeOutputValue("COORD-X", iPoint, Node_Geo->GetCoord(iPoint, 0)); - SetVolumeOutputValue("COORD-Y", iPoint, Node_Geo->GetCoord(iPoint, 1)); - if (nDim == 3) - SetVolumeOutputValue("COORD-Z", iPoint, Node_Geo->GetCoord(iPoint, 2)); - // Mesh quality metrics, computed in CPhysicalGeometry::ComputeMeshQualityStatistics. if (config->GetWrt_MeshQuality()) { SetVolumeOutputValue("ORTHOGONALITY", iPoint, geometry->Orthogonality[iPoint]); diff --git a/SU2_CFD/src/output/CFlowCompOutput.cpp b/SU2_CFD/src/output/CFlowCompOutput.cpp index 25eb63ff145e..e5774e0de41e 100644 --- a/SU2_CFD/src/output/CFlowCompOutput.cpp +++ b/SU2_CFD/src/output/CFlowCompOutput.cpp @@ -290,8 +290,11 @@ void CFlowCompOutput::SetHistoryOutputFields(CConfig *config){ void CFlowCompOutput::SetVolumeOutputFields(CConfig *config){ - // Coordinates, Mesh quality metrics - AddCommonFVMOutputs(config); + // Grid coordinates + AddVolumeOutput("COORD-X", "x", "COORDINATES", "x-component of the coordinate vector"); + AddVolumeOutput("COORD-Y", "y", "COORDINATES", "y-component of the coordinate vector"); + if (nDim == 3) + AddVolumeOutput("COORD-Z", "z", "COORDINATES", "z-component of the coordinate vector"); // Solution variables AddVolumeOutput("DENSITY", "Density", "SOLUTION", "Density"); @@ -419,6 +422,8 @@ void CFlowCompOutput::SetVolumeOutputFields(CConfig *config){ AddVolumeOutput("Q_CRITERION", "Q_Criterion", "VORTEX_IDENTIFICATION", "Value of the Q-Criterion"); } + AddCommonFVMOutputs(config); + if (config->GetTime_Domain()){ SetTimeAveragedFields(); } @@ -428,14 +433,17 @@ void CFlowCompOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolv CVariable* Node_Flow = solver[FLOW_SOL]->GetNodes(); CVariable* Node_Turb = nullptr; - CPoint* Node_Geo = geometry->nodes; if (config->GetKind_Turb_Model() != NONE){ Node_Turb = solver[TURB_SOL]->GetNodes(); } - // Coordinates, Mesh quality metrics - LoadCommonFVMOutputs(config, geometry, iPoint); + CPoint* Node_Geo = geometry->nodes; + + SetVolumeOutputValue("COORD-X", iPoint, Node_Geo->GetCoord(iPoint, 0)); + SetVolumeOutputValue("COORD-Y", iPoint, Node_Geo->GetCoord(iPoint, 1)); + if (nDim == 3) + SetVolumeOutputValue("COORD-Z", iPoint, Node_Geo->GetCoord(iPoint, 2)); SetVolumeOutputValue("DENSITY", iPoint, Node_Flow->GetSolution(iPoint, 0)); SetVolumeOutputValue("MOMENTUM-X", iPoint, Node_Flow->GetSolution(iPoint, 1)); @@ -560,6 +568,8 @@ void CFlowCompOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolv SetVolumeOutputValue("Q_CRITERION", iPoint, GetQ_Criterion(&(Node_Flow->GetGradient_Primitive(iPoint)[1]))); } + LoadCommonFVMOutputs(config, geometry, iPoint); + if (config->GetTime_Domain()){ LoadTimeAveragedData(iPoint, Node_Flow); } diff --git a/SU2_CFD/src/output/CFlowIncOutput.cpp b/SU2_CFD/src/output/CFlowIncOutput.cpp index b5c56efea405..a688a9b865c2 100644 --- a/SU2_CFD/src/output/CFlowIncOutput.cpp +++ b/SU2_CFD/src/output/CFlowIncOutput.cpp @@ -372,8 +372,11 @@ void CFlowIncOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSolv void CFlowIncOutput::SetVolumeOutputFields(CConfig *config){ - // Coordinates, Mesh quality metrics - AddCommonFVMOutputs(config); + // Grid coordinates + AddVolumeOutput("COORD-X", "x", "COORDINATES", "x-component of the coordinate vector"); + AddVolumeOutput("COORD-Y", "y", "COORDINATES", "y-component of the coordinate vector"); + if (nDim == 3) + AddVolumeOutput("COORD-Z", "z", "COORDINATES", "z-component of the coordinate vector"); // SOLUTION variables AddVolumeOutput("PRESSURE", "Pressure", "SOLUTION", "Pressure"); @@ -509,6 +512,7 @@ void CFlowIncOutput::SetVolumeOutputFields(CConfig *config){ AddVolumeOutput("RECOVERED_TEMPERATURE", "Recovered_Temperature", "SOLUTION", "Recovered physical temperature"); } + AddCommonFVMOutputs(config); } void CFlowIncOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned long iPoint){ @@ -517,7 +521,6 @@ void CFlowIncOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolve CVariable* Node_Heat = nullptr; CVariable* Node_Turb = nullptr; CVariable* Node_Rad = nullptr; - CPoint* Node_Geo = geometry->nodes; if (config->GetKind_Turb_Model() != NONE){ Node_Turb = solver[TURB_SOL]->GetNodes(); @@ -526,8 +529,12 @@ void CFlowIncOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolve Node_Heat = solver[HEAT_SOL]->GetNodes(); } - // Coordinates, Mesh quality metrics - LoadCommonFVMOutputs(config, geometry, iPoint); + CPoint* Node_Geo = geometry->nodes; + + SetVolumeOutputValue("COORD-X", iPoint, Node_Geo->GetCoord(iPoint, 0)); + SetVolumeOutputValue("COORD-Y", iPoint, Node_Geo->GetCoord(iPoint, 1)); + if (nDim == 3) + SetVolumeOutputValue("COORD-Z", iPoint, Node_Geo->GetCoord(iPoint, 2)); SetVolumeOutputValue("PRESSURE", iPoint, Node_Flow->GetSolution(iPoint, 0)); SetVolumeOutputValue("VELOCITY-X", iPoint, Node_Flow->GetSolution(iPoint, 1)); @@ -658,6 +665,8 @@ void CFlowIncOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolve if (heat && streamwisePeriodic_temperature) SetVolumeOutputValue("RECOVERED_TEMPERATURE", iPoint, Node_Flow->GetStreamwise_Periodic_RecoveredTemperature(iPoint)); } + + LoadCommonFVMOutputs(config, geometry, iPoint); } void CFlowIncOutput::LoadSurfaceData(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned long iPoint, unsigned short iMarker, unsigned long iVertex){ diff --git a/SU2_CFD/src/output/CHeatOutput.cpp b/SU2_CFD/src/output/CHeatOutput.cpp index fd71b45a7752..32cc43bdd41e 100644 --- a/SU2_CFD/src/output/CHeatOutput.cpp +++ b/SU2_CFD/src/output/CHeatOutput.cpp @@ -116,10 +116,13 @@ void CHeatOutput::SetHistoryOutputFields(CConfig *config){ void CHeatOutput::SetVolumeOutputFields(CConfig *config){ - // Coordinates, Mesh quality metrics - AddCommonFVMOutputs(config); + // Grid coordinates + AddVolumeOutput("COORD-X", "x", "COORDINATES", "x-component of the coordinate vector"); + AddVolumeOutput("COORD-Y", "y", "COORDINATES", "y-component of the coordinate vector"); + if (nDim == 3) + AddVolumeOutput("COORD-Z", "z", "COORDINATES","z-component of the coordinate vector"); - // Solution + // SOLUTION AddVolumeOutput("TEMPERATURE", "Temperature", "SOLUTION", "Temperature"); // Primitives @@ -127,21 +130,29 @@ void CHeatOutput::SetVolumeOutputFields(CConfig *config){ // Residuals AddVolumeOutput("RES_TEMPERATURE", "Residual_Temperature", "RESIDUAL", "Residual of the temperature"); + + AddCommonFVMOutputs(config); } void CHeatOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned long iPoint){ CVariable* Node_Heat = solver[HEAT_SOL]->GetNodes(); + CPoint* Node_Geo = geometry->nodes; - // Coordinates, Mesh quality metrics - LoadCommonFVMOutputs(config, geometry, iPoint); + // Grid coordinates + SetVolumeOutputValue("COORD-X", iPoint, Node_Geo->GetCoord(iPoint, 0)); + SetVolumeOutputValue("COORD-Y", iPoint, Node_Geo->GetCoord(iPoint, 1)); + if (nDim == 3) + SetVolumeOutputValue("COORD-Z", iPoint, Node_Geo->GetCoord(iPoint, 2)); - // Solution + // SOLUTION SetVolumeOutputValue("TEMPERATURE", iPoint, Node_Heat->GetSolution(iPoint, 0)); // Residuals SetVolumeOutputValue("RES_TEMPERATURE", iPoint, solver[HEAT_SOL]->LinSysRes(iPoint, 0)); + + LoadCommonFVMOutputs(config, geometry, iPoint); } void CHeatOutput::LoadSurfaceData(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned long iPoint, unsigned short iMarker, unsigned long iVertex){ diff --git a/SU2_CFD/src/output/CNEMOCompOutput.cpp b/SU2_CFD/src/output/CNEMOCompOutput.cpp index 45b5d183e10f..291127f4e08b 100644 --- a/SU2_CFD/src/output/CNEMOCompOutput.cpp +++ b/SU2_CFD/src/output/CNEMOCompOutput.cpp @@ -295,8 +295,11 @@ void CNEMOCompOutput::SetVolumeOutputFields(CConfig *config){ unsigned short nSpecies = config->GetnSpecies(); - // Coordinates, Mesh quality metrics - AddCommonFVMOutputs(config); + // Grid coordinates + AddVolumeOutput("COORD-X", "x", "COORDINATES", "x-component of the coordinate vector"); + AddVolumeOutput("COORD-Y", "y", "COORDINATES", "y-component of the coordinate vector"); + if (nDim == 3) + AddVolumeOutput("COORD-Z", "z", "COORDINATES", "z-component of the coordinate vector"); // Solution variables for(iSpecies = 0; iSpecies < nSpecies; iSpecies++) @@ -424,6 +427,8 @@ void CNEMOCompOutput::SetVolumeOutputFields(CConfig *config){ AddVolumeOutput("VORTICITY_Z", "Vorticity_z", "VORTEX_IDENTIFICATION", "z-component of the vorticity vector"); } + AddCommonFVMOutputs(config); + if (config->GetTime_Domain()){ SetTimeAveragedFields(); } @@ -433,15 +438,18 @@ void CNEMOCompOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolv CVariable* Node_Flow = solver[FLOW_SOL]->GetNodes(); CVariable* Node_Turb = NULL; - auto* Node_Geo = geometry->nodes; unsigned short nSpecies = config->GetnSpecies(); if (config->GetKind_Turb_Model() != NONE){ Node_Turb = solver[TURB_SOL]->GetNodes(); } - // Coordinates, Mesh quality metrics - LoadCommonFVMOutputs(config, geometry, iPoint); + auto* Node_Geo = geometry->nodes; + + SetVolumeOutputValue("COORD-X", iPoint, Node_Geo->GetCoord(iPoint, 0)); + SetVolumeOutputValue("COORD-Y", iPoint, Node_Geo->GetCoord(iPoint, 1)); + if (nDim == 3) + SetVolumeOutputValue("COORD-Z", iPoint, Node_Geo->GetCoord(iPoint, 2)); for(iSpecies = 0; iSpecies < nSpecies; iSpecies++) SetVolumeOutputValue("DENSITY_" + std::to_string(iSpecies), iPoint, Node_Flow->GetSolution(iPoint, iSpecies)); @@ -557,6 +565,8 @@ void CNEMOCompOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolv SetVolumeOutputValue("ROE_DISSIPATION", iPoint, Node_Flow->GetRoe_Dissipation(iPoint)); } + LoadCommonFVMOutputs(config, geometry, iPoint); + if (config->GetTime_Domain()){ LoadTimeAveragedData(iPoint, Node_Flow); } From 1ebee477e09f2e3c43b3c51a920a9d4961ffc96f Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Sun, 6 Jun 2021 00:28:58 +0200 Subject: [PATCH 18/24] AddCoordinates routine for CFVMOutput --- SU2_CFD/include/output/CFVMOutput.hpp | 10 ++++++++++ SU2_CFD/include/output/CHeatOutput.hpp | 2 +- SU2_CFD/src/output/CFVMOutput.cpp | 17 +++++++++++++++++ SU2_CFD/src/output/CFlowCompOutput.cpp | 13 +++---------- SU2_CFD/src/output/CFlowIncOutput.cpp | 13 +++---------- SU2_CFD/src/output/CHeatOutput.cpp | 12 +++--------- SU2_CFD/src/output/CNEMOCompOutput.cpp | 13 +++---------- 7 files changed, 40 insertions(+), 40 deletions(-) diff --git a/SU2_CFD/include/output/CFVMOutput.hpp b/SU2_CFD/include/output/CFVMOutput.hpp index 7eed4f54b759..15769487cb44 100644 --- a/SU2_CFD/include/output/CFVMOutput.hpp +++ b/SU2_CFD/include/output/CFVMOutput.hpp @@ -41,6 +41,16 @@ class CFVMOutput : public COutput{ */ ~CFVMOutput(void) = default; + /*! + * \brief Add Coordinates to output. + */ + void AddCoordinates(); + + /*! + * \brief Load the coordinates. + */ + void LoadCoordinates(const su2double* Coord, const unsigned long iPoint); + /*! * \brief Add common FVM outputs. */ diff --git a/SU2_CFD/include/output/CHeatOutput.hpp b/SU2_CFD/include/output/CHeatOutput.hpp index 279d5658ad87..06f37d1a3344 100644 --- a/SU2_CFD/include/output/CHeatOutput.hpp +++ b/SU2_CFD/include/output/CHeatOutput.hpp @@ -1,6 +1,6 @@ /*! * \file CHeatOutput.hpp - * \brief Headers of the heat output. + * \brief Headers of the heat output. * \author R. Sanchez, T. Albring. * \version 7.1.1 "Blackbird" * diff --git a/SU2_CFD/src/output/CFVMOutput.cpp b/SU2_CFD/src/output/CFVMOutput.cpp index 831a26d5d971..d530cd2f13eb 100644 --- a/SU2_CFD/src/output/CFVMOutput.cpp +++ b/SU2_CFD/src/output/CFVMOutput.cpp @@ -31,6 +31,23 @@ CFVMOutput::CFVMOutput(CConfig *config, unsigned short nDim, bool fem_output) : COutput (config, nDim, fem_output){ } +void CFVMOutput::AddCoordinates() { + + // Grid coordinates + AddVolumeOutput("COORD-X", "x", "COORDINATES", "x-component of the coordinate vector"); + AddVolumeOutput("COORD-Y", "y", "COORDINATES", "y-component of the coordinate vector"); + if (nDim == 3) + AddVolumeOutput("COORD-Z", "z", "COORDINATES", "z-component of the coordinate vector"); +} + +void CFVMOutput::LoadCoordinates(const su2double* Coord, const unsigned long iPoint) { + + SetVolumeOutputValue("COORD-X", iPoint, Coord[0]); + SetVolumeOutputValue("COORD-Y", iPoint, Coord[1]); + if (nDim == 3) + SetVolumeOutputValue("COORD-Z", iPoint, Coord[2]); +} + void CFVMOutput::AddCommonFVMOutputs(const CConfig *config) { // Mesh quality metrics diff --git a/SU2_CFD/src/output/CFlowCompOutput.cpp b/SU2_CFD/src/output/CFlowCompOutput.cpp index e5774e0de41e..0126222cf4ec 100644 --- a/SU2_CFD/src/output/CFlowCompOutput.cpp +++ b/SU2_CFD/src/output/CFlowCompOutput.cpp @@ -291,10 +291,7 @@ void CFlowCompOutput::SetHistoryOutputFields(CConfig *config){ void CFlowCompOutput::SetVolumeOutputFields(CConfig *config){ // Grid coordinates - AddVolumeOutput("COORD-X", "x", "COORDINATES", "x-component of the coordinate vector"); - AddVolumeOutput("COORD-Y", "y", "COORDINATES", "y-component of the coordinate vector"); - if (nDim == 3) - AddVolumeOutput("COORD-Z", "z", "COORDINATES", "z-component of the coordinate vector"); + AddCoordinates(); // Solution variables AddVolumeOutput("DENSITY", "Density", "SOLUTION", "Density"); @@ -433,17 +430,13 @@ void CFlowCompOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolv CVariable* Node_Flow = solver[FLOW_SOL]->GetNodes(); CVariable* Node_Turb = nullptr; + const auto Node_Geo = geometry->nodes; if (config->GetKind_Turb_Model() != NONE){ Node_Turb = solver[TURB_SOL]->GetNodes(); } - CPoint* Node_Geo = geometry->nodes; - - SetVolumeOutputValue("COORD-X", iPoint, Node_Geo->GetCoord(iPoint, 0)); - SetVolumeOutputValue("COORD-Y", iPoint, Node_Geo->GetCoord(iPoint, 1)); - if (nDim == 3) - SetVolumeOutputValue("COORD-Z", iPoint, Node_Geo->GetCoord(iPoint, 2)); + LoadCoordinates(Node_Geo->GetCoord(iPoint), iPoint); SetVolumeOutputValue("DENSITY", iPoint, Node_Flow->GetSolution(iPoint, 0)); SetVolumeOutputValue("MOMENTUM-X", iPoint, Node_Flow->GetSolution(iPoint, 1)); diff --git a/SU2_CFD/src/output/CFlowIncOutput.cpp b/SU2_CFD/src/output/CFlowIncOutput.cpp index a688a9b865c2..57398f448e82 100644 --- a/SU2_CFD/src/output/CFlowIncOutput.cpp +++ b/SU2_CFD/src/output/CFlowIncOutput.cpp @@ -373,10 +373,7 @@ void CFlowIncOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSolv void CFlowIncOutput::SetVolumeOutputFields(CConfig *config){ // Grid coordinates - AddVolumeOutput("COORD-X", "x", "COORDINATES", "x-component of the coordinate vector"); - AddVolumeOutput("COORD-Y", "y", "COORDINATES", "y-component of the coordinate vector"); - if (nDim == 3) - AddVolumeOutput("COORD-Z", "z", "COORDINATES", "z-component of the coordinate vector"); + AddCoordinates(); // SOLUTION variables AddVolumeOutput("PRESSURE", "Pressure", "SOLUTION", "Pressure"); @@ -521,6 +518,7 @@ void CFlowIncOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolve CVariable* Node_Heat = nullptr; CVariable* Node_Turb = nullptr; CVariable* Node_Rad = nullptr; + const auto Node_Geo = geometry->nodes; if (config->GetKind_Turb_Model() != NONE){ Node_Turb = solver[TURB_SOL]->GetNodes(); @@ -529,12 +527,7 @@ void CFlowIncOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolve Node_Heat = solver[HEAT_SOL]->GetNodes(); } - CPoint* Node_Geo = geometry->nodes; - - SetVolumeOutputValue("COORD-X", iPoint, Node_Geo->GetCoord(iPoint, 0)); - SetVolumeOutputValue("COORD-Y", iPoint, Node_Geo->GetCoord(iPoint, 1)); - if (nDim == 3) - SetVolumeOutputValue("COORD-Z", iPoint, Node_Geo->GetCoord(iPoint, 2)); + LoadCoordinates(Node_Geo->GetCoord(iPoint), iPoint); SetVolumeOutputValue("PRESSURE", iPoint, Node_Flow->GetSolution(iPoint, 0)); SetVolumeOutputValue("VELOCITY-X", iPoint, Node_Flow->GetSolution(iPoint, 1)); diff --git a/SU2_CFD/src/output/CHeatOutput.cpp b/SU2_CFD/src/output/CHeatOutput.cpp index 32cc43bdd41e..0e277da57877 100644 --- a/SU2_CFD/src/output/CHeatOutput.cpp +++ b/SU2_CFD/src/output/CHeatOutput.cpp @@ -117,10 +117,7 @@ void CHeatOutput::SetHistoryOutputFields(CConfig *config){ void CHeatOutput::SetVolumeOutputFields(CConfig *config){ // Grid coordinates - AddVolumeOutput("COORD-X", "x", "COORDINATES", "x-component of the coordinate vector"); - AddVolumeOutput("COORD-Y", "y", "COORDINATES", "y-component of the coordinate vector"); - if (nDim == 3) - AddVolumeOutput("COORD-Z", "z", "COORDINATES","z-component of the coordinate vector"); + AddCoordinates(); // SOLUTION AddVolumeOutput("TEMPERATURE", "Temperature", "SOLUTION", "Temperature"); @@ -138,13 +135,10 @@ void CHeatOutput::SetVolumeOutputFields(CConfig *config){ void CHeatOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned long iPoint){ CVariable* Node_Heat = solver[HEAT_SOL]->GetNodes(); - CPoint* Node_Geo = geometry->nodes; + const auto Node_Geo = geometry->nodes; // Grid coordinates - SetVolumeOutputValue("COORD-X", iPoint, Node_Geo->GetCoord(iPoint, 0)); - SetVolumeOutputValue("COORD-Y", iPoint, Node_Geo->GetCoord(iPoint, 1)); - if (nDim == 3) - SetVolumeOutputValue("COORD-Z", iPoint, Node_Geo->GetCoord(iPoint, 2)); + LoadCoordinates(Node_Geo->GetCoord(iPoint), iPoint); // SOLUTION SetVolumeOutputValue("TEMPERATURE", iPoint, Node_Heat->GetSolution(iPoint, 0)); diff --git a/SU2_CFD/src/output/CNEMOCompOutput.cpp b/SU2_CFD/src/output/CNEMOCompOutput.cpp index 291127f4e08b..779b72aa86af 100644 --- a/SU2_CFD/src/output/CNEMOCompOutput.cpp +++ b/SU2_CFD/src/output/CNEMOCompOutput.cpp @@ -296,10 +296,7 @@ void CNEMOCompOutput::SetVolumeOutputFields(CConfig *config){ unsigned short nSpecies = config->GetnSpecies(); // Grid coordinates - AddVolumeOutput("COORD-X", "x", "COORDINATES", "x-component of the coordinate vector"); - AddVolumeOutput("COORD-Y", "y", "COORDINATES", "y-component of the coordinate vector"); - if (nDim == 3) - AddVolumeOutput("COORD-Z", "z", "COORDINATES", "z-component of the coordinate vector"); + AddCoordinates(); // Solution variables for(iSpecies = 0; iSpecies < nSpecies; iSpecies++) @@ -439,17 +436,13 @@ void CNEMOCompOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolv CVariable* Node_Flow = solver[FLOW_SOL]->GetNodes(); CVariable* Node_Turb = NULL; unsigned short nSpecies = config->GetnSpecies(); + const auto Node_Geo = geometry->nodes; if (config->GetKind_Turb_Model() != NONE){ Node_Turb = solver[TURB_SOL]->GetNodes(); } - auto* Node_Geo = geometry->nodes; - - SetVolumeOutputValue("COORD-X", iPoint, Node_Geo->GetCoord(iPoint, 0)); - SetVolumeOutputValue("COORD-Y", iPoint, Node_Geo->GetCoord(iPoint, 1)); - if (nDim == 3) - SetVolumeOutputValue("COORD-Z", iPoint, Node_Geo->GetCoord(iPoint, 2)); + LoadCoordinates(Node_Geo->GetCoord(iPoint), iPoint); for(iSpecies = 0; iSpecies < nSpecies; iSpecies++) SetVolumeOutputValue("DENSITY_" + std::to_string(iSpecies), iPoint, Node_Flow->GetSolution(iPoint, iSpecies)); From 034eb5af3f8e041366f8f80a7b07c02f3c62ac19 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Sun, 6 Jun 2021 00:29:35 +0200 Subject: [PATCH 19/24] TimeRef multizoneDriver --- SU2_CFD/src/drivers/CMultizoneDriver.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/SU2_CFD/src/drivers/CMultizoneDriver.cpp b/SU2_CFD/src/drivers/CMultizoneDriver.cpp index cb904f1a143a..635abc330f58 100644 --- a/SU2_CFD/src/drivers/CMultizoneDriver.cpp +++ b/SU2_CFD/src/drivers/CMultizoneDriver.cpp @@ -142,11 +142,8 @@ void CMultizoneDriver::StartSolver() { To ensure that all zones run synchronously in time, be it a dimensional or non-dimensionalized one. ---*/ su2double Time_Ref = config_container[ZONE_0]->GetTime_Ref(); - - for (iZone = 1; iZone < nZone; iZone++) { - if (config_container[iZone]->GetTime_Ref() < Time_Ref) - Time_Ref = min(Time_Ref, config_container[iZone]->GetTime_Ref()); - } + for (iZone = 1; iZone < nZone; iZone++) + Time_Ref = min(Time_Ref, config_container[iZone]->GetTime_Ref()); for (iZone = 0; iZone < nZone; iZone++) { From cd175e6ce032377511a8cb131f4fb430cc83b175 Mon Sep 17 00:00:00 2001 From: TobiKattmann <31306376+TobiKattmann@users.noreply.github.com> Date: Sun, 6 Jun 2021 17:17:37 +0200 Subject: [PATCH 20/24] Multizone TimeRef update 1/2 Co-authored-by: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com> --- SU2_CFD/src/drivers/CMultizoneDriver.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SU2_CFD/src/drivers/CMultizoneDriver.cpp b/SU2_CFD/src/drivers/CMultizoneDriver.cpp index 635abc330f58..8704da027e50 100644 --- a/SU2_CFD/src/drivers/CMultizoneDriver.cpp +++ b/SU2_CFD/src/drivers/CMultizoneDriver.cpp @@ -141,7 +141,7 @@ void CMultizoneDriver::StartSolver() { /*--- Find out the minimum of all references times and then set each zone to this (same) value. To ensure that all zones run synchronously in time, be it a dimensional or non-dimensionalized one. ---*/ - su2double Time_Ref = config_container[ZONE_0]->GetTime_Ref(); + su2double Time_Ref = std::numeric_limits::max(); for (iZone = 1; iZone < nZone; iZone++) Time_Ref = min(Time_Ref, config_container[iZone]->GetTime_Ref()); From f52092def27941c42ddc9ef17fc9dd4f4dee5995 Mon Sep 17 00:00:00 2001 From: TobiKattmann <31306376+TobiKattmann@users.noreply.github.com> Date: Sun, 6 Jun 2021 17:17:50 +0200 Subject: [PATCH 21/24] Multizone TimeRef update 2/2 Co-authored-by: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com> --- SU2_CFD/src/drivers/CMultizoneDriver.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SU2_CFD/src/drivers/CMultizoneDriver.cpp b/SU2_CFD/src/drivers/CMultizoneDriver.cpp index 8704da027e50..ea5af8b59457 100644 --- a/SU2_CFD/src/drivers/CMultizoneDriver.cpp +++ b/SU2_CFD/src/drivers/CMultizoneDriver.cpp @@ -142,7 +142,7 @@ void CMultizoneDriver::StartSolver() { To ensure that all zones run synchronously in time, be it a dimensional or non-dimensionalized one. ---*/ su2double Time_Ref = std::numeric_limits::max(); - for (iZone = 1; iZone < nZone; iZone++) + for (iZone = 0; iZone < nZone; iZone++) Time_Ref = min(Time_Ref, config_container[iZone]->GetTime_Ref()); for (iZone = 0; iZone < nZone; iZone++) { From e5f6d4fbab764be32c4ae2b816bc3da04f224fc3 Mon Sep 17 00:00:00 2001 From: TobiKattmann <31306376+TobiKattmann@users.noreply.github.com> Date: Sun, 6 Jun 2021 17:20:01 +0200 Subject: [PATCH 22/24] Templated input Coord to CFVMOutput::LoadCoordinates 1/2 Co-authored-by: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com> --- SU2_CFD/src/output/CFVMOutput.cpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/SU2_CFD/src/output/CFVMOutput.cpp b/SU2_CFD/src/output/CFVMOutput.cpp index d530cd2f13eb..364f1f357eba 100644 --- a/SU2_CFD/src/output/CFVMOutput.cpp +++ b/SU2_CFD/src/output/CFVMOutput.cpp @@ -40,13 +40,6 @@ void CFVMOutput::AddCoordinates() { AddVolumeOutput("COORD-Z", "z", "COORDINATES", "z-component of the coordinate vector"); } -void CFVMOutput::LoadCoordinates(const su2double* Coord, const unsigned long iPoint) { - - SetVolumeOutputValue("COORD-X", iPoint, Coord[0]); - SetVolumeOutputValue("COORD-Y", iPoint, Coord[1]); - if (nDim == 3) - SetVolumeOutputValue("COORD-Z", iPoint, Coord[2]); -} void CFVMOutput::AddCommonFVMOutputs(const CConfig *config) { From 80f8a3e62ac3819672b75aa3a29ef75694f23a22 Mon Sep 17 00:00:00 2001 From: TobiKattmann <31306376+TobiKattmann@users.noreply.github.com> Date: Sun, 6 Jun 2021 17:20:14 +0200 Subject: [PATCH 23/24] Templated input Coord to CFVMOutput::LoadCoordinates 2/2 Co-authored-by: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com> --- SU2_CFD/include/output/CFVMOutput.hpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/SU2_CFD/include/output/CFVMOutput.hpp b/SU2_CFD/include/output/CFVMOutput.hpp index 15769487cb44..7e7da9e7a380 100644 --- a/SU2_CFD/include/output/CFVMOutput.hpp +++ b/SU2_CFD/include/output/CFVMOutput.hpp @@ -49,7 +49,13 @@ class CFVMOutput : public COutput{ /*! * \brief Load the coordinates. */ - void LoadCoordinates(const su2double* Coord, const unsigned long iPoint); + template + inline void LoadCoordinates(const T& Coord, const unsigned long iPoint) { + SetVolumeOutputValue("COORD-X", iPoint, Coord[0]); + SetVolumeOutputValue("COORD-Y", iPoint, Coord[1]); + if (nDim == 3) + SetVolumeOutputValue("COORD-Z", iPoint, Coord[2]); + } /*! * \brief Add common FVM outputs. From 1771391e4f771f7ce684977cb05d7675fd75844b Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Thu, 18 Mar 2021 22:42:57 +0100 Subject: [PATCH 24/24] Move unsteady CHT regression test to tutorials.py. --- TestCases/parallel_regression.py | 13 ------------- TestCases/serial_regression.py | 13 ------------- TestCases/tutorials.py | 14 ++++++++++++++ 3 files changed, 14 insertions(+), 26 deletions(-) diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py index 54728bb237a0..77faa7d3ecf9 100644 --- a/TestCases/parallel_regression.py +++ b/TestCases/parallel_regression.py @@ -1252,19 +1252,6 @@ def main(): cht_incompressible.tol = 0.00001 test_list.append(cht_incompressible) - # CHT incompressible unsteady - cht_incompressible_unsteady = TestCase('cht_incompressible_unsteady') - cht_incompressible_unsteady.cfg_dir = "coupled_cht/incomp_2d_unsteady" - cht_incompressible_unsteady.cfg_file = "cht_2d_3cylinders.cfg" - cht_incompressible_unsteady.test_iter = 2 - cht_incompressible_unsteady.test_vals = [-1.305471, -0.080372, -0.080376, -0.080372] #last 4 columns - cht_incompressible_unsteady.su2_exec = "mpirun -n 2 SU2_CFD" - cht_incompressible_unsteady.timeout = 1600 - cht_incompressible_unsteady.multizone = True - cht_incompressible_unsteady.unsteady = True - cht_incompressible_unsteady.tol = 0.00001 - test_list.append(cht_incompressible_unsteady) - # CHT compressible cht_compressible = TestCase('cht_compressible') cht_compressible.cfg_dir = "coupled_cht/comp_2d" diff --git a/TestCases/serial_regression.py b/TestCases/serial_regression.py index 6a715ac54781..040d9fba0207 100644 --- a/TestCases/serial_regression.py +++ b/TestCases/serial_regression.py @@ -1416,19 +1416,6 @@ def main(): cht_incompressible.tol = 0.00001 test_list.append(cht_incompressible) - # CHT incompressible unsteady - cht_incompressible_unsteady = TestCase('cht_incompressible_unsteady') - cht_incompressible_unsteady.cfg_dir = "coupled_cht/incomp_2d_unsteady" - cht_incompressible_unsteady.cfg_file = "cht_2d_3cylinders.cfg" - cht_incompressible_unsteady.test_iter = 2 - cht_incompressible_unsteady.test_vals = [-1.303588, -0.080377, -0.080380, -0.080377] #last 4 columns - cht_incompressible_unsteady.su2_exec = "SU2_CFD" - cht_incompressible_unsteady.timeout = 1600 - cht_incompressible_unsteady.multizone = True - cht_incompressible_unsteady.unsteady = True - cht_incompressible_unsteady.tol = 0.00001 - test_list.append(cht_incompressible_unsteady) - # CHT compressible cht_incompressible = TestCase('cht_compressible') cht_incompressible.cfg_dir = "coupled_cht/comp_2d" diff --git a/TestCases/tutorials.py b/TestCases/tutorials.py index 8ae969d93c79..01bf850b4e2d 100644 --- a/TestCases/tutorials.py +++ b/TestCases/tutorials.py @@ -42,6 +42,20 @@ def main(): ### RUN TUTORIAL CASES ### ###################################### + + # CHT incompressible unsteady + cht_incompressible_unsteady = TestCase('cht_incompressible_unsteady') + cht_incompressible_unsteady.cfg_dir = "../Tutorials/multiphysics/unsteady_cht/" + cht_incompressible_unsteady.cfg_file = "cht_2d_3cylinders.cfg" + cht_incompressible_unsteady.test_iter = 2 + cht_incompressible_unsteady.test_vals = [-2.659390, -2.533160, -0.080399, -0.080399, -0.080399, -12.421450, 0.0000e+00, 0.0000e+00, 2.3824e+02] #last 9 columns + cht_incompressible_unsteady.su2_exec = "mpirun -n 2 SU2_CFD" + cht_incompressible_unsteady.timeout = 1600 + cht_incompressible_unsteady.multizone = True + cht_incompressible_unsteady.unsteady = True + cht_incompressible_unsteady.tol = 0.00001 + test_list.append(cht_incompressible_unsteady) + ### Incompressible Flow # 2D pin case massflow periodic with heatflux BC and prescribed extracted outlet heat