# Computation Drag Force for 2D Geometry

 Register Blogs Members List Search Today's Posts Mark Forums Read

 February 8, 2022, 13:11 Computation Drag Force for 2D Geometry #1 New Member   Barış Bıçakçı Join Date: Dec 2021 Location: Turkey Posts: 7 Rep Power: 3 Hello everyone, I've done a simulation for 2D supersonic air intake. I have history output file which includes Cd and Cl values from this simulation and I also have surface_flow.vtu which includes Cp values for my intake geometry. I need to calculate drag force on my intake geometry. There is some example for computation of drag force via Paraview. However all these examples performed for 3D case. Is there anyone have suggestion for me about my case. I couldn't figured out how I can do it. Thank you.

 February 12, 2022, 09:39 #2 Senior Member   bigfoot Join Date: Dec 2011 Location: Netherlands Posts: 375 Rep Power: 16 Hi! If you have the Cd and Cl from SU2, just make it dimensional to compute the lift and the drag. You can also output Cd and Cl for each of the markers that you have in your domain. If you have a 2D case and you would like to compute lift and drag in paraview from pressure, you need compute the 2D normals first using a programmable filter. Make sure that the input is the 2D edge that you would like to compute the normals on. If you have a multiblock mesh, you use an Extract Block to get the edge that you want. To make it easier for the programmable source, convert the edge into unstructured data by using a Merge Blocks. The programmable source looks like this, after the source you will have the surface normals available to compute the lift and the drag 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)) normx[i] = p2[1] - p1[1] normy[i] = -(p2[0] - p1[0]) norm = algs.make_vector(normx, normy, normz) output.CellData.append(norm, "normals")

 Tags drag, drag analysis, paravie, su2