CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > SU2

Usage of SU2_DOT

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By bigfootedrockmidget

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 20, 2024, 01:57
Default Usage of SU2_DOT
  #1
New Member
 
Viv Bone
Join Date: Jun 2024
Posts: 15
Rep Power: 2
MaxGains is on a distinguished road
Hello,

I'm looking to use SU2 to manually compute derivatives of an objective function
with respect to flight conditions (Mach, AoA) and some shape design variables.
I'm not looking to perform shape optimization here; I only need to evaluate
gradients at a range of input points.
I've parameterized my geometry with a 3D FFD box, which I am manually
adjusting by setting the DV_PARAM and DV_VALUE entries in my config file.
The following steps are running correctly:
+ mesh deformation using SU2_DEF
+ evaluation of primal solution using SU2_CFD
+ evaluation of adjoint solution using SU2_CFD.
Using the SENS_MACH and SENS_AOA outputs, I've validated my adjoint solution
against finite difference gradients.

When I run SU2_DOT <config_file>.cfg, I get the following error message:
Surface sensitivity not found in file
Here, my simulation is 3D, so my surface adjoint results are output as
`surface_adjoint.vtu'; could this be the cause of the problem?

If I run the same steps on the QuickStart example, everything works and I get a
gradient in the `of_grad.dat' file.

Thanks for any help.
MaxGains is offline   Reply With Quote

Old   July 21, 2024, 21:33
Default
  #2
New Member
 
Tongtong
Join Date: Jan 2024
Posts: 24
Rep Power: 2
Tongtong1919 is on a distinguished road
Hi MaxGains,

Could you please describe the problem in more detail or provide a screenshot of the error?

From my experience, the SU2_DOT module uses the result file from SU2_CFD (restart_adj.dat, which should be renamed to solution_adj.dat) to obtain the projection results for the design variables.

Tongtong
Tongtong1919 is offline   Reply With Quote

Old   July 22, 2024, 21:50
Default
  #3
New Member
 
Viv Bone
Join Date: Jun 2024
Posts: 15
Rep Power: 2
MaxGains is on a distinguished road
Thanks Tongtong.


As a reference point, the QuickStart examples works fine for me.
After running the primal and adjoint simulations and renaming the restart files, my directory contains the following files:
Code:
adjoint.vtu  flow.vtu  history.csv  inv_NACA0012.cfg  mesh_NACA0012_inv.su2  solution_adj_cd.dat  solution_flow.dat  surface_adjoint.csv  surface_flow.csv
I then run
Code:
SU2_DOT inv_NACA0012.cfg
and successfully generate a file called
Code:
of_grad.dat

I'm now trying to replicate this workflow for my own example.
I first converge my primal and adjoint simulations, then rename restart_adj_cl.dat to solution_adj_cl.dat.
I run my job file
Code:
SU2_DOT run_adjoint.cfg
and get the following error output:
Code:
----------------- Physical Case Definition ( Zone 0 ) -------------------
Input mesh file name: mesh_deformed.su2
Input sensitivity file name: surface_adjoint.

-------------- Surface deformation parameters ( Zone 0 ) ----------------
Design variables definition (markers <-> value <-> param):
FFD (control point) <-> WING3D <-> 0 <-> ( WING, 0, 0, 0, 1, 0, 0 )
FFD (control point) <-> WING3D <-> 0 <-> ( WING, 1, 0, 0, 1, 0, 0 )
FFD (control point) <-> WING3D <-> 0.0406 <-> ( WING, 0, 1, 0, 1, 0, 0 )
FFD (control point) <-> WING3D <-> 0.0406 <-> ( WING, 1, 1, 0, 1, 0, 0 )
FFD (control point) <-> WING3D <-> 0 <-> ( WING, 0, 0, 1, 1, 0, 0 )
FFD (control point) <-> WING3D <-> 0 <-> ( WING, 1, 0, 1, 1, 0, 0 )
FFD (control point) <-> WING3D <-> 0.0406 <-> ( WING, 0, 1, 1, 1, 0, 0 )
FFD (control point) <-> WING3D <-> 0.0406 <-> ( WING, 1, 1, 1, 1, 0, 0 )

---------------- Design problem definition  ( Zone 0 ) ------------------
CL objective function.

-------------------- Output Information ( Zone 0 ) ----------------------
Output gradient file name: of_grad.dat.

------------- Config File Boundary Information ( Zone 0 ) ---------------
+-----------------------------------------------------------------------+
|                        Marker Type|                        Marker Name|
+-----------------------------------------------------------------------+
|                          Far-field|                           FARFIELD|
+-----------------------------------------------------------------------+
|                     Symmetry plane|                           SYMMETRY|
+-----------------------------------------------------------------------+
|                     Heat flux wall|                             WING3D|
+-----------------------------------------------------------------------+
Three dimensional problem.
2057 grid points.
1920 volume elements.
3 surface markers.
120 boundary elements in index 0 (Marker = WING3D).
192 boundary elements in index 1 (Marker = SYMMETRY).
120 boundary elements in index 2 (Marker = FARFIELD).
1728 hexahedra.
192 prisms.
Identify vertices.
Storing a mapping from global to local point index.

----------------------- Preprocessing computations ----------------------
Setting local point connectivity.
Checking the numerical grid orientation of the elements.
All volume elements are correctly orientend.
All surface elements are correctly orientend.
Identify edges and vertices.
Setting the bound control volume structure.
Storing a mapping from global to local point index.
Reading surface sensitivities at each node from file.


Error in "virtual void CPhysicalGeometry::SetBoundSensitivity(CConfig*)":
-------------------------------------------------------------------------
Surface sensitivity not found in file.
------------------------------ Error Exit -------------------------------

Here, since my case is 3D, my surface adjoint file is surface_adjoint.vtu (rather than surface_adjoint.dat).
Could this be causing the problem?


Regards,
Viv
MaxGains is offline   Reply With Quote

Old   July 23, 2024, 14:05
Default
  #4
Senior Member
 
bigfoot
Join Date: Dec 2011
Location: Netherlands
Posts: 596
Rep Power: 17
bigfootedrockmidget is on a distinguished road
I don't think the reader can read paraview vtu files. You need SURFACE_CSV in OUTPUT_FILES I guess.
If this is indeed the problem, maybe we can change the error message.
CleverBoy likes this.
bigfootedrockmidget is offline   Reply With Quote

Old   July 24, 2024, 22:54
Default
  #5
New Member
 
Viv Bone
Join Date: Jun 2024
Posts: 15
Rep Power: 2
MaxGains is on a distinguished road
Yep -- that was the problem!


Very easy to convert between the two with vtk library though
MaxGains is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
CPUs vs GPUs for CFD? hami11 Hardware 22 July 23, 2024 15:59
Fluent time usage plot and save to file svantevid FLUENT 1 December 12, 2023 04:01
Large memory usage for steady simulation Wenqiang SU2 2 May 15, 2020 13:40
New workstation for different usage scenarios - CPU and RAM natem Hardware 6 August 7, 2013 02:47
OpenFOAM Solver/BC usage description murrayjc OpenFOAM 3 August 25, 2009 04:48


All times are GMT -4. The time now is 20:44.