Skip to content

Commit aca53d5

Browse files
authored
Merge pull request #2077 from MastermindScope/patch-1
Add Velocity volume output for compressible flow solvers
2 parents 2f37e98 + b3e4bdd commit aca53d5

3 files changed

Lines changed: 19 additions & 0 deletions

File tree

AUTHORS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ Thomas D. Economon
132132
Tim Albring
133133
TobiKattmann
134134
Trent Lukaczyk
135+
Vinzenz Götz
135136
VivaanKhatri
136137
Wally Maier
137138
Y. Chandukrishna

SU2_CFD/src/output/CFlowCompOutput.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ void CFlowCompOutput::SetVolumeOutputFields(CConfig *config){
218218
AddVolumeOutput("DENSITY", "Density", "SOLUTION", "Density");
219219
AddVolumeOutput("MOMENTUM-X", "Momentum_x", "SOLUTION", "x-component of the momentum vector");
220220
AddVolumeOutput("MOMENTUM-Y", "Momentum_y", "SOLUTION", "y-component of the momentum vector");
221+
221222
if (nDim == 3)
222223
AddVolumeOutput("MOMENTUM-Z", "Momentum_z", "SOLUTION", "z-component of the momentum vector");
223224
AddVolumeOutput("ENERGY", "Energy", "SOLUTION", "Energy");
@@ -237,6 +238,11 @@ void CFlowCompOutput::SetVolumeOutputFields(CConfig *config){
237238
AddVolumeOutput("TEMPERATURE", "Temperature", "PRIMITIVE", "Temperature");
238239
AddVolumeOutput("MACH", "Mach", "PRIMITIVE", "Mach number");
239240
AddVolumeOutput("PRESSURE_COEFF", "Pressure_Coefficient", "PRIMITIVE", "Pressure coefficient");
241+
AddVolumeOutput("VELOCITY-X", "Velocity_x", "PRIMITIVE", "x-component of the velocity vector");
242+
AddVolumeOutput("VELOCITY-Y", "Velocity_y", "PRIMITIVE", "y-component of the velocity vector");
243+
244+
if (nDim == 3)
245+
AddVolumeOutput("VELOCITY-Z", "Velocity_z", "PRIMITIVE", "z-component of the velocity vector");
240246

241247
// Datadriven fluid model
242248
if(config->GetKind_FluidModel() == DATADRIVEN_FLUID){
@@ -330,6 +336,11 @@ void CFlowCompOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolv
330336

331337
const su2double factor = solver[FLOW_SOL]->GetReferenceDynamicPressure();
332338
SetVolumeOutputValue("PRESSURE_COEFF", iPoint, (Node_Flow->GetPressure(iPoint) - solver[FLOW_SOL]->GetPressure_Inf())/factor);
339+
SetVolumeOutputValue("VELOCITY-X", iPoint, Node_Flow->GetVelocity(iPoint, 0));
340+
SetVolumeOutputValue("VELOCITY-Y", iPoint, Node_Flow->GetVelocity(iPoint, 1));
341+
if (nDim == 3){
342+
SetVolumeOutputValue("VELOCITY-Z", iPoint, Node_Flow->GetVelocity(iPoint, 2));
343+
}
333344

334345
if(config->GetKind_FluidModel() == DATADRIVEN_FLUID){
335346
SetVolumeOutputValue("EXTRAPOLATION", iPoint, Node_Flow->GetDataExtrapolation(iPoint));

SU2_CFD/src/output/CNEMOCompOutput.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,10 @@ void CNEMOCompOutput::SetVolumeOutputFields(CConfig *config){
242242
AddVolumeOutput("PRESSURE", "Pressure", "PRIMITIVE", "Pressure");
243243
AddVolumeOutput("TEMPERATURE_TR", "Temperature_tr", "PRIMITIVE", "Temperature_tr");
244244
AddVolumeOutput("TEMPERATURE_VE", "Temperature_ve", "PRIMITIVE", "Temperature_ve");
245+
AddVolumeOutput("VELOCITY-X", "Velocity_x", "PRIMITIVE", "x-component of the velocity vector");
246+
AddVolumeOutput("VELOCITY-Y", "Velocity_y", "PRIMITIVE", "y-component of the velocity vector");
247+
if (nDim == 3)
248+
AddVolumeOutput("VELOCITY-Z", "Velocity_z", "PRIMITIVE", "z-component of the velocity vector");
245249

246250
AddVolumeOutput("MACH", "Mach", "PRIMITIVE", "Mach number");
247251
AddVolumeOutput("PRESSURE_COEFF", "Pressure_Coefficient", "PRIMITIVE", "Pressure coefficient");
@@ -313,10 +317,13 @@ void CNEMOCompOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolv
313317

314318
SetVolumeOutputValue("MOMENTUM-X", iPoint, Node_Flow->GetSolution(iPoint, nSpecies));
315319
SetVolumeOutputValue("MOMENTUM-Y", iPoint, Node_Flow->GetSolution(iPoint, nSpecies+1));
320+
SetVolumeOutputValue("VELOCITY-X", iPoint, Node_Flow->GetPrimitive(iPoint, nSpecies));
321+
SetVolumeOutputValue("VELOCITY-Y", iPoint, Node_Flow->GetPrimitive(iPoint, nSpecies+1));
316322
if (nDim == 3){
317323
SetVolumeOutputValue("MOMENTUM-Z", iPoint, Node_Flow->GetSolution(iPoint, nSpecies+2));
318324
SetVolumeOutputValue("ENERGY", iPoint, Node_Flow->GetSolution(iPoint, nSpecies+3));
319325
SetVolumeOutputValue("ENERGY_VE", iPoint, Node_Flow->GetSolution(iPoint, nSpecies+4));
326+
SetVolumeOutputValue("VELOCITY-Z", iPoint, Node_Flow->GetPrimitive(iPoint, nSpecies+2));
320327
} else {
321328
SetVolumeOutputValue("ENERGY", iPoint, Node_Flow->GetSolution(iPoint, nSpecies+2));
322329
SetVolumeOutputValue("ENERGY_VE", iPoint, Node_Flow->GetSolution(iPoint, nSpecies+3));

0 commit comments

Comments
 (0)