diff --git a/Common/src/geometry/CGeometry.cpp b/Common/src/geometry/CGeometry.cpp index 880d71a9ee7e..6eb2ff4fe6de 100644 --- a/Common/src/geometry/CGeometry.cpp +++ b/Common/src/geometry/CGeometry.cpp @@ -3510,14 +3510,16 @@ void CGeometry::SetRotationalVelocity(const CConfig *config, bool print) { unsigned long iPoint; unsigned short iDim; - su2double RotVel[3] = {0.0,0.0,0.0}, Distance[3] = {0.0,0.0,0.0}, - Center[3] = {0.0,0.0,0.0}, Omega[3] = {0.0,0.0,0.0}; + su2double GridVel[3] = {0.0,0.0,0.0}, Distance[3] = {0.0,0.0,0.0}, + Center[3] = {0.0,0.0,0.0}, Omega[3] = {0.0,0.0,0.0}, + xDot[3] = {0.0,0.0,0.0}; /*--- Center of rotation & angular velocity vector from config ---*/ for (iDim = 0; iDim < 3; iDim++) { Center[iDim] = config->GetMotion_Origin(iDim); Omega[iDim] = config->GetRotation_Rate(iDim)/config->GetOmega_Ref(); + xDot[iDim] = config->GetTranslation_Rate(iDim)/config->GetVelocity_Ref(); } su2double L_Ref = config->GetLength_Ref(); @@ -3529,9 +3531,11 @@ void CGeometry::SetRotationalVelocity(const CConfig *config, bool print) { cout << ", " << Center[2] << " )\n"; cout << " Angular velocity about x, y, z axes: ( " << Omega[0] << ", "; cout << Omega[1] << ", " << Omega[2] << " ) rad/s" << endl; + cout << " Translational velocity in x, y, z direction: (" + << xDot[0] << ", " << xDot[1] << ", " << xDot[2] << ")." << endl; } - /*--- Loop over all nodes and set the rotational velocity ---*/ + /*--- Loop over all nodes and set the rotational and translational velocity ---*/ for (iPoint = 0; iPoint < nPoint; iPoint++) { @@ -3544,15 +3548,15 @@ void CGeometry::SetRotationalVelocity(const CConfig *config, bool print) { for (iDim = 0; iDim < nDim; iDim++) Distance[iDim] = (Coord[iDim]-Center[iDim])/L_Ref; - /*--- Calculate the angular velocity as omega X r ---*/ + /*--- Calculate the angular velocity as omega X r and add translational velocity ---*/ - RotVel[0] = Omega[1]*(Distance[2]) - Omega[2]*(Distance[1]); - RotVel[1] = Omega[2]*(Distance[0]) - Omega[0]*(Distance[2]); - RotVel[2] = Omega[0]*(Distance[1]) - Omega[1]*(Distance[0]); + GridVel[0] = Omega[1]*(Distance[2]) - Omega[2]*(Distance[1]) + xDot[0]; + GridVel[1] = Omega[2]*(Distance[0]) - Omega[0]*(Distance[2]) + xDot[1]; + GridVel[2] = Omega[0]*(Distance[1]) - Omega[1]*(Distance[0]) + xDot[2]; /*--- Store the grid velocity at this node ---*/ - nodes->SetGridVel(iPoint, RotVel); + nodes->SetGridVel(iPoint, GridVel); } diff --git a/TestCases/py_wrapper/translating_NACA0012/config.cfg b/TestCases/py_wrapper/translating_NACA0012/config.cfg index 201f6ba4d7c9..92425cb0c8e9 100644 --- a/TestCases/py_wrapper/translating_NACA0012/config.cfg +++ b/TestCases/py_wrapper/translating_NACA0012/config.cfg @@ -8,9 +8,13 @@ RESTART_SOL= NO % FREE-STREAM DEFINITION % % We are translating the domain instead of having farfield velocity. -GRID_MOVEMENT= STEADY_TRANSLATION -MOTION_ORIGIN= ( 0.0, 0.0, 0.0 ) -TRANSLATION_RATE= ( -264.994, -5.78219, 0.0 ) +% Note: The rotating frame is intended for 3D cases. To use the feature in a 2D case, +% care must be taken with respect to the axes, e.g. to obtain a pitching motion, a +% rotation about the z-axis can be used. +GRID_MOVEMENT= ROTATING_FRAME +MOTION_ORIGIN= 0.0, 0.0, 0.0 +ROTATION_RATE= 0.0, 0.0, 0.5 +TRANSLATION_RATE= -264.994, -5.78219, 0.0 MACH_NUMBER= 0.0 FREESTREAM_PRESSURE= 101325.0 FREESTREAM_TEMPERATURE= 273.15 @@ -68,6 +72,6 @@ CONV_RESIDUAL_MINVAL= -9 % MESH_FILENAME= ../../euler/naca0012/mesh_NACA0012_inv.su2 MESH_FORMAT= SU2 -SCREEN_OUTPUT= (INNER_ITER, RMS_RES, LIFT, DRAG) +SCREEN_OUTPUT= (INNER_ITER, RMS_RES, LIFT, DRAG, MOMENT_X, MOMENT_Y, MOMENT_Z) HISTORY_OUTPUT= (INNER_ITER, RMS_RES, AERO_COEFF) diff --git a/TestCases/py_wrapper/translating_NACA0012/forces_0.csv.ref b/TestCases/py_wrapper/translating_NACA0012/forces_0.csv.ref index 1f7208ae6948..aa9112983d04 100644 --- a/TestCases/py_wrapper/translating_NACA0012/forces_0.csv.ref +++ b/TestCases/py_wrapper/translating_NACA0012/forces_0.csv.ref @@ -1,200 +1,200 @@ 199, -1.01, -0.00, 0.00 -0, -2.07, 14.24, 0.00 -1, -3.61, 24.90, 0.00 -2, -4.82, 33.27, 0.00 -3, -5.83, 40.36, 0.00 -4, -6.67, 46.28, 0.00 -5, -7.34, 51.12, 0.00 -6, -7.90, 55.22, 0.00 -7, -8.32, 58.47, 0.00 -8, -8.63, 60.93, 0.00 -9, -8.82, 62.64, 0.00 -10, -8.90, 63.67, 0.00 -11, -8.90, 64.08, 0.00 -12, -8.79, 63.82, 0.00 -13, -8.60, 62.95, 0.00 -14, -8.33, 61.47, 0.00 -15, -7.98, 59.42, 0.00 -16, -7.56, 56.90, 0.00 -17, -7.09, 53.85, 0.00 -18, -6.55, 50.31, 0.00 -19, -5.96, 46.32, 0.00 -20, -5.33, 41.86, 0.00 -21, -4.65, 37.00, 0.00 -22, -3.94, 31.73, 0.00 -23, -3.19, 26.04, 0.00 -24, -2.42, 20.02, 0.00 -25, -1.63, 13.63, 0.00 -26, -0.81, 6.90, 0.00 -27, 0.02, -0.14, 0.00 -28, 0.86, -7.51, 0.00 -29, 1.70, -15.17, 0.00 -30, 2.55, -23.10, 0.00 -31, 3.40, -31.31, 0.00 -32, 4.24, -39.81, 0.00 -33, 5.08, -48.56, 0.00 -34, 5.90, -57.53, 0.00 -35, 6.71, -66.78, 0.00 -36, 7.50, -76.26, 0.00 -37, 8.27, -85.92, 0.00 -38, 9.01, -95.84, 0.00 -39, 9.71, -105.96, 0.00 -40, 10.38, -116.23, 0.00 -41, 10.99, -126.68, 0.00 -42, 11.57, -137.35, 0.00 -43, 12.08, -148.19, 0.00 -44, 12.53, -159.17, 0.00 -45, 12.91, -170.22, 0.00 -46, 13.20, -181.38, 0.00 -47, 13.41, -192.62, 0.00 -48, 13.52, -203.86, 0.00 -49, 13.52, -215.14, 0.00 -50, 13.40, -226.37, 0.00 -51, 13.15, -237.51, 0.00 -52, 12.74, -248.08, 0.00 -53, 12.20, -258.53, 0.00 -54, 11.55, -270.03, 0.00 -55, 10.64, -278.83, 0.00 -56, 9.12, -273.76, 0.00 -57, 7.23, -256.31, 0.00 -58, 6.37, -278.50, 0.00 -59, 6.45, -373.63, 0.00 -60, 4.88, -427.97, 0.00 -61, 2.24, -427.37, 0.00 -62, -0.51, -417.30, 0.00 -63, -3.27, -408.38, 0.00 -64, -6.03, -398.56, 0.00 -65, -8.75, -387.02, 0.00 -66, -11.39, -373.99, 0.00 -67, -13.92, -359.95, 0.00 -68, -16.32, -344.85, 0.00 -69, -18.56, -328.91, 0.00 -70, -20.62, -312.27, 0.00 -71, -22.46, -294.93, 0.00 -72, -24.06, -277.04, 0.00 -73, -25.38, -258.65, 0.00 -74, -26.43, -239.98, 0.00 -75, -27.17, -221.05, 0.00 -76, -27.53, -201.69, 0.00 -77, -27.52, -182.12, 0.00 -78, -27.11, -162.57, 0.00 -79, -26.25, -142.89, 0.00 -80, -24.92, -123.30, 0.00 -81, -23.07, -103.81, 0.00 -82, -20.65, -84.47, 0.00 -83, -17.60, -65.41, 0.00 -84, -13.84, -46.67, 0.00 -85, -9.29, -28.35, 0.00 -86, -3.83, -10.54, 0.00 -87, 2.67, 6.60, 0.00 -88, 10.40, 22.96, 0.00 -89, 19.52, 38.18, 0.00 -90, 30.30, 51.99, 0.00 -91, 42.99, 63.90, 0.00 -92, 57.62, 72.97, 0.00 -93, 74.22, 78.25, 0.00 -94, 92.65, 78.70, 0.00 -95, 111.70, 72.75, 0.00 -96, 129.33, 59.28, 0.00 -97, 142.80, 38.65, 0.00 -98, 108.83, 14.60, 0.00 -99, 70.15, -0.00, 0.00 -100, 103.00, -13.82, 0.00 -101, 122.70, -33.21, 0.00 -102, 97.43, -44.66, 0.00 -103, 71.62, -46.65, 0.00 -104, 47.69, -40.51, 0.00 -105, 26.62, -28.06, 0.00 -106, 8.83, -11.19, 0.00 -107, -5.69, 8.46, 0.00 -108, -17.49, 30.00, 0.00 -109, -26.97, 52.75, 0.00 -110, -34.47, 76.08, 0.00 -111, -40.41, 99.90, 0.00 -112, -45.07, 124.09, 0.00 -113, -48.64, 148.47, 0.00 -114, -51.32, 173.10, 0.00 -115, -53.23, 197.89, 0.00 -116, -54.42, 222.67, 0.00 -117, -55.02, 247.56, 0.00 -118, -55.06, 272.38, 0.00 -119, -54.59, 297.11, 0.00 -120, -53.68, 321.86, 0.00 -121, -52.32, 346.28, 0.00 -122, -50.60, 370.70, 0.00 -123, -48.53, 394.87, 0.00 -124, -46.07, 418.35, 0.00 -125, -43.35, 441.69, 0.00 -126, -40.37, 464.94, 0.00 -127, -37.14, 487.69, 0.00 -128, -33.67, 509.87, 0.00 -129, -29.99, 531.37, 0.00 -130, -26.15, 552.36, 0.00 -131, -22.16, 572.82, 0.00 -132, -18.04, 592.52, 0.00 -133, -13.83, 611.66, 0.00 -134, -9.53, 629.75, 0.00 -135, -5.19, 647.00, 0.00 -136, -0.82, 663.83, 0.00 -137, 3.55, 679.52, 0.00 -138, 7.91, 694.04, 0.00 -139, 12.23, 708.07, 0.00 -140, 16.49, 721.12, 0.00 -141, 20.67, 732.69, 0.00 -142, 24.76, 743.52, 0.00 -143, 28.75, 753.57, 0.00 -144, 32.60, 762.33, 0.00 -145, 36.31, 769.81, 0.00 -146, 39.89, 776.48, 0.00 -147, 43.31, 782.12, 0.00 -148, 46.55, 786.51, 0.00 -149, 49.64, 790.15, 0.00 -150, 52.55, 792.54, 0.00 -151, 55.28, 793.95, 0.00 -152, 57.83, 794.41, 0.00 -153, 60.21, 793.97, 0.00 -154, 62.43, 792.89, 0.00 -155, 64.17, 787.14, 0.00 -156, 66.44, 789.04, 0.00 -157, 69.24, 797.87, 0.00 -158, 19.48, 218.28, 0.00 -159, -4.61, -50.26, 0.00 -160, -0.00, -0.03, 0.00 -161, -0.06, -0.59, 0.00 -162, -0.09, -0.89, 0.00 -163, -0.05, -0.47, 0.00 -164, -0.17, -1.63, 0.00 -165, -0.38, -3.62, 0.00 -166, -0.67, -6.33, 0.00 -167, -1.04, -9.57, 0.00 -168, -1.46, -13.23, 0.00 -169, -1.93, -17.18, 0.00 -170, -2.43, -21.34, 0.00 -171, -2.96, -25.60, 0.00 -172, -3.51, -29.91, 0.00 -173, -4.08, -34.24, 0.00 -174, -4.65, -38.46, 0.00 -175, -5.21, -42.55, 0.00 -176, -5.77, -46.52, 0.00 -177, -6.31, -50.23, 0.00 -178, -6.83, -53.68, 0.00 -179, -7.32, -56.87, 0.00 -180, -7.77, -59.70, 0.00 -181, -8.18, -62.19, 0.00 -182, -8.54, -64.28, 0.00 -183, -8.85, -65.91, 0.00 -184, -9.10, -67.15, 0.00 -185, -9.28, -67.88, 0.00 -186, -9.38, -68.05, 0.00 -187, -9.40, -67.68, 0.00 -188, -9.32, -66.66, 0.00 +0, -2.07, 14.25, 0.00 +1, -3.62, 24.97, 0.00 +2, -4.84, 33.38, 0.00 +3, -5.85, 40.49, 0.00 +4, -6.69, 46.42, 0.00 +5, -7.36, 51.26, 0.00 +6, -7.92, 55.36, 0.00 +7, -8.34, 58.59, 0.00 +8, -8.64, 61.04, 0.00 +9, -8.83, 62.73, 0.00 +10, -8.91, 63.73, 0.00 +11, -8.90, 64.10, 0.00 +12, -8.79, 63.80, 0.00 +13, -8.59, 62.88, 0.00 +14, -8.31, 61.35, 0.00 +15, -7.95, 59.25, 0.00 +16, -7.53, 56.67, 0.00 +17, -7.05, 53.55, 0.00 +18, -6.50, 49.94, 0.00 +19, -5.90, 45.87, 0.00 +20, -5.26, 41.32, 0.00 +21, -4.57, 36.38, 0.00 +22, -3.85, 31.01, 0.00 +23, -3.09, 25.23, 0.00 +24, -2.31, 19.12, 0.00 +25, -1.51, 12.63, 0.00 +26, -0.68, 5.79, 0.00 +27, 0.16, -1.36, 0.00 +28, 1.01, -8.84, 0.00 +29, 1.86, -16.61, 0.00 +30, 2.72, -24.66, 0.00 +31, 3.58, -32.98, 0.00 +32, 4.43, -41.60, 0.00 +33, 5.28, -50.47, 0.00 +34, 6.11, -59.56, 0.00 +35, 6.93, -68.92, 0.00 +36, 7.73, -78.52, 0.00 +37, 8.50, -88.30, 0.00 +38, 9.24, -98.33, 0.00 +39, 9.95, -108.57, 0.00 +40, 10.62, -118.95, 0.00 +41, 11.24, -129.51, 0.00 +42, 11.81, -140.28, 0.00 +43, 12.33, -151.21, 0.00 +44, 12.78, -162.28, 0.00 +45, 13.15, -173.40, 0.00 +46, 13.44, -184.61, 0.00 +47, 13.64, -195.87, 0.00 +48, 13.73, -207.12, 0.00 +49, 13.72, -218.38, 0.00 +50, 13.58, -229.47, 0.00 +51, 13.30, -240.10, 0.00 +52, 12.85, -250.14, 0.00 +53, 12.31, -261.02, 0.00 +54, 11.62, -271.62, 0.00 +55, 10.32, -270.49, 0.00 +56, 8.26, -248.20, 0.00 +57, 6.94, -245.94, 0.00 +58, 7.97, -348.31, 0.00 +59, 7.61, -440.57, 0.00 +60, 5.11, -448.31, 0.00 +61, 2.28, -436.77, 0.00 +62, -0.53, -428.04, 0.00 +63, -3.36, -418.60, 0.00 +64, -6.17, -407.62, 0.00 +65, -8.93, -395.29, 0.00 +66, -11.62, -381.67, 0.00 +67, -14.20, -367.12, 0.00 +68, -16.64, -351.56, 0.00 +69, -18.92, -335.22, 0.00 +70, -21.01, -318.22, 0.00 +71, -22.89, -300.56, 0.00 +72, -24.52, -282.37, 0.00 +73, -25.88, -263.71, 0.00 +74, -26.96, -244.77, 0.00 +75, -27.72, -225.59, 0.00 +76, -28.12, -205.99, 0.00 +77, -28.13, -186.20, 0.00 +78, -27.76, -166.42, 0.00 +79, -26.92, -146.54, 0.00 +80, -25.62, -126.74, 0.00 +81, -23.79, -107.06, 0.00 +82, -21.39, -87.53, 0.00 +83, -18.36, -68.27, 0.00 +84, -14.63, -49.34, 0.00 +85, -10.10, -30.83, 0.00 +86, -4.66, -12.84, 0.00 +87, 1.82, 4.49, 0.00 +88, 9.54, 21.04, 0.00 +89, 18.64, 36.46, 0.00 +90, 29.42, 50.48, 0.00 +91, 42.11, 62.60, 0.00 +92, 56.77, 71.89, 0.00 +93, 73.41, 77.41, 0.00 +94, 91.92, 78.09, 0.00 +95, 111.10, 72.36, 0.00 +96, 128.91, 59.09, 0.00 +97, 142.62, 38.60, 0.00 +98, 108.87, 14.61, 0.00 +99, 70.25, -0.00, 0.00 +100, 103.25, -13.86, 0.00 +101, 123.24, -33.35, 0.00 +102, 98.16, -44.99, 0.00 +103, 72.48, -47.21, 0.00 +104, 48.60, -41.28, 0.00 +105, 27.56, -29.06, 0.00 +106, 9.78, -12.38, 0.00 +107, -4.77, 7.09, 0.00 +108, -16.59, 28.46, 0.00 +109, -26.11, 51.06, 0.00 +110, -33.64, 74.25, 0.00 +111, -39.61, 97.94, 0.00 +112, -44.31, 122.01, 0.00 +113, -47.92, 146.26, 0.00 +114, -50.63, 170.78, 0.00 +115, -52.57, 195.45, 0.00 +116, -53.80, 220.12, 0.00 +117, -54.43, 244.90, 0.00 +118, -54.50, 269.61, 0.00 +119, -54.06, 294.24, 0.00 +120, -53.18, 318.89, 0.00 +121, -51.86, 343.20, 0.00 +122, -50.17, 367.52, 0.00 +123, -48.12, 391.59, 0.00 +124, -45.70, 414.97, 0.00 +125, -43.01, 438.21, 0.00 +126, -40.06, 461.35, 0.00 +127, -36.86, 484.02, 0.00 +128, -33.42, 506.10, 0.00 +129, -29.77, 527.50, 0.00 +130, -25.96, 548.39, 0.00 +131, -22.00, 568.76, 0.00 +132, -17.91, 588.36, 0.00 +133, -13.73, 607.39, 0.00 +134, -9.47, 625.38, 0.00 +135, -5.15, 642.54, 0.00 +136, -0.81, 659.27, 0.00 +137, 3.53, 674.87, 0.00 +138, 7.85, 689.30, 0.00 +139, 12.15, 703.23, 0.00 +140, 16.38, 716.18, 0.00 +141, 20.53, 727.67, 0.00 +142, 24.59, 738.40, 0.00 +143, 28.55, 748.36, 0.00 +144, 32.38, 757.04, 0.00 +145, 36.06, 764.43, 0.00 +146, 39.61, 771.02, 0.00 +147, 43.00, 776.59, 0.00 +148, 46.22, 780.89, 0.00 +149, 49.29, 784.46, 0.00 +150, 52.17, 786.78, 0.00 +151, 54.87, 788.13, 0.00 +152, 57.40, 788.54, 0.00 +153, 59.77, 788.13, 0.00 +154, 61.95, 786.74, 0.00 +155, 63.49, 778.73, 0.00 +156, 67.16, 797.62, 0.00 +157, 62.16, 716.24, 0.00 +158, 1.28, 14.32, 0.00 +159, -2.99, -32.64, 0.00 +160, 0.35, 3.75, 0.00 +161, -0.04, -0.41, 0.00 +162, 0.11, 1.11, 0.00 +163, 0.13, 1.27, 0.00 +164, 0.00, 0.00, 0.00 +165, -0.22, -2.15, 0.00 +166, -0.53, -5.01, 0.00 +167, -0.91, -8.41, 0.00 +168, -1.35, -12.19, 0.00 +169, -1.83, -16.27, 0.00 +170, -2.34, -20.53, 0.00 +171, -2.88, -24.89, 0.00 +172, -3.44, -29.28, 0.00 +173, -4.01, -33.68, 0.00 +174, -4.59, -37.96, 0.00 +175, -5.16, -42.10, 0.00 +176, -5.72, -46.12, 0.00 +177, -6.27, -49.88, 0.00 +178, -6.79, -53.37, 0.00 +179, -7.28, -56.59, 0.00 +180, -7.74, -59.45, 0.00 +181, -8.15, -61.97, 0.00 +182, -8.52, -64.08, 0.00 +183, -8.82, -65.74, 0.00 +184, -9.08, -67.01, 0.00 +185, -9.26, -67.76, 0.00 +186, -9.37, -67.96, 0.00 +187, -9.39, -67.62, 0.00 +188, -9.32, -66.63, 0.00 189, -9.16, -65.08, 0.00 -190, -8.90, -62.85, 0.00 -191, -8.53, -59.92, 0.00 -192, -8.04, -56.24, 0.00 -193, -7.43, -51.74, 0.00 -194, -6.71, -46.56, 0.00 -195, -5.83, -40.35, 0.00 -196, -4.77, -32.93, 0.00 -197, -3.53, -24.33, 0.00 -198, -1.89, -13.01, 0.00 +190, -8.90, -62.89, 0.00 +191, -8.54, -59.98, 0.00 +192, -8.06, -56.33, 0.00 +193, -7.45, -51.85, 0.00 +194, -6.73, -46.69, 0.00 +195, -5.85, -40.49, 0.00 +196, -4.79, -33.08, 0.00 +197, -3.55, -24.47, 0.00 +198, -1.91, -13.14, 0.00 diff --git a/config_template.cfg b/config_template.cfg index 707d25e56c10..14cb62c98608 100644 --- a/config_template.cfg +++ b/config_template.cfg @@ -403,6 +403,13 @@ PRANDTL_TURB= 0.90 % % Type of dynamic mesh (NONE, RIGID_MOTION, ROTATING_FRAME, % STEADY_TRANSLATION, GUST) +% ROTATING_FRAME: This option considers both parameters ROTATION_RATE and +% TRANSLATION_RATE, which allows to simulate a free-flying aircraft (in a flight +% mechanical sense) which moves and rotates in all six degrees of freedom about +% the center of gravity. In this context, the farfield MACH number is set to +% zero and MACH_MOTION is used instead to compute force coefficients. +% STEADY_TRANSLATION: This option considers only the parameter TRANSLATION_RATE. +% GRID_MOVEMENT= NONE % % Motion mach number (non-dimensional). Used for initializing a viscous flow