|
[Sponsors] |
March 28, 2011, 09:33 |
When should i stop simulation!?
|
#1 |
Member
|
Good day, All!
I use MRFSimpleFoam based solver, and I have a questions: When do I need to stop the simulation? How do I know that the solution persisted? How to write a condition in the solver, so that when it reach a certain level of accuracy a decision to stop. (of course if it's possible ) I would be very grateful to all who answer me!!!
__________________
davidmd |
|
March 28, 2011, 09:51 |
|
#2 |
Member
Samuel ARNAUD
Join Date: Feb 2011
Location: Grenoble, FRANCE
Posts: 39
Rep Power: 15 |
Hi David,
use: Code:
pyFoamPlotRunner.py MRFSimpleFoam Regards
__________________
Sam |
|
March 28, 2011, 10:26 |
|
#3 | |
Member
|
Quote:
But I do not know what is pyFoamPlotRunner.py :-( Where can I find itself, and manual for it? And what is the functionality of pyFoamPlotRunner.py? will this help me to stop the solver on the condition of achievement a given accuracy? I would really appreciate if you answer!
__________________
davidmd Last edited by davidmd; March 28, 2011 at 10:30. Reason: forgot one question :) |
||
March 28, 2011, 11:55 |
|
#4 |
Member
Join Date: Nov 2010
Posts: 41
Rep Power: 15 |
||
March 28, 2011, 17:05 |
|
#5 |
Member
|
So I install it, and now try to start solving my case with this:
Code:
python '/home/davidmd/src/PyFoam-0.5.4/bin/pyFoamPlotRunner.py' ReMRFSimpleFoam '/home/davidmd/OpenFOAM/davidmd-1.7.0/work/' NF2 and got this: Code:
Traceback (most recent call last): File "/home/davidmd/src/PyFoam-0.5.4/bin/pyFoamPlotRunner.py", line 3, in <module> from PyFoam.Applications.PlotRunner import PlotRunner File "/usr/local/lib/python2.6/dist-packages/PyFoam/Applications/PlotRunner.py", line 7, in <module> from PyFoam.Execution.GnuplotRunner import GnuplotRunner File "/usr/local/lib/python2.6/dist-packages/PyFoam/Execution/GnuplotRunner.py", line 49 self.plotIter=GnuplotTimelines(self.getAnalyzer("PlotIterations").lines,persist=persist,with="steps") ^ SyntaxError: invalid syntax Now I try to rename variable "with" in GnuplotRunnr.py and now i have this: Code:
davidmd@rootpc ~/OpenFOAM/davidmd-1.7.0/work/NF2 $ python '/home/davidmd/src/PyFoam-0.5.4/bin/pyFoamPlotRunner.py' 'ReMRFSimpleFoam' '/home/davidmd/OpenFOAM/davidmd-1.7.0/work/' 'NF2' /usr/local/lib/python2.6/dist-packages/PyFoam/Execution/FoamThread.py:3: DeprecationWarning: The popen2 module is deprecated. Use the subprocess module. from popen2 import Popen4 Usage: ReMRFSimpleFoam [-parallel] [-case dir] [-help] [-doc] [-srcDoc] --> FOAM FATAL ERROR: Wrong number of arguments, expected 0 found 2 FOAM exiting
__________________
davidmd Last edited by davidmd; March 28, 2011 at 18:30. |
|
March 29, 2011, 04:32 |
|
#6 |
Member
Join Date: Nov 2010
Posts: 41
Rep Power: 15 |
Make sure you have done the required under points 3.2 adn 3.5 of the above link. Copy paste the PATHs into your ~/.bashrc file. then test the installation (point 3.5), then you dont have to give the entire path to the py-utility you are using.
if your installation test is negative, then it wont work... the correct syntax to run a case is (from inside your case directory) pyFoamPlotRunner.py nameOfSolver, e.g. pyFoamPlotRunner.py pisoFoam |
|
March 29, 2011, 05:29 |
|
#7 |
Member
Join Date: Nov 2009
Location: Germany
Posts: 96
Rep Power: 17 |
Hi David,
there are different (and easier) ways... 1. You can use gnuplot to plot the residuals (look here) 2. You should monitor important points in your modell. (easily done in controlDict --> you will find an example in the pimpleFoam/t-junction tutorial) 3. You can also monitor the pressure force on specific patches/walls --> also done in controlDict --> example in tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion2D_simpleFoam) I for myself use all 3 of them to make sure my solution is converged Regards, Toni |
|
March 29, 2011, 06:48 |
|
#8 |
Member
|
Thank you, grjmell! I really found PyFoam was setup wrong. Now I got the graphics! Something like these:
But how can I now determine when to stop the calculation? I see that it is converges. I should just independently decide when I'm quitting? Oh, and can someone tell me what I have to deal with pressure? Why is it jumping? val46, thank you very much for your reply! However, I have tried so far only the first way and I have something wrong in the chart with the pressure. Perhaps the fact that I use 3 nonOrthogonalCorrectors and I get something like this And once again thank you, that you answered!
__________________
davidmd |
|
March 29, 2011, 08:14 |
|
#9 | |
Member
|
Quote:
I figured, just a little rewrote solver! Thank you! But how to make the solver stopped himself when a certain accuracy reached? Which is the best parameter to determine the convergence of the solution inside of the solver?
__________________
davidmd |
||
March 30, 2011, 05:52 |
|
#10 | |
Member
Join Date: Nov 2009
Location: Germany
Posts: 96
Rep Power: 17 |
Quote:
as I said, I would recommend you to monitor points. The reason is sometimes you have a good solution when all residuals reach 10^-3 and sometimes its not even converged when you reach 10^-6. So to answer your question: The best parameter to determine the convergence of the solution is NOT the residual, its the velocity, pressure or temperature of certain points within your domain. Regards, Toni |
||
March 30, 2011, 08:56 |
|
#11 |
Member
David Aljure
Join Date: Mar 2011
Location: CTTC Universidad Politécnica de Catalunya. Spain
Posts: 38
Rep Power: 15 |
My opinion in this subject, hope it helps:
If its a laminar case with a steady state solution, then residual is a good way to know when to stop. You could also check that stady state has been reached by checking that velocity isn't changing in time. There's also laminar cases that don't reach a stady state (such as flow over bodies past a critical Re), instead they reach a periodic state. For this its usefull to use averages and check to see if the averaged solution reach a steady state. Turbulent cases are a bit different, if you're using RANS models, then the average steady state may be reached. Usually you have to check several conditions, for this what val46 is very usefull. Plot a map of velocity over time at certain points, then, you'll see the behaviour of the velocity. There'll be a first transition period and a statistically stationary period. When you're in the statistically stationary period you should choose an integration time long enough so that your parameters are satisfactory. If your case is turbulent I recomend you check a turbulent flow book. Turbulent Flows by Stephen B. Pope is quite good. I have used 2 tools in OF to check the behaviour of my case, probes and fieldAverages. They are configured in the controlDict: functions { probes { type probes; functionObjectLibs ("libsampling.so"); enabled true; outputControl timeStep; outputInterval 10; probeLocations ( ( 8.55 0.5 3 ) ); fields ( U ); } fieldAverage1 { type fieldAverage; functionObjectLibs ( "libfieldFunctionObjects.so" ); enabled true; outputControl outputTime; outputInterval 100; fields ( U { mean on; prime2Mean on; base time; } p { mean on; prime2Mean off; base time; } ); } } Remember that averages should be enabled (for turbulent flows) once a statistically stationary state has been reached. |
|
April 2, 2011, 06:22 |
|
#12 |
Member
|
Many thanks to all who replied. I have no more questions!
__________________
davidmd |
|
May 16, 2017, 19:22 |
|
#13 | |
New Member
Raquel Faria
Join Date: Sep 2011
Posts: 2
Rep Power: 0 |
Quote:
Best regards, Kelly |
||
Tags |
condition, steady-state, stop simulation |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Solar Radiation in OpenFOAM | plainstyle | OpenFOAM Running, Solving & CFD | 15 | July 8, 2014 05:43 |
velocity profile export from a simulation onto another | sudhirlv | STAR-CCM+ | 1 | September 12, 2010 19:57 |
Solver STOP with a variable | Roland R | CFX | 3 | March 10, 2010 19:38 |
How stop simulation if convergence is not reached? | Andreas | FLUENT | 0 | October 16, 2007 13:35 |
strange simulation error | Ralf Schmidt | FLUENT | 2 | May 4, 2007 14:02 |