Finally starting to explore OpenFOAM, questions on icoFoam solver...
2 Attachment(s)
I have finally began exploring OpenFOAM, and trying to evaluate if the software will meet my needs in terms of functionality. I plan to attend one of the future training courses, but in the mean time I am trying to see how far I can get on my own.
The current model is a section of internal passages in a structure. I attempted to place a prismatic boundary layer on the surfaces that have flow across them, which admittedly I am still learning and not sure about the appropriate layer dimensions that this model calls for. I was attempting to look at a laminar incompressible case using the icoFoam solver. The outlet velocity is known, and I wish to determine what the pressure drop is through the passage. My main goal is to view the steady state condition pressure drop, and I can accept some loss of resolution to improve computing time. I found that I can not maintain a courant number less than 1 unless my timestep is at least 1e-7. I let this iterate over the course of 2 days, and it appeared to be converging. Then, the pressure residual started oscillating around 8e-6 and 1e-5. Eventually, it finally started to diverge and the courant number went very high. Here are my initial conditions: " FoamFile { version 2.0; format ascii; class volScalarField; object p; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -2 0 0 0 0]; internalField uniform 0; boundaryField { inlet { type fixedValue; value uniform 0; } outlet { type zeroGradient; } boundary { type zeroGradient; } } // ************************************************** *********************** //" FoamFile { version 2.0; format ascii; class volVectorField; object U; } "// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0 0 0]; internalField uniform (0 0 0); boundaryField { outlet { type fixedValue; value uniform (0 0 -.998); } inlet { type zeroGradient; } boundary { type fixedValue; value uniform (0 0 0); } } // ************************************************** *********************** //" Attached is a picture of the mesh and pressure/velocity plots prior to divergence. I am not sure if I have specified a boundary condition incorrectly, an improper mesh, or if I am using the wrong solver. I greatly appreciate any help. Thanks. |
Also, is there a simple way to specify boundary conditions to a face based on a local coordinate system. The inlet face is not perfectly aligned with the global Cartesian, but I suppose I could transform the velocity vector if I knew the angle it was mis-aligned.
|
Hi Jason,
you can try simpleFoam. It's much faster and more stable... In the following thread are some hints how to speed up simpleFoam: http://www.cfd-online.com/Forums/ope...nvergence.html Martin |
Quote:
|
No, you don't need to specify other values/Parameters/fields than U and p.
Just select Code:
RASModel laminar; |
Thanks again, I am going to give that a try on simplified passage.
|
Try this "system/fvSolution":
Code:
/*--------------------------------*- C++ -*----------------------------------*\ Code:
/*--------------------------------*- C++ -*----------------------------------*\ Code:
/*--------------------------------*- C++ -*----------------------------------*\ I suppose simpleFoam will solve your simulation in a couple of minutes ;-) Martin |
Wow, thanks alot! Yes, I know I am only running on a core 2 duo with 5gb of ram, but felt 2 days was a bit much!
|
1 Attachment(s)
Right now it is at Time= 180, but the residuals are slowly dropping. I think for now I'll let it solve through in the background for a bit and see if it reaches convergence, attached are some initial plots.
|
I left the solution to run over night at work, but decided to restart it on my home pc. So far, it is very very slowly dropping the residual; much like the icoFoam did just before it went unstable.
I feel that some of the sharp corners with overly dense mesh concentration may be causing some of the flow instability. I am at least learning, that I have much to learn when switching from a standard structural approach to fluids :). Here is an excerpt of the log file: Time = 1596 smoothSolver: Solving for Ux, Initial residual = 5.04376e-05, Final residual = 9.87483e-07, No Iterations 6 smoothSolver: Solving for Uy, Initial residual = 5.51604e-05, Final residual = 5.5295e-07, No Iterations 7 smoothSolver: Solving for Uz, Initial residual = 2.065e-05, Final residual = 7.26189e-07, No Iterations 5 GAMG: Solving for p, Initial residual = 0.00138633, Final residual = 8.14647e-07, No Iterations 5 GAMG: Solving for p, Initial residual = 0.0016717, Final residual = 8.46325e-07, No Iterations 5 GAMG: Solving for p, Initial residual = 0.00174926, Final residual = 6.99528e-07, No Iterations 5 time step continuity errors : sum local = 0.000138876, global = -2.97148e-07, cumulative = -6.34467e-05 ExecutionTime = 1416.44 s ClockTime = 1423 s Time = 1603 smoothSolver: Solving for Ux, Initial residual = 4.989e-05, Final residual = 9.76406e-07, No Iterations 6 smoothSolver: Solving for Uy, Initial residual = 5.40616e-05, Final residual = 5.39811e-07, No Iterations 7 smoothSolver: Solving for Uz, Initial residual = 2.02852e-05, Final residual = 7.14789e-07, No Iterations 5 GAMG: Solving for p, Initial residual = 0.00136729, Final residual = 5.67102e-07, No Iterations 5 GAMG: Solving for p, Initial residual = 0.00167996, Final residual = 1.14624e-06, No Iterations 4 GAMG: Solving for p, Initial residual = 0.00162179, Final residual = 7.83107e-07, No Iterations 5 time step continuity errors : sum local = 0.000155448, global = -1.93752e-07, cumulative = -6.60641e-05 ExecutionTime = 1455.49 s ClockTime = 1463 s |
Hi,
may I ask you to run a checkMesh on your case? What is the number of cells you are using and what is the size of the system? Best, |
I think, Alberto is right:
run a "checkMesh -allTopology -allGeometry" I suppose that there are cell determinant problems... Martin |
Here is the output generated from the above command:
Code:
Build : 1.7.0-279cc8e8233b |
I was also wondering if it might be appropriate to loosen up on my pressure and maybe velocity tolerance. For these initial stages I am attempting to show comparative pressure drops between designs, and 5-10% within the converged result may be adequate.
|
Hi,
the mesh passes all the tests without errors or warnings. About tolerances, try to plot the residuals, and check if they became flat or the keep dropping, and stop the simulation after they stayed flat for a while. That should be the converged solution. Best, |
1 Attachment(s)
I thought the solution couldn't be assumed converged until the tolerance set is met, is a steady mean residual over time more important than hitting the tolerance?
|
The tolerance is an arbitrary value, and it is not necessarily something you can reach, especially if very low.
Usually residuals are an indication of convergence that has to me considered together with other elements, both numerical and physical. For example, your residuals can be high, but never change for a high number of iterations, and that means your solution is not changing at all. |
Thanks again, this has been very helpful. I am relieved to know this case will not require 3 days to run :).
|
It should really take less thank 1 hour! :-)
|
Yes, looking at the plot I think I could have killed it after 200-500 iterations which would be 20-40mins :).
|
All times are GMT -4. The time now is 04:59. |