CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Various questions and doubts about simulating Drag Coefficient of Cylinder (https://www.cfd-online.com/Forums/openfoam-solving/177281-various-questions-doubts-about-simulating-drag-coefficient-cylinder.html)

_Ennui September 9, 2016 11:32

Various questions and doubts about simulating Drag Coefficient of Cylinder
 
5 Attachment(s)
Hello all,

I have been attempting to calculate Cd for a cylinder in sea water using a 2D case.
Diameter = 5m
Nu = 1.35e-6
U = 1 m/s
Re = 3.7e+6
Rho = 1026.9 (Although this is never requested or used, seemingly...)
I'm using SimpleFoam solver with Realisable k-e as the turbulence model.

In the documentation I am using for comparison/validation, the value of Cd listed for a smooth cylinder is 0.65 in steady-state flow situation.

The value I calculated for Cd were 0.159 and 0.113 for time steps of 1e-2 and 1e-3, respectively. Both of which are far lower than they should be.


My questions:

1. My mesh is limited to 100k nodes, is this too coarse to generate an accurate result? (see attached)

2. Why is the result seemingly independent of the fluid density? (it is never required as an input)

3. Why is there lift measured for the smaller of the two time steps?

My requests:

1. General advice on calculation of drag coefficients for high Re

2. Any helpful advice would be greatly appreciated


Attached are pictures of my mesh, and residuals & results for each run.

Attachment 50422 Attachment 50420Attachment 50421 Attachment 50423
Attachment 50424

I hope someone can help - I feel like this is a simple problem but I am really struggling with it.

Thank you very much!

_Ennui September 9, 2016 11:38

For clarity, these were formed using SimFlow - a GUI for OpenFOAM. I hope this is an appropriate place to post this as there is currently no SimFlow specific sub.

_Ennui September 9, 2016 11:41

Case Summary
 
1 Attachment(s)
Here is the case summary:
Attachment 50425

_Ennui September 12, 2016 08:01

Aref // lref
 
Bonus question (for extra points): What is the use of Aref/lref in 2D simulation?

I am at the end of my tether with this. Please demystify these issues and I will be eternally grateful.

Tobi September 13, 2016 05:07

Hello Angus,

first of all, a very clear thread with a lot of information. I highly appreciate that. Based on the fact that I did similar simulations during my master, I think I can help you (but it is a few years ago).

Quote:

Originally Posted by _Ennui (Post 617282)
Hello all,

I have been attempting to calculate Cd for a cylinder in sea water using a 2D case.
Diameter = 5m
Nu = 1.35e-6
U = 1 m/s
Re = 3.7e+6
Rho = 1026.9 (Although this is never requested or used, seemingly...)
I'm using SimpleFoam solver with Realisable k-e as the turbulence model.

You are using simpleFoam, that means it is a solver without denisty (the whole equation is divided by rho - hence, cd and cl has to be multiplied by rho to get the real values later on).

Quote:

In the documentation I am using for comparison/validation, the value of Cd listed for a smooth cylinder is 0.65 in steady-state flow situation.

The value I calculated for Cd were 0.159 and 0.113 for time steps of 1e-2 and 1e-3, respectively. Both of which are far lower than they should be.
Furthermore, simpleFoam is not a transient solver, that means that you do not have a real time step. Based on the fact that we are only interested in the steady-state solution, we use some algorithm that does not fulfill the time accuracy (SIMPLE) but reaches the steady-state solution quickly; much faster than an transient solver. For that kind of solver we set dT always to 1 which will correspond to the number of iterations we did. That means, if the time is 145s, it means that we have 145 iterations done. Changing dT will not influence the solving procedure. In other words, if you have dT = 1 and go on in time to 145s (145 iterations) and compare that one with another simulation where you set dT = 0.02 and go on in time to 2.9s (145 iterations), you will figure out that the solutions are equal.

Quote:

My questions:

1. My mesh is limited to 100k nodes, is this too coarse to generate an accurate result? (see attached)
Yes

Quote:

2. Why is the result seemingly independent of the fluid density? (it is never required as an input)
It is based on the equation as mentioned above.

Quote:

3. Why is there lift measured for the smaller of the two time steps?
I did not get the point but again it is not the time, it is the iteration.

Quote:

My requests:

1. General advice on calculation of drag coefficients for high Re

2. Any helpful advice would be greatly appreciated
I calculated cd and cl for a flow around a cylinder for low Re numbers (Re ~ 40 to get the Von Karman Street) and compare the cd coefficients with the literature. Furthermore, I analyzed the vortex shedding to get the frequency - also here I got very good results. The only bad result that I got was the shedding angular. But it was as bad as predicted in fluent. All in all, my results were very accurate and compared to fluend the difference were 0.0001% (so equal).

Did you ever check your simulation results? Like, how does the velocity and pressure field look like and change during the iterations. You have some jump in the residual plot. Do you know where this behavior come from? I would first check the simulation results in paraview to get an idea about the flow field (it should be smooth and should not jump during the iterations). If you have some jumps, it could be based on the set-up you did (more than one solution allowed). In addition, at the end you have some unsteady behavior of your simulation. Maybe your mesh is too fine and you really resolve some vortexes ;) but this can be analyzed by using paraview.

One way would be, to reduce your relaxation factors to be more stable.

Quote:

For clarity, these were formed using SimFlow - a GUI for OpenFOAM. I hope this is an appropriate place to post this as there is currently no SimFlow specific sub.
The problem you have is not related to SimFlow. Hence, your post is correct placed.

Quote:

Bonus question (for extra points): What is the use of Aref/lref in 2D simulation?
The A_{ref} is the projected area of your cylinder perpendicular to the flow (you need to consider the extrusion in the 3rd dimension) and l_{ref} is the diameter of your cylinder. To be more clear with A_{ref}, it is finally:

A_{ref} = d_{cyl} \cdot \Delta z

I hope I could help you a bit. Good luck.

_Ennui September 13, 2016 05:49

Extremely helpful, thank you.

How can one measure a value for Δz in a 2D simulation? As I understand it, OpenFOAM doesn't truly model in 2D? Is Δz therefore the cell size in z direction?

Secondly, I can't make sense of why Cd should be so dependent on Area? I understand that it is intrinsically connected to the Force but cannot seem get round this circular relationship. Linear relationship between value of Cd and variance in Area?

Lastly, changing "lref" seems to have no effect on the solution at all?

Sorry to be a burden, thanks for all the help so far.

Tobi September 13, 2016 06:35

Quote:

Originally Posted by _Ennui (Post 617707)
Extremely helpful, thank you.

How can one measure a value for Δz in a 2D simulation? As I understand it, OpenFOAM doesn't truly model in 2D? Is Δz therefore the cell size in z direction?

Exactly. Based on the fact that FOAM uses the finite volume method, we need a 3D mesh, even for 1D or 2D cases.

Quote:

Originally Posted by _Ennui (Post 617707)
Secondly, I can't make sense of why Cd should be so dependent on Area? I understand that it is intrinsically connected to the Force but cannot seem get round this circular relationship. Linear relationship between value of Cd and variance in Area?

The calculation of the coeffs are done within the forceCoeffs.C
Code:

        // lift, drag and moment
        coeffs[0] = (totForce & liftDir_)/(Aref_*pDyn);
        coeffs[1] = (totForce & dragDir_)/(Aref_*pDyn);
        coeffs[2] = (totMoment & pitchAxis_)/(Aref_*lRef_*pDyn);

        scalar Cl = sum(coeffs[0]);
        scalar Cd = sum(coeffs[1]);
        scalar Cm = sum(coeffs[2]);

        scalar Clf = Cl/2.0 + Cm;
        scalar Clr = Cl/2.0 - Cm;

Why should the drag coefficient not be depended on the projected area? What would you expect?

Quote:

Originally Posted by _Ennui (Post 617707)
Lastly, changing "lref" seems to have no effect on the solution at all?

Sorry to be a burden, thanks for all the help so far.

This value will not change your drag and lift coefficient, it will only influence your moment (cm) as you can see in the C++ code above.

_Ennui September 13, 2016 07:10

Brilliant, thank you.

That is what I had initially thought, I think my confusion stemmed from a tutorial video produced by SimFlow themselves:

https://www.youtube.com/watch?v=wASYUxQ9LMc

at ~10:00 they set the values of lref and Aref. For the latter he sets it to be equal to dcyl^2 .
Any idea why this may have been done? It is a similar case, in that it is 2D and of a cylinder in crossflow.

All the best,
Angus

_Ennui September 13, 2016 11:40

As it stands...
 
4 Attachment(s)
Recap / Overview:
Attempting to calculate drag coefficients for a smooth cylinder in crossflow using 2D steady state, incompressible case.
Diameter = D = 5m
Nu = 1.35e-6
U = 1 m/s
Re = 3.7e+6
The expected value from literature (http://www.germanlloyd.org/pdf/DNV-OS-J101_2014-05.pdf) is Cd = 0.65 for steady flow.


Current state:
After refining the mesh as much as possible within the 100k node limit and resetting the discussed parameters (Δt, lref, Aref, relaxation) the case converged in 5,118 iterations.
The calculated value was found to be Cd = 2.66712 which is far larger than the expected. (Somewhat humorously, it is nearly equidistant from the expected solution as my initial calculation)


Case Details:
Mesh:
See attached.
Solver:
SimpleFoam
Turbulence Model:
Realizable k-ε Model with full defaults on constants.
Discretisation:
Steady-state. Using LUST scheme for U, k and ε convection.
Boundary Conditions:
Inlet: Velocity inlet, of type "Surface Normal Fixed Value" (=U=1m/s)
Outlet: Custom of type "Pressure Inlet-Outlet Velocity"
Boundaries: Outflow of type "Zero Gradient"
Z-plane: Empty
Initial Conditions:
U=1m/s
k=1
ε=1
Monitor Reference Values:
lref = D = 5
Aref = D = 5

Questions:
{{ Expected: Cd=0.65 // Calculated: Cd=2.66712 }}
  1. Can anyone see any glaringly obvious reasons the calculated solution would be so far from the expected value? (out by ~310% :()

  2. Anything of note regarding the residuals? Particularly, what is happening to the residual for k? (see attached)

  3. Is the reason for the error in the solution primarily due to the coarseness of the mesh?


Pictures:

Mesh: Attachment 50474 Attachment 50475
Residuals & Case Summary: Attachment 50476 Attachment 50477

Any guidance at this point (specific or otherwise) would be greatly appreciated.


Kind regards,
Angus

Tobi September 13, 2016 14:06

Hi,

my time is very limited but I uploaded my project work onto my web space (unfortunately it is in German). Nonetheless, maybe it will help you. You will find it here: http://www.holzmann-cfd.de/index.php...karman-strasse

I am wondering why your projected area is equal to 5 - and if you say it is the diameter, the unit would be [m] and not [mē]. I can not belive that you extrude the mesh in z - direction to 1m.

A H Gazi May 16, 2019 01:13

Quote:

Originally Posted by Tobi (Post 617711)
Exactly. Based on the fact that FOAM uses the finite volume method, we need a 3D mesh, even for 1D or 2D cases.



The calculation of the coeffs are done within the forceCoeffs.C
Code:

        // lift, drag and moment
        coeffs[0] = (totForce & liftDir_)/(Aref_*pDyn);
        coeffs[1] = (totForce & dragDir_)/(Aref_*pDyn);
        coeffs[2] = (totMoment & pitchAxis_)/(Aref_*lRef_*pDyn);

        scalar Cl = sum(coeffs[0]);
        scalar Cd = sum(coeffs[1]);
        scalar Cm = sum(coeffs[2]);

        scalar Clf = Cl/2.0 + Cm;
        scalar Clr = Cl/2.0 - Cm;

Why should the drag coefficient not be depended on the projected area? What would you expect?


This value will not change your drag and lift coefficient, it will only influence your moment (cm) as you can see in the C++ code above.




Thank you very much for such details explanation. I want to calculate Cd1, Cd2, Cl1 and Cl2 for tandem cylinders (two cylinders are placed in a row). So, what change i have to do, Please suggest.
Thanks

rrrajjes March 25, 2020 11:41

not getting CD calue
 
hi guys
forces
{
type forceCoeffs;
libs ("libforces.so");
writeControl timeStep;
writeInterval 1;

patches ("inner");
rho rhoInf;
log true;
rhoInf 1000;
liftDir (0 1 0);
dragDir (1 0 0);
CofR (0 0 0);
pitchAxis (1 0 0);
magUInf 0.6739;
lRef 0.2136;
Aref 0.01958;
}
this is my forcecoeffs setup but m not getting proper cd value can any one plz help me on that where i m going wrong?
Using simplefoam.


All times are GMT -4. The time now is 22:35.