CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   how to do the fvSolution configuration - SIMPLE Foam - complex cylinder geometry (https://www.cfd-online.com/Forums/openfoam-solving/104057-how-do-fvsolution-configuration-simple-foam-complex-cylinder-geometry.html)

despaired student July 2, 2012 13:21

how to do the fvSolution configuration - SIMPLE Foam - complex cylinder geometry
 
Hello,

I have(had) a problem with one of my OpenFoam simulations. OpenFoam 2.0.1 finished the simulation before the entire stream was simulated -> just the beginning of the inlet was simulated - see picture 1:

https://dl.dropbox.com/u/77194917/fa...imulation2.png


To solve this problem I modified the fvSolution file (U, p and nNonOrthogonalCorrectors). The result is better, it seems that OpenFoam 2.0.1 does the simulation from inlet to outlet - see picture 2:

https://dl.dropbox.com/u/77194917/re...se%20cells.png



The changes I did at the fvSolution file are just "good guesses". So, now I would like to know if they are correct, how to check if they are correct and how to determine the right values for the fvSolution and fvScheme files? Are there rules of thumb or some methods to calculate/estimate these values???



Here are my fvSolution file (the old values are written behind a double backslash //) and my fvSchemes file:

https://dl.dropbox.com/u/77194917/fvSolution

https://dl.dropbox.com/u/77194917/fvSchemes


CheckMesh is O.K. - see the file:

https://dl.dropbox.com/u/77194917/checkMesh_Log5


And here is the terminal outputfile:

https://dl.dropbox.com/u/77194917/Log5



Kind regards,

Sören

wyldckat July 2, 2012 16:52

Greetings Sören,

OK, now we're getting somewhere :)

In fvSolution, try this instead:
Code:

residualControl
    {
        p              1e-2;
        U              1e-3;
        "(k|epsilon|omega)" 1e-3;
    }

For more about residuals and convergence: http://www.cfd-online.com/Wiki/Best_...gence_criteria

For more about plotting residuals: http://www.cfd-online.com/Forums/ope...residuals.html

Best regards,
Bruno

despaired student July 3, 2012 04:11

Thanks for the quick reply on my question.

The fvSolution part that you showed to use instead I already used it in my fvSolution file. Did you accidently copied that part from my file instead from your file?


Kind regards,

Sören

wyldckat July 3, 2012 04:19

Hi Sören,

My apologies... Firefox crashed yesterday while I was writing the post and had to write all over again and forgot to recalibrate the values. What I meant was this:
Code:

residualControl
    {
        p              1e-3;
        U              1e-4;
        "(k|epsilon|omega)" 1e-4;
    }

Lowering even more should help a bit more as well. You could also remove these limits completely and monitor the residuals, waiting for the residuals to converge, i.e. reach an average horizontal line... if it starts to rise, it will probably diverge.

Best regards,
Bruno

despaired student July 3, 2012 11:55

3 Attachment(s)
Thanks for the reply again.
I plotted the residuals according to the tutorial but they don't converge to a stable line but within an interval one could say.

The plot is attached also my fvSolution and fvSchemes file with some modifications.
I put the residual control up to 1e-5 for "U" and "p".


1) According to the plot - is convergence fulfilled?

2) The convergence we are talking about is the convergence of the mathematical calculation of a physical problem, right? The statement one can make is that our mathematical solution is correct and "if" the mathematical solution is an exact description of the physical problem, we can "trust" the results of this simulation - is my understanding correct here?

3) In the log-file the statement at the end that say e.g. "SIMPLE solution converged in 171 iterations" is missing this time. But I OpenFoam did 2000 Iterations - what does this mean?


Best regards and sorry for some maybe stupid questions,

Sören

despaired student July 3, 2012 12:15

...I just remembered what I read in the "best practice guidelines"
Quote:

Exactly what the residuals should be is not possible to say, it all depends on how your particular code computes and scales the residuals.
I guess this is somehow an answer to question 2) and 3).

wyldckat July 3, 2012 12:32

Quote:

"SIMPLE solution converged in 171 iterations"
This only applies to the settings defined in "residualControl". Namely, you have to understand the problem to have a sense of the values you should be aiming to.

As for not being a line: it rarely is linear. The objective is to have it not fluctuate too much and not come back up again.

By what I see from that plot... isn't not looking very good :( Wide band fluctuations and the residual values too high!

In these cases, the best is to go back to the tutorials OpenFOAM has, as well as trying simpler set-ups of your own case. That should give you a better feel of what's good or bad.

despaired student July 4, 2012 08:33

gnuplot p;N;N' or N;N;p'
 
2 Attachment(s)
Hi,

I've tried to plot the residuals and it works quite fine but I have problems understanding this part:
"< cat Log5 | grep 'Solving for p' | cut -d' ' -f9 | sed -n 'p;N;N' | tr -d ','" title 'p' with lines

How do I change the Iteration-Residual that is plotted? I've tried | sed -n 'N;N;p' | but this only destroyed my axis... What is for example the right code to plot the second or the last of the three iteration-residuals?

my log-file and my Residual-file are attached.


Kind regards,

Sören

despaired student July 4, 2012 10:02

pimpleFoam try
 
1 Attachment(s)
I also tried with pimpleFoam in case it's not steady-state but transient. The residual-graph is attached. Doesn't look good neither...

wyldckat July 4, 2012 18:14

Note to other readers: if you have more experience than me on this case, feel free to contribute with your experience!

______________________________
Hi Sören,


I've got a feeling you didn't read the rest of thread about plotting residuals. There you'll find references to PyFoam, which is more advanced that this trick with Gnuplot ;)


Now, since unfortunately I'm not an expert in using OpenFOAM for any and all CFD cases, here are my suggestions:
  • For solving this issue, you should first go back several steps, that you apparently skipped (or at least didn't you mention them). You're dealing with OpenFOAM, not with any other commercial package where it's just "point, click and shoot with auto-target" :D
  • First start with a simple geometry. In your case, a simplified 2D representation of the geometry you're trying to solve. Then go to a simple 3D. Keep it simple and get a feel for what needs to be done at each stage to get good results. The ideal situation would be to have an already known solution for the simple case...
  • In other words: you'll have to work through each step, one at a time. Increase complexity gradually, because anything you try at this point without going through these steps, will as efficient as the Infinite monkey theorem ;)

Check OpenFOAM's tutorials for ideas on simple geometries and how to use the solvers. Here are some cases that should give you good ideas:
  • incompressible/icoFoam/elbow
  • incompressible/simpleFoam/pitzDaily
  • incompressible/pimpleFoam/TJunction
And keep in mind that although you may think your case is stationary, it might not be possible to solve it with simpleFoam, because there might be vortexes up and about, giving a clear requirement for a transient solution...


By the way: although checkMesh gives and OK at the end, this message might probably shouldn't be ignored:
Code:

Number of severely non-orthogonal faces: 191.
"nNonOrthogonalCorrectors" isn't simply magical... it can help in many cases, but "severely non-orthogonal" might not be what this corrector can help with...


Good luck!
Bruno

despaired student July 5, 2012 03:36

Thanks again for your advise.
I did some simple cases of my geometry...lets see if can come closer to the solution with them.

I've read the thread about plotting but gnuplot was working so I thought why change it...but I'll also try PyFoam.


So, thanks again,

Sören


All times are GMT -4. The time now is 16:15.