# PimpleFoam - oscillating forces and drag coefficient

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

July 1, 2018, 06:30
PimpleFoam - oscillating forces and drag coefficient
#1
Member

Cristina Hernandez
Join Date: May 2018
Posts: 35
Rep Power: 7
Hi,

I am trying to run a simple case of the flow around a 2D square (side=0.5m) with rounded edges inside a rectangular domain using Pimplefoam solver. My objective is to calculate the drag coefficient at the walls of the square for different radius of curvature of the square.

For a particular radius (case1: r=0.2m), my drag coefficient is fairly stable after 40 s. However, if I decrease the radius (case2: r=0.1m), the drag coefficient oscillates a lot around the "mean" value. See attached drag_coeff_plot.
[Note that magnitude of drag coefficient in both cases is different since for more rounded edges, Cdrag should be lower]

From my understanding, as drag coefficient dependes on forces, which are obtained from pressure, the problem is with pressure calculation.

The only thing that I am changing between both cases is the mesh, that has to be adapted for the different radius, so the size of the cells around the square may not be the same. However, I have done "checkMesh" and non-orthogonality and aspect ratio are very similar in both cases. Find attached files.

I have also plotted the residuals for p (see residuals_p attached file) and they look a bit different, but I do not know if this could be causing the difference.

Can you think about any possible reason why I am obtaining this huge variations in drag coefficient in case2? Maybe I should modify some parameters in my fvSolution and fvSchemes files? I can post them if necessary.

Any tip would be helpful, I am really stuck with this.

Cristina
Attached Images
 drag_coeff_plot.png (69.1 KB, 123 views) residuals_p.jpg (62.6 KB, 102 views)
Attached Files
 checkMesh_case1.txt (3.5 KB, 38 views) checkMesh_case2.txt (3.5 KB, 13 views)

 July 2, 2018, 02:47 #2 Senior Member   Join Date: Sep 2013 Posts: 353 Rep Power: 20 Your mesh seems fine, but try lowering the skewness. It is a bit high. For the case you are trying to solve you can do a lot better regarding the mesh. Both of your results are most likely incorrect though, since your residuals are still way to high. If you do not need a logarithmic scale to plot your residuals it is quite likely, that the results aren't convincing. You might want to check your schemes, time step, nCorrectors etc. Even for an unsteady simulation these should be lower. The first question is hence...what Reynolds number are you solving at? Which turbulence model, what are your fvSchemes and fvSolution settings.

July 2, 2018, 06:47
#3
Member

Cristina Hernandez
Join Date: May 2018
Posts: 35
Rep Power: 7
Hi Bloerb, thanks a lot for your response.

In terms of the mesh, I have generated it using gmsh, my objective was to have a structured quadrangular mesh with finer cells in the region near the square, that is valid for different radius of curvature, but I am not very happy with my solution. Do you have any suggestions on how to create a better mesh for my case?

Quote:
 Originally Posted by Bloerb Both of your results are most likely incorrect though, since your residuals are still way to high.
What would you suggest as a reasonable value for residuals?

Quote:
 Originally Posted by Bloerb The first question is hence...what Reynolds number are you solving at? Which turbulence model, what are your fvSchemes and fvSolution settings.
I am solving for Reynolds 3*10^4 and using komegaSSTSAS as turbulence model. My fvSchemes and fvSolution files are attached (they are based on FOAM tutorials).

I hope you can have a look and give me feedback about it.

Cristina
Attached Files
 fvSolution.txt (1.4 KB, 27 views) fvSchemes.txt (1.4 KB, 27 views)

 July 2, 2018, 11:53 #4 Senior Member   Join Date: Sep 2013 Posts: 353 Rep Power: 20 For meshing you could try cartesian2DMesh from cfMesh. Maybe even blockMesh. The easiest way to test the benefit would be Code: ```generate an stl file of your boundaries. e.g by using your existing mesh. surfaceMeshTriangulate test.stl delete "frontAndback" parts inside the stl run surfaceFeatureEdges on it surfaceFeatureEdges test.stl test.fms copy a meshDict into your system folder and run it on the test.fms file cartesian2DMesh``` Lets start with something that should converge. Try the following changes: Code: ``` nCorrectors 4; nNonOrthogonalCorrectors 1;``` and Code: ` div(phi,U) bounded Gauss upwind;` Since to my knowledge kOmegaSSTSAS is an LES model you should make sure your maxCo in your controlDict or your timeStep is small enough. E.g below a courant number of 0.2. If that shows better results you could try less diffusive schemes. E.g limitedLinear, linearUpwind, or LUST

 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 OffTrackbacks are Off Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post CoolHersheys OpenFOAM Post-Processing 5 September 27, 2021 06:04 Gunni OpenFOAM Running, Solving & CFD 17 October 31, 2019 02:18 ozzythewise Main CFD Forum 8 June 13, 2012 06:24 squanto773 OpenFOAM Post-Processing 1 March 7, 2012 09:43 nkiru FLUENT 9 August 14, 2008 01:00

All times are GMT -4. The time now is 06:55.