Skip to content

Commit

Permalink
Merge pull request #2077 from MastermindScope/patch-1
Browse files Browse the repository at this point in the history
Add Velocity volume output for compressible flow solvers
  • Loading branch information
pcarruscag authored Aug 7, 2023
2 parents 2f37e98 + b3e4bdd commit aca53d5
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ Thomas D. Economon
Tim Albring
TobiKattmann
Trent Lukaczyk
Vinzenz Götz
VivaanKhatri
Wally Maier
Y. Chandukrishna
Expand Down
11 changes: 11 additions & 0 deletions SU2_CFD/src/output/CFlowCompOutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ void CFlowCompOutput::SetVolumeOutputFields(CConfig *config){
AddVolumeOutput("DENSITY", "Density", "SOLUTION", "Density");
AddVolumeOutput("MOMENTUM-X", "Momentum_x", "SOLUTION", "x-component of the momentum vector");
AddVolumeOutput("MOMENTUM-Y", "Momentum_y", "SOLUTION", "y-component of the momentum vector");

if (nDim == 3)
AddVolumeOutput("MOMENTUM-Z", "Momentum_z", "SOLUTION", "z-component of the momentum vector");
AddVolumeOutput("ENERGY", "Energy", "SOLUTION", "Energy");
Expand All @@ -237,6 +238,11 @@ void CFlowCompOutput::SetVolumeOutputFields(CConfig *config){
AddVolumeOutput("TEMPERATURE", "Temperature", "PRIMITIVE", "Temperature");
AddVolumeOutput("MACH", "Mach", "PRIMITIVE", "Mach number");
AddVolumeOutput("PRESSURE_COEFF", "Pressure_Coefficient", "PRIMITIVE", "Pressure coefficient");
AddVolumeOutput("VELOCITY-X", "Velocity_x", "PRIMITIVE", "x-component of the velocity vector");
AddVolumeOutput("VELOCITY-Y", "Velocity_y", "PRIMITIVE", "y-component of the velocity vector");

if (nDim == 3)
AddVolumeOutput("VELOCITY-Z", "Velocity_z", "PRIMITIVE", "z-component of the velocity vector");

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

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

if(config->GetKind_FluidModel() == DATADRIVEN_FLUID){
SetVolumeOutputValue("EXTRAPOLATION", iPoint, Node_Flow->GetDataExtrapolation(iPoint));
Expand Down
7 changes: 7 additions & 0 deletions SU2_CFD/src/output/CNEMOCompOutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,10 @@ void CNEMOCompOutput::SetVolumeOutputFields(CConfig *config){
AddVolumeOutput("PRESSURE", "Pressure", "PRIMITIVE", "Pressure");
AddVolumeOutput("TEMPERATURE_TR", "Temperature_tr", "PRIMITIVE", "Temperature_tr");
AddVolumeOutput("TEMPERATURE_VE", "Temperature_ve", "PRIMITIVE", "Temperature_ve");
AddVolumeOutput("VELOCITY-X", "Velocity_x", "PRIMITIVE", "x-component of the velocity vector");
AddVolumeOutput("VELOCITY-Y", "Velocity_y", "PRIMITIVE", "y-component of the velocity vector");
if (nDim == 3)
AddVolumeOutput("VELOCITY-Z", "Velocity_z", "PRIMITIVE", "z-component of the velocity vector");

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

SetVolumeOutputValue("MOMENTUM-X", iPoint, Node_Flow->GetSolution(iPoint, nSpecies));
SetVolumeOutputValue("MOMENTUM-Y", iPoint, Node_Flow->GetSolution(iPoint, nSpecies+1));
SetVolumeOutputValue("VELOCITY-X", iPoint, Node_Flow->GetPrimitive(iPoint, nSpecies));
SetVolumeOutputValue("VELOCITY-Y", iPoint, Node_Flow->GetPrimitive(iPoint, nSpecies+1));
if (nDim == 3){
SetVolumeOutputValue("MOMENTUM-Z", iPoint, Node_Flow->GetSolution(iPoint, nSpecies+2));
SetVolumeOutputValue("ENERGY", iPoint, Node_Flow->GetSolution(iPoint, nSpecies+3));
SetVolumeOutputValue("ENERGY_VE", iPoint, Node_Flow->GetSolution(iPoint, nSpecies+4));
SetVolumeOutputValue("VELOCITY-Z", iPoint, Node_Flow->GetPrimitive(iPoint, nSpecies+2));
} else {
SetVolumeOutputValue("ENERGY", iPoint, Node_Flow->GetSolution(iPoint, nSpecies+2));
SetVolumeOutputValue("ENERGY_VE", iPoint, Node_Flow->GetSolution(iPoint, nSpecies+3));
Expand Down

0 comments on commit aca53d5

Please sign in to comment.