|
[Sponsors] |
August 5, 2019, 06:46 |
Steady state simpleFOAM crash
|
#1 |
New Member
Karl
Join Date: Jun 2017
Posts: 11
Rep Power: 9 |
Hello fellow foamers. I tried to simulate a flow inside a U shaped pipe whose cross section changes from circular to elliptical suddenly. I've attached a rough drawing of the geometry (done on MS Paint ) for your reference. The input is 0.001 m^3/s and the diameter is roughly 0.028m. The flow is unsteady and turbulent. I used k-epsilon modelling with ddt scheme set to steady state.
Problem: The steady state simulation was crashing no matter what I tried. The time step continuity error kept increasing leading to a crash or the bounding of k and epsilon kept becoming bigger and bigger (eg: Min = -1e30 and Max = 1e30) or it just crashed with floating point exception error. I did try various things:
The geometry was meshed using snappyHexMesh and checkMesh did not show any errors. I finally had to run the steady state simulation on Ansys CFX and submit my project. Now that I some time I want to investigate why OpenFOAM could not solve the problem when Ansys could. Even more frustrating thing is that transient simulation in OpenFOAM worked without any issue and even giving me similar result to Ansys. Please help in figuring out the cause for the issue. I am currently away for the day and hence not able to upload case files. Moreover, I did not create a new folder for every change I made (such a noob ) and was overwriting the case files with new changes everytime. Please let me know what file you guys will be requiring. Thanks! |
|
August 7, 2019, 02:36 |
|
#2 |
New Member
Karl
Join Date: Jun 2017
Posts: 11
Rep Power: 9 |
I am playing around with case file to see where I'm making a mistake. My files in the 0 folder:
p Code:
dimensions [0 2 -2 0 0 0 0]; internalField uniform 97.1477; boundaryField { wall { type zeroGradient; } inlet { type zeroGradient; } outlet { type fixedValue; value uniform 97.1477; } } Code:
dimensions [0 1 -1 0 0 0 0]; internalField uniform (0 0 0); boundaryField { wall { type noSlip; } inlet { type flowRateInletVelocity; volumetricFlowRate constant 0.001; value uniform (0 0 0); } outlet { type zeroGradient; } } Code:
dimensions [0 2 -3 0 0 0 0]; internalField uniform 0.0635805; boundaryField { wall { type epsilonWallFunction; value $internalField; } inlet { type fixedValue; value uniform 0.0635805; } outlet { type zeroGradient; } } Code:
dimensions [0 2 -2 0 0 0 0]; internalField uniform 0.00992673; boundaryField { wall { type kqRWallFunction; value uniform 0.00992673; } inlet { type fixedValue; value uniform 0.00992673; } outlet { type zeroGradient; } } Code:
dimensions [0 2 -1 0 0 0 0]; internalField uniform 0; boundaryField { wall { type nutkWallFunction; value uniform 0; } inlet { type calculated; value uniform 0; } outlet { type calculated; value uniform 0; } } Code:
dimensions [0 2 -1 0 0 0 0]; internalField uniform 0; boundaryField { wall { type zeroGradient; } inlet { type zeroGradient; } outlet { type zeroGradient; } } |
|
August 7, 2019, 02:43 |
|
#3 |
New Member
Karl
Join Date: Jun 2017
Posts: 11
Rep Power: 9 |
Forgot to add my system files. There are many things commented out and many changes were made overwriting the files.
controlDict Code:
application simpleFoam; startFrom startTime; startTime 0; stopAt endTime; endTime 1; deltaT 1e-03; writeControl adjustableRunTime; writeInterval 0.1; purgeWrite 0; writeFormat ascii; writePrecision 6; writeCompression uncompressed; timeFormat general; timePrecision 6; runTimeModifiable true; adjustTimeStep yes; maxCo 1; Code:
ddtSchemes { default steadyState; } gradSchemes { default Gauss linear; } divSchemes { default none; div(phi,U) bounded Gauss upwind; div(phi,p) bounded Gauss upwind; div(phi,k) bounded Gauss upwind; div(phi,epsilon) bounded Gauss upwind; div(phi,omega) bounded Gauss upwind; div(U) Gauss linear; div((nuEff*dev2(T(grad(U))))) Gauss linear; } laplacianSchemes { default Gauss linear corrected; } interpolationSchemes { default linear; } snGradSchemes { default corrected; } Code:
solvers { p { solver GAMG; preconditioner GAMG; tolerance 1e-05; relTol 0.01; smoother GaussSeidel; } pFinal { $p; tolerance 1e-06; relTol 0; } "(U|k|epsilon|omega)" { solver smoothSolver; smoother GaussSeidel; tolerance 1e-05; relTol 0.01; } "(U|k|epsilon|omega)Final" { $U; tolerance 1e-06; relTol 0; } } SIMPLE { nNonOrthogonalCorrectors 1; pRefCell 0; pRefValue 0; residualControl { p 1e-5; U 1e-5; } } /* PIMPLE { nOuterCorrectors 50; nCorrectors 2; nNonOrthogonalCorrectors 1; residualControl { "(U|k|epsilon|omega)" { tolerance 1e-5; relTol 0; } p { tolerance 1e-5; relTol 0; } } } */ relaxationFactors { fields { p 0.3; pFinal 1; } equations { "U|k|epsilon|omega" 0.3; "(U|k|epsilon|omega)Final" 1; } } |
|
August 8, 2019, 06:53 |
|
#4 |
Member
Join Date: Mar 2016
Posts: 73
Rep Power: 10 |
You can try to run potentialFoam first (remember to backup your u in 0, because potentialFoam overwrites it). It will do a initialization of the u-field. Afterwards you can run simpleFoam
Second, you can try to use the localEuler ddt Scheme. It is pseudo-transient and more stable than steadyState. Third, if nothing helps you can just average you transient results. Your pressure B/C is really low. Is it supposed to be like that? Maybe the problem is in you thermophysicalProperties. Can you post the as well? |
|
August 8, 2019, 21:13 |
|
#5 |
Senior Member
Peter Hess
Join Date: Apr 2011
Location: Austria
Posts: 250
Rep Power: 17 |
Change the velocity at the outlet to:
outlet { type inletOutlet; value uniform (0 0 0); inletValue uniform (0 0 0); } inletOutlet is much stable than zeroGradient! ------------------------- Try to add referencePressure to the velocity field at the inlet. referencePressure value; This advice works well if the flow compressible. I dont know if it works in simpleFoam... Last edited by peterhess; August 9, 2019 at 01:17. |
|
August 13, 2019, 03:25 |
|
#6 | |
New Member
Karl
Join Date: Jun 2017
Posts: 11
Rep Power: 9 |
Quote:
1) I did try potentialFoam but it did not initialise for the whole domain, rather it initialised only for the inlet boundary surface. I tried running it again and again but initialising was not happening. 2) Tried the localEuler but got a weird error. Code:
--> FOAM FATAL ERROR: request for volScalarField rDeltaT from objectRegistry region0 failed available objects of type volScalarField are 6 ( nut pPrevIter k nu p epsilon ) From function const Type& Foam::objectRegistry::lookupObject(const Foam::word&) const [with Type = Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>] in file /home/ufifi/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/objectRegistryTemplates.C at line 193. FOAM aborting 3) Do you mean that I should take results from various time step and just average? For pressure, I wanted to use 1 atm at outlet. According to the forums, OpenFOAM uses p = p/rho. So I divided 1 atm/ rho. 101325 Pa/1043 Kg/m3. I don't have a thermophysical dict. I guess those are used in heat transfer analysis. In constant all I have are transport properties and turbulenceDict. |
||
August 13, 2019, 03:37 |
|
#7 | |
New Member
Karl
Join Date: Jun 2017
Posts: 11
Rep Power: 9 |
Quote:
|
||
August 13, 2019, 06:01 |
|
#8 |
Member
Lilian Chabannes
Join Date: Apr 2017
Posts: 58
Rep Power: 9 |
Hello,
you can try more stuff : - start by a laminar simulation, if it runs, introduce turbulence at a later timestep - your div schemes are very diffusive (that's good to make it run at first), but you can try to change your other schemes (see p.47 of these slides http://www.wolfdynamics.com/wiki/fvm_crash_intro.pdf) - Increase your mass flow rate gradually to the final value, may help. good luck, let us know how it goes
__________________
Feel free to join the OpenFOAM Discord https://discord.gg/P9p9eHn, a live chat about OpenFOAM |
|
August 13, 2019, 11:51 |
|
#9 |
Senior Member
Peter Hess
Join Date: Apr 2011
Location: Austria
Posts: 250
Rep Power: 17 |
outlet
{ type inletOutlet; inletValue uniform (0 0 0); value $internalField; } |
|
August 14, 2019, 03:09 |
|
#10 | |
New Member
Karl
Join Date: Jun 2017
Posts: 11
Rep Power: 9 |
Quote:
I'm now suspecting that it may be due to meshing. CheckMesh did not show any errors but I'm going to tighten the mesh quality parameters and try running the simulation again. |
||
August 14, 2019, 03:10 |
|
#11 |
New Member
Karl
Join Date: Jun 2017
Posts: 11
Rep Power: 9 |
||
August 14, 2019, 03:14 |
|
#12 |
New Member
Karl
Join Date: Jun 2017
Posts: 11
Rep Power: 9 |
I've found something interesting. When I increase the nNonOrthogonalCorrectors, the simulation crashes at a much later timestep. This leads me to thinks that I may have some problem with my mesh. CheckMesh did not show any errors. However, I'm planning on remeshing the geometry with tighter mesh quality parameters. Can someone suggest what should be the values of parameters to be set in meshQualityDict for snappyHexMesh. I'm currently using default values found in OpenFOAM-4.x/etc/caseDicts.
|
|
August 14, 2019, 06:06 |
|
#13 |
Member
Lilian Chabannes
Join Date: Apr 2017
Posts: 58
Rep Power: 9 |
Can you share your files?
__________________
Feel free to join the OpenFOAM Discord https://discord.gg/P9p9eHn, a live chat about OpenFOAM |
|
Tags |
simplefoam stability, steady state |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Steady state solution ----> transient | nskelly | OpenFOAM Running, Solving & CFD | 4 | March 12, 2018 11:49 |
Convergence in steady state simulations vs transient ones | cardioCFD | CFX | 5 | January 21, 2018 10:59 |
laminar steady state using simpleFoam | monti | OpenFOAM Running, Solving & CFD | 6 | January 17, 2011 03:39 |
Constant velocity of the material | Sas | CFX | 15 | July 13, 2010 08:56 |
About the difference between steady and unsteady problems | Lisa | Main CFD Forum | 11 | July 5, 2000 14:37 |