Skip to content

Commit

Permalink
Merge pull request #1004 from su2code/fix_gridvel
Browse files Browse the repository at this point in the history
Adds Grid Velocity Term in the Euler/Symmetry BC
  • Loading branch information
economon authored May 29, 2020
2 parents 626be8f + bd46eb5 commit 916219d
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 27 deletions.
6 changes: 6 additions & 0 deletions SU2_CFD/src/solvers/CEulerSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

#include "../../include/solvers/CEulerSolver.hpp"
#include "../../include/variables/CNSVariable.hpp"
#include "../../../Common/include/toolboxes/geometry_toolbox.hpp"
#include "../../../Common/include/toolboxes/printing_toolbox.hpp"
#include "../../include/gradients/computeGradientsGreenGauss.hpp"
#include "../../include/gradients/computeGradientsLeastSquares.hpp"
Expand Down Expand Up @@ -6841,6 +6842,11 @@ void CEulerSolver::BC_Sym_Plane(CGeometry *geometry,
velocity in normal direction: v_r = v - 2 (v*n)n ---*/
ProjVelocity_i = nodes->GetProjVel(iPoint,UnitNormal);

/*--- Adjustment to v.n due to grid movement. ---*/
if (dynamic_grid) {
ProjVelocity_i -= GeometryToolbox::DotProduct(nDim, geometry->nodes->GetGridVel(iPoint), UnitNormal);
}

for (iDim = 0; iDim < nDim; iDim++)
V_reflected[iDim+1] = nodes->GetVelocity(iPoint,iDim) - 2.0 * ProjVelocity_i*UnitNormal[iDim];

Expand Down
8 changes: 4 additions & 4 deletions TestCases/hybrid_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ def main():
harmonic_balance.cfg_dir = "harmonic_balance"
harmonic_balance.cfg_file = "HB.cfg"
harmonic_balance.test_iter = 25
harmonic_balance.test_vals = [-1.589863, 3.922098, -0.001443, 0.099457]
harmonic_balance.test_vals = [-1.589755, 3.922207, 0.006725, 0.099455]
harmonic_balance.new_output = False
test_list.append(harmonic_balance)

Expand Down Expand Up @@ -327,7 +327,7 @@ def main():
sine_gust.cfg_dir = "gust"
sine_gust.cfg_file = "inv_gust_NACA0012.cfg"
sine_gust.test_iter = 5
sine_gust.test_vals = [-1.977545, 3.481778, -0.001667, -0.007429]
sine_gust.test_vals = [-1.977520, 3.481804, -0.012404, -0.007452]
sine_gust.unsteady = True
test_list.append(sine_gust)

Expand All @@ -336,7 +336,7 @@ def main():
aeroelastic.cfg_dir = "aeroelastic"
aeroelastic.cfg_file = "aeroelastic_NACA64A010.cfg"
aeroelastic.test_iter = 2
aeroelastic.test_vals = [0.079009, 0.033187, -0.001665, -0.000156]
aeroelastic.test_vals = [0.074525, 0.033127, -0.001650, -0.000127]
aeroelastic.unsteady = True
test_list.append(aeroelastic)

Expand Down Expand Up @@ -467,7 +467,7 @@ def main():
rotating_cylinders.cfg_dir = "sliding_interface/rotating_cylinders"
rotating_cylinders.cfg_file = "rot_cylinders_WA.cfg"
rotating_cylinders.test_iter = 3
rotating_cylinders.test_vals = [3.000000, 0.000000, 0.777267, 1.134746, 1.224125]
rotating_cylinders.test_vals = [3.000000, 0.000000, 0.777567, 1.134807, 1.224136]
rotating_cylinders.unsteady = True
rotating_cylinders.multizone = True
test_list.append(rotating_cylinders)
Expand Down
10 changes: 5 additions & 5 deletions TestCases/parallel_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ def main():
harmonic_balance.cfg_dir = "harmonic_balance"
harmonic_balance.cfg_file = "HB.cfg"
harmonic_balance.test_iter = 25
harmonic_balance.test_vals = [-1.589862, 3.922099, -0.001443, 0.099456] #last 4 columns
harmonic_balance.test_vals = [-1.589755, 3.922208, 0.006724, 0.099454] #last 4 columns
harmonic_balance.su2_exec = "parallel_computation.py -f"
harmonic_balance.timeout = 1600
harmonic_balance.tol = 0.00001
Expand Down Expand Up @@ -756,7 +756,7 @@ def main():
sine_gust.cfg_dir = "gust"
sine_gust.cfg_file = "inv_gust_NACA0012.cfg"
sine_gust.test_iter = 5
sine_gust.test_vals = [-1.977545, 3.481778, -0.001525, -0.007375] #last 4 columns
sine_gust.test_vals = [-1.977520, 3.481804, -0.012343, -0.007390] #last 4 columns
sine_gust.su2_exec = "parallel_computation.py -f"
sine_gust.timeout = 1600
sine_gust.tol = 0.00001
Expand All @@ -768,7 +768,7 @@ def main():
aeroelastic.cfg_dir = "aeroelastic"
aeroelastic.cfg_file = "aeroelastic_NACA64A010.cfg"
aeroelastic.test_iter = 2
aeroelastic.test_vals = [0.081326, 0.033214, -0.001666, -0.000155] #last 4 columns
aeroelastic.test_vals = [0.076842, 0.033154, -0.001650, -0.000127] #last 4 columns
aeroelastic.su2_exec = "parallel_computation.py -f"
aeroelastic.timeout = 1600
aeroelastic.tol = 0.00001
Expand Down Expand Up @@ -950,7 +950,7 @@ def main():
rotating_cylinders.cfg_dir = "sliding_interface/rotating_cylinders"
rotating_cylinders.cfg_file = "rot_cylinders_WA.cfg"
rotating_cylinders.test_iter = 3
rotating_cylinders.test_vals = [3.000000, 0.000000, 0.777274, 1.134742, 1.224125] #last 4 columns
rotating_cylinders.test_vals = [3.000000, 0.000000, 0.777575, 1.134804, 1.224136] #last 4 columns
rotating_cylinders.su2_exec = "parallel_computation.py -f"
rotating_cylinders.timeout = 1600
rotating_cylinders.tol = 0.00001
Expand Down Expand Up @@ -1184,7 +1184,7 @@ def main():
pywrapper_aeroelastic.cfg_dir = "aeroelastic"
pywrapper_aeroelastic.cfg_file = "aeroelastic_NACA64A010.cfg"
pywrapper_aeroelastic.test_iter = 2
pywrapper_aeroelastic.test_vals = [0.081326, 0.033214, -0.001666, -0.000155] #last 4 columns
pywrapper_aeroelastic.test_vals = [0.076842, 0.033154, -0.001650, -0.000127] #last 4 columns
pywrapper_aeroelastic.su2_exec = "mpirun -np 2 SU2_CFD.py --parallel -f"
pywrapper_aeroelastic.timeout = 1600
pywrapper_aeroelastic.tol = 0.00001
Expand Down
2 changes: 1 addition & 1 deletion TestCases/parallel_regression_AD.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ def main():
discadj_pitchingNACA0012.cfg_dir = "disc_adj_euler/naca0012_pitching"
discadj_pitchingNACA0012.cfg_file = "inv_NACA0012_pitching.cfg"
discadj_pitchingNACA0012.test_iter = 4
discadj_pitchingNACA0012.test_vals = [-1.236430, -1.654332, -0.007426, 0.000013] #last 4 columns
discadj_pitchingNACA0012.test_vals = [-1.225570, -1.643131, -0.007597, 0.000013] #last 4 columns
discadj_pitchingNACA0012.su2_exec = "parallel_computation.py -f"
discadj_pitchingNACA0012.timeout = 1600
discadj_pitchingNACA0012.tol = 0.00001
Expand Down
19 changes: 10 additions & 9 deletions TestCases/rotating/caradonna_tung/rot_caradonna_tung.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
% Case description: Caradonna & Tung rotor in hover (still air) %
% Author: Thomas D. Economon %
% Institution: Stanford University %
% Date: 2013.09.29 %
% Date: 2020.05.24 %
% File Version 7.0.4 "Blackbird" %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Expand Down Expand Up @@ -91,39 +91,39 @@ MARKER_MONITORING= ( blade_1, blade_2 )
NUM_METHOD_GRAD= GREEN_GAUSS
%
% Courant-Friedrichs-Lewy condition of the finest grid
CFL_NUMBER= 6.0
CFL_NUMBER= 1e3
%
% Adaptive CFL number (NO, YES)
CFL_ADAPT= NO
%
% Parameters of the adaptive CFL number (factor down, factor up, CFL min value,
% CFL max value )
CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 )
CFL_ADAPT_PARAM= ( 0.1, 2.0, 15, 1e6 )
%
% Runge-Kutta alpha coefficients
RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 )
%
% Number of total iterations
EXT_ITER= 99999
ITER= 99999

% ------------------------ LINEAR SOLVER DEFINITION ---------------------------%
%
% Linear solver for implicit formulations (BCGSTAB, FGMRES)
LINEAR_SOLVER= FGMRES
%
% Preconditioner of the Krylov linear solver (JACOBI, LINELET, LU_SGS)
LINEAR_SOLVER_PREC= LU_SGS
LINEAR_SOLVER_PREC= ILU
%
% Minimum error of the linear solver for implicit formulations
LINEAR_SOLVER_ERROR= 1E-4
LINEAR_SOLVER_ERROR= 1E-10
%
% Max number of iterations of the linear solver for the implicit formulation
LINEAR_SOLVER_ITER= 4
LINEAR_SOLVER_ITER= 10

% -------------------------- MULTIGRID PARAMETERS -----------------------------%
%
% Multi-Grid Levels (0 = no multi-grid)
MGLEVEL= 2
MGLEVEL= 3
%
% Multi-grid cycle (V_CYCLE, W_CYCLE, FULLMG_CYCLE)
MGCYCLE= W_CYCLE
Expand Down Expand Up @@ -168,7 +168,6 @@ TIME_DISCRE_FLOW= EULER_IMPLICIT
%
CONV_CRITERIA= RESIDUAL
%
%
% Min value of the residual (log10 of the residual)
CONV_RESIDUAL_MINVAL= -12
%
Expand Down Expand Up @@ -231,3 +230,5 @@ WRT_SOL_FREQ= 100
%
% Writing convergence history frequency
WRT_CON_FREQ= 1

SCREEN_OUTPUT=(INNER_ITER, WALL_TIME, RMS_DENSITY, LIFT, DRAG, AVG_CFL)
12 changes: 6 additions & 6 deletions TestCases/serial_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,7 @@ def main():
harmonic_balance.cfg_dir = "harmonic_balance"
harmonic_balance.cfg_file = "HB.cfg"
harmonic_balance.test_iter = 25
harmonic_balance.test_vals = [-1.589862, 3.922099, -0.001443, 0.099456] #last 4 columns
harmonic_balance.test_vals = [-1.589755, 3.922208, 0.006724, 0.099454] #last 4 columns
harmonic_balance.su2_exec = "SU2_CFD"
harmonic_balance.new_output = False
harmonic_balance.timeout = 1600
Expand Down Expand Up @@ -887,7 +887,7 @@ def main():
sine_gust.cfg_dir = "gust"
sine_gust.cfg_file = "inv_gust_NACA0012.cfg"
sine_gust.test_iter = 5
sine_gust.test_vals = [-1.977545, 3.481778, -0.001572, -0.007286] #last 4 columns
sine_gust.test_vals = [-1.977520, 3.481804, -0.012277, -0.007308] #last 4 columns
sine_gust.su2_exec = "SU2_CFD"
sine_gust.timeout = 1600
sine_gust.tol = 0.00001
Expand All @@ -900,7 +900,7 @@ def main():
aeroelastic.cfg_dir = "aeroelastic"
aeroelastic.cfg_file = "aeroelastic_NACA64A010.cfg"
aeroelastic.test_iter = 2
aeroelastic.test_vals = [0.079371, 0.033176, -0.001665, -0.000156] #last 4 columns
aeroelastic.test_vals = [0.074885, 0.033116, -0.001650, -0.000127] #last 4 columns
aeroelastic.su2_exec = "SU2_CFD"
aeroelastic.timeout = 1600
aeroelastic.tol = 0.00001
Expand Down Expand Up @@ -938,7 +938,7 @@ def main():
unst_deforming_naca0012.cfg_dir = "disc_adj_euler/naca0012_pitching_def"
unst_deforming_naca0012.cfg_file = "inv_NACA0012_pitching_deform.cfg"
unst_deforming_naca0012.test_iter = 5
unst_deforming_naca0012.test_vals = [ -3.669625, -3.818858, -3.729946, -3.155637] #last 4 columns
unst_deforming_naca0012.test_vals = [-3.665128, -3.793593, -3.716506, -3.148308] #last 4 columns
unst_deforming_naca0012.su2_exec = "SU2_CFD"
unst_deforming_naca0012.timeout = 1600
unst_deforming_naca0012.tol = 0.00001
Expand Down Expand Up @@ -1120,7 +1120,7 @@ def main():
rotating_cylinders.cfg_dir = "sliding_interface/rotating_cylinders"
rotating_cylinders.cfg_file = "rot_cylinders_WA.cfg"
rotating_cylinders.test_iter = 3
rotating_cylinders.test_vals = [3.000000, 0.000000, 0.777273, 1.134732, 1.224115] #last 4 columns
rotating_cylinders.test_vals = [3.000000, 0.000000, 0.777574, 1.134794, 1.224127] #last 4 columns
rotating_cylinders.su2_exec = "SU2_CFD"
rotating_cylinders.timeout = 1600
rotating_cylinders.tol = 0.00001
Expand Down Expand Up @@ -1758,7 +1758,7 @@ def main():
pywrapper_aeroelastic.cfg_dir = "aeroelastic"
pywrapper_aeroelastic.cfg_file = "aeroelastic_NACA64A010.cfg"
pywrapper_aeroelastic.test_iter = 2
pywrapper_aeroelastic.test_vals = [0.079371, 0.033176, -0.001665, -0.000156] #last 4 columns
pywrapper_aeroelastic.test_vals = [0.074885, 0.033116, -0.001650, -0.000127] #last 4 columns
pywrapper_aeroelastic.su2_exec = "SU2_CFD.py -f"
pywrapper_aeroelastic.new_output = True
pywrapper_aeroelastic.timeout = 1600
Expand Down
4 changes: 2 additions & 2 deletions TestCases/serial_regression_AD.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ def main():
discadj_pitchingNACA0012.cfg_dir = "disc_adj_euler/naca0012_pitching"
discadj_pitchingNACA0012.cfg_file = "inv_NACA0012_pitching.cfg"
discadj_pitchingNACA0012.test_iter = 4
discadj_pitchingNACA0012.test_vals = [-1.234466, -1.657592, -0.007497, 0.000013] #last 4 columns
discadj_pitchingNACA0012.test_vals = [-1.223509, -1.646090, -0.007671, 0.000013] #last 4 columns
discadj_pitchingNACA0012.su2_exec = "SU2_CFD_AD"
discadj_pitchingNACA0012.timeout = 1600
discadj_pitchingNACA0012.tol = 0.00001
Expand All @@ -210,7 +210,7 @@ def main():
unst_deforming_naca0012.cfg_dir = "disc_adj_euler/naca0012_pitching_def"
unst_deforming_naca0012.cfg_file = "inv_NACA0012_pitching_deform_ad.cfg"
unst_deforming_naca0012.test_iter = 4
unst_deforming_naca0012.test_vals = [-1.869488, -1.745821, 1094.3, 0.000006] #last 4 columns
unst_deforming_naca0012.test_vals = [-1.867980, -1.741743, 1090.200000, 0.000006] #last 4 columns
unst_deforming_naca0012.su2_exec = "SU2_CFD_AD"
unst_deforming_naca0012.timeout = 1600
unst_deforming_naca0012.tol = 0.00001
Expand Down

0 comments on commit 916219d

Please sign in to comment.