CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Comparison of axisymmetric case, Starccm+ and OpenFOAM

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 26, 2009, 10:15
Default Comparison of axisymmetric/2D case, Starccm+ and OpenFOAM
  #1
Senior Member
 
linnemann's Avatar
 
Niels Nielsen
Join Date: Mar 2009
Location: NJ - Denmark
Posts: 556
Rep Power: 27
linnemann will become famous soon enough
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
File Type: jpg star-residuals.jpg (47.5 KB, 999 views)
File Type: png foam_residual.png (10.3 KB, 935 views)
File Type: jpg star-axi.jpg (97.6 KB, 75 views)
File Type: jpg foam-axi.jpg (97.4 KB, 945 views)
File Type: jpg force-star.jpg (21.8 KB, 935 views)

Last edited by linnemann; June 29, 2009 at 07:31. Reason: typos
linnemann is offline   Reply With Quote

Old   June 26, 2009, 11:23
Default
  #2
Senior Member
 
linnemann's Avatar
 
Niels Nielsen
Join Date: Mar 2009
Location: NJ - Denmark
Posts: 556
Rep Power: 27
linnemann will become famous soon enough
Some of the pictures haven't been uploaded, will do on monday,

Regards
linnemann is offline   Reply With Quote

Old   June 28, 2009, 04:19
Default autoPatch 45
  #3
Member
 
amin
Join Date: May 2009
Posts: 62
Rep Power: 17
az1362f is on a distinguished road
Hi

what is autopatch?
how does it work?

thanks
az1362f is offline   Reply With Quote

Old   June 28, 2009, 12:21
Default
  #4
Senior Member
 
linnemann's Avatar
 
Niels Nielsen
Join Date: Mar 2009
Location: NJ - Denmark
Posts: 556
Rep Power: 27
linnemann will become famous soon enough
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 is offline   Reply With Quote

Old   June 29, 2009, 05:30
Default
  #5
Senior Member
 
linnemann's Avatar
 
Niels Nielsen
Join Date: Mar 2009
Location: NJ - Denmark
Posts: 556
Rep Power: 27
linnemann will become famous soon enough
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
File Type: png foam-U.png (18.6 KB, 927 views)
File Type: png star-U.png (17.8 KB, 918 views)
File Type: png foam-p.png (21.3 KB, 915 views)
File Type: png star-p.png (17.2 KB, 913 views)
linnemann is offline   Reply With Quote

Old   June 29, 2009, 05:31
Default
  #6
Senior Member
 
linnemann's Avatar
 
Niels Nielsen
Join Date: Mar 2009
Location: NJ - Denmark
Posts: 556
Rep Power: 27
linnemann will become famous soon enough


Attached Images
File Type: png foam-k.png (17.0 KB, 916 views)
File Type: png star-k.png (16.3 KB, 906 views)
linnemann is offline   Reply With Quote

Old   September 10, 2009, 04:29
Default
  #7
Senior Member
 
MadsR's Avatar
 
Mads Reck
Join Date: Aug 2009
Location: Copenhagen, Denmark
Posts: 177
Rep Power: 18
MadsR is on a distinguished road
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
MadsR is offline   Reply With Quote

Old   September 10, 2009, 15:44
Default
  #8
Senior Member
 
mkraposhin's Avatar
 
Matvey Kraposhin
Join Date: Mar 2009
Location: Moscow, Russian Federation
Posts: 355
Rep Power: 21
mkraposhin is on a distinguished road
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?
mkraposhin is offline   Reply With Quote

Old   May 5, 2010, 09:33
Default how export from salome 2d axi-symmetric case
  #9
New Member
 
sasha
Join Date: Feb 2010
Posts: 10
Rep Power: 16
zabar is on a distinguished road
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
zabar is offline   Reply With Quote

Old   May 6, 2010, 16:04
Default
  #10
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
alberto will become famous soon enoughalberto will become famous soon enough
Quote:
Originally Posted by mkraposhin View Post
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.
alberto is offline   Reply With Quote

Old   June 15, 2011, 11:43
Default
  #11
New Member
 
Juanito
Join Date: Oct 2010
Posts: 27
Rep Power: 16
Aerospace is on a distinguished road
Quote:
Originally Posted by alberto View Post
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
Aerospace is offline   Reply With Quote

Old   June 15, 2011, 14:02
Default
  #12
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
alberto will become famous soon enoughalberto will become famous soon enough
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.
alberto is offline   Reply With Quote

Old   June 16, 2011, 06:43
Default
  #13
New Member
 
Juanito
Join Date: Oct 2010
Posts: 27
Rep Power: 16
Aerospace is on a distinguished road
Quote:
Originally Posted by alberto View Post
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.
Aerospace is offline   Reply With Quote

Reply

Tags
axisymmetric, drag, forces, lift, starccm+


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 Off
Trackbacks are Off
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 04:37.