Comparison of axisymmetric case, Starccm+ and OpenFOAM

 User Name Remember Me Password
 Register Blogs Members List Search Today's Posts Mark Forums Read

June 26, 2009, 09:15
Comparison of axisymmetric/2D case, Starccm+ and OpenFOAM
#1
Senior Member

Niels Nielsen
Join Date: Mar 2009
Location: NJ - Denmark
Posts: 555
Rep Power: 27
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/

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.

Both cases ran for about 2000 iterations.

Foam Residuals

Starccm+ Residuals.

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.
Attached Images
 star-residuals.jpg (47.5 KB, 999 views) foam_residual.png (10.3 KB, 935 views) star-axi.jpg (97.6 KB, 75 views) foam-axi.jpg (97.4 KB, 945 views) force-star.jpg (21.8 KB, 935 views)

Last edited by linnemann; June 29, 2009 at 06:31. Reason: typos

 June 26, 2009, 10:23 #2 Senior Member     Niels Nielsen Join Date: Mar 2009 Location: NJ - Denmark Posts: 555 Rep Power: 27 Some of the pictures haven't been uploaded, will do on monday, Regards

 June 28, 2009, 03:19 autoPatch 45 #3 Member   amin Join Date: May 2009 Posts: 62 Rep Power: 16 Hi what is autopatch? how does it work? thanks

 June 28, 2009, 11:21 #4 Senior Member     Niels Nielsen Join Date: Mar 2009 Location: NJ - Denmark Posts: 555 Rep Power: 27 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

June 29, 2009, 04:30
#5
Senior Member

Niels Nielsen
Join Date: Mar 2009
Location: NJ - Denmark
Posts: 555
Rep Power: 27
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.

Attached Images
 foam-U.png (18.6 KB, 927 views) star-U.png (17.8 KB, 918 views) foam-p.png (21.3 KB, 915 views) star-p.png (17.2 KB, 913 views)

June 29, 2009, 04:31
#6
Senior Member

Niels Nielsen
Join Date: Mar 2009
Location: NJ - Denmark
Posts: 555
Rep Power: 27

Attached Images
 foam-k.png (17.0 KB, 916 views) star-k.png (16.3 KB, 906 views)

 September 10, 2009, 03:29 #7 Senior Member     Mads Reck Join Date: Aug 2009 Location: Copenhagen, Denmark Posts: 177 Rep Power: 17 Hi! Interesting. I am also struggling a bit, validating forces for a 2D cylinder with OpenFOAM. Did you manage to get this working? /Mads __________________ Online free airfoil-mesher for OpenFOAM here

 September 10, 2009, 14:44 #8 Senior Member     Matvey Kraposhin Join Date: Mar 2009 Location: Moscow, Russian Federation Posts: 355 Rep Power: 21 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?

 May 5, 2010, 08:33 how export from salome 2d axi-symmetric case #9 New Member   sasha Join Date: Feb 2010 Posts: 10 Rep Power: 16 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. From function regIOobject::readStream(const word&) in file db/regIOobject/regIOobjectRead.C at line 66. FOAM exiting" i think something wrong with creation of mesh . thank in advance Sasha

May 6, 2010, 15:04
#10
Senior Member

Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
Quote:
 Originally Posted by mkraposhin 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
__________________
Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.

June 15, 2011, 10:43
#11
New Member

Juanito
Join Date: Oct 2010
Posts: 27
Rep Power: 15
Quote:
 Originally Posted by alberto 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.

I look forward to reading your suggestions.

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

residuals.png

 June 15, 2011, 13:02 #12 Senior Member   Alberto Passalacqua Join Date: Mar 2009 Location: Ames, Iowa, United States Posts: 1,912 Rep Power: 36 Usually setting the relTol to zero in the linear solvers, and requiring a stricter residual for p than form U helps. __________________ Alberto Passalacqua GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541) OpenQBMM - An open-source implementation of quadrature-based moment methods. To obtain more accurate answers, please specify the version of OpenFOAM you are using.

June 16, 2011, 05:43
#13
New Member

Juanito
Join Date: Oct 2010
Posts: 27
Rep Power: 15
Quote:
 Originally Posted by alberto 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.

residualstol0.jpg

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

 Tags axisymmetric, drag, forces, lift, starccm+

 Thread Tools Search this Thread Search this Thread: Advanced Search Display Modes Linear Mode

 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

All times are GMT -4. The time now is 18:54.

 Contact Us - CFD Online - Privacy Statement - Top