use "CST" method to deform mesh
Zcaic opened this issue · 3 comments
when I use CST parameters to deform mesh,
My airfoil mesh has two boundaries (far: farfield, air: airfoil),
and I use the below naca0012.cfg:
...
DV_KIND= CST
DV_MARKER= ( air )
DV_PARAM= (0, 5, 7)
DV_VALUE= 0.6
...
when I use SU2_DEF naca0012.cfg
the output mesh is same as original grid, and the output message is :
...
--------------------- Surface grid deformation (ZONE 0) -----------------
Performing the deformation of the surface grid.
Design Variable not implemented yet
------------------- Volumetric grid deformation (ZONE 0) ----------------
Performing the deformation of the volumetric grid.
CSysSolve::FGMRES(): system solved by initial guess.
----------------------- Write deformed grid files -----------------------
|SU2 mesh |naca0012.su2 |
|Paraview Multiblock |naca0012.vtm |
Adding any FFD information to the SU2 file.
------------------------- Solver Postprocessing -------------------------
Deleted CGeometry container.
Deleted CSurfaceMovement class.
Deleted CVolumetricMovement class.
Deleted CConfig container.
Deleted COutput class.
Completed in 0.335274 seconds on 1 core.
------------------------- Exit Success (SU2_DEF) ------------------------
it seems that my cst method didn't work.
How can I use CST method?
Thanks!
@pcarruscag
Hello, I solved the question with adding some code to CSurfaceMovement.cpp
.
The following is my specific added code:
...
557: else if ((config->GetDesign_Variable(0) == ROTATION) || (config->GetDesign_Variable(0) == TRANSLATION) ||
558: (config->GetDesign_Variable(0) == SCALE) || (config->GetDesign_Variable(0) == HICKS_HENNE) ||
559: (config->GetDesign_Variable(0) == SURFACE_BUMP) || (config->GetDesign_Variable(0) == ANGLE_OF_ATTACK) ||
560: (config->GetDesign_Variable(0) == CST)) {
561: /*--- Apply rotation, displacement and stretching design variables (this
562: should be done before the bump function design variables) ---*/
563:
564: for (iDV = 0; iDV < config->GetnDV(); iDV++) {
565: switch (config->GetDesign_Variable(iDV)) {
566: case SCALE:
567: SetScale(geometry, config, iDV, false);
568: break;
569: case TRANSLATION:
570: SetTranslation(geometry, config, iDV, false);
571: break;
572: case ROTATION:
573: SetRotation(geometry, config, iDV, false);
574: break;
575: }
576: }
577:
578: /*--- Apply the design variables to the control point position ---*/
579:
580: for (iDV = 0; iDV < config->GetnDV(); iDV++) {
581: switch (config->GetDesign_Variable(iDV)) {
582: case HICKS_HENNE:
583: SetHicksHenne(geometry, config, iDV, false);
584: break;
585: }
586: }
587:
588: /*--- Apply the design variables to the control point position ---*/
589:
590: for (iDV = 0; iDV < config->GetnDV(); iDV++) {
591: switch (config->GetDesign_Variable(iDV)) {
592: case CST:
593: SetCST(geometry, config, iDV, false);
594: break;
595: }
596: }
...
I add
(config->GetDesign_Variable(0) == CST))
in line 560 and add
for (iDV = 0; iDV < config->GetnDV(); iDV++) {
switch (config->GetDesign_Variable(iDV)) {
case CST:
SetCST(geometry, config, iDV, false);
break;
}
}
in line 590~596.
Then I recompiled it and run SU2_DEF naca0012.cfg
, it worked as expected.
But I'm not sure if the added code has a hidden hole.
That looks like what might be missing, open a PR and attach the example you used to test please 👍
@pcarruscag
Hi, I have opened a PR #2124 and add a cst test case to TestCases/deformation/