su2code/SU2

FFD mesh deformation outside FFD box.

ChristianBauerEng opened this issue · 5 comments

Describe the bug
I'd like to use the FFD shape optimization feature of SU2. From a geometrical point of view the domain is very similar to the "2 way mixing channel optimization" tutorial example. I've therefore followed the steps of this tutorial and tested the mesh deformation with some dummy values.

The result of the deformation can be seen here:
grafik

The lower halve of the picture shows the original, undeformed mesh. The upper halve contains in green the original FFD box (ffd_box_0.vtk), in white the deformed FFD box and the deformed mesh (volume_deformed_0000.vtu) in blue/white.

From the definition of the deformation I'd expect that the cells outside the FFD box to remain largely unchanged. Instead, here the largest deformations occur.

Following the mixer-example the FFD information was added to the mesh by running SU2_DEF with a config file containing this information:

%%%%%%%%%%%%%%% FFD definition %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FFD_DEFINITION = (BOX, \
0.012, 0.0005, 0.0,\
0.080, 0.0005, 0.0,\
0.080, 0.0035, 0.0,\
0.012, 0.0035, 0.0 )
FFD_DEGREE= (4, 1, 0)
FFD_CONTROL_POINT
DV_KIND = FFD_SETTING
DV_MARKER = (NS_Resonator_Wall, NS_ResonatorTip_Wall)
DV_PARAM = (1.0)

This added the following info to the mesh:

FFD_NBOX= 1
FFD_NLEVEL= 1
FFD_TAG= BOX
FFD_LEVEL= 0
FFD_DEGREE_I= 4
FFD_DEGREE_J= 1
FFD_BLENDING= BEZIER
FFD_PARENTS= 0
FFD_CHILDREN= 0
FFD_CORNER_POINTS= 4
0.012   0.0005
0.08    0.0005
0.08    0.0035
0.012   0.0035
FFD_CONTROL_POINTS= 20
0       0       0       0.012   0.0005  -0.5
0       0       1       0.012   0.0005  0.5
0       1       0       0.012   0.0035  -0.5
0       1       1       0.012   0.0035  0.5
1       0       0       0.029   0.0005  -0.5
1       0       1       0.029   0.0005  0.5
1       1       0       0.029   0.0035  -0.5
1       1       1       0.029   0.0035  0.5
2       0       0       0.046   0.0006  -0.5
2       0       1       0.046   0.0005  0.5
2       1       0       0.046   0.0036  -0.5
2       1       1       0.046   0.0035  0.5
3       0       0       0.063   0.0007  -0.5
3       0       1       0.063   0.0005  0.5
3       1       0       0.063   0.0037  -0.5
3       1       1       0.063   0.0035  0.5
4       0       0       0.08    0.0057  -0.5
4       0       1       0.08    0.0005  0.5
4       1       0       0.08    0.0087  -0.5
4       1       1       0.08    0.0035  0.5
FFD_SURFACE_POINTS= 2822
...

The deformation was then tested by running SU2_DEF with the two leftmost FFD control points being fixed:

%%%%%%%%%%%%%%% FFD definition %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FFD_DEFINITION = (BOX, \
0.012, 0.0005, 0.0,\
0.080, 0.0005, 0.0,\
0.080, 0.0035, 0.0,\
0.012, 0.0035, 0.0 )
FFD_DEGREE= (4, 1, 0)
DV_KIND = FFD_CONTROL_POINT, FFD_CONTROL_POINT, FFD_CONTROL_POINT, FFD_CONTROL_POINT, FFD_CONTROL_POINT, FFD_CONTROL_POINT
DV_MARKER = (NS_Resonator_Wall, NS_ResonatorTip_Wall)
%%%%%%%%%%%%%% FFD PARAMETERS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FFD_TOLERANCE = 1E-10
FFD_ITERATIONS = 20
FFD_CONTINUITY=USER_INPUT
% DV_PARAM = ( FFD_BoxTag, i_Ind, j_Ind, k_Ind, x_Disp, y_Disp, z_Disp )
DV_PARAM = \
(BOX, 2, 0, 0, 0.0, 1.0, 0.0); \
(BOX, 3, 0, 0, 0.0, 1.0, 0.0); \
(BOX, 4, 0, 0, 0.0, 1.0, 0.0); \
(BOX, 2, 1, 0, 0.0, 1.0, 0.0); \
(BOX, 3, 1, 0, 0.0, 1.0, 0.0); \
(BOX, 4, 1, 0, 0.0, 1.0, 0.0)
% NOTE: left-most 2 points omitted, to make them fixed
% Value of the shape deformation
% first row:  lower row y-direction
% second row: upper row y-direction
DV_VALUE= 0.00005, 0.0001, 0.005, \
          0.00005, 0.0001, 0.005
% ------------------------ GRID DEFORMATION PARAMETERS ------------------------%
% Linear solver or smoother for implicit formulations (FGMRES, RESTARTED_FGMRES, BCGSTAB)
DEFORM_LINEAR_SOLVER= FGMRES
DEFORM_LINEAR_SOLVER_PREC= ILU
% Number of smoothing iterations for mesh deformation
DEFORM_LINEAR_SOLVER_ITER= 500
% Number of nonlinear deformation iterations (surface deformation increments)
DEFORM_NONLINEAR_ITER= 1
% Minimum residual criteria for the linear solver convergence of grid deformation
DEFORM_LINEAR_SOLVER_ERROR= 1E-14
% Print the residuals during mesh deformation to the console (YES, NO)
DEFORM_CONSOLE_OUTPUT= YES
% Deformation coefficient (linear elasticity limits from -1.0 to 0.5, a larger
% value is also possible)
DEFORM_COEFF = 0.0
% Type of element stiffness imposed for FEA mesh deformation (INVERSE_VOLUME,
%                                           WALL_DISTANCE, CONSTANT_STIFFNESS)
DEFORM_STIFFNESS_TYPE= WALL_DISTANCE
% Deform the grid only close to the surface. It is possible to specify how much
% of the volumetric grid is going to be deformed in meters or inches (1E6 by default)
DEFORM_LIMIT = 1E6

Desktop (please complete the following information):

  • OS: SLES15
  • C++ compiler and version: intel compiler, 2021.4.0
  • MPI implementation and version: intel-mpi 2019
  • SU2 Version: current master branch

What is the output of SU2_DEF? That usually means the linear solver did not converge.

Good point! Indeed the solver has a hard time converging and the resudual barely drops below 4E-8 (far away from the limit specified in the tutorial).

--------------------- Surface grid deformation (ZONE 0) -----------------
Performing the deformation of the surface grid.
1 Free Form Deformation boxes.
1 Free Form Deformation nested levels.
FFD box tag: BOX. FFD box level: 0. Degrees: 4, 1.
FFD Blending using Bezier Curves.
Number of parent boxes: 0. Number of child boxes: 0.
Corner points: 4. Control points: 20. Surface points: 3404.
Writing a Paraview file of the FFD boxes.

----------------- FFD technique (parametric -> cartesian) ---------------
Checking FFD box dimension.
Checking FFD box intersections with the solid surfaces.
SU2 is fixing user's input planes.
Update cartesian coord        | FFD box: BOX. Max Diff: 0.00246933.
Writing a Paraview file of the FFD boxes.

------------------- Volumetric grid deformation (ZONE 0) ----------------
Performing the deformation of the volumetric grid.
Computing volumes of the grid elements.
Min. volume: 1.15412e-13, max. volume: 7.81947e-08.
Min. distance: 5e-07, max. distance: 0.0061806.

# FGMRES residual history
# Residual tolerance target = 1e-14
# Initial residual norm     = 9.32748e+06
     0     1
     10     4.70151e-07
     20     1.0396e-07
     30     9.99835e-08
     40     9.99358e-08
     50     9.94837e-08
     60     9.79571e-08
     70     9.48291e-08
     80     9.26963e-08
     90     9.25628e-08
     100     9.2495e-08
     110     9.13192e-08
     120     8.82461e-08
     130     8.5977e-08
     140     8.55573e-08
     150     8.55348e-08
     160     8.52077e-08
     170     8.32895e-08
     180     8.13964e-08
     190     8.10219e-08
...

Any suggestions on which settings may help the solver to converge?

You can try CONJUGATE_GRADIENT instead of FGMRES, or running on a single core, or CONSTANT_STIFFNESS, or setting a large value (e.g. 1E6) for DEFORM_COEFF

Using CG did the trick it seems, and the solver now converges < 1e-18. Thanks a lot!

However, one small issue remains: near the tip, the deformation looks quite strange:
grafik
grafik
White box is undeformed FFD-box, translucent green is the deformed one.

BC on the bottom is axis, right and top boundaries are walls. Top and right wall are included in DV_MARKER and DV-direction is (0., 1., 0.).

Any idea what could be behind this behaviour?

The ffd doesn't cover the entire right surface, so some points on it are fixed while other are dragged to a far location.
The deformation you are trying to apply is discontinuous. I would not move the bottom points of the ffd.