|
[Sponsors] |
potentialFoam not writing and only one iteration |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
October 9, 2014, 11:14 |
potentialFoam not writing and only one iteration
|
#1 |
New Member
Max Foamer
Join Date: Oct 2014
Posts: 5
Rep Power: 12 |
Hi,
I have downloaded and installed OpenFoam 2.3 and I am currently trying to simulate the testcase for the Ahmed body. The mesh is built so that The first cell (prism layer) is as tiny as to solve the boundary layer (y+=1). Therefore I am not using any wall functions. The thing is that when I am about to run potentialFoam for initialization, it does only one iteration, and it does not save the result. I have checked with paraview, and The low field is as I specified in 0. There fore simpleFoam chrashes when it tries to calculate the flow. Does Anyone know how to use potentialFoam on OpenFoam 2.3 just as any other solver? I mean in the sense that, I want it to do as many iterations as I specify in controlDict. Any ideas why is not writing the result of the potentialFoam iteration? Cheers Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.3.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object fvSolution; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // solvers { p { solver GAMG; tolerance 1e-6; relTol 0.08; smoother GaussSeidel; nPreSweeps 0; nPostSweeps 2; cacheAgglomeration on; agglomerator faceAreaPair; nCellsInCoarsestLevel 190; mergeLevels 2; } U { solver smoothSolver; smoother symGaussSeidel; tolerance 1e-5; relTol 0.08; nSweeps 2; } k { solver smoothSolver; smoother symGaussSeidel; tolerance 1e-5; relTol 0.08; nSweeps 2; } epsilon { solver smoothSolver; smoother symGaussSeidel; tolerance 1e-5; relTol 0.08; nSweeps 2; } } SIMPLE { nNonOrthogonalCorrectors 0; residualControl { p 1e-4; U 1e-4; k 1e-4; epsilon 1e-4; } } potentialFlow { nNonOrthogonalCorrectors 10; // Residuals here (one per variable) // If one variable is not specified, zero is assumed as // desired residual (iterations will not stop) residualControl { p 1e-10; U 1e-10; k 1e-10; epsilon 1e-10; } } relaxationFactors { fields { p 0.3; } equations { U 0.5; k 0.5; epsilon 0.5; } } cache { grad(U); } // ************************************************************************* // Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.3.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object fvSchemes; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // ddtSchemes { default seteadyState; } gradSchemes { default leastSquares; grad(U) leastSquares; grad(p) leastSquares; grad(epsilon) leastSquares; grad(k) leastSquares; } divSchemes { default none; div(phi,U) bounded Gauss upwind; div(phi,k) bounded Gauss upwind ; div(phi,epsilon) bounded Gauss upwind ; div((nuEff*dev(T(grad(U))))) Gauss linear; } laplacianSchemes { default Gauss linear corrected; } interpolationSchemes { default linear; } snGradSchemes { default corrected; } fluxRequired { default no; p; } // ************************************************************************* // Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.3.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object controlDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // libs ( "libOpenFOAM.so" "libincompressibleTurbulenceModel.so" "libincompressibleRASModels.so" "libmyfiniteVolume.so" ); application simpleFoam; startFrom latestTime;// startTime; startTime 0; stopAt endTime; endTime 1000; deltaT 1; writeControl timeStep; writeInterval 25; purgeWrite 0; //- Uncomment to have regular (every 2 hours of run time) restart files //secondaryWriteControl cpuTime; // runtime //secondaryWriteInterval 7200; // seconds //secondaryPurgeWrite 1; // keep all but last dump writeFormat binary; writePrecision 6; writeCompression uncompressed; timeFormat general; timePrecision 6; runTimeModifiable true; // ************************************************************************* // |
|
October 9, 2014, 18:06 |
|
#2 |
New Member
Join Date: Jul 2011
Posts: 9
Rep Power: 15 |
potentialFoam only needs one iteration to converge.
It computes an analytical solution for your flow, meaning that it creates a conservative field from a non-conservative initial field. It is usually used to get a more stable initial state for other solvers. In your case you set writeInterval to 25, so the converged solution of the first time step is never written. So in your case if you set writeInterval to 1 you should be able to see a potential flow in paraview. Good tutorial for potentialFoam can be found here : http://www.foamcfd.org/Nabla/guides/...Guidese12.html |
|
October 10, 2014, 09:05 |
|
#3 |
New Member
Max Foamer
Join Date: Oct 2014
Posts: 5
Rep Power: 12 |
Cheers, it works great now. The tutorial was very helpful.
|
|
Tags |
potentialfoam, teration, writing |
|
|