# [OpenFOAM] Drag Force from Forces Function different from Paraview

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

 November 26, 2018, 11:12 Drag Force from Forces Function different from Paraview #1 Member   Ed O'Malley Join Date: Nov 2017 Posts: 30 Rep Power: 5 Hi - I've noticed an interesting issue - when I use OpenFoam to do runtime drag force calculations, they are different than when I calculate them in Paraview. At the same time step, OpenFoam calculates the force to be 2.28N and Paraview gets 1.83N. In Paraview, after loading the case I do Extract Block on the geometry, then Extract Surface, then Generate Surface Normals, including cell normals. Then Calculator using cell normals, p*Normals_X, then Integrate Variables and display the Cell Normals attribute. In OpenFoam, here is my forcesIncompressible file. This is a Spalart-Allmaras DDES simulation using pisoFoam. Any idea what is going on and which one (if any) is accurate? Code: /*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 6 \\/ M anipulation | ------------------------------------------------------------------------------- Description Calculates pressure and viscous forces over specified patches for a case where the solver is incompressible (pressure is kinematic, e.g. m^2/s^2). \*---------------------------------------------------------------------------*/ #includeEtc "caseDicts/postProcessing/forces/forcesIncompressible.cfg" rhoInf 1.225; // Fluid density patches (Shoe1); outputControl timeStep; outputInterval 250; CofR (0.03 0 0.03); pitchAxis (0 1 0); // ************************************************************************* //

 November 30, 2018, 05:00 #2 Senior Member   anonymous Join Date: Jan 2016 Posts: 391 Rep Power: 9 Hi! OF calculates the viscous forces too. But I think in paraview you miss this component.

December 10, 2018, 13:21
#3
Member

Ed O'Malley
Join Date: Nov 2017
Posts: 30
Rep Power: 5
Quote:
 Originally Posted by simrego Hi! OF calculates the viscous forces too. But I think in paraview you miss this component.
That's true but OF breaks out viscous forces separately from pressure forces. I'm comparing just pressure forces in the x direction.

 December 13, 2018, 10:15 #4 Senior Member   Yann Join Date: Apr 2012 Location: France Posts: 181 Rep Power: 12 Hello, pisoFoam, as many other incompressible solvers is based on the kinematic pressure, which is basically the pressure normalized by density: You can make sure of that by checking the pressure dimensions in the p file. It should be either m2/s2 if the solver use kinematic pressure or kg/(m.s2) for regular pressure. E.g in pisoFoam: Code: FoamFile { version 2.0; format ascii; class volScalarField; object p; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -2 0 0 0 0]; When post-processing in paraview, you need to calculate p*rhoInf to get the actual pressure value. Using the example you gave in your initial post, it would be something like 1.83*1.225=2.24N, which is closer to what openFoam computes. I don't know what can cause the remaining difference. Write precision ? Interpolation somewhere in the process ? For such thing I usually just load the patch(es) I want to work with in paraView so I don't use extract block and extract surface filters. edomalley1 likes this.

 December 14, 2018, 00:44 #5 Member   Ed O'Malley Join Date: Nov 2017 Posts: 30 Rep Power: 5 Great, thanks!

 Tags drag, forces