|
[Sponsors] |
July 16, 2022, 15:02 |
Hydrofoil in Openfoam
|
#1 |
New Member
Silver Blaze
Join Date: Dec 2021
Posts: 20
Rep Power: 5 |
Dear Altruist,
I am quite new in OpenFOAM. I am doing turbulence flow pattern of NACA0012 hydrofoil. I have done it in Ansys Fluent. Now I am tring to solve it in OpenFOAM.com to validate the answer. I wanto share the procedures: 1. I have save the ansys fluent mesh in ASCII and used a command fluentMeshtoFoam and covert the mesh file. 2. I have updated the boundary file, p and U file. ( My Re = 2.98X10^6, nu = 0.001002991, rho = 997 kg/m^3, Speed = 3 m/s) 3. Now, simpleFoam command used and execute the case with this error (functionObjects::div contErr writing field: div(phi)). Then foam file generated. 4. Open the foam file in paraview. Extraxt Cp for lower and upper surface. Plot the Cp vs x/c. but didnot get the same result like Ansys, the difference is huge. Now my questions are: 1. Whats wrong I have done? 2. should I update other files according my Re, V, nu value? 3. How can I solve this? Kindly help me My files : P: Code:
FoamFile { version 2.0; format ascii; class volScalarField; object p; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -2 0 0 0 0]; internalField uniform 0; boundaryField { inlet { type freestreamPressure; freestreamValue $internalField; } outlet { type freestreamPressure; freestreamValue $internalField; } hydrofoil-wall { type zeroGradient; } frontAndBack { type empty; } } Code:
FoamFile { version 2.0; format ascii; class volVectorField; object U; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0 0 0]; internalField uniform (3 0 0); boundaryField { inlet { type freestreamVelocity; freestreamValue $internalField; } outlet { type freestreamVelocity; freestreamValue $internalField; } hydrofoil-wall { type fixedValue; value uniform (0 0 0); } frontAndBack { type empty; } } // ************************************************************************* // / Code:
FoamFile { version 2.0; format ascii; class dictionary; location "constant"; object transportProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // transportModel Newtonian; rho 997; nu 0.001002991; // ************************************************************************* // Code:
FoamFile { version 2.0; format ascii; class volScalarField; object nut; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -1 0 0 0 0]; internalField uniform 0.14; boundaryField { inlet { type freestream; freestreamValue uniform 0.14; } outlet { type freestream; freestreamValue uniform 0.14; } hydrofoil-wall { type nutUSpaldingWallFunction; value uniform 0; } frontAndBack { type empty; } } // ************************************************************************* // Code:
FoamFile { version 2.0; format ascii; class volScalarField; object nuTilda; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -1 0 0 0 0]; internalField uniform 0.14; boundaryField { inlet { type freestream; freestreamValue uniform 0.14; } outlet { type freestream; freestreamValue uniform 0.14; } hydrofoil-wall { type fixedValue; value uniform 0; } frontAndBack { type empty; } } // ************************************************************************* // |
|
July 17, 2022, 13:04 |
|
#2 |
Member
Join Date: Feb 2020
Posts: 79
Rep Power: 6 |
Hi,
Could you upload the whole case ? BR |
|
July 21, 2022, 17:29 |
|
#3 |
New Member
Silver Blaze
Join Date: Dec 2021
Posts: 20
Rep Power: 5 |
||
July 21, 2022, 18:13 |
|
#4 |
Senior Member
Join Date: Dec 2019
Location: Cologne, Germany
Posts: 369
Rep Power: 8 |
Can you provide more information?
1. Checkmesh result 2. Residuals 3. FvSchemes file 4. Fvsolution file |
|
July 21, 2022, 19:33 |
Hydrofoil in Openfoam
|
#5 |
Senior Member
Nejc
Join Date: Feb 2017
Location: Slovenia
Posts: 196
Rep Power: 9 |
looks your 'nu' is the dynamic viscosity but simpleFoam takes kinematic viscosity and doesn't need density...
|
|
July 22, 2022, 01:56 |
|
#6 | |
New Member
Silver Blaze
Join Date: Dec 2021
Posts: 20
Rep Power: 5 |
Quote:
1. checkMesh Result: Code:
Mesh stats points: 60700 internal points: 0 faces: 120350 internal faces: 59650 cells: 30000 faces per cell: 6 boundary patches: 4 point zones: 0 face zones: 0 cell zones: 0 Overall number of cells of each type: hexahedra: 30000 prisms: 0 wedges: 0 pyramids: 0 tet wedges: 0 tetrahedra: 0 polyhedra: 0 Checking topology... Boundary definition OK. Cell to face addressing OK. Point usage OK. Upper triangular ordering OK. Face vertices OK. Number of regions: 1 (OK). Checking patch topology for multiply connected surfaces... Patch Faces Points Surface topology hydrofoil-wall 200 400 ok (non-closed singly connected) inlet 300 602 ok (non-closed singly connected) outlet 200 402 ok (non-closed singly connected) frontAndBackPlanes 60000 60700 ok (non-closed singly connected) Checking faceZone topology for multiply connected surfaces... No faceZones found. Checking basic cellZone addressing... No cellZones found. Checking geometry... Overall domain bounding box (-4.851962 -5 -0.1790477) (10 5 0.1790477) Mesh has 2 geometric (non-empty/wedge) directions (1 1 0) Mesh has 2 solution (non-empty) directions (1 1 0) All edges aligned with or perpendicular to non-empty directions. Boundary openness (-4.998397e-18 -7.594004e-19 8.795399e-19) OK. Max cell openness = 2.390399e-16 OK. Max aspect ratio = 178.1052 OK. Minimum face area = 9.417987e-06. Maximum face area = 0.2519532. Face area magnitudes OK. Min volume = 3.372538e-06. Max volume = 0.04976618. Total volume = 49.31023. Cell volumes OK. Mesh non-orthogonality Max: 42.75253 average: 6.294525 Non-orthogonality check OK. Face pyramids OK. Max skewness = 0.8074126 OK. Coupled point location match (average 0) OK. Mesh OK. End I am sorry, I am not sure, where it is. 3. fvSchemes File: Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: v1812 | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; class dictionary; format ascii; location "system"; object fvSchemes; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // ddtSchemes { default steadyState; } gradSchemes { default Gauss linear; } divSchemes { default bounded Gauss upwind; div(phi,U) bounded Gauss upwind; div(phi,k) bounded Gauss upwind; //div(phi,epsilon) bounded Gauss upwind; div(phi,omega) bounded Gauss upwind; div(phi,R) bounded Gauss upwind; div(R) Gauss linear; div(phi,nuTilda) bounded Gauss upwind; div((nuEff*dev2(T(grad(U))))) Gauss linear; } laplacianSchemes { default Gauss linear corrected; } interpolationSchemes { default linear; } snGradSchemes { default corrected; } fluxRequired { default no; p ; } wallDist { method meshWave; nRequired true; } Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: v1812 | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; class dictionary; format ascii; location "system"; object fvSolution; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // solvers { U { solver PBiCGStab; tolerance 1E-8; relTol 0.1; preconditioner DILU; maxIter 100; } p { solver GAMG; smoother GaussSeidel; tolerance 1E-8; relTol 0.1; cacheAgglomeration true; nFinestSweeps 2; maxIter 100; nPreSweeps 0; nPostSweeps 1; agglomerator faceAreaPair; nCellsInCoarsestLevel 10; mergeLevels 1; } "(k|epsilon|nuTilda)" { relTol 0.1; preconditioner DILU; tolerance 1E-8; maxIter 100; solver PBiCGStab; } Phi { solver GAMG; smoother GaussSeidel; tolerance 1E-10; relTol 01; nPreSweeps 0; nPostSweeps 1; nFinestSweeps 1; nCellsInCoarsestLevel 10; mergeLevels 2; agglomerator faceAreaPair; cacheAgglomeration true; maxIter 100; } } SIMPLE { nNonOrthogonalCorrectors 1; consistent true; pRefCell 0; pRefValue 0; residualControl { p 1E-6; epsilon 1E-6; k 1E-6; U 1E-6; } } relaxationFactors { p 0.75; epsilon 0.5; k 0.5; U 0.75; } potentialFlow { nNonOrthogonalCorrectors 10; PhiRefCell 0; PhiRefValue 0; } |
||
July 22, 2022, 01:58 |
|
#7 | |
New Member
Silver Blaze
Join Date: Dec 2021
Posts: 20
Rep Power: 5 |
Quote:
Code:
*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: v1812 | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "constant"; object transportProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // transportModel Newtonian; //rho 998.2002; nu 1e-6; |
||
July 22, 2022, 04:22 |
|
#8 |
Senior Member
Join Date: Dec 2019
Location: Cologne, Germany
Posts: 369
Rep Power: 8 |
If you use simplefoam you should track the residual behaviour. Look in the tutorials for simplefoam, you should find the files in one. You can also search in google how to do that, there is at least one video.
Gauss upwind is only first order accurate, so if your first run converges with upwind you can use this as starting point for second order schemes like gauss linearUpwindV grad(U) for div(phi,U) for example. May i ask which turbulence model you use? If k-epsilon you did not upload the boundary files. SimpleC algorithm: use 0.9 or 0.95 for all equation URF and optionally 0.9 for the fields. |
|
July 22, 2022, 04:29 |
|
#9 | |
New Member
Silver Blaze
Join Date: Dec 2021
Posts: 20
Rep Power: 5 |
Quote:
Yes, I am using k-epsilon. Boundary file: Code:
FoamFile { version 2.0; format ascii; class polyBoundaryMesh; location "constant/polyMesh"; object boundary; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 4 ( hydrofoil-wall { type wall; inGroups 1(wall); nFaces 200; startFace 59650; } inlet { type patch; nFaces 300; startFace 59850; } outlet { type patch; nFaces 200; startFace 60150; } frontAndBackPlanes { type empty; inGroups 1(empty); nFaces 60000; startFace 60350; } ) // ************************************************************************* // |
||
July 22, 2022, 04:30 |
|
#10 | |
New Member
Silver Blaze
Join Date: Dec 2021
Posts: 20
Rep Power: 5 |
Quote:
|
||
July 22, 2022, 04:35 |
|
#11 | |
Senior Member
Join Date: Dec 2019
Location: Cologne, Germany
Posts: 369
Rep Power: 8 |
Quote:
|
||
July 22, 2022, 04:40 |
|
#12 |
New Member
Silver Blaze
Join Date: Dec 2021
Posts: 20
Rep Power: 5 |
Sorry,
here it is: k Code:
FoamFile { version 2.0; format ascii; class volScalarField; location "0"; object k; } dimensions [0 2 -2 0 0 0 0]; internalField uniform 0.03375; boundaryField { hydrofoil-wall { type kqRWallFunction; value $internalField; } inlet { type turbulentIntensityKineticEnergyInlet; value $internalField; intensity 0.03; } outlet { type zeroGradient; //type inletOutlet; //inletValue uniform 1.0; } } Code:
FoamFile { version 2.0; format ascii; class volScalarField; location "0"; object epsilon; } dimensions [0 2 -3 0 0 0 0]; internalField uniform 0.000102 ; boundaryField { hydrofoil-wall { type epsilonWallFunction; value $internalField; } inlet { type turbulentMixingLengthDissipationRateInlet; value $internalField; mixingLength 0.3; } outlet { type zeroGradient; } } |
|
July 22, 2022, 14:46 |
|
#13 |
Senior Member
Nejc
Join Date: Feb 2017
Location: Slovenia
Posts: 196
Rep Power: 9 |
Just out of curiosity, you can try using fvSchemes as recommended by wolfDynamics tutorials/courses (change omega to epsilon):
Code:
gradSchemes { default cellLimited leastSquares 1.0; grad(U) cellLimited leastSquares 1.0; } divSchemes { default none; div(phi,U) bounded Gauss linearUpwindV grad(U); div(phi,k) bounded Gauss upwind; div(phi,omega) bounded Gauss upwind; div((nuEff*dev2(T(grad(U))))) Gauss linear; } laplacianSchemes { default Gauss linear limited 0.5; } interpolationSchemes { default linear; } snGradSchemes { default limited 0.5; } wallDist { method meshWave; } If you need lift and drag, you can use the forceCoeffs functionObject but if you insist on using PV, please share that pipeline as I had similar enterprise there in the past and was stabbed in the back multiple times. I'm lucky I survived at all |
|
July 22, 2022, 15:15 |
|
#14 | |
New Member
Silver Blaze
Join Date: Dec 2021
Posts: 20
Rep Power: 5 |
Quote:
|
||
July 22, 2022, 18:01 |
|
#15 |
Member
Join Date: Feb 2020
Posts: 79
Rep Power: 6 |
Hi,
I ran your case with the following configuration file : fvSchemes : Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: v1812 | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; class dictionary; format ascii; location "system"; object fvSchemes; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // ddtSchemes { default steadyState; } gradSchemes { default Gauss linear; } divSchemes { default bounded Gauss upwind; // div(phi,U) bounded Gauss upwind; div(phi,U) bounded Gauss linearUpwind grad(U); div(phi,k) bounded Gauss upwind; //div(phi,epsilon) bounded Gauss upwind; div(phi,omega) bounded Gauss upwind; div(phi,R) bounded Gauss upwind; div(R) Gauss linear; div(phi,nuTilda) bounded Gauss upwind; div((nuEff*dev2(T(grad(U))))) Gauss linear; } laplacianSchemes { default Gauss linear corrected; } interpolationSchemes { default linear; } snGradSchemes { default corrected; } fluxRequired { default no; p ; } wallDist { method meshWave; nRequired true; } Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: v1812 | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; class dictionary; format ascii; location "system"; object fvSolution; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // solvers { U { solver PBiCGStab; tolerance 1E-8; relTol 0.1; preconditioner DILU; maxIter 100; minIter 2; } p { solver GAMG; smoother GaussSeidel; tolerance 1E-8; relTol 0.1; cacheAgglomeration true; nFinestSweeps 2; maxIter 100; nPreSweeps 0; nPostSweeps 1; agglomerator faceAreaPair; nCellsInCoarsestLevel 10; mergeLevels 1; } "(k|epsilon|nuTilda)" //"(k|omega|nuTilda)" { relTol 0.1; preconditioner DILU; tolerance 1E-8; maxIter 100; solver PBiCGStab; } Phi { solver GAMG; smoother GaussSeidel; tolerance 1E-10; relTol 01; nPreSweeps 0; nPostSweeps 1; nFinestSweeps 1; nCellsInCoarsestLevel 10; mergeLevels 2; agglomerator faceAreaPair; cacheAgglomeration true; maxIter 100; } } SIMPLE { nNonOrthogonalCorrectors 1; consistent true; pRefCell 0; pRefValue 0; residualControl { p 1E-6; epsilon 1E-6; k 1E-6; U 1E-6; } } relaxationFactors { // p 0.75; epsilon 0.5; k 0.5; U 0.75; } potentialFlow { nNonOrthogonalCorrectors 10; PhiRefCell 0; PhiRefValue 0; } Test it and tell me if the result is better. Cheers. |
|
July 27, 2022, 03:05 |
|
#16 | |
New Member
Silver Blaze
Join Date: Dec 2021
Posts: 20
Rep Power: 5 |
Quote:
Could you please send me the case file? |
||
July 27, 2022, 16:06 |
|
#17 |
Member
Join Date: Feb 2020
Posts: 79
Rep Power: 6 |
Could you explain what's wrong ?
Download link for the case : https://nextcloud.cm-en-transition.fr/s/kjnYJkF2RrHWbKR |
|
July 27, 2022, 18:16 |
|
#18 | |
New Member
Silver Blaze
Join Date: Dec 2021
Posts: 20
Rep Power: 5 |
Quote:
Kindly help me |
||
Tags |
openfoam, openfoam.com, paraview |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
OpenFOAM 5.0 Released | CFDFoundation | OpenFOAM Announcements from OpenFOAM Foundation | 11 | June 6, 2018 00:48 |
OpenFOAM Training Jan-Jul 2017, Virtual, London, Houston, Berlin | CFDFoundation | OpenFOAM Announcements from Other Sources | 0 | January 4, 2017 07:15 |
OpenFOAM Training, London, Chicago, Munich, Sep-Oct 2015 | cfd.direct | OpenFOAM Announcements from Other Sources | 2 | August 31, 2015 14:36 |
OpenFOAM Foundation releases OpenFOAM 2.2.2 | opencfd | OpenFOAM Announcements from ESI-OpenCFD | 0 | October 14, 2013 08:18 |
Adventure of fisrst openfoam installation on Ubuntu 710 | jussi | OpenFOAM Installation | 0 | April 24, 2008 15:25 |