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

Computing forces in grid points

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By bigfootedrockmidget

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 17, 2024, 12:10
Default Computing forces in grid points
  #1
New Member
 
Join Date: Dec 2023
Posts: 3
Rep Power: 2
Massimodecimo is on a distinguished road
Hi everyone,

I've done some simulations with a 3D wing and I'm looking for a way for computing the forces in each point of the surface mesh. In the surface_flow there are Cp and Cf values but for obtaining the forces I need the normal vectors. How can I retrieve the Normals directly from SU2?
Massimodecimo is offline   Reply With Quote

Old   January 17, 2024, 14:13
Default
  #2
Senior Member
 
bigfoot
Join Date: Dec 2011
Location: Netherlands
Posts: 504
Rep Power: 17
bigfootedrockmidget is on a distinguished road
The normal forces are not being written to any file. But you can construct the normal forces in paraview if you save the results in paraview .vtm format (then it is easy to extract the surfaces that you need for the force calculation)
bigfootedrockmidget is offline   Reply With Quote

Old   January 18, 2024, 18:22
Default
  #3
New Member
 
Join Date: Dec 2023
Posts: 3
Rep Power: 2
Massimodecimo is on a distinguished road
Hi, do you intend to use a programmable filter in Paraview? Is there a convenient way? Because I obtained the normals faces in the triangles of the mesh but I'm not sure how extracting the normals in the grid point where SU2 compute the Cp and Cf.
Massimodecimo is offline   Reply With Quote

Old   January 19, 2024, 02:59
Default
  #4
Senior Member
 
bigfoot
Join Date: Dec 2011
Location: Netherlands
Posts: 504
Rep Power: 17
bigfootedrockmidget is on a distinguished road
Have a look at this statefile:
https://github.com/bigfooted/su2case...eseries_3.pvsm


It was used to make the first movie, force distribution on a vortex shedding cylinder, that is shown here:
https://github.com/bigfooted/su2cases/tree/master


The input should be a vtm file, there is one here:
https://github.com/bigfooted/su2case...inder_farfield


In the statefile, the force normal to the surface is computed using pressure * normal
The lift is then computed again by taking the normal in the vertical direction.


The programmable filter is simply this:
Code:
from vtk.numpy_interface import algorithms as algs
 import numpy as np
 

 input0 = inputs[0]
 numCells = input0.GetNumberOfCells()
 

 normx = np.empty(numCells, dtype=np.float64)
 normy = np.empty(numCells, dtype=np.float64)
 normz = np.zeros(numCells, dtype=np.float64)
 for i in range(numCells):
   cell = input0.GetCell(i)
   p1 = input0.GetPoint(cell.GetPointId(0))
   p2 = input0.GetPoint(cell.GetPointId(1))
   nx = p2[1] - p1[1]
   ny = -(p2[0] - p1[0])
   normx[i] = -nx/sqrt(nx*nx+ny*ny) 
   normy[i] = -ny/(sqrt(nx*nx+ny*ny))
 

 norm = algs.make_vector(normx, normy, normz)
 output.CellData.append(norm, "normals")
p, li { white-space: pre-wrap; }
giovanni.medici likes this.
bigfootedrockmidget is offline   Reply With Quote

Old   January 19, 2024, 13:48
Default
  #5
New Member
 
Join Date: Dec 2023
Posts: 3
Rep Power: 2
Massimodecimo is on a distinguished road
Thanks for helping me.

Is the programmable filter for a 3D case? I don't understand how could be the norm in the z direction always 0
Massimodecimo is offline   Reply With Quote

Old   January 19, 2024, 15:33
Default
  #6
Senior Member
 
bigfoot
Join Date: Dec 2011
Location: Netherlands
Posts: 504
Rep Power: 17
bigfootedrockmidget is on a distinguished road
The cylinder case is 2D, you can just add the z-coordinate in a straightforward way...
bigfootedrockmidget 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
Convergence problem of OF WUYing OpenFOAM Running, Solving & CFD 2 September 20, 2021 10:09
solution result of any parameter at all grid points in ANSYS Fluent in data file? Muhammad Shad FLUENT 2 September 25, 2018 13:02
How can I get pressure distribution between two grid points PolyU FLUENT 0 February 28, 2014 01:27
[snappyHexMesh] determining displacement for added points CFDnewbie147 OpenFOAM Meshing & Mesh Conversion 1 October 22, 2013 09:53
[DesignModeler] DM's JScript: FPoint()'s GetPoint(i) function picks points backwards? ANT ANSYS Meshing & Geometry 2 July 23, 2012 15:25


All times are GMT -4. The time now is 07:18.