CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Comparison of axisymmetric case, Starccm+ and OpenFOAM (http://www.cfd-online.com/Forums/openfoam-solving/65808-comparison-axisymmetric-case-starccm-openfoam.html)

 linnemann June 26, 2009 09:15

Comparison of axisymmetric/2D case, Starccm+ and OpenFOAM

5 Attachment(s)
Hi all

I've decided to post some of my results regarding comparing Starccm+ and OpenFOAM on a axisymmteric case for a ship nozzle.

First of all here are some basics.

Profile length (chord) ~1.95m

transportproperties water @ 20C nu=1.004e-6

high Re > 1e7, Turbulence model Realizable K-e

freestream velocity 6.16667m/s

reference pressure 0Pa

Turbulent kinetic energy (estimate) = 1.5*(Intensity (5-10%) * u_avg)^2 = 1.5 * (0.1*6.16667)^2 = 0.57 (Fluent Manual)
Turbulent dissipation rate (estimate) = (mu_t = rho * Cu *(k/e)^2) => e= (k*sqrt(rho)*sqrt(Cu))/mu_t. Where mu_t can be estimated to be 2 orders of magnitude larger than the molecular viscosity, Fluent Manual, This gives an e=17.08.

First of all I wanted to see how it would compare in a strict 2D case so i created a mesh using Salome - export to UNV. Converted it to OpenFOAM using ideasUnvToFoam, transformPoints -scale "(0.001 0.001 0.001)" to get it in meters, split the mesh into patches using autoPatch 45.

Move the new mesh with split patches to constant/polymesh
mv 1/polyMesh/* constant/polyMesh/

To create a fine enough grid for the y+ I used the refineWallLayer command and split the first cell adjacent to the nozzle wall into 5 (see pictures) to do this I created this small script.

#!/bin/bash
echo "step 1"
refineWallLayer dyse 0.833
mv 1/polyMesh/* constant/polyMesh/

echo "step 2"
refineWallLayer dyse 0.694
mv 1/polyMesh/* constant/polyMesh/

echo "step 3"
refineWallLayer dyse 0.578
mv 1/polyMesh/* constant/polyMesh/

echo "step 4"
refineWallLayer dyse 0.482
mv 1/polyMesh/* constant/polyMesh/

echo "step 5"
refineWallLayer dyse 0.402
mv 1/polyMesh/* constant/polyMesh/

http://www.cfd-online.com/Forums/att...1&d=1246015370http://www.cfd-online.com/Forums/att...1&d=1246255679

Then I set up the correct boundary conditions for the OpenFOAM case and set it to itterate, after 300 or so itterations i changed the divergence scheme from upwind to a higher order. (one at a time, change 1 then iterate 20 and change the next). This is done all on the fly.

div(phi,U) Gauss linearUpwindV cellLimited Gauss linear 1;
div(phi,k) Gauss linearUpwind cellLimited Gauss linear 1;
div(phi,epsilon) Gauss linearUpwind cellLimited Gauss linear 1;

Using yPlusRAS after it has converged gives y+ between 25-170 average 100 so it should be ok.

to get lift and drag I used the following in my controlDict

functions
(
forces
{
type forceCoeffs;
functionObjectLibs ("libforces.so");
patches (dyse); //Name of patche to integrate forces
rhoInf 998.2;
CofR (0 0 0);
liftDir (0 1 0);
dragDir (1 0 0);
pitchAxis (0 0 0);
magUInf 6.16667;
lRef 1.0;
Aref 1.0;
}
);

To get it in Starccm+ I converted the mesh into a Fluent mesh foamMeshToFluent. I converted the Mesh to 2D in Starccm+. The original Mesh is 1m thick in the z-direction.

In Starccm+ i used the exact same setup for the boundary conditions. A screenshot of the force monitor setup.

http://www.cfd-online.com/Forums/att...1&d=1246015261http://www.cfd-online.com/Forums/att...1&d=1246255686

Both cases ran for about 2000 iterations.

Foam Residuals

http://www.cfd-online.com/Forums/att...1&d=1246015634http://www.cfd-online.com/Forums/att...1&d=1246255653

Starccm+ Residuals.

http://www.cfd-online.com/Forums/att...1&d=1246017871

Results 2D
StarCCM+ - OpenFOAM - diff
C_d 0.03924 0.0389159 - -0.83%
C_l 0.015874 - 0.0545671 - 70.9%
The drag is spot on but the lift is way off, any hints here?

Now the funny part comes when changing to an axisymmetric case. 2D for Starccm+ and a wedge shape geometry for OpenFOAM.

Running the exact same setup I have to change the Aref in the controlDict since my mesh is not 1m in the z-direction (from what I can read in the forums), but rather sin(2.5)*2=0.087239.
Center of the profile is ~2m up from the axis.

If I set the Aref to 1 in controlDict for the axisymmetric case it produces a drag coefficient that if you take the OpenFOAM drag and divide by the Starccm+ drag 0.00661139/0.075348=0.087745 which is ~0.087239.

If I use this Aref I get similar results, but my wedge is 5degree in angle and not 2.5degree.

Results axisymmetric
StarCCM+ - OpenFOAM - diff (star/foam)
C_d 0.075348 - 0.0754326 - 0.1121%
C_l -0.17969 - -0.156871 - -14.54%
Does anyone else have experience with forces and axisymmetric cases? Because I don't think this can be correct.

 linnemann June 26, 2009 10:23

Some of the pictures haven't been uploaded, will do on monday,

Regards

 az1362f June 28, 2009 03:19

autoPatch 45

Hi

what is autopatch?
how does it work?

thanks

 linnemann June 28, 2009 11:21

autoPatch does the same as "Split by angle" in Starccm+.

So it takes one patch and splits it into several patches, the input is an angle so autoPatch 45 splits the one patch into several where the angle exceeds 45degree

Regards

 linnemann June 29, 2009 04:30

4 Attachment(s)
Update with some more results.

The drag is almost spot on from the 2D case but it seems the lift is somewhat off.

Here are some scalar plots from the comparison (2D) and from what I can deduct the results are very similar, but have a look and please feel free to comment. The needed information is really about axisymmetric cases and the force coefficients.

http://www.cfd-online.com/Forums/att...1&d=1246263622

http://www.cfd-online.com/Forums/att...1&d=1246263632

http://www.cfd-online.com/Forums/att...1&d=1246263638

http://www.cfd-online.com/Forums/att...1&d=1246263650

 linnemann June 29, 2009 04:31

2 Attachment(s)

Hi!

Interesting. I am also struggling a bit, validating forces for a 2D cylinder with OpenFOAM. Did you manage to get this working?

 mkraposhin September 10, 2009 14:44

I'm not sure, but i think, that OpenFOAM case doesn't converge. Preesure residual too big.

Why did you switch from upwind to linear?

 zabar May 5, 2010 08:33

how export from salome 2d axi-symmetric case

Hi all,
can somebody please explain how export from Salome 2d axi symmetric case to OpenFoam
i am creating a surface mesh and then "revolve" him, but when i tried to convert .unv file
i have
"cannot open file

file: /home/caelinux/Desktop/axi/system/controlDict at line 0.

in file db/regIOobject/regIOobjectRead.C at line 66.

FOAM exiting"

i think something wrong with creation of mesh .

Sasha

 alberto May 6, 2010 15:04

Quote:
 Originally Posted by mkraposhin (Post 229160) I'm not sure, but i think, that OpenFOAM case doesn't converge. Preesure residual too big.
I agree. Star results have residuals for p ~ 10^-7, while the OpenFOAM has residuals for p higher than 10^-3. The comparison should be done not tat the same number of iterations, but when the same convergence criterion is reached.

You might want to try to reduce the requested tolerance for p in fvSolution to 10^-10. In addition, check if you're using the same under-relaxation

Best,
Alberto

 Aerospace June 15, 2011 10:43

1 Attachment(s)
Quote:
 Originally Posted by alberto (Post 257849) I agree. Star results have residuals for p ~ 10^-7, while the OpenFOAM has residuals for p higher than 10^-3. The comparison should be done not tat the same number of iterations, but when the same convergence criterion is reached. You might want to try to reduce the requested tolerance for p in fvSolution to 10^-10. In addition, check if you're using the same under-relaxation Best, Alberto
Hello everybody

I have noticed that it is quite difficult to obtain a small residual for p, and as a consecuence the aerodynamic coefficients are different from expected, I think that this is the cause of bad coefficients obtained in this thread http://www.cfd-online.com/Forums/ope...parison-3.html

I upload an airfoil example with the obtained residuals, I suggest all of you to find a solution, all together, to this common problem.

http://www.mediafire.com/file/t6286l...il2D_SA.tar.gz

Attachment 8041

 alberto June 15, 2011 13:02

Usually setting the relTol to zero in the linear solvers, and requiring a stricter residual for p than form U helps.

 Aerospace June 16, 2011 05:43

1 Attachment(s)
Quote:
 Originally Posted by alberto (Post 312170) Usually setting the relTol to zero in the linear solvers, and requiring a stricter residual for p than form U helps.

Sorry, it didn't work. I set relTol to zero and tolerance to 1e-09 and the residuals are now almost the same.

Attachment 8048

Could be a problem with the mesh? Its averaged yPlus is about 125.

 All times are GMT -4. The time now is 02:45.