CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

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

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By wyldckat

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 2, 2012, 14:21
Default how to do the fvSolution configuration - SIMPLE Foam - complex cylinder geometry
  #1
Senior Member
 
Sören
Join Date: Mar 2012
Posts: 102
Rep Power: 14
despaired student is on a distinguished road
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
despaired student is offline   Reply With Quote

Old   July 2, 2012, 17:52
Default
  #2
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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
__________________
wyldckat is offline   Reply With Quote

Old   July 3, 2012, 05:11
Default
  #3
Senior Member
 
Sören
Join Date: Mar 2012
Posts: 102
Rep Power: 14
despaired student is on a distinguished road
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
despaired student is offline   Reply With Quote

Old   July 3, 2012, 05:19
Default
  #4
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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
__________________
wyldckat is offline   Reply With Quote

Old   July 3, 2012, 12:55
Default
  #5
Senior Member
 
Sören
Join Date: Mar 2012
Posts: 102
Rep Power: 14
despaired student is on a distinguished road
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
Attached Files
File Type: zip ScreenshotResiduals.png.zip (43.3 KB, 151 views)
File Type: zip fvSchemes.zip (719 Bytes, 67 views)
File Type: zip fvSolution.zip (761 Bytes, 194 views)
despaired student is offline   Reply With Quote

Old   July 3, 2012, 13:15
Default
  #6
Senior Member
 
Sören
Join Date: Mar 2012
Posts: 102
Rep Power: 14
despaired student is on a distinguished road
...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).
despaired student is offline   Reply With Quote

Old   July 3, 2012, 13:32
Default
  #7
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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.
ophr likes this.
__________________
wyldckat is offline   Reply With Quote

Old   July 4, 2012, 09:33
Default gnuplot p;N;N' or N;N;p'
  #8
Senior Member
 
Sören
Join Date: Mar 2012
Posts: 102
Rep Power: 14
despaired student is on a distinguished road
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
Attached Files
File Type: zip Log5.zip (25.3 KB, 10 views)
File Type: zip Residuals.zip (353 Bytes, 18 views)
despaired student is offline   Reply With Quote

Old   July 4, 2012, 11:02
Default pimpleFoam try
  #9
Senior Member
 
Sören
Join Date: Mar 2012
Posts: 102
Rep Power: 14
despaired student is on a distinguished road
I also tried with pimpleFoam in case it's not steady-state but transient. The residual-graph is attached. Doesn't look good neither...
Attached Images
File Type: jpg Residuals-pimpleFoam-referencemodel.jpg (34.1 KB, 310 views)
despaired student is offline   Reply With Quote

Old   July 4, 2012, 19:14
Default
  #10
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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"
  • 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
__________________
wyldckat is offline   Reply With Quote

Old   July 5, 2012, 04:36
Default
  #11
Senior Member
 
Sören
Join Date: Mar 2012
Posts: 102
Rep Power: 14
despaired student is on a distinguished road
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
despaired student is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Commercial meshers] Using starToFoam clo OpenFOAM Meshing & Mesh Conversion 33 September 26, 2012 05:04
[ICEM] Meshing adjacent wall geometry and simple ICEM questions everdimension ANSYS Meshing & Geometry 25 June 20, 2012 05:25
[ICEM] Cylinder Geometry and Blocking Leepox ANSYS Meshing & Geometry 2 November 21, 2011 11:32
[Gmsh] Import problem ARC OpenFOAM Meshing & Mesh Conversion 0 February 27, 2010 11:56
[Other] StarToFoam error Kart OpenFOAM Meshing & Mesh Conversion 1 February 4, 2010 05:38


All times are GMT -4. The time now is 12:54.